2005 Dec 12 11:40 AM
Hi,
I go to XD02 Transaction (Change Customer: Inicial Screen) and i go to menu Extras/Texts. I write a head office text like "Please payme!". Now i want that check: ZOPTRAT610_GGB print me this head office text. How can i do this?. Which table save office text for the customer?
A lot of thanks in advance.
Regards.
jlragel
2005 Dec 12 11:46 AM
Hi,
The text details are stored in table STXH ( This is found in SO10 transaction as well ), you can make use of the function module READ_TEXT to retrieve the text maintained, to do that you should know the object details, to know that go to Extras>Texts>doubleclick on any of the textts>in the text editor use the following menu path Go to>Header, a small Popup window with the 'Text name', language, Text id & Text object will be displayed, you can pass these details to retrieve the text from READ_TEXT function module,
Hope this helps,
Rgds,
2005 Dec 12 12:08 PM
Ok. i understand u.
small Popup window said me:
Text Name: 0000000004
Language: ES
TEXT ID: 0002
Text object: KNA1
But every customer will have diferent information, no?
Can you show me an code example for window form painter for my ZOPTRAT610_GGB check for every customer?
A lot of thanks in advance.
regards
2005 Dec 12 12:11 PM
Juan,
Yes you are right.
The Text id and the Text object are going to remain the same. For whichever customer you want to print this, send that customer number as the Text name. Guess you checked with customer number 4.
Regards,
Ravi
Note : Please reward the posts that help you.
2005 Dec 12 12:18 PM
Juan,
Here is the code. I am assuming you have a list of customer in a internal table.
Loop at customer table.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = '0002'
language = 'EN'
name = Customer Number
object = 'KNA1'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
tables
lines =
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endloop.
2005 Dec 12 1:47 PM
Ok Ravi, i understand you.
But, Can you show me an code example for window form painter for my ZOPTRAT610_GGB check for every customer?
Sorry im beginner.
Thanks in advance.
regards
2005 Dec 12 2:01 PM
a lot of thanks for your time ravi i go to test your code in my form.
2005 Dec 12 2:23 PM
ravi, can i put your code on window ADRESS in my form and give customer number from REGUH-KUNNR?
thanks in advance
2005 Dec 12 4:19 PM
Juan,
Are you using SMART Forms or SAP Scripts?
The code that I have given to get the long text of the Sales document, once you get the text, you can print that where you want.
If you want to print that text in the Address window you can do that. I am guessing that you are calling this form once for every customer.
However, if you are using SMART Forms, you don't need to retrieve the text. Take a look at this thread.
Regards,
Ravi
Note : Please reward the posts that help you.
2005 Dec 12 4:34 PM
Im using SAP Scripts.
Yes, i want to print that text in the Address window. But i must paste your code on Address window OR on a print program for my form?
A lot of thanks in advance.
regards
2005 Dec 12 4:41 PM
Juan,
I am not very comfortable with SAP Scripts. However, the answer to you question depends on how your Print program and SAP Script are designed. You can do it both ways.
You can put my code in the driver program and pass the text table as input, or you can take it inside the window and use it there.
Regards,
Ravi
2005 Dec 12 11:49 AM
Hi Welcome to SDN.
You can do sql trace on the corresponding transaction to get the table name.
Well u have to use READ_TEXT function module to obtain that text.
Regards,
Abdul