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: 

Bapi_po_change Remove lock indicator of line items in

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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.

0 Kudos

Hi

I am doing the same .what is the meaning of set position here

regards

Prasun

0 Kudos

Hello

It mean that you must set here number of position PO (if this position is marked as locked).

0 Kudos

thx