Skip to Content

Uploading the data from EXCEL to internal table

hello all,

I am working on a BDC where i am getting data from a EXCEL sheet , which i need to get in into internal table, i am using method 'cl_gui_frontend_services=>gui_upload' and kept

filetype = 'BIN'. I know that this method is only useful for csv or tab delimited , so iam getting the data in Binary format, Now i want to convert this to ASCII to pass the data to the BDC.My problem is , i am unable to convert the binary data to ASCII data.

is there any other method.

i am currently working in SCM where the func. module 'ALSM_EXCEL_TO_INTERNAL_TABLE' and 'KCD_EXCEL_OLE_TO_INT_CONVERT' are not there.

help me in solving this.

with regards,

sandeep akella.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 09:50 AM

    Hi Sandeep ,

    you can always create a function module in ur SCM server whcih is a copy of ASLM_to_excel ..

    Thanks

    Sahil

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 09:46 AM

    Hi,

    Convert ur xl file to csv and use function module gui_upload.

    It will work.

    Vikas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 23, 2008 at 09:50 AM

    hello,

    I can not convert the file into CSV and upload it, as the end user req. is that he wants to update it through EXCEL file, thanks for the option i have already considered it.

    with regards,

    sandeep akella.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 09:53 AM

    Hello,

    You an convert data to ASCII using the function module QADB_DOCU_CONVERT_TO_ASCII.

    Regards,

    Nimish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 09:56 AM

    hi,

    Try this code...

    DATA l_count TYPE sy-tabix.

    CONSTANTS: lc_begin_col TYPE i VALUE '1',

    lc_begin_row TYPE i VALUE '2',

    lc_end_col TYPE i VALUE '2',

    lc_end_row TYPE i VALUE '3000'.

    * Begin of CALK912848 - Carlos Werberich - 16Sep08

    CLEAR p_i_excel_data. REFRESH p_i_excel_data.

    * End of CALK912848 - Carlos Werberich - 16Sep08

    * Function module to read excel file and convert it into internal table

    CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'

    EXPORTING

    filename = p_p_file

    i_begin_col = lc_begin_col

    i_begin_row = lc_begin_row

    i_end_col = lc_end_col

    i_end_row = lc_end_row

    TABLES

    intern = i_data

    EXCEPTIONS

    inconsistent_parameters = 1

    upload_ole = 2

    OTHERS = 3.

    * Error in file upload

    IF sy-subrc NE 0 .

    MESSAGE text-006 TYPE 'E'.

    EXIT.

    ENDIF.

    IF i_data[] IS INITIAL .

    MESSAGE text-007 TYPE 'E'.

    EXIT.

    ELSE.

    SORT i_data BY row col .

    * Loop to fill data in Internal Table

    LOOP AT i_data .

    MOVE i_data-col TO l_count .

    ASSIGN COMPONENT l_count OF STRUCTURE p_i_excel_data TO .

    AT END OF row .

    * Append data into internal table

    APPEND p_i_excel_data.

    CLEAR p_i_excel_data.

    ENDAT .

    ENDLOOP .

    ENDIF

    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.