Read text in standard text element in sap abap programming lanuage
Some time requirment to read text help of below code you can read any text in item level in sap abap
programming language
DATA: lt_lines TYPE STANDARD TABLE OF tline,
wa_line TYPE tline,
lv_name TYPE thead-tdname.
SORT lt_vbfa ASCENDING.
READ TABLE lt_vbfa INTO wa_vbfa
INDEX ls_item-slno.
CONCATENATE wa_vbfa-vbelv wa_vbfa-posnv INTO lv_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'Z002'
LANGUAGE = sy-langu
NAME = lv_name
OBJECT = 'VBBP'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
* OLD_LINE_COUNTER =
TABLES
LINES = LT_LINES
* 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.
exit.
ELSE.
DELETE lt_lines WHERE tdline IS INITIAL.
LOOP AT lt_lines INTO wa_line.
gv_frame_text = wa_line-tdline.
ENDLOOP.
ENDIF.
programming language
DATA: lt_lines TYPE STANDARD TABLE OF tline,
wa_line TYPE tline,
lv_name TYPE thead-tdname.
SORT lt_vbfa ASCENDING.
READ TABLE lt_vbfa INTO wa_vbfa
INDEX ls_item-slno.
CONCATENATE wa_vbfa-vbelv wa_vbfa-posnv INTO lv_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'Z002'
LANGUAGE = sy-langu
NAME = lv_name
OBJECT = 'VBBP'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
* OLD_LINE_COUNTER =
TABLES
LINES = LT_LINES
* 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.
exit.
ELSE.
DELETE lt_lines WHERE tdline IS INITIAL.
LOOP AT lt_lines INTO wa_line.
gv_frame_text = wa_line-tdline.
ENDLOOP.
ENDIF.
Comments
Post a Comment