I have a requirement to get the header text of a sales order. Normally I would use an include statement in a SAPScript/SmartForm or the FM Read_Text. However we just had our sales order numbers cross into the 500,000 range and we have ITOs (Intercompany Transfer Orders or POs) in that number range. So when I use an include statement using tdname (the Sales Order number) I get the header info of the ITO/PO that has the same number. Basically somehow I need to differentiate between order types (regular orders verses ITO).
Do you have any tips that will allow me to do this?
The text names should be unique within a client if you specify the OBJECT + NAME + ID + LANGUAGE (see table STXH) .. i.e. the TDNAME alone is not sufficient.
So for a sales order you make have object = 'VBBK', Name = '0000000010', ID = '0001', and language "EN" (say), but for another text (say customer) you might have object = 'KNA1', Name = '0000000010', ID = '0001', and language "EN" i.e. the object will be different, even if the rest is the same. Purchase orders will usually have object = 'EKKO' for header texts, and 'EKPO" for lines.
Jonathan, thanks for the reply. I thought that there should be a unique entry in the table but it doesn't seem to be that way. For whatever reason, since the SO numbers overlapped the PO numbers, we are getting the PO header text for SOs over 500,000. The header text corresponds to a PO with the same document number as the SO. I do not have access to the Prod system right now but thank you very much for the table name. I have been trying to figure out the table name all day long. I will look at the table in the morning.
Thanks again for the help!
No worries... When you have the system in front of you, perhaps could you post back the way you have the "include" too in the SAPScript as that may give a hint why you are getting the wrong text i.e. it should be along the lines of:
INCLUDE my_text_name OBJECT my_object ID my_id LANGUAGE my_language
INCLUDE &VBDKA-TDNAME& OBJECT VBBK ID Z123 LANGUAGE E