Application Development and Automation 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: 
Read only

Issue in creating Return Order

Former Member
0 Likes
529

Hello Experts,

I am creating a Return Order Document w.ref.to Invoice using BAPI_CUSTOMERRETURN_CREATE , It is generating Return Order number once the execution is done , But saying that Return order number is Archived. Reason behind that is It was not committed once the Execution has been done.

If we execute BAPI_TRANSCTION_COMMIT in a sequence , it is working fine.

Is there any Auto-Commit field available within the BAPI_CUSTOMERRETURN_CREATE . I don't want to use Explicit commit for the BAPI. Bcoz I need to generate a OData service using Gateway for the same Return order generation . Odata Multiple row creation(Changeset Method) doesn't allow Commit Statement . So Is there any chance to get Auto-Commit on the BAPI.

Appreciate your help.

Thanks,

Uday.

3 REPLIES 3
Read only

Former Member
0 Likes
483

Hi Uday,

   You can try,

   If SY-SUBRC = 0.

   COMMIT WORK.

ENDIF.

Regards

Ajit

Read only

Former Member
0 Likes
483

Hi , Could anyone update my query and suggest the desired solution.

Appreciate your help.

Thanks,

Uday.

Read only

0 Likes
483

Hi Uday,

This BAPI is just like simulation.

That is good thing to use BAPI_TRANSACTION_COMMIT. BAPI always returns sy-subrc EQ 0.

Call BAPI_TRANSACTION_COMMIT if your return table does not have any message of Type 'E' else do BAPI Rollback.

I dont think there is way of autocommit for this BAPI because Update function module are not processed automatically.

Deependra