03-30-2006 6:36 PM
Hi all,
I am using bapi SD_SALESDOCUMENT_CREATE for creating orders. A bit doubtful about what are all the order types that i can use this for. can i use this for creating
returns
return replacement
order replacements
credit-value
credit -coop
credit - price prot.
credit stock
debit value
invoice correction
foc customer coop
FOC - Marketing
FOC - Overheads
FOC - Price Protect.
Consignment Pick-up
Consignment Fill-up
Consignment Issue
Consignment Returns
could somebody help me with this.
Thanks a lot,
Kiran.
03-30-2006 6:42 PM
Kiran,
I am not sure why you are NOT using the BAPI - BAPI_SALESORDER_CREATEFROMDAT2 Which will also have ORDER type (DOC_TYPE) so you should not have a problem which order type you want to create.
Looks like your function SD_SALESDOCUMENT_CREATE also has similar input parameters, so it depends on what order type you are passing.
Regards,
Ravi
Note : please mark the helpful answers
03-30-2006 6:49 PM
03-30-2006 6:51 PM
ive tried with the fm first. but its not happy with returns and causing some problems. bcoz the business bus2032 is hard coded in that fm and cant process returns stuff etc.....
max i will be happy if it creates all order types with that fm. i am using that fm in the ale program and the idoc created is of status 51 sales document was not changed..is there something wrong with my program mate...
thanks a lot.
03-31-2006 12:23 AM
Hi Kiran
I had a problem like yours so I created a copy of BAPi BAPI_SALESORDER_CREATEFROMDAT2 where I determined
the correct business object by fm SD_OBJECT_TYPE_DETERMINE and transfered it (instead of BUS2032) to fm SD_SALESDOCUMENT_CREATE.
Something like this:
function Zbapi_salesorder_createfromdat2.
.................
SELECT SINGLE * FROM TVAK WHERE AUART = order_header_in-DOC_TYPE.
call function 'SD_OBJECT_TYPE_DETERMINE'
exporting
i_document_type = tvak-vbtyp
importing
e_business_object = business_object
exceptions
others = 1.
call function 'SD_SALESDOCUMENT_CREATE'
exporting
...............
business_object = 'BUS2032' <------------------
business_object = business_object
....................
endfunction.
Max