Skip to Content
0

REF_ITEM not transferred from BAPIMEPOITEM-REF_ITEM to table EKPO-REF_ITEM using BAPI_PO_CHANGE

Nov 10, 2017 at 03:41 PM

38

avatar image
Former Member

Why is the field value of REF_ITEM not transferred from BAPI parameter BAPIMEPOITEM-REF_ITEM to database table EKPO-REF_ITEM when using BAPI_PO_CHANGE? After executing the following code, the field values set on BAPIMEPOITEM are available in table EKPO except the field REF_ITEM which is empty

Version info: SAP ECC 6.0, SAP_ABA 702, SAP_AP 700(support pack= SAPKNA7017)

I could not find any documentation on this or SAP Note relevant to the version indicated above.

DATA: lt_items TYPE bapimepoitem_tp.
DATA: lt_itemsx TYPE bapimepoitemx_tp.

DATA: ls_item TYPE bapimepoitem.
DATA: ls_itemx TYPE bapimepoitemx.

DATA: lt_ret TYPE bapiret2_tt.
DATA: ls_ret TYPE bapiret2.

"new Item addition to exising po lines
ls_item-po_item = '60'.
ls_itemx-po_item = '60'.

ls_itemx-po_itemx = abap_true. 

ls_item-material = '1700000987'.
ls_itemx-material = abap_true.

ls_item-ematerial =ls_item-material.
ls_itemx-ematerial = abap_true.

ls_item-po_unit = 'L'. 
ls_itemx-po_unit = abap_true.

ls_item-short_text = 'MY MATERIAL ONE'.
ls_itemx-short_text = abap_true.

ls_item-quantity = '123.456'.
ls_itemx-quantity = abap_true.

"*************************************
"Ref item never gets transfered to EKPO-REF_ITEM
"this is the issue.is it supposed to be transferred to EKPO-REF_ITEM or not?
"or Where can I even get detail information on this field or EKPO_REF_ITEM??

ls_item-ref_item = '10'.
ls_itemx-ref_item = abap_true.

"*************************************

ls_item-plant = 'PL10'. 
ls_itemx-plant = abap_true.

ls_item-stge_loc = '1001'. 
ls_itemx-stge_loc = abap_true.

APPEND ls_item TO lt_items.
APPEND ls_itemx TO lt_itemsx.

CALL FUNCTION 'BAPI_PO_CHANGE'
  EXPORTING
    purchaseorder = '4500012346'
  TABLES
    return        = lt_ret
    poitem        = lt_items
    poitemx       = lt_itemsx.

"checking lt_ret goes here
 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait   = abap_true
    IMPORTING
      return = ls_ret.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers