SAP ABAP - Create Purchase Order Text in Material Master Using BAPI CREATE_TEXT
DATA :
FID TYPE THEAD-TDID,FLANGUAGE TYPE THEAD-TDSPRAS,
FNAME TYPE THEAD-TDNAME,
FOBJECT TYPE THEAD-TDOBJECT.
FID = 'BEST'.
FNAME = 'MAT0001'. "Material Number
FOBJECT = 'MATERIAL'.
FLANGUAGE = 'EN'.
REFRESH IT_FLINES.
CLEAR IT_FLINES.
IT_FLINES-TDFORMAT = '*'.
IT_FLINES-TDLINE = 'Long Text Purchase Order Text'.
APPEND IT_FLINES.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
FID = FID
FLANGUAGE = SY-LANGU
FNAME = FNAME
FOBJECT = FOBJECT
SAVE_DIRECT = 'X'
FFORMAT = '*'
TABLES
FLINES = IT_FLINES[]
EXCEPTIONS
NO_INIT = 1
NO_SAVE = 2
OTHERS = 3.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = FOBJECT
NAME = FNAME
ID = FID
LANGUAGE = SY-LANGU
SAVEMODE_DIRECT = 'X'
KEEP = ''.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
Comments
Post a Comment