2013 Oct 23 8:07 AM
hi ,
i am using BAPI_OUTB_DELIVERY_CREATE_STO for creating Delivery , the BAPI is executuing correctly and the Delivery number is Getting generated . But if go to the transcation VL02N and i give the generated Delivery Number it says it does not exist .
What Could Be the Problem?
Regards
Biju
2013 Oct 23 8:21 AM
Hi,
Yes i have
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
now i added the wait 3 second and tried
But still the same problem.
Regards
Biju
Dear Biju,
1. You may have to debug it at every BAPI end, to confirm the delivery number is generated and commited. ( check the return table for messages ). It seems there is a performance issue. You may increate 3 seconds to 6 seconds..
2. Or use this BAPI instead. BAPI_OUTB_DELIVERY_CREATE_SLS.. The same structure..
2013 Oct 23 8:09 AM
2013 Oct 23 8:13 AM
Dear Biju,
You need to commit the transaction after the successful execution of BAPI. Use the following code, which works for me.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
WAIT UP TO 3 SECONDS.
Regards,
Venkat
2013 Oct 23 8:21 AM
Hi,
Yes i have
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
now i added the wait 3 second and tried
But still the same problem.
Regards
Biju
2013 Oct 23 8:26 AM
2013 Oct 23 8:27 AM
The BAPI has a documentation with sample code. Can you please cross check your code and various flags.. Please paste your code.
2013 Oct 23 8:27 AM
HI Biju, there could be a perfomance issue with your server, but you can try incrementing the wait seconds , also verify the return table of the BAPI have any messages...
2013 Oct 23 8:28 AM
parameters: vbeln like ekko-ebeln OBLIGATORY memory id bes,
EBELP like ekpo-EBELP ,
vstel like tvst-vstel,
logsys like tbdls-logsys default 'NONE'.
data: lf_vbeln type vbeln_vl,
lf_num type vbnum,
ls_deli type bapishpdelivnumb,
lt_deli type table of bapishpdelivnumb,
lt_order type table of bapidlvreftosto,
ls_order type bapidlvreftosto,
ls_itm type bapidlvitemcreated,
lt_itm type table of bapidlvitemcreated,
ls_ext type bapiparex,
lt_extin type table of bapiparex,
lt_extout type table of bapiparex,
ls_ret type bapiret2,
lt_return type table of bapiret2.
* StockTransItems (here: complete STO)
ls_order-ref_doc = vbeln.
ls_itm-ref_item = EBELP .
append ls_order to lt_order.
* ExtensionIn
ls_ext = 'My additional input'.
append ls_ext to lt_extin.
* Synchronous RFC
call function 'BAPI_OUTB_DELIVERY_CREATE_STO'
DESTINATION logsys
EXPORTING
SHIP_POINT = vstel
* DUE_DATE =
* DEBUG_FLG =
importing
delivery = lf_vbeln
num_deliveries = lf_num
tables
stock_trans_items = lt_order
extension_in = lt_extin
deliveries = lt_deli
created_items = lt_itm
extension_out = lt_extout
return = lt_return
.
write: / 'Delivery:', lf_vbeln,
/ 'NumDeliveries:', lf_num,
/ 'Deliveries:'.
loop at lt_deli into ls_deli.
write ls_deli-deliv_numb.
endloop.
if not lt_itm[] is initial.
write: / 'CreatedItems:'.
loop at lt_itm into ls_itm.
write: / ls_itm-ref_doc,
ls_itm-ref_item,
ls_itm-deliv_numb,
ls_itm-deliv_item,
ls_itm-material,
ls_itm-dlv_qty,
ls_itm-sales_unit,
ls_itm-sales_unit_iso.
endloop.
endif.
if not lt_return[] is initial.
write: / 'Return:'.
loop at lt_return into ls_ret.
write: / ls_ret-type, ls_ret-id, ls_ret-number,
ls_ret-message,
/.
endloop.
endif.
if not lt_extout[] is initial.
write: / 'ExtensionOut:'.
loop at lt_extout into ls_ext.
write: / ls_ext.
endloop.
endif.
* COMMIT WORK
if not lf_vbeln is initial.
call FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING wait = 'X'.
WAIT UP TO 3 SECONDS.
endif.
2013 Oct 23 8:35 AM
I saw your code,
You paste the following code jsut after your Return statement of BAPI.
if not lf_vbeln is initial.
call FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING wait = 'X'.
WAIT UP TO 3 SECONDS.
endif.
2013 Oct 23 8:49 AM
Do a commit after the call. Plus please paste debugging screen shot of delivery number generated along with IF_NUM parameter.
2013 Oct 23 8:54 AM
i tried it .but still the same
but when i execute via se37 using test sequence
first i call BAPI_OUTB_DELIVERY_CREATE_STO and then
BAPI_TRANSACTION_COMMIT
it is working .
2013 Oct 23 8:58 AM
2013 Oct 23 9:00 AM
Dear Biju,
1. You may have to debug it at every BAPI end, to confirm the delivery number is generated and commited. ( check the return table for messages ). It seems there is a performance issue. You may increate 3 seconds to 6 seconds..
2. Or use this BAPI instead. BAPI_OUTB_DELIVERY_CREATE_SLS.. The same structure..
2013 Oct 23 9:03 AM
The Problem was with the destination i was giving NONE
i Removed it and now works fine.
I wonder what Could be the problem with that COZ i believe
whenever i call the BAPI from SAP We will give Destination as NONE
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |