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

Excel problem while sending report output as mail!!

Former Member
0 Likes
430

Hi,

I am sending an excel file as attachment in the mail id provided on the selection screen but once we open the attachment the first column value is not displayed in excel , but if we click on the excel cell twice , it does display the content otherwise it's seen as blank ..what may be the reason?

I am using FM SO_DOCUMENT_SEND_API1 for sending mail...

Points for sure .....

Regards

Gunjan

Hi,

I am sending an excel file as attachment in the mail id provided on the selection screen but once we open the attachment the first column value is not displayed in excel , but if we click on the excel cell twice , it does display the content otherwise it's seen as blank ..what may be the reason?

I am using FM SO_DOCUMENT_SEND_API1 for sending mail...

Points for sure .....

Regards

Gunjan

1 REPLY 1
Read only

Former Member
0 Likes
409

Hello,

DO like this:


  CONSTANTS: CON_CRET TYPE X VALUE '0D',  "OK for non Unicode
             CON_TAB TYPE X VALUE '09'.   "OK for non Unicode

*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
*    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
*    con_cret type c value cl_abap_char_utilities=>CR_LF.


  CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
         INTO IT_ATTACH SEPARATED BY CON_TAB.
  CONCATENATE CON_CRET IT_ATTACH  INTO IT_ATTACH.
  APPEND  IT_ATTACH.

  LOOP AT IT_EKPO INTO WA_CHAREKPO.
    CONCATENATE WA_CHAREKPO-EBELN WA_CHAREKPO-EBELP
                WA_CHAREKPO-AEDAT WA_CHAREKPO-MATNR
           INTO IT_ATTACH SEPARATED BY CON_TAB.  " Check here
    CONCATENATE CON_CRET IT_ATTACH  INTO IT_ATTACH.  " Check here
    APPEND  IT_ATTACH.
  ENDLOOP.

VAsanth