‎2014 Jan 07 9:43 AM
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
‎2014 Jan 07 9:50 AM
‎2014 Jan 07 9:54 AM
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.
‎2014 Jan 07 9:54 AM
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?
‎2014 Jan 07 9:58 AM
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
‎2014 Jan 07 11:04 AM
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
‎2014 Jan 07 11:09 AM
Hi
What happens if you execute REPLICA bapi with test run...does it generate any number?
Nabheet
‎2014 Jan 07 11:59 AM
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
‎2014 Jan 07 6:26 PM
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
‎2014 Jan 08 3:33 AM
Hi Nabheet,
I guess this is the correct way! Even I have the same thought in my first response!
Rg, Kiran