‎2011 May 24 3:38 AM
Hi All,
Is this a correct way by using IF and ELSE statement to call the function call?
IF SY-LANGU = 'N'.
l_header = 'Vennligst '(007).
l_txtques = 'Er du sikker '(008).
ELSEIF SY-LANGU = 'E'.
l_header = 'PLEASE SELECT REASON'(006).
l_txtques = 'Are you sure want to enter reason code?'(004).
ENDIF.
DO.
CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
EXPORTING
mark_flag = ' '
mark_max = 1
start_col = 80
start_row = 5
textline1 = l_header
titel = 'REASON FOR CHANGE'(002)
IMPORTING
answer = l_ans
TABLES
t_spopli = i_spopli
EXCEPTIONS
not_enough_answers = 1
too_much_answers = 2
too_much_marks = 3
OTHERS = 4.
Thanks in advance.
Regards,
Alice
‎2011 May 24 3:50 AM
It will work and syntactically it is correct but better would be something like:
*IF SY-LANGU = 'N'.
l_header = 'Vennligst '(007).
l_txtques = 'Er du sikker '(008).
*ELSEIF SY-LANGU = 'E'.
* l_header = 'PLEASE SELECT REASON'(006).
* l_txtques = 'Are you sure want to enter reason code?'(004).
* ENDIF.Then translate the texts 007 and 008 into language 'N' and 'E'. You can do that in transaction SE38 with 'Goto -> Translation'.
The benefit is cleaner, shorter coding and the ability to possibly translate into more languages winthout changing the coding.
Regards Jack
‎2011 May 24 4:15 AM
Hi Jack
what do I need to include in the temporary worklist after I selected SE38 -> Goto -> translation ?
Thanks.
‎2011 May 24 4:57 AM
Hi, when you go to translation you translate texts from the original langauge into the required languages. So you need to translate to 'E' ('EN') and 'N' ('NL') for texts 007 and 008.
Not sure what 2 languages you need here. 'N' is the SAP internal language code length 1 for 'NL' (Dutch). But you might need 'O' here. 'O' is the SAP internal language code length 1 for 'NO' (Norwegian).
Regards Jack
‎2011 May 24 4:44 AM
Hi.,
SY-LANGU will return 2 char ., ie if logon language is English it will return EN not E.,
so u have to use
IF SY-LANGU = 'EN'.
hope this helps u.,
Thanks & Regards
Kiran