cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: Printing of standard text if content is present ?

Former Member
0 Kudos

Hello All,

My Requirement is like this :

1. I have a Selection Screen Parameter for language p_spras.

2. I'll use the logic as per my reuirement and get the Suppliers and thier details.

3. This supllier has a language.

4. Now the Output of my Program is a letter to the Supplier with some Standard texts .

5. What's my problem is the printing of the standard texts.

6. While executing the Include of my STandard Text in the Form I need to check whether the text exists for that language which I pass thru &p_spras& .

7. If the text is not there then I have to print the text in English i.e I need to make p_spras as 'EN'.

8. Can any one tell me how to check whether the text is there in the particular language ?

IN which table shud I check and How shud I proceed ?

I hope i'm clear in Explaining my problem.

Regards,

Deepu.K

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

If you want to read header text you can use

ALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = 'Z040'

LANGUAGE = p_spras

NAME = <textname>

OBJECT = 'VBBK'

TABLES

LINES = i_tlines_r

If you want to display in SAP script then do it like this

In the desired window

INCLUDE &Textname& OBJECT TEXT ID ADRS LANGUAGE &p_spras&

IF SY-SUBRC NE 0.

INCLUDE &Textname& OBJECT TEXT ID ADRS LANGUAGE EN.

ENDIF.

Standard text are maintained in SO10 Tcode.

Regards,

Sairam

Former Member
0 Kudos

Hello Sai,

I'm actually looking for this type of solution.

I want to check in my script only.

U said :-

<i>In the desired window

INCLUDE &Textname& OBJECT TEXT ID ADRS LANGUAGE &p_spras&

IF SY-SUBRC NE 0.

INCLUDE &Textname& OBJECT TEXT ID ADRS LANGUAGE EN.

ENDIF.</i>

What Does the above sy-subrc check ?

Willl it check the content of the include if present or not ?

will sy-subrc work in scripts ?

if yes can u tell me the exact syntax ?

Regards,

Deepu.K

former_member196280
Active Contributor
0 Kudos

Yes, SY-SUBRC but inside your form you should write it like this <b>SAPSCRIPT-SUBRC</b> , it will give the return code, success 0.

If hope this info is helpful to solve your problem.

Regards,

Sairam

Former Member
0 Kudos

Hello Sai,

Thanks for ur reply . It's working fine.

But I have one more Qn. Plz look in my other thread.

Regards,

Deepu.K

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

I suggest that it is better to maintain the Std texts in different languages in SO10 transaction

and check the table <b>STXH</b> for the TEXT ID and LANGUAGE fields and put a condition to display the proper lang related text

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Hello Anji,

Maintaining the texts in all the other language can not be done bcoz of some restictions from my client.

Can u tell me how to put the condition ?

Regards,

Deepu.K

former_member150733
Contributor
0 Kudos

use the FM: READ_TEXT with the particular language key. THe return parameter will tell you if the text is present or not.