2017 Apr 06 12:03 PM
i want to display current line item material stock during pr creation in me51n, but problem is i just got the last item stock.. so how can i identify the line item in pr to display stock??
here my code is....
METHOD IF_EX_ME_PROCESS_REQ_CUST~CHECK.
DATA : LT_ITEM TYPE MMPUR_REQUISITION_ITEMS,
LS_ITEM TYPE MMPUR_REQUISITION_ITEM,
LS_ITEM_DATA TYPE MEREQ_ITEM.
DATA: LV_STK TYPE MBEW-LBKUM.
DATA: LV_STK_FINAL_MSG TYPE STRING.
DATA: LV_STK_FINAL TYPE STRING.
LT_ITEM = IM_HEADER->GET_ITEMS( ).
LOOP AT LT_ITEM INTO LS_ITEM .
CLEAR LS_ITEM_DATA.
LS_ITEM_DATA = LS_ITEM-ITEM->GET_DATA( ).
SELECT SINGLE LBKUM INTO LV_STK FROM MBEW WHERE MATNR = LS_ITEM_DATA-MATNR AND BWKEY = LS_ITEM_DATA-WERKS .
LV_STK_FINAL_MSG = LV_STK.
CONCATENATE 'Material Stock is ' LV_STK_FINAL_MSG INTO LV_STK_FINAL SEPARATED BY SPACE.
ENDLOOP.
IF SY-UCOMM EQ 'MECHECKDOC'. "it execute, when click ckeck
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
TITEL = 'Information'
TEXTLINE1 = LV_STK_FINAL
TEXTLINE2 = ' '
START_COLUMN = 40
START_ROW = 6.
ENDIF.
ENDMETHOD.
so how can i identify line item?? any flag or indicator that identify the selected line..
2017 Apr 07 5:48 AM