‎2009 Jun 19 5:52 PM
Hi !
Im looking to create a program to read texts for all of a particular objevt and id . I mean if I have a an object called 'material' and the ID 'SPUR' . I want the ability to be there on the selection screen to enter the text ID and text object name and after entering that on selection screen and running the program I should get all the texts associated with that object in my output , similary I should be able to enter any textid and object name and run teh program and get all teh texts associated withn it. If anyone has done this before could you please help out.In the output when run it will give the entire list of texts with for eg:
material number and texts against it in teh desired langugae.
Thanks
‎2009 Jun 19 5:56 PM
u will be using Read_text Fm and declare corresponding selection elements which can drive Read_text
[ABAP READ_TEXT functions to read the SAP Long Text|http://www.sap-basis-abap.com/sapac002.htm]
‎2009 Jun 19 5:56 PM
u will be using Read_text Fm and declare corresponding selection elements which can drive Read_text
[ABAP READ_TEXT functions to read the SAP Long Text|http://www.sap-basis-abap.com/sapac002.htm]
‎2009 Jun 19 6:18 PM
Thats right , I already have created a program like that but as I said that will only read the text of a specoific ID and object , what I want is like an ability to enter the text id and object and name in the selection screen rather than only the object name which will give me textb to a specific text object only .For eg: In my slection screen I should ahve option:
TEXid: obligatory
Text object: Obligatory
Text name : can be enterd if want for specific one.
So in this selection screen I can enter and object Id like VBBP, VBBK, Material, ect and in Id : 001, z001, spur ect , so that I can ready any text .
In the programs we usually use read_text FM to read a specific object and id , say for materials , but if I would like to just ahve read_text in general which can read any objecta nd id through my selection , that si what I want.
Thanks
‎2009 Jun 19 6:38 PM
if you use the FM
ID
LANGUAGE
NAME
OBJECT are mandatory..if you dont want to use all of these..FM is not a correct choice...
U can use a select statement on STXH table and get the output..
‎2009 Jun 19 6:42 PM
Yes I would like to use all those in my selection screen ofcourse and would like to go through the FM only , but is it possible to what I want through the Fm and if so how do I go about doing that becauise I just want to enter it in the selection screen and get the output for any TEXTID and OBJECT rather than limiting it to just one .
Thanks
‎2009 Jun 19 6:54 PM
ID
LANGUAGE
NAME
OBJECT are mandatory, on call of the function all these need to be present to get the output. to get all some thing need to blank, which FM does not allow. I guess u might have to be a little considerate on ur requirement of using the FM... analyze the code of read_text and just replicate the same in ur code.... but its mere hit on table STXH which will get u all the data as per ur req.
‎2009 Jun 19 8:03 PM
Hi !
Thats absolutely right I cant use FM as its mandatory , so the other way you suggested is through the STXH table , so how would I be able to get the texts from there with the selection screen as per my needs ?
Thanks
‎2009 Jun 19 9:56 PM
‎2009 Jun 24 8:48 PM
Yes , i tried doing that with a suggetsion code as below but it dosent seem to be working .
data: it_stxh type table of stxh,
wa_stxh type stxh.
select-options: p_id for stxh-tdid,
p_object for stxh-tdobject,
p_name for stxh-tdname,
p_lang for stxh-tdspras.
loop at l_stxh into wa_stxh.
select single * from stxh into corresponding fields of wa_stxh where
tdid = p_id and
tdobject = p_object and
tdname = p_name and
tdspras = p_name.
if sy-subrc = 0.
append wa_stxh to l_stxh.
endif.
write:/ wa_stxh.
endloop.Thanks
‎2009 Jun 24 8:54 PM
>
> Yes , i tried doing that with a suggetsion code as below but it dosent seem to be working .
Please - this is the way a user might describe a problem.
What isn't working? what is happening - dump, error message, return code, incorrect results???
Rob
‎2009 Jun 24 9:04 PM
The selection is not taking place and either entring nay value in the selection screen or running without entering any selection it dosent go anywhere , nor does it give nay error, it just stays there as if there is no values associated with the selection.
Thanks
‎2009 Jun 24 9:30 PM
Well, what is l_stxh? It isn't defined in your program snippet.
And you are looping at it into a work area then selecting into the same work area and finally appending that same work area to the table your are looping through. Is this what you mean to do?
And this won't read any texts - just the header from the text table
And you've confused PARAMETERS and SELECT-OPTIONS.
also
tdname = p_name and
tdspras = p_name.Please do some desk checking before posting.
Rob
Edited by: Rob Burbank on Jun 24, 2009 4:53 PM
Edited by: Rob Burbank on Jun 24, 2009 5:22 PM
‎2009 Jun 19 5:57 PM
Hi,
You can call function module READ_TEXT and pass respective parameters. You can find the values in STXH table.
KR Jaideep,
‎2009 Jun 19 6:01 PM
Hi
Use Read_text with following entries:-
CLIENT 700
ID SPUR
LANGUAGE EN
NAME
OBJECT MATERIAL
Give Material Number in selection screen and pass that number in NAME parameter above.
You will get all the text in LINES internal table of FM read_text.
Thanks
Prashant