Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Read header text from vf01 and print in script main window

Former Member
0 Kudos
393

Hi Gurus,

I need to read text from vf01 header note 1, there user type max 10 lines i want to read that 10 lines and print in sap script main window after line item printed. i used read text but one line only fetched. i declare variable like data : NEXRSP LIKE TLINE-TDLINE and read_text function module. pls provide solution for this.

Regards

G.Vendhan

7 REPLIES 7

Former Member
0 Kudos
193

Use the include statement after the line item :

INCLUDE &TDNAME& OBJECT<>ID <> LANGUAGE <>& PARAGRAPH <>

Mathews

Former Member
0 Kudos
193

Use the include statement after the line item :

INCLUDE &TDNAME& OBJECT<>ID <> LANGUAGE <>& PARAGRAPH <>

Mathews

Former Member
0 Kudos
193

instaed of line variable declare a internal table like NEXRSP type standard table of TLINE.

i guess you are getting only one line because you are passing work area. you need to pass the internal table to capture all the lines of long text.

also check for the exapmple you are testing with, it has multiple lines of header text.

0 Kudos
193

HI GURUS,

Thank u for reply i declare like

ID = '0002'.

PERFORM READTEXT USING EN NAME OBJECT ID TEXT_OUTPUT.

NEXRSP = TEXT_OUTPUT . CLEAR TEXT_OUTPUT.

FORM READTEXT USING P_EN

P_NAME

P_OBJECT

P_ID

P_TEXT_OUTPUT.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = P_ID

LANGUAGE = P_EN

NAME = P_NAME

OBJECT = P_OBJECT

TABLES

LINES = LINES

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

LOOP AT LINES.

P_TEXT_OUTPUT = LINES-TDLINE.

EXIT.

ENDLOOP.

FREE LINES. CLEAR LINES.

ENDFORM. " READTEXT

0 Kudos
193

hi,

In below code, because of exit , you are getting only one row in P_TEXT_OUTPUT.

{code

LOOP AT LINES.

P_TEXT_OUTPUT = LINES-TDLINE.

EXIT.

ENDLOOP.

you can do like this.

loop at lines.

concatenate P_TEXT_OUPUT line-tdline into p_text_output.

endloop.

at the end p_text_output will have all the lines of header text.

{code}

0 Kudos
193

Thank u santosh,

I want to print line by line like ,

ED Suffered:

Basic Duty XXXXXX

2% Cess on ED XXXXXX

1% Addl Cess on ED XXXXXX

Total XXXXXXX

Excise Duty Remitted

thanks and regards

G.Vendhan

0 Kudos
193

solved