2006 Jul 07 8:23 AM
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.
2006 Jul 07 8:34 AM
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
2006 Jul 07 8:37 AM
Hi kiran,
Can u supply full coding including FM Read_text.
Ravi.
2006 Jul 07 8:38 AM
Simple and the most often used way is to get the value into a variable and print it in the script.
-Aarthi.
2006 Jul 07 8:41 AM
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
2006 Jul 07 8:38 AM
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.
2006 Jul 07 8:54 AM
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
2006 Jul 07 9:04 AM
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
2006 Jul 07 9:45 AM
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
2006 Jul 07 9:53 AM
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.
2006 Jul 07 10:10 AM
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.