Skip to Content
author's profile photo Former Member
Former Member

Uplaoding excel file for BDC program

Hi,

I am making a BDC program to uplaod material pricing condition i want the code to uplaod data with excel file also is at header field name required or not , and is it required to filed remaning filed lenght with zero like as matnr filed lenght is 18 if my code is 1000 is it required to write as 0000000000001000., also what changes are required if i m uplaoding a text file.

regards,

zafra

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 27, 2010 at 07:14 AM

    Hi,

    Since you want to upload through Excel file for your referencr u can give the header name but in Intenal table the header name u might discard.........

    Please check ih Conversion Exit is there for the particular field, if it is present,than u can ddirectly update no nedd to for '000...'

    Regards

    Arbind.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 27, 2010 at 07:15 AM

    Use Conversion_Exit FM's.

    Manas M.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 27, 2010 at 08:37 AM

    Hi,

    For uploading data into internal table from excel before recording you can try doing,

    (code}

    DATA: it_raw TYPE truxs_t_text_data.

    &----


    *&Function module called to upload xls data into an internal table

    &----


    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

    EXPORTING

    i_field_seperator = 'X'

    i_line_header = 'X'

    i_tab_raw_data = it_raw

    i_filename = p_file "file path browsed

    TABLES

    i_tab_converted_data = it_upload[] "int table populated

    EXCEPTIONS

    conversion_failed = 1 "browsed file's data

    OTHERS = 2.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    After uploading data into internal table it_upload,

    Then for MATNR field you can apply conversion exit that is,

    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT' "This FM will append leading zeroes with the material no to 18 length

    EXPORTING

    INPUT = it_upload-matnr

    IMPORTING

    OUTPUT = it_upload-matnr

    EXCEPTIONS

    LENGTH_ERROR = 1

    OTHERS = 2

    .

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    Hope it helps

    Regards

    Mansi

    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.