‎2009 Nov 17 3:20 PM
hello,
in call function 'read_text' , what tables to use .
how do i find out what sud be the name of the table .
joseph
‎2009 Nov 17 3:31 PM
Hi Joesph,
You have to pass the TEXT ID, LANGUAGE, NAME OF THE TEXT TO BE READ, OBJECT OF THE TEXT TO BE READ.
So you will get the lines of the text read in the TABLES parameter LINES.
A sample code for your kind perusal:-
data: begin of lt_tline occurs 0.
include structure tline.
data: end of lt_tline.
data: l_tabix like sy-tabix.
data: l_name like thead-tdname.
sort it_kdgrp by spras kdgrp.
loop at it_billing_docs into w_billing_docs.
clear l_name.
l_tabix = sy-tabix.
*-----Convert billing doc number to appropriate format
* CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
* EXPORTING
* INPUT = w_billing_docs-vbeln
* IMPORTING
* OUTPUT = l_name.
*-----Move to correct format for read_text
move w_billing_docs-vbeln to l_name.
call function 'READ_TEXT'
exporting
client = sy-mandt
id = 'Z012'
language = sy-langu
name = l_name
object = 'VBBK'
tables
lines = lt_tline
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 eq 0.
*----Only the first line will be read
read table lt_tline index 1.
if sy-subrc eq 0.
w_billing_docs-bill_name = lt_tline-tdline.
endif.
endif.Kindly set to resolved if it helps you.
Regards
Abhii
Moderator message - Please use code tags to help readability
Edited by: Rob Burbank on Nov 17, 2009 10:41 AM
‎2009 Nov 17 3:46 PM
thanks abhi,
that is my questions . i have to get the item text on GR-slip
i have written the code but i get stuck at
tables
lines =
what do i write after equal to sign and then what i declare in the data stmnt.
i have passed all the rest parametrs of item text like text id , name object etc.
it is just this one .
joseph
‎2009 Nov 17 3:53 PM
Just pass the parameter in the tables as I defined above. READ_TEXT will fill up this tables.
You might get a doubt from where to find out the values of TEXT ID, LANGUAGE, NAME OF THE TEXT TO BE READ, OBJECT OF THE TEXT TO BE READ.
Example : Say you have to read the Long text in the Sales Header. To find out above values do as below :-
1) Go to VA03 ,enter billing number & hit enter.
2) Click on Go to Menu.
3) Then Select HEADER.
4) Then Select TEXTS.
5) Double click on the long text ,you see there.
6) It will open SAP script text editor.
7) Then click on GO TO & select HEADER
😎 You will find TEXT NAME, LANGUAGE, TEXT ID, & TEXT OBJECT.
Kindly set to resolved if it helps you.
Regards
Abhii
Edited by: Abhii on Nov 17, 2009 4:54 PM
‎2009 Nov 17 4:08 PM
thanks abhi,
i already told you i know where to get the rest of the parameters , i wanted to know how to get the table
you gave the entire program code , but my question i still not answered .
i want to know what table name to write .
joseph
‎2009 Nov 17 4:10 PM
Dear Abhii,
You deserve full credit for your replies, however, I should point out that you should no longer use the 'OCCURS x' language statement. Beside the fact that it is obsolete, you simply cannot use it in classes.
‎2009 Nov 17 4:13 PM
Joseph,
it is all there in Abhii's code:
Name of the table 'LT_LINES' (which is arbitrary).
Data declaration:
data: begin of lt_tline occurs 0.
include structure tline.
data: end of lt_tline.
What else do you need.
‎2009 Nov 18 8:50 AM
Hi Mickey,
my code is
DATA : EBELP TYPE EBELP .
DATA : EBELN TYPE EBELN .
DATA : begin of lt_tline occurs 0.
include structure tline.
DATA : end of lt_tline.
CLEAR lv_name.
CONCATENATE ebeln ebelp INTO lv_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'F01'
LANGUAGE = 'E'
NAME = 'lv_name'
OBJECT = 'EKPO'
TABLES
LINES = lt_tline
EXCEPTIONS
NOT_FOUND = 04.when i check the print preview i get 00000 .
where am i wrong .
also if there are 5 line items , what sud be the loop.
Joseph
‎2009 Nov 18 8:54 AM
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'F01'
LANGUAGE = 'E'
" NAME = 'lv_name'
NAME = lv_name
OBJECT = 'EKPO'This should be it ...
BR,
Suhas
‎2009 Nov 18 8:57 AM
now i get a runtime error saying the field lv_name specifed is a different field type.
what sud be the data type for lv_name
joseph
Edited by: joseph_sweden on Nov 18, 2009 9:59 AM
‎2009 Nov 18 9:12 AM
‎2009 Nov 18 9:14 AM
thanks ,
i have declared it same way but it is giving 00000 in the print out
joseph
Edited by: joseph_sweden on Nov 18, 2009 10:25 AM
‎2009 Nov 18 9:28 AM
Hello,
Forget about the print out for the time being, debug the code & check if the table LT_TLINE is populated after READ_TEXT.
If values are populated, then we proceed.
BR,
Suhas
‎2009 Nov 18 9:31 AM
print program is a standard program for m any smartforms , do i need to debugg the smartform , how do i do that
joseph
‎2009 Nov 18 9:49 AM
Hi,
write the statement BREAK-POINT before calling your function module READ_TEXT.
Now check whether the input parameters are passed correctly or not.
Now execute the function module and then check the tables parameter whether any records are coming into this table.
Regards,
Swarna Munukoti.
‎2009 Nov 18 10:19 AM
hello Suhas,
i debugged and no values are populated in the table.
joseph
‎2009 Nov 18 10:21 AM
Hello,
This means that the call of your READ_TEXT is incorrect.
You are trying to read the long text for which object?
BR,
Suhas
‎2009 Nov 18 10:24 AM
‎2009 Nov 18 10:27 AM
Check in debug mode what are the parameters you are passing to the FM. Is the variable LV_NAME populated correctly?
Is the language always 'E' ?
BR,
Suhas
‎2009 Nov 18 10:31 AM
thanks ,
but i really dont know what to do . the parameters are id, object , language and name and wheni click on lv_name it is 00000.
it is taking the value of ebeln
is there any thing wrong with the data declaration of ebeln and ebelp .
see my code in the previous comments
joseph
‎2009 Nov 18 10:42 AM
Hi,
In your code:
DATA : EBELP TYPE EBELP .
DATA : EBELN TYPE EBELN .
DATA : begin of lt_tline occurs 0.
include structure tline.
DATA : end of lt_tline.
CLEAR lv_name.
CONCATENATE ebeln ebelp INTO lv_name.
What are the values that you are passing in ebeln and ebelp ?
Are there any values passed to these two variables?
Regards,
Swarna Munukoti
‎2009 Nov 18 10:43 AM
‎2009 Nov 18 10:56 AM
Hi,
In your code lv_name is the combination of ebelp and ebeln.
When you are not passing any values to these variables, obviously lv_name contains 00000.
First of all, get the values for which you want to read the long text values. Pass that value to lv_name. And check.
What is the transaction you are using?
Regards,
Swarna Munukoti.
Edited by: Swarna Munukoti on Nov 18, 2009 11:56 AM
‎2009 Nov 18 11:08 AM
HELLO Swarna,
thanks fór the reply,
i was told to use call function read text and with tthat the value will be printed .
i am not an abaper so getting difficulty,
i have to print the item text on gr slip ,
how do i pass values to the ebelp and ebeln.
joseph
‎2009 Nov 18 11:55 AM
Hello Joseph,
You mentioned - "i have to print the item text on gr slip ,"
You are trying to print the item text of what ?
Regards,
Swarna Munukoti
‎2009 Nov 18 12:00 PM
hello,
the concated numbers(ebelp+ebeln) are printed but not the text . i have to print the item text on gr -slip . i am doing it using read_text call function.
My text is stored in the internal table defined in the call function . how do i make data from internal table print on smartform .
any solutions gurus.
joseph
Edited by: joseph_sweden on Nov 19, 2009 12:00 PM
‎2009 Nov 19 3:11 PM
These are not training forums. Thread locked. Please post specific questions. And also note that Smartform/SAPScript questions go in the Form Printing forum.
matt
‎2009 Nov 17 5:48 PM
Hi Joseph,
The TABLES parameter passed while calling a Function module , combines the features of EXPORTING and IMPORTING parameters.
READ_TEXT will read the text maintained , and fill the itab passed in TABLES parameter. (Before calling FM, itab would be empty)
Let us know if you still face any issues.
Regards,
Nisha Vengal.
‎2009 Nov 17 9:31 PM
Function module will return texts in LINES table. you need to pass your internal table here.
P.S. - Please see Function Module Documentation of READ_TEXT in SE37.
Rgds,
PB
‎2009 Nov 17 9:41 PM
Table LINES should be of type TLINE.
DATA: t_lines TYPE STANDARD TABLE OF tline,
wa_lines TYPE tline. "work area
Use this table in your function call.
,
,
,
tables
lines = t_lines
,
,
,
Regards,
Aparna Gaikwad