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

Error while creating Sales Order

Former Member
0 Likes
422

Hi Experts,

When i am trying to create Sales Order by using 'BAPI_SALESORDER_CREATEFROMDAT2',the program is giving the error

'Please enter sold-to-party or ship-to-party'.

I checked the header structure 'BAPISDHD1' but there is no field for sold-to party or ship-to party.

I checked the partners structure 'BAPIPARNR'.In this structure there is field 'partn_nub'

I passed values to that field still it giving the same error.

Can anyone suggest me how to solve this error.

Thanks & Regards,

Gopalakrishna.K

2 REPLIES 2
Read only

Former Member
0 Likes
385

Hi,

You to pass the values to the partner table order_partners for sold to party and ship to party.

There is a field in this structure Partner Function. In that you have to pass value SP for Sold to party and SH for ship to party.

You can take reference from VBPA table which is a partner function table to create a sales order.

Sample code :-


    wa_part-parvw = 'SP'.
    wa_part-itm_number = '10'.
    wa_part-partn_numb = '520'
    wa_part-unload_pt = 
    append wa_part to it_part. " it_part is of type BAPIPARNR which is there in BAPI

Hope this will solve your problem.

Thanks,

Regards,

Jhings

Read only

0 Likes
385

Hi,

Thanks for your reply.I solved that error 'Please enter sold-to party or ship-to party'.

But still it giving the error 'document 35 does not have a document catagery but'.

I will give you my code what I havae written in my partners tab.

wa_partners1-partn_role = 'AG'.

wa_partners1-PARTN_NUMB = wa_header-sold_to.

  • wa_partners1-itm_number = '10'.

append wa_partners1 to it_partners1.

clear wa_partners1.

can you please suggest me how to solve this error,

Thanks & Regards,

Gopalakrishna.K