07-10-2009 8:17 AM
Hi Experts ,
How can i remove the lock indicator of line item in Purchase order , if the line item is in trash .I have tried the follwing condition but it is not working.
clear t_bapi_poitem.
t_bapi_poitem-po_item = t_poitem-item.
t_bapi_poitem-delete_ind = ' '.
CLEAR t_bapi_poitemx.
t_bapi_poitemx-po_item = t_poitem-item.
t_bapi_poitemx-po_itemx = c_x.
t_bapi_poitemX-delete_ind = 'X'.
*
APPEND t_bapi_poitem.
APPEND t_bapi_poitemx.
clear t_bapi_poitem.
clear t_bapi_poitemx.
endloop.
DATA : l_msgty TYPE c,
l_msgid(2) TYPE c,
l_msgno(3) TYPE c,
l_msgtx(100) TYPE c,
l_errflag TYPE c.
CLEAR: t_bapireturn.
REFRESH: t_bapireturn.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = T_Poitem-PO
POHEADER = T_BAPI_POHEADER
POHEADERX = T_BAPI_POHEADERX
TABLES
RETURN = T_BAPIRETURN
POITEM = T_BAPI_POITEM
POITEMX = T_BAPI_POITEMX.
can any one kindly provide their valuable inputs.
regards
Prasun
07-10-2009 8:50 AM
Hello
Working code:
DATA: xreturn like BAPIRET2 occurs 0 with header line,
xpoitem like BAPIMEPOITEM occurs 0 with header line,
xpoitemx like BAPIMEPOITEMX occurs 0 with header line.
xpoitem-po_item = p_ebelp. " set position here
xpoitem-delete_ind = ' '.
append xpoitem.
xpoitemx-po_item = p_ebelp. " set position here
xpoitemx-delete_ind = 'X'.
append xpoitemx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = p_ebeln "set ebeln here
TABLES
return = xreturn
poitem = xpoitem
poitemx = xpoitemx.
if sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING WAIT = 'X'.
endif.
07-10-2009 9:09 AM
Hi
I am doing the same .what is the meaning of set position here
regards
Prasun
07-10-2009 9:15 AM
Hello
It mean that you must set here number of position PO (if this position is marked as locked).
08-18-2009 10:41 AM