Application Development 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: 

bapi for different order types

Former Member
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

I think you can create all order types by that fm.

Max

0 Kudos

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.

0 Kudos

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