Read text sales order header VA03
Some time requirement to read text to header level in sap abap for this purpose we can write below
Code read text va03
************************************************************ Reading text in sap abap programming language *******************************************
DATA:
tdname LIKE stxl-tdname,
myline LIKE tline-tdline,
ze13_line(200) TYPE c,
lv_value TYPE c LENGTH 142.
DATA: BEGIN OF lines OCCURS 0.
INCLUDE STRUCTURE tline.
DATA:END OF lines.
DATA:BEGIN OF myheader.
INCLUDE STRUCTURE thead.
DATA:END OF myheader.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = '1001' " id for text
language = sy-langu
name = '1300000001' "tdname " sales order Number
object = 'VBBK'
IMPORTING
header = myheader
TABLES
lines = lines " here fill the your text
EXCEPTIONS
id = 1
language = 2
name = 3
not
found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc = 0.
LOOP AT lines.
MOVE lines-tdline(132) TO lv_value.
EXIT.
ENDLOOP.
ENDIF.
Code read text va03
************************************************************ Reading text in sap abap programming language *******************************************
DATA:
tdname LIKE stxl-tdname,
myline LIKE tline-tdline,
ze13_line(200) TYPE c,
lv_value TYPE c LENGTH 142.
DATA: BEGIN OF lines OCCURS 0.
INCLUDE STRUCTURE tline.
DATA:END OF lines.
DATA:BEGIN OF myheader.
INCLUDE STRUCTURE thead.
DATA:END OF myheader.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = '1001' " id for text
language = sy-langu
name = '1300000001' "tdname " sales order Number
object = 'VBBK'
IMPORTING
header = myheader
TABLES
lines = lines " here fill the your text
EXCEPTIONS
id = 1
language = 2
name = 3
not
found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc = 0.
LOOP AT lines.
MOVE lines-tdline(132) TO lv_value.
EXIT.
ENDLOOP.
ENDIF.
Comments
Post a Comment