Skip to Content

Getting Blank Column While Downloading Excel

Hello ,

I am downloading excel file using class~method

CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE

but I am getting a blank column at first position(A). All the data are correctly downloaded starting from Column B.

Steps I have done :

1. Get data from App server using Open dataset and populate internal table

2. Convert internal table into string

3. convert string into xstring

4. call the above method

Please let me know where I am doing wrong.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 21, 2014 at 05:14 AM


    Use the following dummy code.


    " Header details.

    CONCATENATE
    <Header details..>
    cl_abap_char_utilities=>newline
    INTO lv_text2
    SEPARATED BY cl_abap_char_utilities=>horizontal_tab.


    " Actual data..
    LOOP AT lt_srvr_mstr INTO ls_srvr_mstr.
    <Main Data>
    cl_abap_char_utilities=>newline
    INTO lv_text1
    SEPARATED BY cl_abap_char_utilities=>horizontal_tab.


    CONCATENATE lv_text2 lv_text1 INTO lv_text.
    CLEAR lv_text2.
    CLEAR ls_srvr_mstr.


    ENDLOOP.



    DATA : lv_xstring TYPE xstring.
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
    text = lv_text
    IMPORTING
    buffer = lv_xstring


    ............


    .............

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 21, 2014 at 02:26 AM

    Hi Jitendra,

    I suspect something is going wrong while converting data in step 2 & 3.

    Please go through the below links

    Exporting Internal Table contents to an Excel File

    Download a file into excel sheet - Web Dynpro ABAP - SCN Wiki

    If your issue is still not solved, please share the piece of code to convert data to excel.

    Regards,

    Rama

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 21, 2014 at 04:59 AM

    Hi Jitendra,

    While converting Internal table records into String, you might be using the statement as below.

    loop ....

    concatenate lv_string

    ..... (table fields)

    .....(table fields )

    cl_abap_char_utilities=>new_line

    INTO lv_string

    SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

    endloop.

    Remove lv_string immediately which is after concatenate, otherwise it introduces Blank Column.

    loop ....

    concatenate

    ..... (table fields)

    .....(table fields )

    cl_abap_char_utilities=>new_line

    INTO lv_string

    SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

    endloop.

    Hope this is helpful.

    Regards,

    Ravikiran.k

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.