Skip to Content
-2
May 16 at 08:43 AM

I am failing to write ABAP logic in SQL Using AMDP class. Please Help me to resolve this issue ,,

375 Views

fig1amdp.jpg

Hi i am trying to calculate total Qty in MSEG table based on indicator and i wrote ALV report in ABAP its working fine , but my requirement is to write it in AMDP and consume those result in CDS view. please help me how to write below ABAP code in SQL query .

LOOP AT it_mseg INTO wa_mseg WHERE matnr = wa_mslb-matnr

AND werks = wa_mslb-erks AND lifnr = wa_mslb-lifnr.
IF sy-subrc EQ 0.
CASE wa_mseg-shkzg.
WHEN 'S'. qas = qas + wa_mseg-menge.
WHEN 'H'. qah = qah + wa_mseg-menge.
ENDCASE.
ENDIF.
CLEAR: wa_mseg.
ENDLOOP.

Thank you.

Attachments

fig1amdp.jpg (31.0 kB)