Application Development 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 text from purchase order.

Former Member
0 Kudos
4,086

I have few queries regarding texts in a document.

1. How do i identify the id for a text of a line item in any PO document?

2. Secondly a pgm is using read_text to get this text. before which 'stxh' is queried. But when i debugged i found that for a particular document there is no entry in this table though there is a text in the document and hence doesnot perform a read_text. The text is auto generated through info records. How to retrieve this text?

Ans wil be appreciated and rewarded

1 ACCEPTED SOLUTION

Former Member
0 Kudos
1,219

Hi Kantheri,

Use tcode se75. Double click on EKKO or EKPO. There you can find the id of the text.

Regards

Arun

21 REPLIES 21

Former Member
0 Kudos
1,219

To identify text id, double click on the text editor area.

In that click on Goto--> Header

*Please award points if it helps

Former Member
0 Kudos
1,219

Try using the function module READ_TEXT with the following keys:

OBJECT: EKPO

ID: F01

LANGUAGE: sy-langu

NAME: PO number + PO item number

Stored texts can be located in tables: STXH, STXL

Best regards

Tamá

Former Member
0 Kudos
1,219

In your PO, go to Item > Texts > Overview. Now select the text that you want the ID for and click 'Long text'. In the long text screen, you should be able to see the Id of the object in Goto > Header. The combination of the Language, textname, ID and object is used for selection from STXH.

There should be a corresponding entry in STXH for each text created - maybe the program reads it wrong?

Hope this helps.

Sudha

Former Member
0 Kudos
1,219

Hi,

text are stored in table <b>stxh</b>,<b>stxl</b> .

if you want the Texts in PO, GOTO --> HEADER , here you will find the header text, double click that Text, you will find the attributes, or there would be a option in the menu to find the options for the texts, you will find the ID etc ...

GOTO --> ITEM --> text for Item texts in PO

Regards

Sudheer

Former Member
0 Kudos
1,220

Hi Kantheri,

Use tcode se75. Double click on EKKO or EKPO. There you can find the id of the text.

Regards

Arun

0 Kudos
1,219

Hey I am getting error while trying to reward u all.

Will surely reward if it works.

but i have got ans for first query.

second one.. i found that the tdid for text is F05 (info record), which is not stored in stxh and stxl and hence it is failing. how to handle this situation?

0 Kudos
1,219

even if i use read_text

with values F05,EN,docnum+linenum,EKPO, it doesnot return the value.

I cross verified that the text id is correct from ME23n.

but it doesnot exit is stxh too, neither read_text returns it...wht could be the reason and how to solve it?

0 Kudos
1,219

for INFO record

BT (text ID )      Purchase order text

,

for more info check Tcode SE75.

If dont know how to use SE75 , i cannt help u out.

regards

Prabhu

0 Kudos
1,219

Couldnot find anything useful in se75.

wht is BT?

0 Kudos
1,219

If you see the text in that text field it has to be there.

Try selecting STXL tables also.

Try to use less selection criteries (fro example only TDOBJECT).

Maybe the language was different than "EN".

Check all of these, and you will find the texts.

Happy developing

Tamá

0 Kudos
1,219

This is what i could find.

for a PO, the TEXT is auto generated for its relevant info record. (in PO it is F05 but doesnot exist in STXH)

So to get this text, i have to find its info record first then use the below info in read_text to get it.

TDID = BT

Object = EINE

objectname = inforecordnum+..

i get this text, but isnt there a direct way to get this text given the PO. And secondly, if i put this logic, then all the PO would get this. As i noticed that for some PO this text is generated but still can be retrieved using object EKPO.

0 Kudos
1,219

Has anyone encountered such pbm?

0 Kudos
1,219

Hi,

When a PO is created the INFO RECORD text will be referred from the text of the MATERIAL INFORECORD, that is why you are able to retrieve the same using the INFORECORD parameters.

However, when you change the same, the text gets copied and is stored separately for the PO alone and then you will be fetch this new text using the PO parameters.

Regards,

Ravi

0 Kudos
1,219

Hi Ravikumar thanks for u quick reply.

This is wht is currently coded.

  • concatenate values to get item text for read text function

invar3+0(10) = invar1. "PO number

invar3+10(5) = invar2. "PO line number

SELECT SINGLE * FROM stxh WHERE tdobject = 'EKPO'

AND tdname = invar3

AND tdid = 'F01'

AND tdspras = sy-langu.

IF sy-subrc = 0.

invar4 = invar3.

  • reading the text for the document items.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'F01'

language = sy-langu

name = invar4

object = 'EKPO'

TABLES

lines = it_itab.

I have seen some PO's which have info rec texts in that, which gets pulled by the above code...first thing is its id is F02 which exist in STXH table also there is other text with F01 id, and hence the table it_itab gets both these text hence no pbm.

but i came across a PO which has only one text which is info rec text with id F05 and is not store in stxh and hence doesnot get pulled by read_text fm. How do i change my cod to get this text which should not hamper other PO's as well.

As mentioned in above msgs, this F05 could be retrieved by providing object name as EINE.

anyhelp will be appreciated and rewarded.

thanks

0 Kudos
1,219

You can change the code to read the PO text first and if you don't get the text, then you read the INFORECORD text.

Regards,

Ravi

0 Kudos
1,219

Thanks, will try this and see, and hopefully this does not effect other PO's, I mean it shouldnot pull unnecessary texts.

0 Kudos
1,219

Hi,

I am trying to get the info rec number for this PO and then found entry for this info rec in STXH tdid BT and object EINE. And using read_text i am getting the correct the text name.

But how do i generate the textname for this.

I found for some it is directly infnr, for some it is infnrline and for some infnrline+plant(or porg).

Any inputs on this?

0 Kudos
1,219

I am not sure what exactly are you trying to do

But if you are looking to get the INFORECORD for a given a line item of the PO, that will be available in the PO line item table EKPO and the field INFNR.

Regards,

Ravi

0 Kudos
1,219

No I am not asking for info record for a given Po. I know how to retrieve it.

But I need to get the PO text using this info record.

SO i will be provideing object = EINE, id = BT, lang = EN and text name = generated number.

I tried this for my e.g and it worked. But this generated number i found it directly from stxh.

But in the progrom how do i generate it?

inforecord numberline itemplant is it? for some i see it is number+line and no plant. hence confused abt its generation.

any help here?

0 Kudos
1,219

I am not sure, may be its dependent whether or not plant is entered on the line item of the PO. Did you see that?

It might be a good idea to see if the plant info is stored in the EINE table and if present concatenate that as well to get the text else just the INFNR and the LINE ITEM number.

Regards,

Ravi

0 Kudos
1,219

Thank you very much.

Looks like it is generated from EINE table with fields

Info record

Purchasing Org.

Infotype

Plant.