cancel
Showing results for 
Search instead for 
Did you mean: 

In bsp application is displaying the report in arabic but not in webdynpro

Former Member
0 Kudos

Hi,

I did the application what is that BI report displaying the data in table arabic format it was fine displayed.

same application is BI report data is not displaying in the arabic format it's displaying in the hexadecimal format.

can any one help in the same. I will provice the code.

data : ls_candidate_data type zcand_arab_info_s.

types: begin of ty_summb,

/bic/objid type /bic/ahsummbse00-/bic/hobjid,

/bic/happlnam1 type /bic/ahsummbse00-/bic/happlnam1,

/bic/habbrevon type /bic/ahsummbse00-/bic/habbrevon,

act_type type /bic/ahsummbse00-act_type,

/bic/hacttyp_t type /bic/ahsummbse00-/bic/hacttyp_t,

end of ty_summb.

data: int_summb type table of ty_summb,

wa_summb type ty_summb.

*ls_candidate_data = '60007926'.

*append ls_candidate_data to lt_candidate.

*

select * from zbi_arab_can_smp into table lt_candidate.

call function 'Z_BI_GET_ARABIC_NAMES' destination 'DVRCLNT095'

tables

candidate = lt_candidate

encoded_data = lt_encoded_data.

select /bic/hobjid

/bic/happlnam1

/bic/habbrevon

act_type

/bic/hacttyp_t

into table int_summb

from /bic/ahsummbse00

for all entries in lt_candidate

where /bic/hobjid = lt_candidate-candidate.

loop at lt_encoded_data into ls_encoded_data.

read table int_summb with key /bic/objid = ls_encoded_data-candidate

into wa_summb.

if sy-subrc = 0.

ls_encoded_data-/bic/happlnam1 = wa_summb-/bic/happlnam1.

ls_encoded_data-/bic/habbrevon = wa_summb-/bic/habbrevon.

ls_encoded_data-act_type = wa_summb-act_type.

ls_encoded_data-/bic/hacttyp_t = wa_summb-/bic/hacttyp_t.

modify lt_encoded_data from ls_encoded_data.

clear: ls_encoded_data.

endif.

endloop.

............................................................in bsp part end here...................................................

Z_BI_GET_ARABIC_NAMES':

FUNCTION Z_BI_GET_ARABIC_NAMES_TEST.

*"----


""Local Interface:

*" TABLES

*" CANDIDATE STRUCTURE ZCAND_ARAB_INFO OPTIONAL

*" ENCODED_DATA STRUCTURE ZCAND_ARAB_DATA

*"----


data wa_HRP9550 type HRP9550.

data: input_val type char0128.

data: output_val type CHAR512.

data wa_ENCODED_DATA type ZCAND_ARAB_DATA.

TYPES: BEGIN OF ty_cand,

CANDIDATE type hrp9550-objid,

FNAME_AR type hrp9550-fname_ar,

MNAME_AR type hrp9550-MNAME_AR,

LNAME_AR type hrp9550-LNAME_AR,

GFNAME_AR type hrp9550-GFNAME_AR ,

end of ty_cand.

data: int_cand type table of ty_cand,

wa_cand type ty_cand.

TYPES: BEGIN OF ty_summb,

objid type ZER_SUMMB_SEL-objid,

major type ZER_SUMMB_SEL-major,

major_desc type ZER_SUMMB_SEL-major_desc,

gmajor type ZER_SUMMB_SEL-gmajor,

gmajor_desc type ZER_SUMMB_SEL-gmajor_desc,

end of ty_summb.

data: int_summb type table of ty_summb,

wa_summb type ty_summb.

  • data: int_cand_arab_data type TABLE OF ZCAND_ARAB_DATA ,

  • wa_cand_arab_data type ZCAND_ARAB_DATA.

SELECT OBJID

fname_ar

mname_ar

lname_ar

gfname_ar

FROM hrp9550

into TABLE int_cand

for all entries in candidate

WHERE plvar EQ '01'

AND otype EQ 'NA'

AND objid = CANDIDATE-candidate

AND ENDDA GE sy-datum

AND BEGDA LE sy-datum.

if sy-subrc = 0.

sort int_cand by candidate.

delete ADJACENT DUPLICATES FROM int_cand COMPARING candidate.

SELECT OBJID

major

major_desc

gmajor

gmajor_desc

FROM zer_summb_sel

INTO TABLE int_summb

for all entries in int_cand

wHERE objid = int_cand-candidate.

loop at int_cand into wa_cand.

wa_encoded_data-candidate = wa_cand-candidate.

  • first name conversion

input_val = wa_cand-FNAME_AR.

CALL FUNCTION 'Z_BW_ENCODE_TO_HTML_DATA'

EXPORTING

DATA = input_val

L_ENCODING = 'UTF-8'

IMPORTING

OUTPUT = output_val.

wa_encoded_data-FNAME_AR = output_val.

clear: input_val, output_val.

  • mid name conversion

input_val = wa_cand-MNAME_AR.

CALL FUNCTION 'Z_BW_ENCODE_TO_HTML_DATA'

EXPORTING

DATA = input_val

L_ENCODING = 'UTF-8'

IMPORTING

OUTPUT = output_val.

wa_encoded_data-MNAME_AR = output_val.

clear: input_val, output_val.

  • last name conversion

input_val = wa_cand-LNAME_AR.

CALL FUNCTION 'Z_BW_ENCODE_TO_HTML_DATA'

EXPORTING

DATA = input_val

L_ENCODING = 'UTF-8'

IMPORTING

OUTPUT = output_val.

