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: 

Get the next new Item number

Former Member
0 Kudos

Hi Experts,

Is it possible to get the next new item number for the service contract.

For example we have the service contract like 40100924, for this we have the item numbers (10,20,30)

The neext new item number is the 40.

How we can get this number.

Could any one suggest is there any FM available to get that number.

Thnx,

Jaya.

9 REPLIES 9

Former Member
0 Kudos

I don't think so but you can calculate it using the configuration field "item interval".

former_member156446
Active Contributor
0 Kudos

we have an alternative but that would not be correct always...

find out the number range assigned to the item number.. from ur Functional person and use that using the FM NUMBER_GET_NEXT , this would not work if two ppl are using the same number range at the same time... so be very very carefull

0 Kudos

>

> we have an alternative but that would not be correct always...

>

> find out the number range assigned to the item number.. from ur Functional person and use that using the FM NUMBER_GET_NEXT , this would not work if two ppl are using the same number range at the same time... so be very very carefull

If I recall correctly, FM NUMBER_GET_NEXT also updates the next number, so if the last number used was 3 for example and you call the FM to find out the next number (and get 4), the next number actually used would be 5.

Somebody correct me if I'm wrong.

Rob

0 Kudos

Actually item numbers are not generated using number ranges.

Rob GET_NEXT_NUMBER will give 4 in your example but if you have buffering turned on, then the next call may not get 5.

0 Kudos

Thanks Srinivas - I was just trying to keep it simple

Rob

0 Kudos

I generally think of this FM when I am really lazy for debugging and finding the correct structure which holds the next item number.. As we all know lazyness never rules.

0 Kudos

Hi J@y,

Thnx for your help.

2 days onwards I am sitting on the same Issue , I could not found any thing Becuase of that only I posted in the SDN

Thnx,

Jay

0 Kudos

Hi All,

I have sloved the problem.

Sloution is

Get the order type based on the contract number using the table VBAK

Using the TVAK table pass the order type and get the Item number increment field INCPO.

Get the last Item number and increment with the INCPO value.

we will get the new Item number.

But we should make sure no one editing the document.

Thnx for all help and thnx for your pacience.

Thnx,

Jaya

Former Member
0 Kudos

Hi,

In table T161 based on the purchase doc.catefory (K for Contract), and appropriate purch.doc type, get the PINCR (Item Number Interval) and add to your line item no.

Hope this helps.

Regards,

Subramanian