Skip to Content
0
Former Member
Aug 12, 2011 at 02:58 PM

Smartforms: Only include text if it available in the specific language

1420 Views

Hello,

I have an include text in the smartform for the position footer text: texname is invoicenumber+position, object is VBBP and id is ZR02 (our footer text id). Language is empty.

Standard language of the smartform is German.

The position in the invoice has only a German text. When I printout the smartform in English it outputs the German text (beauce English is not available).

I read about, that this i because system checks if prefered language (English output) is available, if not than in logon language and if also not the original form language is taken. So the system finds the German text and puts it on the smartform.

I don't want that handling so I implemented a little bit of code:

clear: GV_TEXT_AVAILABLE.

select single * from STXH

into ls_stxh

where

TDNAME = G_TEXT_KEY " invoice + position

AND TDOBJECT = 'VBBP'

AND TDID = 'ZR02'

AND TDSPRAS = IS_NAST-SPRAS.

if sy-subrc = 0.

gv_text_available = 'X'.

endif.

And the Include text got the condition gv_text_available IS 'X'.

So now it works and only the English text is printed (if available). But this is a bit messy to put this code befor all include-texts if I want a strict handling for texts.

Also tried to put IS_NAST-SPRAS in the language of the include text - but then also the standard logic is taken and the German text is found.

So what can I do?