wa_encoded_data-LNAME_AR = output_val.

clear: input_val, output_val.

  • GF name conversion

input_val = wa_cand-GFNAME_AR.

CALL FUNCTION 'Z_BW_ENCODE_TO_HTML_DATA'

EXPORTING

DATA = input_val

L_ENCODING = 'UTF-8'

IMPORTING

OUTPUT = output_val.

wa_encoded_data-GFNAME_AR = output_val.

  • Read and populate Major details

read table int_summb with key objid = wa_cand-candidate

into wa_summb.

if sy-subrc = 0.

  • MAJOR

wa_encoded_data-major = wa_summb-major.

  • MAJOR_DESC

input_val = wa_summb-major_desc.

CALL FUNCTION 'Z_BW_ENCODE_TO_HTML_DATA'

EXPORTING

DATA = input_val

L_ENCODING = 'UTF-8'

IMPORTING

OUTPUT = output_val.

wa_encoded_data-major_desc = output_val.

  • GMAJOR

wa_encoded_data-gmajor = wa_summb-gmajor.

  • GMAJOR_DESC

input_val = wa_summb-gmajor_desc.

CALL FUNCTION 'Z_BW_ENCODE_TO_HTML_DATA'

EXPORTING

DATA = input_val

L_ENCODING = 'UTF-8'

IMPORTING

OUTPUT = output_val.

wa_encoded_data-gmajor_desc = output_val.

endif.

append wa_encoded_data to ENCODED_DATA.

clear: input_val, output_val, ENCODED_DATA, wa_encoded_data.

endloop.

endif.

ENDFUNCTION.

............................................end.......................................................

'Z_BW_ENCODE_TO_HTML_DATA':

FUNCTION Z_BW_ENCODE_TO_HTML_DATA.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(DATA) TYPE CHAR0128

*" REFERENCE(L_ENCODING) TYPE ABAP_ENCOD DEFAULT 'UTF-8'

*" EXPORTING

*" REFERENCE(OUTPUT) TYPE CHAR512

*"----


data: conv type ref to cl_abap_conv_out_ce,

inbuf type string,

outbuf type string,

wf_len type i,

wf_str_len type i,

wf_out type string,

wf_buf type string,

WF_BUF_I TYPE I.

IF NOT DATA IS INITIAL.

clear: wf_len, wf_str_len, wf_out.

wf_str_len = strlen( DATA ).

do.

CALL METHOD CL_ABAP_CONV_OUT_CE=>CREATE

EXPORTING

ENCODING = L_ENCODING

REPLACEMENT = '#'

IGNORE_CERR = ABAP_TRUE

RECEIVING

CONV = CONV.

clear: INBUF, OUTBUF, wf_buf, WF_BUF_I.

INBUF = DATA+wf_len(1).

  • if not INBUF is initial.

CALL METHOD CONV->WRITE

EXPORTING

DATA = INBUF.

CALL METHOD CONV->GET_BUFFER

RECEIVING

BUFFER = WF_BUF.

WF_BUF = OUTBUF.

if INBUF is not initial.

WF_BUF_I = CONV->UCCPI( INBUF ).

wf_buf = WF_BUF_I.

condense wf_buf.

  • endif.

concatenate wf_out '&#' wf_buf ';' into wf_out.

else.

concatenate wf_out ' ' into wf_out.

endif.

  • concatenate wf_out wf_buf into wf_out.

wf_len = wf_len + 1.

if wf_len eq wf_str_len.

exit.

endif.

enddo.

  • OUT-ZZFIRSTNAM_AR = wf_out.

ENDIF.

OUTPUT = wf_out.

ENDFUNCTION.

................................................end..............................................................

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm guessing that your ABAP system is not Unicode. Unlike in BSP where you can specify the page encoding, Web Dynpro automatically encodes all strings based upon the system code page of the application server. Therefore you cannot mix code pages or directly output UTF-8 from Web Dynpro as you could with BSP.

For Unicode encoded output of Web Dynpro your Application Server would have to running Unicode.

Former Member
0 Kudos

Hi Thomas,

Thank you for quick reply...

I tried with out using the code page changes in non-unicode sytem in webdynpro.Previosu i got the hexadecimla data but now it's getting some english and insted of arabic data it's displaying "####" like that.

can you please help me in the same.

Thnak you in advacne.

Former Member
0 Kudos

Hi Ramkumar,

Within class CL_GUI_HTML_VIEWIER there is method GET_RECOMMENDED_CHARSET within this method there is FUNCTION Module called ' Get_SGP_code page ' cant recollect the exactname.

try this, within your source code after getting arabic data

step 1.

call that get_sgp_code page function module , that would return you appropriate code page for the Language u want to display your content in.

step 2.

pass the recommended code page, as L_ENCODING value to the method

CALL METHOD CL_ABAP_CONV_OUT_CE=>CREATE

EXPORTING

ENCODING = L_ENCODING

REPLACEMENT = '#'

IGNORE_CERR = ABAP_TRUE

RECEIVING

CONV = CONV.

rest of the processing should be same.

Greetings

Prashant

Former Member
0 Kudos

Hi,

I already did those steps.I am doing in that webdynpro application in non-unicode system.I tried those steps but it's not getting the arabic data displaying some hexadecimal language.

Thomas told me that, webdynpro automatically encoded the data in code page we need not to do anything like BSP.

If you know anything about this please let me know.

Thank you in advacne

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm sorry, but you can't mix code pages like this in Web Dynpro without your system being Unicode. Unicode is the supported solution for such requirements. You either need to logon to the Web AS in Arabic or you need to have a Unicode system.

Answers (0)