cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SALESORDER_CREATEFROMDAT2 and Returns, RMA

Former Member
0 Kudos

Hello all. I'm glad to see this forum doing so well.

Have any of you used the BAPI_SALESORDER_CREATEFROMDAT2 to create an RMA (returned goods) doc type RE? This is my current task and I'm hitting a wall in my initial tests. I've done plently of work with this bapi for creating orders (doc type TA) but never a return.

Returns are created with reference to the original order. This is the main difference at the document entry level. When I try to create an RE type document, I get an error: [E V1 761 Unpermitted combination of business object BUS2032 and sales doc. category H]

First of all, is doc_type RE correct or is there some converted value I should be using?

I have not filled in the REFOBJTYPE, REFOBJKEY, or REFDOCTYPE yet. So the first test is to create a return without reference. Later, I will create one with reference. Are these fields used for setting the reference or do I leave those blank and just fill in the REF_DOC field?

Thank you for tips. If anyone needs help with VB or ASP calling this BAPI, I can help you there.

Thanks.

Crew Reynolds

Software Development Manager

Daydots

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I have to create a sales order for document type Returns as well as a debit memo request.The BAPI 'BAPI_SALESORDER_CREATEFROMDAT2' is giving the following error message for Debit Memo Request document creation as well as for Returns.

761 Unpermitted combination of business object BUS2032 and sales doc. category L

I found BAPIs:

‘BAPI_CUSTOMERRETURN_CREATE’ for creating sales document of type ZDRE and SD document category ‘H’.

‘BAPI_DEBITREQUEST_PROXY_CREATE’ for creating sales document of type ZDDR and SD document category ‘L’.

please let me know if anybody have used them. If so what values need to be passed to I_UPLOAD_ID,I_DESTIN,I_SFA_REL parameters of BAPI_DEBITREQUEST_PROXY_CREATE. Are there any alternative solutions using the Salesorder bapi.

I have to create documents based on the flat file data no reference sales document numbers are available.

Former Member
0 Kudos

Same issue I was getting. I'm not sure if BAPI_SALESORDER_CREATEFROMDAT2 can create a return. I don't know why since both that BAPI and the BAPI_CUSTOMERRETURN_CREATE functions are both just wrappers for SD_SALESDOCUMENT_CREATE. I have been able to create returns with BAPI_CUSTOMERRETURN_CREATE.

These parameters passed into BAPI_CUSTOMERRETURN_CREATE produce a valid return based on our configuration.

RETURN_HEADER_IN

-DOC_TYPE RE

-SALES_ORG 0010

-DISTR_CHAN 10

-DIVISION 10

-PURCH_DATE 07/13/2004

-INCOTERMS1 3-5

-INCOTERMS2 ORIGIN

-PMNTTRMS NT00

-DLVSCHDUSE QA1

RETURN_ITEMS_IN -ITM_NUMBER 000000

-MATERIAL 20409-03-11

-TARGET_QTY 1.000

RETURN_PARTNERS -PARTN_ROLE SP

-PARTN_NUMB 1002

-ITM_NUMBER 000000

Hope that helps.

Former Member
0 Kudos

Hi Crew,

Thanks a lot for the timely help. I am calling SD_SALESDOCUMENT_CREATE directly by passing the business object types depending on the document type.

The other BAPIs have dependencies e.g. certain import parameters are mandatory which are irrelevant for my object.And I am able to create both returns and Debit memo request using the above FM.

Thanks once again

Good Day

Regards

Bhargavi

Former Member
0 Kudos

One question. I'm trying to pull together a working test and I keep getting an error I'm not sure how to get past. Returns require a usage indicator. In VA01, there is one at the header level and there is also one at the item level. I can find the one for the item level but have not located the header level usage indicator yet. I'm getting this error that indicates I need it.

E V1 901 Update usage indicator on sales view with return reason for credit

Do you know where I might find this field?

Thank you.

Crew Reynolds

Former Member
0 Kudos

Hi,

I can't say for certain but have you checked if field AUGRU on VBAK is populated? This is the reason for a return and can often be required for document creation.

HTH.

Former Member
0 Kudos

A good thought. I actually had tried that but double-checked it in case. No, there's a usage code somewhere I'm missing. In VA01, there is a usage code at the header level and also at the line level. I can find the line level version but not the header version.

Here's what I get in the RETURN when I attempt to create a return for one item with the AUGRU set for good measure. The line level USAGE_IND is set to a valid value as well just to see if it made a difference.

S V4 233 SALES_HEADER_IN has been processed successfully

S V4 233 SALES_ITEM_IN has been processed successfully

W V1 555 The sales document is not yet complete: Edit data

E V1 901 Update usage indicator on sales view with return reason for credit

That last error is what I need to overcome. I didn't see this BAPI in the BOR so I'm not working from documentation yet. If you know where I can find some, that would be great.

Thanks.

Crew Reynolds

Daydots

Former Member
0 Kudos

Hi Crew,

I would suggest trying to create the document in VA01 with exactly the same data and see if you get the same error. Then I'm afraid it is a case of debugging until this message is generated and see what causes it.

Hope this is of some help.

colin.

Former Member
0 Kudos

I was hoping I could crack this with documentation but that proved to be a dead end. Based on your suggestion Colin, I broke down and debugged the code to get my answer. DLVSCHDUSE is the proper header field for the usage code. Adding a usage code of QA1 into my test produced a return.

Thanks to all who took time to help me past this little hump.

Former Member
0 Kudos

Hi,

I don't believe you can use this BAPI to create return orders. You could look at business object BUS2102 which has a BAPI called BAPI_CUSTOMERRETURN_CREATE which may be of use.

HTH.

Former Member
0 Kudos

Seems reasonable! I'll check that out. I assumed that the salesorder BAPI would be the place to go since we use VA01 to create returns.

Thanks.