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: 

FM for internal number generation

Former Member
0 Kudos

Hi Friends,

I want to generate one internal number and print the same for my Gate Pass Form...this number should be alloted to the particular delivery document which i called for and it goes like other delivery document number for follow-ups.

If i call the same delivery number for multiple print out...the gates pass no should be same as generated once.

Example in FORM****

Gatepass No:1

Invoice No: 98300012

then in next FORM

Gatepass No: 2

Invoice No: 98301247

Pls advise with some sample code of FM.

thanks & regards

sankar.

Edited by: sankar babu on Jan 31, 2008 9:13 AM

Edited by: sankar babu on Jan 31, 2008 12:26 PM

3 REPLIES 3

Former Member
0 Kudos

use FM NUMBER_GET_NEXT

former_member181962
Active Contributor
0 Kudos

Step 1)

Create a Number Range in SNRO Transaction.

Step 2)

Create a Z Table with two fields Delivery Number and Gate Pass Number.

Step 3)

In your form, write the code as per the following guidelines.

select single * from ZTABLE where DELIVERY = P_DELIVERY.

if sy-subrc <> 0.

Use the FM NUMBER_GET_NEXT to get the next available

number.

ztable-delivery = p_delivery.

ztable-gatepassno = <Number that was returned by the FM>.

modify ztable from ztable.

endif.

Regards,

Ravi Kanth Talagana

0 Kudos

HI Ravikanth,

thanks for ur prompt reply.

I've created a new object range and assigned the same as u said.But actually, before assinging a new one, one of my colleague already moved the gatepassno to one table with same FM.So, even if i assigned a new one, the old GP number is still repeating in the Form, So how to clear the table or this Gatepass number and run with a new object range.

Pls advise.

regards

sankar.