Read Text
Read Text
Read Text
SAP long text. Every text in SAP has its own ID and NAME, by passing these parameters into
the READ_TEXT function, we can get all the text in the SAP long text object.
Heres how to do it, for example well be using long text from Sales Order.
1. Execute tcode VA02 and enter the Sales Order number.
2. Press enter to display the Sales Order data. Choose GoTo -> Header -> Texts
3. Double click the Header Note text and enter the long text in the text editor.
8. On the next window screen, you will see all the parameters required for the READ_TEXT
function. (Name, Language, ID, Object)
9. Now lets get the text using ABAP, open your ABAP editor (SE38), copy this code below.
"A sample code to use READ_TEXT FM
"www.freesaptutorial.com
data:
10. Now execute the program (F8), you will see the long text from the header note text object.
* NAME = 3
* NOT_FOUND = 4
* OBJECT = 5
* REFERENCE_CHECK = 6
* WRONG_ACCESS_TO_ARCHIVE = 7
* OTHERS = 8
thanks & regards,
Venkatesh
Sai
Ram
Redd
y N...
Posts: 2,249
Registered: 12/22/05
Forum Points: 3,392
* OTHERS = 8
IF sy-subrc = 0.
READ TABLE i_tlines INDEX 1.
t_in-m1 = i_tlines-tdline.
ENDIF.
Regards,
SaiRam
READ_TEXT IN SMARTFORM-urgent
Posted: Sep 25, 2007 4:15 PM
Reply
HI
I am using the read_text fm for reading the standard text in smartform please tell me the fm
parameters based on the text.i
NAVEEN
KUMAR
GU...
Posts: 2,280
Registered: 2/3/06
Forum Points: 3,638
Reply
Hi Varsha,
Check this sample code...
DATA: leng TYPE thead-tdspras,
l_fname TYPE thead-tdname.
DATA: il_tline LIKE tline OCCURS 0 WITH
HEADER LINE.
leng = 'ES'.
l_fname = is_dlv_delnote-hd_gen-deliv_numb.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = '0001'
language = leng
name = l_fname
object = 'VBBK'
TABLES
lines = il_tline.
comentario = ''.
LOOP AT il_tline.
CONCATENATE comentario il_tline-tdline
INTO comentario SEPARATED BY space.
ENDLOOP.
My suggestion would be....
Instead of using the FM, Use the standard
functionality to print the required text provided
by Smartforms.
Create a text element, in the left top...in the drop
down there is an option of include text...
something like...
id = '0001'
language = 'E'
name = '0080000055'
object = 'VBBK'
u will get the dessired output
NW
Posts: 696
Registered: 5/8/06
Forum Points: 718
Reply
Hi,
I have a field in smartform,which has to pick data (long text).
Pick up the data from long text by passing following values. Pick up only 2 lines from long text.
Exclude the administrative information from long text
Text Name: 16 digit value. Initial 3 digits are Client (QAVE-MANDANT). Subsequent 12 digits
are Inspection lot number along with preceding zeros (QALS- PRUEFLOS). Last digit to be
picked up from QAVE-KZART. Concatenate these 3 values and then pass in to field Text
name
Language: EN
Text ID: QAVE
Text Object: QPRUEFLOS
I am able to pick data,but I have to exclude the adminstrative data.Please guide me as I am
clueless about it.
Thanks
Subbu P
Posts: 1,709
Registered: 4/29/05
Forum Points: 2,792
in response to:
Reply
HI,
I presume, you are using read_text to read the
long text.
Now loop at the internal table which you get as
a result from read_text and move the desired
lines into another internal table.
Pass this internal table to smartforms through
the TABLES parameter.
Regards
Subramanian
Laxmi.Suryadevar
a
Posts: 291
Registered: 1/8/07
Forum Points: 320
in response to:
Hi,
If you are using the FM read_text then you will
be getting an internal table as an output of
read_text.
To take first 2 rows only do the following.
take this in the table and keep a condition on the
table as sy-tabix < = 2.
&wa_text&.
Br,
Laxmi.
p317980
Posts: 522
Registered: 12/31/06
Forum Points: 50
in response
Reply
Hi,
When you get the values Textname, text id,
textobject to the smartform.
call the FM read_text in the programing lines to
get the long text in the internal table. Another
way to retrieve the long text is to use INCLUDE
but for your requirement is better to uses
READ_TEXT function module.
Once you get the data in the internal table.
Create table and loop the long text internal
table. Now in the table when create a text node,
keep a condition on the text node in the
conditions column that when sy-tabix = 3.
Which means you are skipping two lines
(Administrative data).
Procedure:
1. Right click --> create---> programming lines.
2. In the Input parameters pass TEXT NAME,
TEXT ID, Text Object and Interanal table(itab)
and In output paramaeters the Internal table
(itab).
3. call function Read_text and pass the values.
4. create a table for Itab.
5. create a text node.
6. Keep a condition on the text node sy-tabix =
3 in the condition tab of the text node.
7. &itab-line&
Br,
Laxmi.Suryadevara
Haryati
Sulaiman
Posts: 9
Registered: 12/28/05
Forum Points: 0
Hi,
I'm having the quite similar problem but my form is developed using
Sapscript. I'm using an 'INCLUDE' command but not sure what to put
into the text name as it consists of the 15 digit value.
Text Name : 999999999999999
Language : EN
Text ID : QALS
Text Object : QPRUEFLOS
INCLUDE <???> OBJECT QPRUEFLOS ID QALS LANGUAGE
&QALS-SPRACHE& PARAGRAPH ST
What should I put into <???> for the text name? TQ.
zarina
begum
Posts: 173
Registered: 4/25/07
in response
Reply
hi Sulaiman
you can use a subroutine for getting values from
a function module.
here is the way to do it.
hope this may be helpful for you.
inside the script write these coding lines, this is
to call a subroutine inside the script from a
report program.
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
......
/: CHANGING &OUTVAR1&
......
/: ENDPERFORM
INVAR1is variable symbol and may be of any
of the four SAPscript symbol types.
OUTVAR1is local text symbol and must
therefore be character strings.
In the program (zprog which u specified in the
subroutine call) of se38 write this.
FORM READ_TEXTS TABLES IN_PAR
STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
Data : v_id type LIKE THEAD-TDID VALUE
0001, (EXAMPLE)
V_LANG LIKE THEAD-TDSPRAS VALUE
EN, (EXAMPLE)
V_NAME LIKE THEAD-TDNAME,
V_OBJECT LIKE THEAD-TDOBJECT
VALUE VBBK, (Example).
DATA : T_LINES LIKE TABLE OF TLINE
WITH HEADER LINE.
data
Please close the thread if your problem is solved
Reward points if helpful.
Regards
Zarina
p317980
Posts: 522
Registered: 12/31/06
Forum Points: 50