2021 Dec 28 6:53 AM
I am trying to display the following text in a column in ALV:
'شهر ١٢ '
but it keeps keeps flipping and showing as
'١٢ شهر' instead.
How I am writing it in code: (mnths_c is in arabic)
How it's being displayed:
what is the solution to this?
Is it about converting Unicode or something?
Please help
2021 Dec 28 10:30 AM
With Unicode characters U+200E (left to right) and U+200F (right to left), you can play with the order of words:
DATA(messages) = value bapirettab(
( message = 'شهر ١٢' )
( message = '١٢ شهر' )
( message = | شهر { '١٢' }| )
( message = |{ '١٢' } شهر | )
( message = |شهر{ cl_abap_conv_in_ce=>uccp( '200E' ) } { '١٢' }| )
( message = |{ cl_abap_conv_in_ce=>uccp( '200F' ) }شهر{ cl_abap_conv_in_ce=>uccp( '200E' ) } { '١٢' }| ) ).
DATA salv TYPE REF TO cl_salv_table.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = salv
CHANGING
t_table = messages.
salv->display( ).
2021 Dec 28 8:46 AM
Hi Hussein,
Use CONCATENATE statement to achieve it.
CONCATENATE mnths_c 'شهر' INTO gv_text. "If you require space just add SEPARATED BY SPACE after gv_text.
Then assign it into the wa used above.
Note :Please take all variables in string format or character with specified length.
Reward if helpful.
Regards,
Rohit
2021 Dec 28 10:26 AM
2021 Dec 28 10:30 AM
With Unicode characters U+200E (left to right) and U+200F (right to left), you can play with the order of words:
DATA(messages) = value bapirettab(
( message = 'شهر ١٢' )
( message = '١٢ شهر' )
( message = | شهر { '١٢' }| )
( message = |{ '١٢' } شهر | )
( message = |شهر{ cl_abap_conv_in_ce=>uccp( '200E' ) } { '١٢' }| )
( message = |{ cl_abap_conv_in_ce=>uccp( '200F' ) }شهر{ cl_abap_conv_in_ce=>uccp( '200E' ) } { '١٢' }| ) ).
DATA salv TYPE REF TO cl_salv_table.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = salv
CHANGING
t_table = messages.
salv->display( ).
2021 Dec 28 10:50 AM
Fantastic! it worked perfectly, thank you very much Sandra!
2021 Dec 28 11:04 AM
2021 Dec 28 11:07 AM
2021 Dec 28 11:11 AM
Of course, to clarify the code, this would be better:
DATA(left_to_right) = CONV string( cl_abap_conv_in_ce=>uccp( '200E' ) ).
DATA(message) = |شهر{ left_to_right } { '١٢' }|.