Application Development 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: 

Problem with BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Kudos
1,752

I am Veerendra,

Please help me how to create sales order using this BAPI.

I am passing Header data to BAPISDHD1,

Partner data to ORDER_PARTNERS

and Item data to BAPISDITM.

I am filling the item data for only one item with item number(1000) , Material number(10135) and Qty 1 (target_qty).

In Bapi It is returning error messages like:

1.E |V1 <524 |Only quantity 1 EA is allowed (Item 001000)

2.E |V4 <248 |Error in SALES_ITEM_IN 001000

3.W |V1 <555 |The sales document is not yet complete: Edit data

PLease reply to these doubts as soon as possible.

Thanks

veerendra.

13 REPLIES 13

Former Member
0 Kudos
293

Check whether you have mentioned other unit of measure in the item other than 'EA'.

If the material is configured only for 'EA' in material master (MM01, MM02) then you can only give that of unit of measure.

0 Kudos
293

Hi Sharath,

I checked by passing unit of measure (EA)to

item_in- SALES_UNIT.

Then also it is giving same problem.

iS THERE ANY OTHER CHANCES?.

Thanks.

VEERENDRA

0 Kudos
293

Pass 'EA' to ISO unit of measure.

In target quantity.

Rg,

VM

Former Member
0 Kudos
293

Veerendra,

Can you create this order on-line with the same header data and line item info?

If not, resolve that first.

0 Kudos
293

Veer,

Also note that you MUST fill in the schedule line table as well. This schedule line data MUST contain the ordered qty.

Example:

  • Build schedule line as well.

move l_number to schd_lin-itm_number. "line number

schd_lin-req_qty = i_vbap-kwmeng. "ordered qty

append schd_lin.

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

ORDER_HEADER_IN = hdr

convert = 'X'

IMPORTING

SALESDOCUMENT = salesdoc

TABLES

return = ret_tbl

ORDER_ITEMS_IN = itm

ORDER_PARTNERS = prtnr

ORDER_ITEMS_inx = itmx

ORDER_CONDITIONS_IN = conds

ORDER_CONDITIONS_INX = condsx

order_schedules_in = schd_lin.

0 Kudos
293

HI jhon,

Ya tried to create on-line also it is workin with the same header data. And Bapi also returning message like header data is sucessfull.

PLease suggest if somthing is else is missing.

veerendra.

0 Kudos
293

HI JOhn,

Thanks it is working with shedule line item,

Still it is saying item data is incomplete.

Please what else i need to pass.

Thanks .

Veerendra

0 Kudos
293

Is the order actually saving now... and just stating that the line item is incomplete?

0 Kudos
293

If it is still NOT saving, do this in the debugger:

Set a breakpoint near the beginning of your program (before the call out to the BAPI).

Once you reach the breakpoint, from the menu bar of the debugger choose: Breakpoints > Breakpoint at > Function Module... Enter func module SD_SALES_DOCU_MAINTAIN as the func module.

Now execute.

You will now breakpoint at the core func module that attempts the creation of the sales document.

Execute just past this Func mod call. Once you return from this func mod, check the contents of internal table RETURN - which is returned from the func mod.

This table contains the details of an issues. These table contents are not passed back to the BAPI in their entirety... unfortunately.

But this should tell you WHY the creation is seeing incomplete data.

Former Member
0 Kudos
293

In the return table click for details in the first error and check in which table it is showing error

Correct that field and also pass the ISO unit of measusea also.

Some times this error occurs because of ISO UOM.

Rg,

VM

Former Member
0 Kudos
293

Hi,

Could you check what is the unit of measure maintained for material 10135 in MM03. it is available on basic data 1. Use the same in your bapi and let us know.

Former Member
0 Kudos
293

Veer,

As cited above, you must add the SCHEDULE LINE data.

You must also call the BAPI_TRANSACTION_COMMIT function module.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = ret_text.

Former Member
0 Kudos
293

Hi,

Best thing to know what are the fields to get the completeion status in item would be enter the same data that you are passing in BAPI in transaction VA01 and see the incompletion log. The transaction will traverse you through all the screens and fields where you need to fill valid data in order for it to be completed. Make a note of those fields and populate the same in your BAPI.