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

Err.Message sales document type 'OR' not defined

Former Member
0 Likes
2,122

Hi Friends

I am trying to create an order using standard bapi BAPI_SALESORDER_CREATEFROMDAT2.

When I manually enter the below given data (minimum required as per documentation), it creates an order.

order_header_in-distr_chan = '12'.

order_header_in-division = '00'.

order_header_in-sales_org = '1000'.

order_header_in-doc_type = 'OR'.

order_partners-partn_role = 'SP'.

order_partners-partn_numb = '0000001000'.

However, when I try to call the same BAPI from an SE38 program with exactly the same data, I get an error message _sales document type 'OR' not defined_

Does anyone konw where I am going wrong.

Your suggestions or feedback will be highly appreciated.

Tks

Ram

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,320

HI,

Use this FM


DATA : l_doctype type AUART.

Function module              CONVERSION_EXIT_AUART_INPUT
  Import parameters               Value
  INPUT                           'OR'

  Export parameters               Value
  OUTPUT                          l_auart.

order_header_in-doc_type = l_auart.

6 REPLIES 6
Read only

former_member156446
Active Contributor
0 Likes
1,320

doc_type s 4 characters.... you are entering only 2 characters

use convertion routins:

CONVERSION_EXIT_AUART_INPUT " for input

CONVERSION_EXIT_AUART_OUTPUT "for output.

Read only

naimesh_patel
Active Contributor
0 Likes
1,320

There is a conversion Exit on the DOC_TYPE field.

Try with:


  order_header_in-doc_type = 'TA'.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,321

HI,

Use this FM


DATA : l_doctype type AUART.

Function module              CONVERSION_EXIT_AUART_INPUT
  Import parameters               Value
  INPUT                           'OR'

  Export parameters               Value
  OUTPUT                          l_auart.

order_header_in-doc_type = l_auart.

Read only

0 Likes
1,320

Thanks a lot for all the responses. I appreciate it. I tried each and every suggestions and here are my responses to those.

J@Y, I tried adding blanks but still got the same error.

Naimesh Patel, I tried 'TA' instead of 'OR' and I got an error that said

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

However, I have already entered the partner number which works when I

manually tested this BAPI. Also the same set of data works with

quote creating BAPI. My understanding is that Partner-number

can be used as ship-to or sold-to party.

I also tried calling CONVERSION_EXIT_AUART_INPUT function but again got the same above

error message asking for 'sold-to' or ship-to-party'.

I would also like to add that I have added the transaction commit in my code.

Any other suggestions or feedback will be greatly appreciated.

Tks

Ram

Read only

0 Likes
1,320

HI,

Pass AG instead of SP.

order_partners-partn_role = 'AG'.

or use this Fm CONVERSION_EXIT_PARVW_INPUT

Function module              CONVERSION_EXIT_PARVW_INPUT

  Import parameters               Value
  INPUT                           'SP'

  Export parameters               Value
  OUTPUT                          order_partners-partn_role

Read only

0 Likes
1,320

Thanks a lot guys, Avinash's suggestion of using AG instead of SP did the trick.

Thanks again to everyone for responding. I appreciate it.