Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_GOODSMVT_CREATE from MB21

Former Member
0 Likes
1,776

Hi

I was told that I could use BAPI_GOODSMVT_CREATE to create a Reservation (TX MB21). Has anyone done this before? There is no gm_code in the table T158G. Any one has an example for this?

Thank you!

Felipe

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,029

Hi ,

check this

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

Award pints if helpful

Thanks

venki

3 REPLIES 3
Read only

Former Member
0 Likes
1,029

I'll try to use the function BAPI_RESERVATION_CREATE

Read only

Former Member
0 Likes
1,029

I'll try to use the function BAPI_RESERVATION_CREATE

Read only

Former Member
0 Likes
1,030

Hi ,

check this

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

Award pints if helpful

Thanks

venki