cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to update the Subcontracting type of PO using 'BAPI_PO_CHANGE'. However i am able to update this field . Can someone advice me how to do.

Former Member
0 Kudos

HI,


I am trying to update the Subcontracting type of PO using 'BAPI_PO_CHANGE'. However i am able to update this field .

Can someone advice me how to do.



My code sample is :


wl_poitem-po_item = l_ebelp.

wl_poitemx-po_item = wl_poitem-po_item.

wl_poitemx-po_itemx = c_x.

*C--material procurement indicator need to update

*   the type of procurement

wl_materialind-po_item       = wl_poitem-po_item.

wl_materialindx-po_item      = wl_poitem-po_item.

wl_materialindx-po_itemx     = c_x.

wl_materialind-item_no       = wl_poitem-po_item.

wl_materialindx-item_no      = wl_poitem-po_item.

wl_materialindx-item_nox     = c_x.

wl_materialind-mat_provision = 'S'.

wl_materialindx-mat_provision = c_x.

wl_materialind-sched_line      = '0001'.

wl_materialindx-sched_line     = '0001'.

wl_materialindx-sched_linex    = c_x.

wl_materialind-entry_quantity  = wl_poitem-quantity.

wl_materialindx-entry_quantity = c_x.

wl_materialind-plant           = wl_poitem-plant.

wl_materialindx-plant          = c_x.

wl_materialind-material        = wl_poitem-material.

wl_materialindx-material       = c_x.

wl_materialind-item_cat        = 'L'.

wl_materialindx-item_cat       = c_x.

wl_extensionin-structure  = 'BAPI_TE_MEPOITEM'.

wl_extensioninx-structure = 'BAPI_TE_MEPOITEMX' .

wl_extensionin-valuepart1+222(1) = '1'.

wl_extensioninx-valuepart1+24(1) = c_x.

APPEND wl_poitem  TO tl_poitem.

CLEAR  wl_poitem.

APPEND wl_poitemx TO tl_poitemx.

CLEAR  wl_poitemx.

APPEND wl_materialind TO tl_materialind.

CLEAR  wl_materialind.

APPEND wl_materialindx TO tl_materialindx.

CLEAR  wl_materialindx.

APPEND wl_extensionin  TO tl_extensionin.

CLEAR  wl_extensionin.

APPEND wl_extensioninx TO tl_extensioninx.

CLEAR  wl_extensioninx.

CALL FUNCTION 'BAPI_PO_CHANGE'

   EXPORTING

     purchaseorder = l_ebeln

     versions      = wa_version

   TABLES

     return        = tl_return

*    poitem        = tl_poitem

*    poitemx       = tl_poitemx

     pocomponents  = tl_materialind

     pocomponentsx = tl_materialindx

     extensionin   = tl_extensionin

     extensionout  = tl_extensioninx.

READ TABLE  tl_return WITH KEY type = 'E' TRANSPORTING NO FIELDS.

IF sy-subrc NE 0.

   CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .

ENDIF.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

In the above question i mean- I am UNABLE to update