‎2009 Apr 06 4:53 PM
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
‎2009 Apr 06 5:26 PM
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.
‎2009 Apr 06 4:56 PM
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.
‎2009 Apr 06 4:57 PM
There is a conversion Exit on the DOC_TYPE field.
Try with:
order_header_in-doc_type = 'TA'.
Regards,
Naimesh Patel
‎2009 Apr 06 5:26 PM
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.
‎2009 Apr 06 5:56 PM
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
‎2009 Apr 06 6:04 PM
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
‎2009 Apr 06 6:11 PM
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.