07-06-2012 4:17 PM
I am writing a program that reads in a file and makes a number of changes to the operation short text found in tasks (as found in IA06, PLPO-LTXAI).
When this text is longer than one line however it is stored elsewhere and I need to find what table and what the mapping is to this table such that i can make the updates.
Any help tracking this down would be appreciated.
07-06-2012 4:31 PM
Did you try activating an SQL trace in ST05. This is what I would do.
Just before pressing the save button activate trace. After save, deactivate trace. Look for Update, Insert, Modify statements in the trace. Should give you an idea of the tables involved. Once you find the right table - Put a debugging point on the include where the code is present. You might be able to find the FM/subroutine to use from the call stack while debugging.
Regards,
Shravan
07-06-2012 4:31 PM
Did you try activating an SQL trace in ST05. This is what I would do.
Just before pressing the save button activate trace. After save, deactivate trace. Look for Update, Insert, Modify statements in the trace. Should give you an idea of the tables involved. Once you find the right table - Put a debugging point on the include where the code is present. You might be able to find the FM/subroutine to use from the call stack while debugging.
Regards,
Shravan
07-06-2012 4:52 PM
tried the trace, and there is a lot going on, but i cant seem to find my text. im wondering if its stored as raw bytes instead of asci or something...
07-06-2012 5:05 PM
Yeah, agreed there is a lot of information there and it may be stored in any format - so you may not exactly find your text. Look for update/insert/modify SQL statements - or may be your text name. If whatever it is you are doing is updating the database then it has to be present there.
Regards,
Shravan
07-06-2012 5:48 PM
Don't update the SAPscript database tables directly (stxh,stxl). Use function module SAVE_TEXT instead, with the keys I indicated you.
07-06-2012 5:51 PM
Hi Keith,
I just tried this on my system. The table getting updated for this is STXH - and yes I got it through ST05 . So you will have to use SAVE_TEXT. Just use below variables. TDNAME will change based on the line item and document number I guess. Debug some more - Put a break-point on FM SAVE_TEXT and see what is getting passed through.
TDOBJECT | ROUTING | |
TDNAME | ||
TDID | PLPO | |
TDSPRAS | E |
Regards,
Shravan
07-06-2012 6:03 PM
I found this:
http://stackoverflow.com/questions/2115170/how-to-decode-sap-text-from-from-stxl-clustd
Which actually explains why you can not edit directly, instead of just saying 'dont do it'. Based on that its going to have to be done via Read_Text and Save_text.
07-06-2012 9:12 PM
It should be clear without mentioning to any developer: If there is an API for a function, this API should be used and not be bypassed by manipulating directly on the database level.
07-06-2012 4:34 PM
Keith,
in PLPO-LXAI, you see the first lines of a SAPscript long text.
The long text can be read with function module READ_TEXT (like every SAPscript text).
A SAPscript text has four key parts - OBJECT, ID, NAME and LANGUAGE.
OBJECT and ID are from table TCA09.
The NAME key is composed of the fields PLNTY, PLNNR, PLNKN and ZAHL of table PLPO. See FM CP_TX_PROCESSING for the precise recipe how the NAME field is built from these data.
Hope this helps.
Rüdiger
07-06-2012 4:36 PM
I need to be able to write an sql statement to update it, reading it through a FM is not the problem here.
07-06-2012 4:53 PM
Hi Keith,
as far as I recall updates are done with FM SAVE_TEXT. It is in the same function group which Rüdiger has mentioned.
The function module have some detailed description in the function module / parameter documentation. Hope that helps.
Best regards
Thorsten