My 2 cents, as this kind of error is frequent in many BAPI functions.
BAPI functions frequently have their parameters doubled, for instance one named ITEM
and another one named accordingly and suffixed with X
(ITEMX
). This additional parameter has the exact same fields, with the same name but with a one-character length which can take the value either '
' or 'X
'.
'X
' is to indicate that the corresponding field in ITEM
must be changed. The interest of these doubled parameters can be better understood in BAPI used to change an existing object, to force a field to be changed to an empty value. Fields with a empty value mean "no change".
Example code:
DATA: items TYPE TABLE OF BAPIMEOUTITEM,
items_x TYPE TABLE OF BAPIMEOUTITEMX.
items = VALUE #(
( item_no = '00010' material = 'MAT01' )
( item_no = '00020' material = 'MAT02' ) ).
items_x = VALUE #(
( item_no = '00010' material = 'X' )
( item_no = '00020' material = 'X' ) ).
...
CALL FUNCTION 'BAPI_CONTRACT_CREATE'
TABLES
item = items
itemx = items_x
...