Skip to Content
0
Former Member
Nov 30, 2011 at 10:09 AM

Problem in converting alv report to excel

47 Views

Hi all,

We are trying to convert an alv report to excel and attach it to the mail. We are able to convert and attach it in mail.But in the mail attachment we see in some records some special characters are displayed. I am attaching the part of code of converting the alv report to excel. Kindly suggest us a solution.

DATA: LD_STORE(50) TYPE C. "Leading zeros

DATA : L_STRING(270) TYPE C.

DATA : dmbtr(15) type c,

wrbtr(15) type c,

30days(15) type c,

60days(15) type c,

90days(15) type c,

120days(15) type c,

180days(15) type c,

above180(15) type c,

salds(15) type c,

saldh(15) type c,

acytd_bal(15) type c,

zbd1t(15) type c.

DATA : a type i.

CONSTANTS:

CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,

CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.

CONCATENATE w_lifnr w_name1 w_docno w_doctype w_ref w_docdate w_postdate w_duedate w_dmbtr w_waers w_wrbtr

w_30days w_60days w_90days w_120days w_180days w_above180 w_debit w_credit w_accbal

INTO L_STRING SEPARATED BY CON_TAB.

CONCATENATE CON_CRET l_string INTO it_objbin.

APPEND it_objbin.

LOOP AT IT_FINAL.

*

if it_final-lifnr = '0000010065'.

break-point.

endif.

*

move it_final-dmbtr to dmbtr.

move it_final-wrbtr to wrbtr.

move it_final-30days to 30days.

move it_final-60days to 60days.

move it_final-90days to 90days.

move it_final-120days to 120days.

move it_final-180days to 180days.

move it_final-above180 to above180.

move it_final-salds to salds.

move it_final-saldh to saldh.

move it_final-acytd_bal to acytd_bal.

move it_final-zbd1t to zbd1t.

CONCATENATE

IT_FINAL-lifnr

IT_FINAL-name1

IT_FINAL-belnr

IT_FINAL-blart

IT_FINAL-xblnr

IT_FINAL-bldat

IT_FINAL-budat

IT_FINAL-zfbdt

dmbtr

IT_FINAL-WAERS

wrbtr

30days

60days

90days

120days

180days

above180

*Nondue TYPE bsik-dmbtr,

SALDS

SALDH

ACYTD_BAL

INTO L_STRING SEPARATED BY CON_TAB.

CONCATENATE CON_CRET l_string INTO it_objbin.

APPEND it_objbin.

endloop.

Thanks & Regards,

Neela