更改SO数量比较常见,修改文本注释就是比较少做了,经过了数小时的调试,终于成功了,分享给小伙伴们以节省时间。
1.双击文本里文本区域
转到->表头
获取ZO32,获取文本标识
ATA: LV_VBELN TYPE BAPIVBELN-VBELN,
LS_HEADRX TYPE BAPISDH1X,
LT_RETURN TYPE TABLE OF BAPIRET2 WITH HEADER LINE,
LT_ITEM TYPE TABLE OF BAPISDITM WITH HEADER LINE,
LT_ITEMX TYPE TABLE OF BAPISDITMX WITH HEADER LINE,
LT_OTEXT TYPE TABLE OF BAPISDTEXT,
LS_OTEXT TYPE BAPISDTEXT.
DATA: LV_MESSAGE TYPE STRING.
LV_VBELN = '1300009048'.
LS_HEADRX-UPDATEFLAG = 'U'.
LT_ITEM-ITM_NUMBER = '10'.
LT_ITEM-MATERIAL = 'A-ALAN-B'.
LT_ITEM-TARGET_QTY = '166'.
APPEND LT_ITEM.
LT_ITEMX-ITM_NUMBER = '10'.
LT_ITEMX-UPDATEFLAG = 'U'.
LT_ITEMX-MATERIAL = 'X'.
LT_ITEMX-TARGET_QTY = 'X'.
APPEND LT_ITEMX.
LS_OTEXT-DOC_NUMBER = '1300009048'.
LS_OTEXT-ITM_NUMBER = '10'.
LS_OTEXT-TEXT_ID = 'ZO32'.
LS_OTEXT-LANGU = '1'.
ls_otext-LANGU_ISO = 'ZH'.
LS_OTEXT-FORMAT_COL = '*'.
LS_OTEXT-FUNCTION = '004'.
LS_OTEXT-TEXT_LINE = '测试123'.
APPEND LS_OTEXT TO LT_OTEXT.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = LV_VBELN
* ORDER_HEADER_IN =
ORDER_HEADER_INX = LS_HEADRX
* SIMULATION =
* BEHAVE_WHEN_ERROR = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* LOGIC_SWITCH =
* NO_STATUS_BUF_INIT = ' '
TABLES
RETURN = LT_RETURN
ORDER_ITEM_IN = LT_ITEM
ORDER_ITEM_INX = LT_ITEMX
* PARTNERS =
* PARTNERCHANGES =
* PARTNERADDRESSES =
* ORDER_CFGS_REF =
* ORDER_CFGS_INST =
* ORDER_CFGS_PART_OF =
* ORDER_CFGS_VALUE =
* ORDER_CFGS_BLOB =
* ORDER_CFGS_VK =
* ORDER_CFGS_REFINST =
* SCHEDULE_LINES =
* SCHEDULE_LINESX =
ORDER_TEXT = LT_OTEXT
* ORDER_KEYS =
* CONDITIONS_IN =
* CONDITIONS_INX =
* EXTENSIONIN =
.
LOOP AT LT_RETURN WHERE TYPE = 'E' OR TYPE = 'A'.
CONCATENATE LT_RETURN-MESSAGE ';' LV_MESSAGE INTO LV_MESSAGE.
ENDLOOP.
IF SY-SUBRC NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF.
WRITE: LV_MESSAGE.