12-09-2008 8:29 AM
PERFORM GET_READTEXT IN PROGRAM 'ZSLR0124_SUBROUTINE'
USING &TNAME&
CHANGING &T_LINES&
ENDPERFORM
written below program in separate subroutiine.
PROGRAM ZSLR0124_SUBROUTINE.
Form get_readtext TABLES input STRUCTURE itcsy
output STRUCTURE itcsy.
DATA: lv_vbeln TYPE VBELN_VF .
DATA: tname like thead-tdname..
*DATA: VBDKR-VBELN LIKE VBDKR-VBELN.
data : t_lines LIKE tline OCCURS 0 WITH HEADER LINE.
*tname = VBDKR-VBELN.
*lv_vbeln = input-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_vbeln
IMPORTING
output = lv_vbeln.
TNAME = lv_vbeln.
READ TABLE input with key 'TNAME'.
TNAME = input-value.
IF sy-subrc = 0.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'X001'
LANGUAGE = 'E'
NAME = TNAME
OBJECT = 'VBBK'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = T_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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE output with key 'T_LINES'.
IF sy-subrc = 0.
LOOP AT t_lines.
output-value = t_lines-tdline.
ENDLOOP.
MODIFY OUTPUT TRANSPORTING VALUE WHERE NAME = 'T_LINES'.
endif.
endif.
endform.
the subroutine is triggering but header text its not displaying on the layout
12-09-2008 8:40 AM
12-09-2008 8:40 AM
Hi,
If you want to print all lines from the text use the standard way of printing test in SAP scripts
INCLUDE &TNAME& OBJECT VBBK ID X001 LANGUAGE 'EN' as a command
If you only wants one line printed you can use you call to a subprogram. and the displey you returned line. All fields used at sending and recieving fields are single fields and not a table.
Regards
Åsa Thenstedt