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

About using BAPI for Data Migration

Hello,

I need the examples for using BAPIs for Data migration in place of BDCs....

I need at least the procedure to follow to solve my problem ...

Thank u...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 10:43 AM

    Hi,

    Below is an example of SO change using BAPI

    • initialize

    clear: zBAPISDH1,

    zBAPISDH1x.

    refresh: zBAPIRET2,

    zBAPISDITM,

    zBAPISDITMx.

    • set header parameters for sales order update

    move '911' to zBAPISDH1-ORD_REASON.

    move 'X' to zBAPISDH1x-ORD_REASON.

    move 'U' to zBAPISDH1x-UPDATEFLAG.

    • set item parameters for sales order update

    select posnr

    into vbap-posnr

    from vbap

    where vbeln eq itab_ord-vbeln.

    clear: zBAPISDITM,

    zBAPISDITMx.

    move vbap-posnr to zBAPISDITM-ITM_NUMBER.

    move '96' to zBAPISDITM-REASON_REJ.

    append zBAPISDITM.

    move vbap-posnr to zBAPISDITMx-ITM_NUMBER.

    move 'X' to zBAPISDITMx-REASON_REJ.

    move 'U' to zBAPISDITMx-UPDATEFLAG.

    append zBAPISDITMx.

    endselect.

    • update sales order

    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

    EXPORTING

    SALESDOCUMENT = itab_ord-vbeln

    ORDER_HEADER_IN = zBAPISDH1

    ORDER_HEADER_INX = zBAPISDH1X

    SIMULATION = p_test

    TABLES

    RETURN = zBAPIRET2

    ORDER_ITEM_IN = zBAPISDITM

    ORDER_ITEM_INX = zBAPISDITMX.

    • commit changes

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

    Rgds,

    HR

    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.