Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

in the below code at selection screen output is triggering after we get output report and press back button then screen modification is taking place why please help me out

$
0
0

*

 

REPORT ZHRO_REMITTANCE_CEP NO STANDARD PAGE HEADING LINE-COUNT 100(8) .

 

tables:mara,ekko.

 

data:gt_marc type standard table of marc with header line,

       gt_ekko type standard table of ekko with header line,

       gt_ekpo type standard table of ekpo with header line.

 

data:flag type c value 'X'..

  data:lv_tabix type sy-tabix.


data:begin of final_mat occurs 0,

         matnr type mara-matnr,

         werks type marc-werks,

         PSTAT  type PSTAT_D,

         LVORM  type LVOWK,

         BWTTY  type BWTTY_D,

         XCHAR  type XCHAR,

      end of final_mat.

 

data:begin of final_purch occurs 0,

         ebeln type ekko-ebeln,

         bukrs type ekko-bukrs,

         ernam type ekko-ernam,

         ekorg type ekko-ekorg,

         ebelp type ekpo-ebelp,

         MATNR type ekpo-matnr,

         WERKS type ekpo-werks,

   end of final_purch.

 

 

 

   select-options: s_matnr for mara-matnr modif id g1,

                   s_ebeln for ekko-ebeln modif id g2.

       parameters: p_werks type werks_d DEFAULT '0001'.

 

   parameters:p_mat type c radiobutton group g1 USER-COMMAND ONLI DEFAULT 'X'.

   parameters:p_purch type c radiobutton group g1 .

 

 

AT SELECTION-SCREEN OUTPUT.

 

 

if p_mat = 'X' .

     loop at screen .

       if screen-GROUP1 = 'G2'.

         screen-input = 0 .

       endif .

       modify screen .

       endloop.

  elseif

       p_purch = 'X'.

    loop at screen.

       if screen-GROUP1 = 'G1'.

 

         screen-input = 0 .

       endif .

     modify screen .

   endloop .

endif .

 

 

start-of-selection.

  if p_mat = 'X'.

    select *

      from marc

        into table gt_marc

           where   matnr in s_matnr and werks = p_werks.

  elseif p_purch = 'X'.

   if p_werks is initial.

       select * from ekko

         into table gt_ekko

           where ebeln in s_ebeln.

       if gt_ekko[] is not initial.

         select * from ekpo

           into table gt_ekpo

             for all entries in gt_ekko

           where ebeln = gt_ekko-ebeln.

       endif.

    elseif p_werks is not initial.

         select * from ekpo

           into table gt_ekpo

             where ebeln in s_ebeln and werks = p_werks.

           if sy-subrc = 0.

             if gt_ekpo[] is not initial.

             select *

               from ekko

                 into table gt_ekko

                   for all entries in gt_ekpo

               where ebeln = gt_ekpo-ebeln.

            endif.

          endif.

     endif.

  endif.

  if sy-subrc = 0.

    sort gt_ekpo by ebeln.

endif.

  loop at gt_ekpo.

   at new ebeln.

   read table gt_ekko with key ebeln = gt_ekpo-ebeln.

   final_purch-ebeln = gt_ekko-ebeln.

   final_purch-bukrs = gt_ekko-bukrs.

   final_purch-ekorg = gt_ekko-ekorg.

   final_purch-ernam = gt_ekko-ernam.

   endat.

    final_purch-ebelp = gt_ekpo-ebelp.

    final_purch-MATNR = gt_ekpo-MATNR.

    final_purch-WERKS = gt_ekpo-WERKS.

 

append final_purch.

clear: final_purch, gt_ekpo,gt_ekko.

endloop.

 

 

end-of-selection.

 

  if p_mat = 'X'.

   loop at gt_marc.

     lv_tabix = sy-tabix.

     if flag = 'X'.

       format color = lv_tabix.

       format color col_total intensified on.

       flag = ' '.

      elseif flag = ' '.

       format color = lv_tabix.

       format color col_total intensified off.

       flag = 'X'.

     endif.

        write:/

            sy-vline+0(1),

           2(18) gt_marc-matnr,

           20(1) sy-vline,

           21(4) gt_marc-werks,

           25(1) sy-vline,

           26(15) gt_marc-pstat,

           41(1) sy-vline,

           42(4) gt_marc-lvorm,

           46(1) sy-vline,

           47(7) gt_marc-bwtty,

           54(1) sy-vline,

           55(7) gt_marc-xchar,

           62(1) sy-vline.

 

 

clear gt_marc.

   endloop.

 

elseif p_purch = 'X'.

   clear lv_tabix.

   loop at final_purch.

     lv_tabix = sy-tabix.

     if flag = 'X'.

       format color = lv_tabix.

       format color col_total intensified on.

       flag = ' '.

      elseif flag = ' '.

       format color = lv_tabix.

       format color col_total intensified off.

       flag = 'X'.

     endif.

    write:

           sy-vline+0(1),

           2(10) final_purch-ebeln,

           12(1) sy-vline,

           13(4) final_purch-bukrs,

           17(1) sy-vline,

           18(7) final_purch-ekorg ,

           25(1) sy-vline,

           26(10) final_purch-ernam,

           36(1) sy-vline,

           37(4) final_purch-ebelp,

           41(1) sy-vline,

           41(18) final_purch-MATNR,

           59(1) sy-vline,

           60(4) final_purch-WERKS,

           64(1) sy-vline,/.

  endloop.

  clear final_purch.

  endif.

   write:/ sy-uline+1(62).

 

   top-of-page.

 

format color col_positive.

   

        write: sy-uline+0(71),

            / sy-vline+0(1),

            'REPORT NAME:',

            sy-repid,

            71(1) sy-vline,

            / sy-vline+0(1),

            'PURPOSE:'.

            if p_mat = 'X'.

              write: 'PLANT AND MATERIAL DETAILS'.

            elseif p_purch = 'X'.

            write:'PURCHASE ORDER DETAILS'.

            endif.

            write:71(1) sy-vline,

            / sy-uline+0(71).

 

format color col_group.

   if p_mat = 'X'.

     write:/,/ sy-uline+1(62),

           / sy-vline+0(1),

           2(18)'MATERIAL NUM',

           20(1) sy-vline,

           21(4)'PLNT',

           25(1) sy-vline,

           26(15)'MAINTIAN STATUS',

           41(1) sy-vline,

           42(4)'FLAG',

           46(1) sy-vline,

           47(7)'VAL CAT',

           54(1) sy-vline,

           55(7)'B.M IND',

           62(1) sy-vline.

     write:/ sy-uline+1(62).

 

elseif p_purch = 'X'.

     write:/,/ sy-uline+1(64),

           / sy-vline+0(1),

           2(10)'Pur Order',

           12(1) sy-vline,

           13(4)'Item',

           17(1) sy-vline,

           18(4)'Comp',

           22(1) sy-vline,

           23(10)'User',

           33(1) sy-vline,

           34(7)'Pur Org',

           40(1) sy-vline,

           41(18)'Material Num',

           59(1) sy-vline,

           60(4) 'Plnt',

           64(1) sy-vline.

     write:/ sy-uline+1(64).

   endif.

 

   end-of-page.

   write:/ sy-pagno.







This is the code plz execute once by copying so u will know exactly what i am facing at 'AT-SELECTION-SCREEN OUTPUT' EVENT and reply back to RJAIKUMAR035@GMAIL.COM if possible


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>