Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2806

Re: Get Cursor

$
0
0

Hello Vishal n Aditya,

 

Thank you for your response. This is the code

 

Data: it_mara type table of mara,

      wa_mara type mara.

Data: it_makt type table of makt,

      wa_makt type makt.

 

 

Data: fnam(30), fval(50).

 

 

select-options: s_matnr for wa_mara-matnr.

 

 

initialization.

 

at selection-screen.

 

start-of-selection.

 

  at line-selection.

    perform DISPLAY_SECONDARYLIST.

 

 

form get_details.

   select * from mara into table it_mara where matnr in s_matnr.

     loop at it_mara into wa_mara.

       write: / wa_mara-matnr, wa_mara-mtart, wa_mara-meins, wa_mara-mbrsh.

       endloop.

       endform.

 

 

form DISPLAY_SECONDARYLIST.

   get cursor field fnam value fval.

   condense FNAM.

   condense FVAL.

 

 

if FNAM = 'WA_MARA-MATNR'.

SELECT SINGLE * FROM MARA INTO WA_MARA WHERE MATNR = FVAL .

      WRITE:/ WA_MARA-MATNR, WA_MARA-MBRSH, WA_MARA-MTART, WA_MARA-MATKL, WA_MARA-MEINS, WA_MARA-ERSDA, WA_MARA-ERNAM.

 

 

 

 

  ELSEIF FNAM = 'WA_MARA-MTART'.

    SELECT * FROM MARA INTO TABLE IT_MARA UP TO 50 ROWS WHERE MTART = FVAL.

    LOOP AT IT_MARA INTO WA_MARA.

      WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MATKL.

    ENDLOOP.

  ENDIF.

 

 

ENDFORM.

 

Thanks,

Viky


Viewing all articles
Browse latest Browse all 2806

Trending Articles



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