Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV-multiple language output

Former Member
0 Likes
2,032

Hi All,

I have created a ALV report, in the sel.screen I have 2 radiobuttons with text English and Arabic.

Now if I excecute the report with radiobutton - English, the O/P should be in English and

if I excute the report with radiobutton - Arabic, I want the O/p to be displayed in ARABIC..

note : User's Logon lang wil be always "English"

plz let me know how to do it.

With Regards,

S.Bharani

1 ACCEPTED SOLUTION
Read only

Former Member
8 REPLIES 8
Read only

Former Member
Read only

0 Likes
1,310

Hi Swetha,

In the above link sample program they are converting only one field , but my requirement is to change all the fields...

With Rgds,

S.Bharani

Read only

0 Likes
1,310

you need to use in your program the following syntAX according your radio button selected

set locale language < language key .>

Check this

http://www.sapnet.ru/abap_docu/ABAPSET_LOCALE.htm

a®

Read only

0 Likes
1,310

Hi ARS,

i have used the statement

LANG = 'A'.
cntry = 'SA'.
SET LOCALE LANGUAGE lang COUNTRY cntry.

but still the output is coming in English..

Pls guide.

With rgds,

S.Bharani

Read only

0 Likes
1,310

did your texts were translated in arabic also ??

a®

Read only

0 Likes
1,310

ARS,

Everything remains same . I have not used any text-elements, just I am fetching data and displaying in ALV . .

code given below..


REPORT  ZSBN_ALV_LANG.

TYPE-POOLS : SLIS.

*************************************************
*                  FOR ALV                      *
*************************************************
DATA:IS_LAYOUT    TYPE  SLIS_LAYOUT_ALV,
     IT_EVENTS    TYPE  SLIS_T_EVENT,
     WA_EVENTS    TYPE  SLIS_ALV_EVENT,
     W_FCAT       TYPE  SLIS_FIELDCAT_ALV,
     T_FCAT       TYPE  SLIS_T_FIELDCAT_ALV.

DATA : I(4).
DATA : BEGIN OF ITAB OCCURS 0.
INCLUDE TYPE PA0001.
DATA : END OF ITAB.

DATA : BEGIN OF ITAB1 OCCURS 0.
INCLUDE TYPE PA0002.
DATA : END OF ITAB1.


DATA: lang  TYPE tcp0c-langu,
      cntry TYPE tcp0c-country,
      mod   TYPE tcp0c-modifier.

*GET LOCALE LANGUAGE lang COUNTRY cntry MODIFIER mod.

LANG = 'A'.
cntry = 'SA'.

SET LOCALE LANGUAGE lang COUNTRY cntry.

*&*& DATA FROM PA0001
SELECT DISTINCT * FROM PA0001
       INTO TABLE ITAB.

SORT ITAB.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING PERNR.

*&*& FCAT
W_FCAT-FIELDNAME = 'PERNR'.
W_FCAT-SELTEXT_M = 'Emp No'.
W_FCAT-HOTSPOT = 'X'.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.

W_FCAT-FIELDNAME = 'ENAME'.
W_FCAT-SELTEXT_M = 'Emp NAme'.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.

*&*& layout
IS_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.

*&*&

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM      = SY-CPROG
    I_CALLBACK_USER_COMMAND = 'F_USERCOMMAND_ALV'
    IS_LAYOUT               = IS_LAYOUT
    IT_FIELDCAT             = T_FCAT
  TABLES
    T_OUTTAB                = ITAB.


*&*& FOR DRILL DOWN WHEN CLICK ON PERNR
FORM F_USERCOMMAND_ALV USING R_UCOMM     LIKE SY-UCOMM
                             RS_SELFIELD TYPE SLIS_SELFIELD.


*&*& TAKING ALL RECORDS IN PA0002 FOR THAT EMP
  CLEAR :ITAB1[].

  SELECT *
         FROM PA0002
         INTO TABLE ITAB1
         WHERE
               PERNR EQ RS_SELFIELD-VALUE.


  CLEAR :   T_FCAT[].
*&*& FCAT
  W_FCAT-FIELDNAME = 'PERNR'.
  W_FCAT-SELTEXT_M = 'Emp No'.
  APPEND W_FCAT TO T_FCAT.
  CLEAR W_FCAT.

  W_FCAT-FIELDNAME = 'GBDAT'.
  W_FCAT-SELTEXT_M = 'DATE'.
  APPEND W_FCAT TO T_FCAT.
  CLEAR W_FCAT.

  W_FCAT-FIELDNAME = 'GESCH'.
  W_FCAT-SELTEXT_M = 'SEX'.
  APPEND W_FCAT TO T_FCAT.
  CLEAR W_FCAT.


  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = SY-CPROG
      IS_LAYOUT          = IS_LAYOUT
      IT_FIELDCAT        = T_FCAT
    TABLES
      T_OUTTAB           = ITAB1.


ENDFORM.                    "F_USERCOMMAND_ALV

With Rgds,

S.Bharani

Read only

0 Likes
1,310

i think you are concenered about the column heading . instead of hardcoding the values

W_FCAT-SELTEXT_M = 'Emp NAme'.

make it as

W_FCAT-SELTEXT_M = text-001 ' Emp Name

and translate the text element to arabic and check

a®

Read only

0 Likes
1,310

Hi ARS,

instead of Emp name hardcoding, as u suggested, I have used text element and the remaining code remains unchanged.......

still it is displayed in English.

With rgds,

S.Bharani