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_OUTB_DELIVERY_CREATE_STO

UmaArjunan
Active Participant
0 Likes
6,817

I am using this BAPI to create outbound delivery. but i am getting errror in the table return

The error message is : Please check the entries. No work list selected.

What is the reason for this error ? How do solve this and to get a successful output for this bapi

Please suggest what are all the things to be checked.

and my code is here

Input is : PO number and item no , quantity and date in

CONSTANTS: lc_ship_point TYPE bapidlvcreateheader-ship_point VALUE '5421',

lc_code_success TYPE string VALUE '0',

lc_code_failure TYPE string VALUE '4',

lc_error TYPE char1 VALUE 'E',

lc_yes TYPE char1 VALUE 'X',

lc_posnr TYPE posnr_vl VALUE '000010',

lc_success TYPE string VALUE 'Succesfully Processed',

lc_delivery_failure TYPE string VALUE 'Outbound Delivery Creation Failure',

lc_goodsissue_failure TYPE string VALUE 'Good Issue Creation Failure'.

DATA : lw_stk_item TYPE bapidlvreftosto,

lt_stk_item TYPE TABLE OF bapidlvreftosto,

lv_delivery TYPE bapishpdelivnumb-deliv_numb,

lv_due_date TYPE bapidlvcreateheader-due_date,

ls_vbkok_wa TYPE vbkok,

lw_vbpok_tab TYPE vbpok,

lt_vbpok_tab TYPE TABLE OF vbpok,

ls_header_data TYPE bapiobdlvhdrcon,

ls_header_control TYPE bapiobdlvhdrctrlcon,

lt_return TYPE TABLE OF bapiret2,

lw_return TYPE bapiret2,

lw_err_msg TYPE zexchange_log_data2.

DATA : lt_serial TYPE TABLE OF bapidlvserialnumber,

lw_serial like line of lt_serial.

  • Item Number

lw_stk_item-ref_item = item_number.

  • Po number

lw_stk_item-ref_doc = po_number.

  • Quantity

lw_stk_item-dlv_qty = quantity.

  • Shipping date (considering that given date is in YYYYMMDD format)

lv_due_date = shipping_date.

*get unit of measure from ekpo table

SELECT SINGLE meins INTO lw_stk_item-sales_unit FROM ekpo

WHERE ebeln = po_number

AND ebelp = item_number.

APPEND lw_stk_item TO lt_stk_item.

MOVE-CORRESPONDING lw_stk_item TO lw_serial.

append lw_serial to lt_serial.

CLEAR lt_return.

*create out bound delivery

CALL FUNCTION 'BAPI_OUTB_DELIVERY_CREATE_STO'

EXPORTING

ship_point = lc_ship_point

due_date = lv_due_date

IMPORTING

delivery = lv_delivery

TABLES

stock_trans_items = lt_stk_item

serial_numbers = lt_serial

  • EXTENSION_IN = ls_ext

return = lt_return.

*Error Handling

CLEAR lw_return.

READ TABLE lt_return INTO lw_return WITH KEY type = lc_error.

There is no value in the field lv_delivery i am getting error message in the lt_return table and cannot proceed further .

Thanks

When i call this RFC Bapi from the other logical system , it is not returning the delivery number for the particular shipping point.

But when i try to use the bapi in the same system ( where it actually exists ) it is returning value for the delivery number for the purchase order.

first thing is when i call RFC from any logical system What do i need to check , in the bapi to return value ? Please give your suggestions.

But when i investigated, i can see some error in the table "No responsibility for creating supplies for shipping rather than 5421"

Please throw some light on this question

Thanks

8 REPLIES 8
Read only

Former Member
0 Likes
3,510

Hi,

Go through the function module documentation which clearly explain how to use BAPI_OUTB_DELIVERY_CREATE_STO

Regards,

Dwaraka.S

Read only

0 Likes
3,510

Of course , i read the function module. But i am missing something to fix the problem in the code or some where in the setting..

Any valuable suggestions are welcome

Read only

UmaArjunan
Active Participant
0 Likes
3,510

I debugged the bapi . if there is no entry in the table 'VETVG' , then the bapi gets failed to generate the delivery number.

In what way the Purchase order entry details are updated in the table 'VETVG' ?

Please explain the process flow happening while creating Purchase orders and their corresponding entries in the SAP tables...

Thanks

Read only

0 Likes
3,510

When i call this RFC Bapi from the other logical system , it is not returning the delivery number for the particular shipping point.

But when i try to use the bapi in the same system ( where it actually exists ) it is returning value for the delivery number for the purchase order.

first thing is when i call RFC from any logical system What do i need to check , in the bapi to return value ? Please give your suggestions.

But when i investigated, i can see some error in the table "No responsibility for creating supplies for shipping rather than 5421"

Please throw some light on this question

Thanks

Read only

0 Likes
3,510

Hi,

Check the user id and pwd (SAP access from Non-sap system) with which you are running this BAPI in legacy system. May be it is causing authorization problem in using the shipping point.

Login to SAP system with the same ID and PWD u r using in non sap frontend for using these BAPI, and check the FM is working fine (Creating the delivery).

Let us know whether u r able to create the delivery or not.

Regards,

Dwaraka.S

Read only

0 Likes
3,510

Thanks for your suggestion. I hope its related to authorisation and i requested to give authorisation for the RFC user to execute this BAPI . I will get authorisation and check for the results.

Read only

0 Likes
3,510

The problem is Solved !!!

It is due to "The RFC user misses authorisation for all activites of authorisation Object V_LIKP_VST."

This is solved by adding the appropriate roles to the RFC_user. Now its creating delivery number when we call the rfc from other system..

Hope it will be useful if some one faces this kind of problem in fututre

Thanks

Read only

Former Member
0 Likes
3,510

Hi Abap_Dev,

Thanks a lot for your post as this info does help!

Regards

Luis