Skip to Content
author's profile photo Former Member
Former Member

FM for internal number generation

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 11:32 AM

    use FM NUMBER_GET_NEXT

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 31, 2008 at 11:34 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.