*&---------------------------------------------------------------------*
*& Report ZSO_TEXT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSO_TEXT.
INCLUDE ZFILE_XLS.
DATA: SVBELN TYPE VBELN.
LOOP AT ITXLS.
MOVE ITXLS-COL1 TO SVBELN.
PERFORM F_ADD_ZERO USING SVBELN.
PERFORM SUB_CREATE_SO_HEADER_TEXT USING SVBELN.
ENDLOOP.
**&---------------------------------------------------------------------*
**& Form SUB_CREATE_SO_HEADER_TEXT
**&---------------------------------------------------------------------*
** 修改销售订单抬头文本:create_text,每次都是创建
**----------------------------------------------------------------------*
FORM SUB_CREATE_SO_HEADER_TEXT USING P_VBELN.
DATA:
GT_TEXT TYPE TABLE OF TLINE WITH HEADER LINE,
G_FNAME TYPE THEAD-TDNAME,
G_STATUS TYPE C.
G_FNAME = P_VBELN.
REFRESH GT_TEXT.
GT_TEXT-TDLINE = '1001000101_OP016596-雷明志_1229.5_201407-000028'.
APPEND GT_TEXT.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
FID = '0001'
FLANGUAGE = SY-LANGU
FNAME = G_FNAME
FOBJECT = 'VBBK'
TABLES
FLINES = GT_TEXT
EXCEPTIONS
NO_INIT = 1
NO_SAVE = 2
OTHERS = 3.
DATA: WA_MSGMESSAGE(100).
CASE SY-SUBRC.
WHEN 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
WHEN 1.
CONCATENATE 'no_init' '请核查!' INTO WA_MSGMESSAGE.
WHEN 2.
CONCATENATE 'no_save' '请核查!' INTO WA_MSGMESSAGE.
WHEN 4.
CONCATENATE 'others_error' '请核查!' INTO WA_MSGMESSAGE.
ENDCASE.
WRITE /:WA_MSGMESSAGE.
ENDFORM. " SUB_CREATE_SO_HEADER_TEXT
INCLUDE ZRPT_FUN.