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

Reset Material number range buffer

Former Member
0 Likes
1,998

Hi All,

I have created a program to create material master using BAPI. Material no. is internal and I am using FM MATERIAL_NUMBER_GET_NEXT

to get next material code. This program first runs in test mode if everything is fine then user bock and runs in update mode .

My problem is, the material nos. which have generated during test run got skipped in update run .

Is there any to reset number range buffer and table for numbers which have generated during test run or update fail to avoid skip nos..

Regards

Jitendra

9 REPLIES 9
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,498

Could you not call MATERIAL_NUMBER_GET_NEXT in test mode but give a dummy value ?

(e.g. : %00000000000000001, %00000000000000002, etc.)

Regards,

Raymond

Read only

Former Member
0 Likes
1,498

hi Jitendra

you can see in this function called aother function'NUMBER_GET_NEXT',  you need add a parameter 'IGNORE_BUFFER' = 'X'. then will no gaps in the number range.

so you can directly call 'NUMBER_GET_NEXT' with this parameter in your code, also add the logical 'perform t134_lesen'.

regards,

Archer.

Read only

Former Member
0 Likes
1,498

Hi,

I think you can't skip it - the function module is not having any option!

for testing purpose use the dummy martial type and dummy number range!

for updates use the correct material type?

Read only

0 Likes
1,498

Hi Jitendra

Why dont you use BAPI_MATERIAL_SAVEREPLICA it has a test run option also

Which BAPI are you using for the same?

Nabheet

Read only

0 Likes
1,498

Thanks all for reply .

My problem not solve by using dummy no. in test run and BAPI using BAPI BAPI_MATERIAL_SAVEREPLICA , because if user run directly in update mode and any error comes, that number will be skipped.

I seeking for some FM or code which can reverse last generated no .

Jitendra 

Read only

0 Likes
1,498

Hi

What happens if you execute REPLICA bapi with test run...does it generate any number?

Nabheet

Read only

0 Likes
1,498

Hi Nabheet,

I have to pass MATNR in REPLICA also because this is mandatory parameter. I will get MATNR thru FM MATERIAL_NUMBER_GET_NEXT because material number range is internal.

Now user runs program for test run after that go back and run program again for update mode. Now nos which have generated at time of test run will not be generate again .

Jitrnra

Read only

0 Likes
1,498

Hi Jitendra

Just an idea which you can try. We keep two number ranges one number range will act as dummy one for your test cases...In this way your other number range wont get affected(dont know if correct approach just a thought).

Secondly even buffered number ranges also tend to skip many times.

Let us know what do you think

Nabheet

Read only

0 Likes
1,498

Hi Nabheet,

I guess this is the correct way! Even I have the same thought in my first response!

Rg, Kiran