cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SALESORDER_CREATEFROMDAT2 partners

Former Member
0 Kudos

I have been trying to use BAPI_SALESORDER_CREATEFROMDAT2 to generate the header for a sales order to shich items will be added later. I am having problems specifying my partners.

The docs say the partner role must use the german keyword, e.g. WE for ship to party. The problem is, my tables are set up with US abbreviations, e.g. SP.

I have tried passing both SP and WE, and get errors for each. SP tells me i have not passed a ship to (because i assume it looks for "WE" hardcoded, as i have seen in the code, and WE, which tells me the customer number is not valid, becuase, again i assume, that it is looking in KNVP for the customer number set up as a WE.

I have checked my sales org, etc, and everything is ok. I have run it with the convert parameter both off and on, and it seems to have no effect.

Stranger still, if i enter the parameters into SE37 in test mode, i dont get the errors back, and it looks like the order would be created. when i use the exact same parameters in my abap, i get the errors.

I am lost.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi David,

SP stands for the sold-to party which is abbreviated 'AG', 'SH' is ship-to which is 'WE' in German.

Regards,

John.

Former Member
0 Kudos

i tried passing SP and SH. With convert on, i get "no customer master record for ..." with convert off, i get "please specify a sold to or ship to".

I tried passing AG and WE. With convert on OR off, i get "no customer master for ..." (message is VP200)

It does not seem to matter if i use the german or the english abbreviations, or i have convert on or off. it just does not want to accept the partners. I have verified that the number exists in KNA1, and in KNVP with the correct sales area and english abbreviation.

Is there another table i am not checking?

By the way, if i go into VA01, and enter the sales order manually, it works fine, and accepts the number for both sold to and ship to.

Former Member
0 Kudos

Hi David,

I probably misunderstood your problem. Did you try passing on the value for partner function in internal(German) representation and your customer number in internal format as well(with all the leading zeros)? I think the customer number without the leading zeros is what is causing the problem.

Please let me know if I am way off the target.

Thanks,

Srinivas

Former Member
0 Kudos

oddly enough, i came to the same conclusion on the customer number. That was indeed the problem. I needed to format the customer number correctly.

Thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi David,

There are several places where SAP shows you some value but stores a different value in the database. This is what is known as external and internal representation. You need to use conversion exits to convert one form into another form. You can find out if a particular field uses a conversion exit, you can go to the domain level and you will find the conversion exit that it uses(if any). In case of the partner function, here are the conversion exits.


CONVERSION_EXIT_PARVW_INPUT  --> Converts partner 
                                 function from external
                                 to internal format.

CONVERSION_EXIT_PARVW_OUTPUT --> Converts partner 
                                 function from internal 
                                 to external format.

All database selects should always be done in internal format. All dialog entries will usually be in external format.

Hope this helps in understanding the WE to SH or the SP to AG conversions.

Regards,

Srinivas

Former Member
0 Kudos

I already understand them. i just dont know why the bapi does not seem to be DOING them.

I do not have the opportunity to do a conversion exit. plus, either value i pass, i get errors returned from the bapi.