Skip to Content
avatar image
Former Member

Bapi_po_change Remove lock indicator of line items in

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 10, 2009 at 07: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.
    
    

    Add comment
    10|10000 characters needed characters exceeded