Professional Documents
Culture Documents
Real AMDP
Real AMDP
Development Steps:
Step 1. Create a Class with one AMDP Method and a Normal Method in HANA Studio or
Eclipse or ADT.
Please note, I have added 4 fields at the end to store the calculated values (screenshot above).
display "Display
CHANGING
it_scrap TYPE gtyt_scrap.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
The above code needs to be in the CLASS Definition.
FROM :lt_afru a
INNER JOIN afko b
ON a.mandt = b.mandt AND
a.aufnr = b.aufnr
INNER JOIN :lt_aufk c
ON a.mandt = c.mandt AND
a.aufnr = c.aufnr
INNER JOIN :lt_matdoc d
ON a.mandt = d.mandt AND
b.plnbez = d.matnr AND
a.aufnr = d.bktxt
INNER JOIN :lt_mara f
ON a.mandt = f.mandt AND
b.plnbez = f.matnr
LEFT OUTER JOIN makt e
ON e.mandt = a.mandt AND
e.matnr = b.plnbez AND
e.spras = :iv_langu
LEFT OUTER JOIN t157e g
ON g.mandt = a.mandt AND
g.bwart = d.bwart AND
g.grund = a.grund AND
g.spras = :iv_langu
ENDMETHOD.
METHOD display.
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = DATA(lo_table) "Basis Class ALV Tables
CHANGING
t_table = it_scrap ).
CATCH cx_salv_msg. "#EC NO_HANDLER
ENDTRY.
lo_table->get_columns( )->set_optimize( ).
lo_table->display( ).
ENDMETHOD.
ENDCLASS.
REPORT zstkoes_amdp.
TABLES: mara, afru, aufk, crhd, matdoc.
**Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-s01.
SELECT-OPTIONS : s_matnr FOR mara-matnr,
* s_cust FOR aufk-zz_cust_numb,
s_werks FOR afru-werks OBLIGATORY,
s_budat FOR afru-budat OBLIGATORY,
s_arbpl FOR crhd-arbpl,
s_prctr FOR aufk-prctr,
s_bwart FOR matdoc-bwart OBLIGATORY MATCHCODE OBJECT H_T156.