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

How to run the BAPI after creation or Modification ?

HI Abapers,

How to run the BAPI after creation or Modification ? What is the step by step procedure to run the the BAPI?

Immediate reply is highely appriciable.

Regards,

Chow.

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2007 at 06:53 PM

    Hi

    If you have done with BAPI creation correctly Run it similar to the fun mdule which we run in SE37 calling this BAPi in the program with CALL FUNCTION and passing the necessary parameters

    see the sample bapi code how it is called in Program

    data : w_resb_header like bapirkpfc.

    data: begin of itab_resb occurs 0.

    include structure bapiresbc.

    data: end of itab_resb.

    data: begin of itab_bapi_return occurs 0.

    include structure bapireturn.

    data: end of itab_bapi_return.

    data : w_resb_no like bapirkpfc-res_no.

    w_resb_header-plant = p_werks.

    w_resb_header-res_date = sy-datum.

    w_resb_header-created_by = sy-uname.

    w_resb_header-cost_ctr = '0000010001'.

    w_resb_header-move_type = '201'.

    w_resb_header-gr_rcpt = w_room_time.

    w_resb_header-part_acct = 'OR'.

        • *ITEM DATA

        loop at i_details.

        itab_resb-material = i_details-matnr.

        itab_resb-plant = i_details-werks.

        itab_resb-store_loc = i_details-lgort.

        itab_resb-quantity = i_details-qty.

        itab_resb-unit = i_details-meins.

        append itab_resb.

        clear itab_resb.

        clear i_details.

        endloop.

        call function 'BAPI_RESERVATION_CREATE'

        exporting

        reservation_header = w_resb_header

        • NO_COMMIT =

        • MOVEMENT_AUTO =

        importing

        reservation = w_resb_no

        tables

        reservation_items = itab_resb

        return = itab_bapi_return

        .

        call function 'BAPI_TRANSACTION_COMMIT'

        exporting

        wait = 'X'

        • IMPORTING

        • RETURN = .

        wait up to 5 seconds.

        w_resb_no contains your reservations numnber

        Regards

        Anji

        Add comment
        10|10000 characters needed characters exceeded