Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to idntify selected line item during pr creation.

Former Member
0 Kudos
338

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..

1 REPLY 1

Former Member
0 Kudos
81

OK thanks sir,

i will be care full next time..