Sie sind auf Seite 1von 2

This badi basically called when the PO released .

Once the PO get released and t

he material number lies within the specified range then it will be entered into
the Z table .
check if sy-tcode = ME29n or ME28
call function module BAPI_PO_GETDETAIL by passing the PO number IM_EKKO-EBELN an
d items = X
then check if any of the items of the po with MATNR lies within RMOR001 and RMO
R999 or RMCO001 and RMCO999
if yes then enter the EBELN, EBELP, DOC DATE, MENGE, MEINS, WERKS and MATNR int
o the table ZMMRMCONTRACK .
If the record already exists in the table then modify the details.
The user will be selection options EBELN and LIFNR .
Select EBELN from EKKO on the basis of input LIFNR and EBELN.
Get all the POs and Line items from ZMMRMCONTRACK for the above selected EBELN.
For the above selected EBELN and EBELP check if the release indicator is 2 if no
t deleted the lines for that EBELN.
Get all the MBLNR from MSEG for PO and Line item. And calculate the unrestriced
quantity and gr blocked stock quantity.
by the logic :
Unrestriced use stock = 101 + 105 + 123 + 262 + 561 + 202 + 902 + 343
- 102 - 122 - 201 - 261 - 901 - 344 - 562 -106
GR blocked stock = 125 + 106 + 103 - 124 - 105 - 104
once the data is calculated now the field catalog will be prepared for the ALV o
Field catalog will be prepared by using FM REUSE_ALV_FIELDCATALOG_MERGE and pass
ing the structure ZMMS002.
And finally ALV will be displayed by the function module REUSE_ALV_GRID_DISPLAY.
Interactive ALV
The selection screen will have two select options EBELN and LIFNR .
Select EBELN from EKKO where EBELN in S_EBELN and LIFNR in S_LIFNR and FRGKE = 2
For the above selected EBELNs Select * from ZMMRMCONTRACK .
Now as the data has been selected the field catalog will be prepared by calling
the FM REUSE_ALV_FIELDCATALOG_MERGE and passing the structure ZMMS002.
Loop at it_fieldcat
if the fieldname = adv_pymt_stat or lv_reqd_dt or vsl_load_dt or vsl_arv_dt or v
anomet_py_dt or stk_rel_dt or lc_pymt_dt or vsl_dis_dt
then make the field editable by wa_fieldcat-edit = X .
If the fieldcat-fieldname = mandt or urmenge or urmeins or urmblnr or urmjahr or
vanomet_py_dt then make the field invisible by fieldcat-no_out = X
And finally ALV will be displayed by the function module REUSE_ALV_GRID_DISPLAY.
Once the user enter the data and try to save then check
lc_reqd_dt <= lc_pymtn_dt<=vsl_load_dt<=vsl_arv_dt <= vsl_dis_dt <= vanomet_py_d
then save the data to zmmrmcontrack and show message data saved successfully. s