cancel
Showing results for 
Search instead for 
Did you mean: 

Standard Text printing

Former Member
0 Kudos

Hi All,

I am trying to print a Standard text in SCRIPT inside a main window.

Before the Main window is called for the each loop pass of the line items , based on the line items i am changing the same standard text using the FM SAVE_TEXT. And then i am trying to print the modified Standard text inside the main window.

During the debug, for the first loop pass , the Standard text is changed and it is printing in the script .

During the second loop pass , the standard text is changed based on the second line items and the standard text changes are reflected int he SO10. However, when printing the standard text , only the first thing is printing repeatedly for all the line items. ( Note : i am changing the standard text before printing the standard text in the line item . Also I am using 1 standard text for all the line items)

Answers will be rewarded.

Thanks

Saravanan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think u need to modify the internal table also that u r passing to the FM.

Because its the same table u r passing again and again...so if the table remains unchanged it will undo the changes done by u to Standard Text.

Thanks.

Former Member
0 Kudos

Hi All, thanks for all your replies.

I am changing the internal table and it is affecting the standard text.

I checked it by debugging.

However , when I print the Standrad text in the line item level , it is printing the same text again and again as in the first line item .

((I think the text should be in the script memory and it is not changing, because i am calling the same standard text again. I might be wrong in this thought ))

Regards

Saravanan N

Former Member
0 Kudos

Are u reading the Text from again immediately after changing it..

also is it a text maintained for any transaction...

Please gimme some clarifications on this

Former Member
0 Kudos

Yes, ass soon as i change the standard text for the second line item in the print program, i am trying to read it in the script .

After writing the standard text in the print program , it is reflecting in SO10 , however when i try to print it in the script , it is printing the first line items standard text details. ( Note : I am changing the content of a single standard text , based on the line item details and i am trying to print it in the script )

I have a created a Standard text for this purpose.

Thank You

I really appriciate any usefull information and rewad gaurenteed.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi sarvanan,

please check the below code.

DATA: TLINE1 LIKE TLINE OCCURS 0 WITH HEADER LINE,

W_NAME(30),

W_TDNAME TYPE TLINE-TDLINE.

SELECT SINGLE * FROM STXH INTO Z_GET_TEXT

WHERE TDNAME = W_NAME.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = Z_GET_TEXT-TDID

LANGUAGE = Z_GET_TEXT-TDSPRAS

NAME = Z_GET_TEXT-TDNAME

OBJECT = Z_GET_TEXT-TDOBJECT

TABLES

LINES = TLINE1

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

then Include this in the form.

INCLUDE &Z_GET_TEXT-TDNAME& ......

and add your object ID and Language.

regards,

sharath

Former Member
0 Kudos

Hi,

Before changing the Text, jusr Refresh the TLINE table.

Regards

Sudheer