Application Development and Automation 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 only

Read_text

Former Member
0 Likes
2,486

Hi all,

I want to print text as output in SAP Script using FM Read_text. For this i am using External subroutine. How to get the output and how to declare it?

Expecting reply.

ravi.

10 REPLIES 10
Read only

Former Member
0 Likes
1,325

One option is to EXPORT the text to a mmemory id after reading the text in the external subroutine and IMPORT the text from the memory id in the SAP script editor .

-Kiran

*Please reward useful answers

Read only

0 Likes
1,325

Hi kiran,

Can u supply full coding including FM Read_text.

Ravi.

Read only

0 Likes
1,325

Simple and the most often used way is to get the value into a variable and print it in the script.

-Aarthi.

Read only

0 Likes
1,325

In the external subroutine write the statement

CALL FUNCTION 'READ_TEXT'

exporting

object

id

name

langu

TABLES

lines = itab

EXPORT itab TO MEMORY-ID 'TXT'.

and after calling the external subroutine(I guess u r calling this in the script editor)

IMPORT itab FROM MEMORY-ID 'TXT.

This is one way of solving ur problem...

-Kiran

Read only

aris_hidalgo
Contributor
0 Likes
1,325

Hi,

Place the read_text in the report program and assign a field that will hold the text.

Example, I named it as tdline. now, in the sapscript form, put in &TDLINE&. It will now

show the value of tdline.

Regards!

P.S. Please award points for useful answers.

Read only

Former Member
0 Likes
1,325

Hi ravi,

why are you using the READ_TEXT Fm.

you can directly include the text using include text option.

INCLUDE <b>TEXT1</b> OBJECT <b>TEXT</b> ID <b>ST</b>

TEXT1 is Name

TEXT is Object

ST is ID.

you can find these from Insert->Text->Standard text

regards

vijay

Read only

0 Likes
1,325

No vijay,

I've finished the O/P using Include..., but client wants to display the text after some space.

Ex: REMARKS: Goods not Received.

Goods not Received is the text taken from the text editor in Me21n

Read only

0 Likes
1,325

Hi Ravi,

get the Text from Me21 using Read_Text.

write a routine to concatenate the out put with contant character for eg: concatenate 'Remarks: ' Read_text-output_value into temp_variable.

print the temp_variable.

Regards,

Jey

Read only

0 Likes
1,325

Hi jay,

Give me coding for this example, and internal table declaration. How to get the text as result...

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = 'F01'

LANGUAGE = SY-LANGU

NAME = 4100000016

OBJECT = 'EKKO'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = ITAB

  • 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 only

Former Member
0 Likes
1,325

Hi Ravi,

To get the text using function module you need to have that text saved in standard text format.and in export parameters ID, Language Name and Object u have to pass then u will get text in LINES parameter.But for this u need all the above export parameters.

With Regards,

Satish Kantipudi.