‎2007 May 23 1:10 PM
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
‎2007 May 23 6:18 PM
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
‎2007 May 23 6:05 PM
‎2007 May 23 6:05 PM
‎2007 May 23 6:18 PM
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