Hi Experts.
I'm trying to modify the field MVGR4 in VBAP table of an sale order through this function, but I don't get it.
I think I don't pass the correct parameters in the function but I don't know what I need give it.
When finish the FM in return table appear the error message -->
TYPE E
ID V4
NUMBER 219
MESSAGE El documento de venta 0000000058 no se modifica
LOG_NO
LOG_MSG_NO 000000
MESSAGE_V1 0000000058
MESSAGE_V2 000020
MESSAGE_V3
MESSAGE_V4
PARAMETER
ROW 0
FIELD
SYSTEM DESCLNT200
This is my reduce code in my program :
****************************************************************
DATA: l_item_order LIKE bapisditm OCCURS 0 WITH HEADER LINE,
l_item_orderx LIKE bapisditmx OCCURS 0 WITH HEADER LINE,
ls_mvgr4 LIKE tvm4t-mvgr4,
l_order_header_inx LIKE bapisdh1x,
l_saledocument LIKE bapivbeln-vbeln.
******************************************************************
CLEAR: l_saledocument,
l_order_header_inx,
l_item_order,
l_item_orderx.
REFRESH: li_return,
l_item_order,
l_item_orderx.
SELECT SINGLE mvgr4
INTO ls_mvgr4
FROM tvm4t
WHERE bezei = ls_good-value.
l_saledocument = i_datos-vbeln.
l_order_header_inx-updateflag = 'U'.
*Table with order items in a sale order (i_post)
LOOP AT i_post WHERE vbeln = i_datos-vbeln
AND uepos = i_datos-uepos.
l_item_order-itm_number = i_post-posnr.
l_item_order-prc_group4 = ls_mvgr4.
APPEND l_item_order.
l_item_orderx-updateflag = 'X'.
l_item_orderx-prc_group4 = 'X'.
APPEND l_item_orderx.
ENDLOOP.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = l_saledocument
order_header_inx = l_order_header_inx
TABLES
return = li_return
order_item_in = l_item_order
order_item_inx = l_item_orderx.
READ TABLE li_return WITH KEY type = 'E'.
***************
I hope you can help me, thanks.