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

Number Range issue with cmd_ei_api=>maintain_bapi

Former Member
0 Likes
1,736

Hi Guys,

I am using cmd_ei_api=>maintain_bapi to upload customer data in to SAP. Everything is working fine except the number range. We are having internal number range. When a customer goes into error, it is not created, but the number is consumed. For example if I give wrong company code, I am getting correct error for it and customer is not created, but the number for the customer is used and next time I will have sequentiality next number.

Kindly Advice how can I have the current number if it customer creation is not successful.

Thanks,

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,165

This is sap buffer logic. You can check the replies from Jurgen & Clemens in this thread http://scn.sap.com/thread/3171954.

Read only

0 Likes
1,165

Hi Kesavadas,

What I understood from the link that you have given is, we need to clear or delete the buffer to retrieve number back.Am I correct?

Read only

0 Likes
1,165

To be frank , I have not worked in such scenario's. But what I understood from that thread is the we have to change the buffer settings through transaction SNUM for the respective object.

But, why cannot you let it go and use the next number proposed ?

Read only

Former Member
0 Likes
1,165

Will it be good idea if I change standard table NRIV(Number Range Intervals).

I mean if customer is not successfully created, and if I reduce the NRIV counter by 1. Will it cause any other effect? Any Suggestion?

Read only

Former Member
0 Likes
1,165

Hi Brijesh,

I do not know if this thread is still open, I faced the same kind of issue and suggest you to use ROLLBACK WORK in case of failure.

check below example.

  cmd_ei_api=>maintain_bapi(

     EXPORTING

       is_master_data           = lwa_main_data

     IMPORTING

       es_master_data_correct   = lwa_master_data_correct

       es_message_correct       = lwa_message_correct

       es_master_data_defective = lwa_master_data_defective

       es_message_defective     = lwa_message_defective

          ).

IF lwa_message_defective IS INITIAL.

COMMIT WORK AND WAIT.

ELSE.

ROLLBACK WORK.

ENDIF.

Reward me if found useful.

Thanks,

Swapnil Joshi