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

BDC Direct Input

Hi

can any of you giv me an simple example of BDC Direct input method.

Vijay

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 01, 2008 at 07:33 AM

    Hi,

    TABLES: kna1.

    DATA: BEGIN OF itab1 OCCURS 0,

    str(255),

    END OF itab1.

    DATA: itab2 TYPE kna1 OCCURS 0 WITH HEADER LINE.

    CALL FUNCTION 'WS_UPLOAD'

    EXPORTING

    filename = 'D:\ABAP EVE\ffile1.txt'

    filetype = 'ASC'

    TABLES

    data_tab = itab1

    EXCEPTIONS

    conversion_error = 1

    file_open_error = 2

    file_read_error = 3

    invalid_type = 4

    no_batch = 5

    unknown_error = 6

    invalid_table_width = 7

    gui_refuse_filetransfer = 8

    customer_error = 9

    no_authority = 10

    OTHERS = 11.

    IF sy-subrc <> 0.

    WRITE:/ 'sorry'.

    ELSE.

    LOOP AT itab1.

    SPLIT itab1-str AT ',' INTO itab2-kunnr itab2-name1.

    APPEND itab2.

    ENDLOOP.

    IF sy-subrc = 0.

    LOOP AT itab2.

    WRITE:/ itab2-kunnr,itab2-name1.

    INSERT INTO kna1 VALUES itab2.

    ENDLOOP.

    IF sy-subrc = 0.

    WRITE:/ 'inserted'.

    ELSE.

    WRITE:/ 'not inserted'.

    ENDIF.

    ELSE.

    WRITE:/ 'fail'.

    ENDIF.

    ENDIF.

    Flat file data

    10001,Sadney

    10003,Yogesh

    20005,Madan

    Save this flat file in above path.

    reward,if it is useful.

    Thanks,

    Chandu

    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.