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: 

Error is return order creation thru BAPI

Former Member
0 Kudos

Hi,

I am using BAPI_CUSTOMERRETURN_CREATE to create return orders. Parameters Passed are

IMPORT

SALESDOCUMENTIN-vbeln = GKCNKETAN1

RETURN_HEADER_IN-REFDOCTYPE = H

DOC_TYPE = ZR20

SALES_ORG

DISTR_CHAN

DIVISION

REQ_DATE_H

PURCH_DATE

ORD_REASON = 102

TABLES

RETURN_ITEMS_IN-ITM_NUMBER

MATERIAL

BATCH

PLANT

STORE_LOC

TARGET_QTY

TARGET_QU

T_UNIT_ISO

ITEM_CATEG

PURCH_NO_C

PURCH_DATE

RETURN_PARTNERS-PARTN_ROLE = SP

PARTN_NUMB

RETURN_CONDITIONS_IN-ITM_NUMBER = 10

COND_TYPE = PR00

COND_VALUE

CURRENCY = INR

COND_UNIT = VIA

COND_P_UNT = 1

But Still the return order is not getting created. It gives message as

SALES_HEADER_IN has been processed successfully

SALES_ITEM_IN has been processed successfully

SALES_CONDITIONS_IN has been processed successfully

The sales document is not yet complete: Edit data

C&S:Dom Ret Ord C&S GKCNKETAN1 has been saved

How to solve this error, is there any other parameters to be passed.

Regards,

Karthik.k

1 ACCEPTED SOLUTION

raguraman_c
Active Contributor
0 Kudos

Hi,

Use BAPI_COMMIT_WORK.

--Ragu

4 REPLIES 4

raguraman_c
Active Contributor
0 Kudos

Hi,

Use BAPI_COMMIT_WORK.

--Ragu

Former Member
0 Kudos

I am executing this function module thru SE37.

Thanks & Regards,

Kathik k

Former Member
0 Kudos

Hi

As standard BAPIs are not followed by COMMIT stmt,

U have to create one custom ZBAPI which will call the standrd BAPI 'BAPI_CUSTOMERRETURN_CREATE ' and fill the parameters as u have done.

then call 'BAPI_TRANSACTION_COMMIT' in the same program to commit the transaction.

Then it will be updated in SAP.

Otherwise not.

if helpful reward me points

Regs

Manas Ranjan Panda.

Former Member
0 Kudos

One thing I am not understanding I am just executing the BAPI in SE37 diectly & passing the values for testing. Why should I use BAPI for commit in this case.

I am able to create sales order in the same manner. I am not executing thru any Z progams.How this bapi alone will require commit externally.

Can anybody help me in creating a return order thru any bapi.It would be great if you can help me in passing the right parameters(also kindly see the parameters I have passed & logs above)

Regards,

Karthik.k