System generated number

Hi all,
I m developing a module pool with z table 1 Header & 1 Item table. Now I would like  to ask how I can get system generated number for the pk filed supose gate pass number and my filed type is char 10.
When user enter a new entry then system will auto generqte the gpass number .
so pls let me know if any one can help me to do this job.
Thanks in advance.
manju

Hey Manju,
first pre determine what range your number should be having , like  starting from 0000000001 like that or 1000000001 etc, after that  :
Scenario 1 ( if you have to show the number as a field  on the screen)
write a select query in the PBO of the screen as below
let the field name be gateno.
select max(gateno)
          from <dbtab>
          into < var1>.
this will fetch the last number and then you can increase it.
if syst-subrc is initial.
var1 = var1 + 1.
endif.
move the value of var1 to the screen field name.
Scenario 2 ( If you just need to update in the database table)
write the above select query in the PAI module of the screen when the user performs some action like SAVE.
Hope this helps,
reward if useful,
Regards ,
RK

Similar Messages

  • Reg: Generating  custom number instead of system generated no in ME21n

    Hi Experts,
                      I need to know user exits or Badi to generate custom number instead of system generated number while saving p.o ME21n transaction.
    Regards,
    Vikram.S

    Vikram,
    Instead of doing it programatically , ypu can satisfy your requirement in configuration settings.
    check SPRO with the help of functional consultant.

  • How to generate a Ref-number automatically ( System Generated) in ABAP

    Hi,
         I have created a z-table where ref_number is the key field. I want to fill this table automatically by system so that whenever a new record by customer is entererd, this ref_number will be given to them with response.
    So Could any one help me out,
    Gud points will be rewar5ded for useful answers.
    Thanks in advance,
    Sunil

    Hi Sonali,
                       Thanks for you kind reply, but I am not able to get the System generated REQ_NUM and fill the table with the same. The program is as follows,
    Could you help me out,
    INCLUDE MZFIRSTPAGETOP                          .    " global Data
    TABLES: ZCHP_CUST_INFO.
    *DATA: OKCODE LIKE SY-UCOMM.
    DATA:   CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
            REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
            DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
            PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
            EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
            COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
            COMM like ZCHP_CUST_INFO-ADDRESS,
            REF_NUM LIKE ZCHP_CUST_INFO-REQ_NUM.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'FOR1000'.
      SET TITLEBAR '1000'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    INCLUDE MZFIRSTPAGEO01                          .  " PBO-Modules     *
    INCLUDE MZFIRSTPAGEI01                          .  " PAI-Modules     *
    INCLUDE MZFIRSTPAGEF01                          .  " FORM-Routines   *
    *&      Module  USER_COMMAND_1000  INPUT
          text
    MODULE USER_COMMAND_1000 INPUT.
    CASE SY-UCOMM.
      WHEN 'SUBMIT'.
            ZCHP_CUST_INFO-CREATED_BY = CNAME.
            ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
            ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
            ZCHP_CUST_INFO-SHORT_TEXT = DESC.
            ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
            ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
            ZCHP_CUST_INFO-ADDRESS = COMM.
    INSERT ZCHP_CUST_INFO.
    COMMIT WORK.
    *GENERATING A REF_NUMBER.
    CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
    nr_range_nr = '01'
    object = 'ZCHP_CUST_INFO'
    QUANTITY = '1'
    SUBOBJECT = ' '
    TOYEAR = '0000'
    IGNORE_BUFFER = ' '
    IMPORTING
    number = ZCHP_CUST_INFO-REQ_NUM " specify ur wa field
    QUANTITY =
    RETURNCODE =
    EXCEPTIONS
    interval_not_found = 1
    number_range_not_intern = 2
    object_not_found = 3
    quantity_is_0 = 4
    quantity_is_not_1 = 5
    interval_overflow = 6
    buffer_overflow = 7
    OTHERS = 8.
    WHEN 'RESET'.
           CLEAR: CNAME,REQTYP,PRIO_TYPE,
    DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
      WHEN 'CANCEL'.
            LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1000  INPUT
    Thanks in advance,
    Sunil K Shetty

  • Creation of PO for an already generated number !!

    Hi All,
    The Requirement is to create a Purchase Order for an already generated number.
    Ex: The generated number is 4500026080.
          Now a purchase Order 4500026080 need to be created.
    Please let me know if more clarification required.
    Thanks & Regards,
    Deeba

    From where you are getting this no.? Because when you will create the PO it will automatically generates the PO # for you.
    I think you can find some enhancement option(User exit/badi/enhancement spot) at the place right after the system is generating the PO and then replace with the once you have created.

  • System generated index property not generated in database

    Hi,
    I created an offline table by copying it from an (first) online database to my project. The table contains a unique key constraint, which references a system generated index. Now I used this offline table to generate a table in another (second) online database. This all works well except, that the "System Generated" property of the index is "false" and not "true" as in the offline table (and the first online database). When I manually reconcile the same table to the second online database again, there is always a difference shown for this index property. When I try to continue the reconcile process to change this property I get an error message, that the index cannot be dropped because it is obviousely referenced by the unique constraint.
    When I drop the constraint and try to generate the index only I get the following warning message:
    Jan 11, 2012 2:08:59 PM oracle.javatools.db.property.AbstractPropertyManager processDiffs
    WARNING: Unsupported property: systemGenerated
    Is there a way to work around this annoying behavour? Is it possible to change this index property by an ALTER INDEX statement?
    Im using JDeveloper 11.1.2.1.0 (Build JDEVADF_11.1.2.1.0_GENERIC_110907.2314.6081)
    Thanks for help and hints
    Thomas
    Edited by: thmayr on 11.01.2012 05:08

    Hi,
    it might be due to some BUG in RDBMS...
    First Check the Secondary index in TEST system
    Look at the Transport Number in DEV system, If this is having error, then it will show you the error details also,
    If that not moved Properly then you need to create another request for the INDEX and move it again
    See the threads with similar problem...
    Warning: Index does not exist in database system MSSQL
    Index does not exist in database system ORACLE??????
    Re creation of database index
    Hope it will solve your problem...
    <b>Reward Points if useful</b>
    Thanks & Regards
    ilesh 24x7

  • System generated column names

    Version - Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    I see some system generated column names(like SYS_C00009_13061211:44:57$,SYS_C00033_13061211:44:57$) in ALL_TAB_COLS view for a partitioned table, not sure how they got created in the first place and tabledoesn't have any virtual columns. Is it something if we drop a column from table and oracle trying to keep them in the dictionary? when i describe the table these "SYS_C00" columns are not showing.
    I am trying to exchange the partition with staging (similar structure) table, but i end up with this error "
    14097. 00000 -  "column type or size mismatch in ALTER TABLE EXCHANGE PARTITION"
    *Cause:    The corresponding columns in the tables specified in the
               ALTER TABLE EXCHANGE PARTITION are of different type or size
    *Action:   Ensure that the two tables have the same number of columns
               with the same type and size."
    Any suggestions would be appreciated.
    Thanks,
    sg

    I have found my solution to this problem.
    My table is compressed table and when i try to drop some of the columns oracle marking them as unused(SYS_CO with timestamp) instead of dropping them. For partition exchange i have created same number of columns as original table in the same order and marked the "dropped" columns as unused on a temporary table. Now i can able to exchange the partition with out any issues
    Thanks to Jonathan and Connor.
    EXCHANGE PARTITION those pesky columns | Learning is not a spectator sport

  • Random generated number along with barcode in smartforms

    Hi All,
    Is it possible to add some random generated number by system to add along with the end of the barcode in smartforms. (what could be the field) If so how it can be done. Tanks in advance
    Regards
    GK

    Hi Tankx man 4 the valuable reply,
         I am able to get that, but what my problem is,
    Eg: In my GR a item with 10 qty, so i made the qty as input and based upon that i am printing 10 labels. for ur ref the code is below"
    menge = TRUNC( is_mseg-menge ).
    DO menge TIMES.
    header-slno = header-slno + 1.
    APPEND header TO itab.
    the complete program is like as follows;
    menge = TRUNC( is_mseg-menge ).
    DO menge TIMES.
    header-slno = header-slno + 1.
    APPEND header TO itab.
    CALL FUNCTION 'QF05_RANDOM_INTEGER'
    EXPORTING
    RAN_INT_MAX   = '999999999'
    RAN_INT_MIN   = '100000000'
    IMPORTING
    RAN_INT       = RANINT
    EXCEPTIONS
    INVALID_INPUT = 1
    OTHERS        = 2.
    IF SY-SUBRC EQ 0.
    ENDIF.
    WRITE :/ RANINT.
    ENDDO.
    but in my barcode all the label has the same random number, can u say how to solve this.

  • System generated value for a field and incrementing (using module pool pro)

    Hi,
    I'm getting system generated value for a field and incrementing (i.e done by coding) when i'm saving the screen or transaction (which is created using module pool programming) while modifying, saving its working fine, but when i'm going out of the screen or exit n again i start the screen (with some ztransco) the value for the field again starting from 0 so i want to start from the same value for a field where we exit or got out from the screen n incremented respectively while saving the screen,
    Thanks & Regards,
    MS
    Edited by: Rob Burbank on May 4, 2010 10:40 AM

    Search the forum for number range objects.
    Rob

  • Is there any way to customise the system generated packing slip?

    Hi All,
    My customer would like to be able to add a few field to the system generated packing slip. I can see where to update things on the invoice in system emails, but couldn't see anywhere for the packing slip?
    Also there's a few random bits that get printed on the invoice that aren't part of the system invoice. Any idea how to remove? My client is printing from Chrome. See below:

    Thanks for replying @thetrickster888,
    Tried all 4 tags but none showed the phone or email on the packing slip
    {tag_addressbilling}
    {tag_addressshipping}
    {tag_recipientaddress}
    {tag_emailaddress}
    We use a pretty standard Registration-buy form and have the phone line as:
    <td><label for="HomePhone">Phone Number </label><br />
                    <input type="text" maxlength="255" class="cat_textbox" id="HomePhone" name="HomePhone" /></td>
    But still doesn't show on the packing slip. I don't know what else to do.
    I can get them all to show on the invoice but not the packing slip. The only thing I can think of is to give the factory the invoice - but then it's not set up well enough for them to mark off the checks when it's made and packed (we have special boxes on the packing slip for this) plus then they can see pricing which we try to avoid.

  • System Change Number

    hi
    i know that each transaction that is committed is given a system change nunber...i saw in the
    Oracle 9i upgradation book and it was talking about the Check point system change number....i
    know about SCN but this thing has created some ambiguities in my mind...so is there anyone
    who could explain that what is Check point SCN....and another thing that is introduced in
    Oracle 9i is Row level SCN and previously SCN was Block level but still default is Block
    level and wqe can tell at Table creation that what should be used...whether Block level or
    Row level....
    kindly explain if someone could and also tell the whole functionally of SCN in database
    Regards

    Salman, as far as I know the checkpoint SCN is just the SCN number at the time of checkpoint.
    Also Oracle has had both block level and row level SCN numbers for some time. When a block is accessed and updated via indexes the row level SCN is generated while a full table scan just uses a block level SCN. This is a performance gain for the full scan that does not have to perform a row by row check.
    If you were to refer to the specific manual, topic, and section you are having a problem understanding I or another poster may be able to discuss the material with you.
    HTH -- Mark D Powell --

  • The table name for the system generated transactions (Retained Earnings).

    Hi Gurus,
    I have a doubt and want to know from U experts there. Hope you won't let me down. The situation is
    I have created a new chart of account in our Oracle Financial. Uploaded 2007 transactions and opened year 2008 and closed all the periods of year 2007.
    When I open a new year Oracle will do internal process transfer R&L balance to Retained Earnings account and make income & expenses accounts to Zero.
    I want to know the system generated entries which table they are stored, this transaction is not in Gl_Balances table.
    Its an urgent plz reply back soon.
    Thanks in advance
    Barkat

    Hello.
    For EBS 11.5.10.2
    Let’s suppose that the last period of you fiscal year is called ‘LAST-2008’ (not adjusting period). If you have an account with a debtor balance of 100 in this period, when you open the following fiscal year you will find an entry of 100 in the first adjustment period of the fiscal year that the ‘LAST-2008’ period belongs to, in the column BEGIN_BALANCE_DR.
    It is clear that if the balance is creditor you will find it in the BEGIN_BALANCE_CR column.
    Hope this helps.
    Octavio

  • Confusion over nested tables and system generated nested tables

    Hi,
    I have been reading other threads about nested tables, naming and updating them etc, but I have what seems
    to me some odd behaviour.
    I modified my schema to set the attribute xdb:maintainDom to be false for a collection and then registered
    the schema with the generate tables option defaulted to true. The result was that I had to add xdb:tableProps
    attributes specifying nested table storage at each element above the collection element, this was because Oracle
    was creating tables at each level. So I have this kind of thing:
    <xsd:element name="BibPt" xdb:SQLType="BIBPT_T"
      xdb:defaultTable="BIBPT"
      xdb:tableProps="NESTED TABLE XMLDATA.PTEES.PTEE_SEC.PTEE STORE AS NESTED_PTEE_SEC
    NESTED TABLE XMLDATA.INVS.INV STORE AS NESTED_INV_BIBPT TABLESPACE BIBLIO">
    <xsd:element name="Ptees" xdb:SQLType="PTEES_T" xdb:tableProps="NESTED TABLE
    XMLDATA.PTEE_SEC.PTEE STORE AS NESTED_PTEE_SEC2">When I did this the nested tables were created, but when I loaded data never had anything in them. Instead
    I found that nestes tables with systems generated names like "SYSNTxxxxxxxxx" has been created that contained
    the data.
    When I registered the schema without the tables being generated, I created a table with this syntax:
    create table poc_wip2 of xmltype
    xmlschema "http://www.derwent.co.uk/wpi.xsd" element "WPI"
    NESTED TABLE XMLDATA."BibPt".PTEES.PTEE_SEC.PTEE STORE AS NESTED_PTEE_SEC
    NESTED TABLE XMLDATA."BibPt".INVS.INV STORE AS NESTED_INV_BIBPT(Thanks to a posting by Sam Monsarrat which showed me this was possible).
    Now I had my named nested tables, which contained the data after it was loaded and no system named
    nested tables.
    So why the difference?
    In the first instance why do my named nested tables stay empty and why does the data go into system
    generated tables I have no control over as regards tablespace placement?
    Is it possible to have a XML schema registered that only generates tables that I have named with the defaultTable
    attribute, rather than all or nothing?
    And last but not least, what's the best approach for this, since I want to be able to access the data via indexes
    on the nested tables.
    Thanks
    Pete

    Hi Pete
    Would you please publish the schema you are using?
    Thanks,
    Tobias

  • How do I add validation to a system-generated Selection Screen?

    As HR ABAPers know, using the Logical Database approach (I'm using PNPCE) gives you a system-generated Selection Screen.  Part of the specs I have for this report involves making sure that the begin and end dates for the period selected are for a two-week period.  If not, I should display an error message until the user enters a period such that the period (pn-begda and pn-endda) reflect a two-week period.
    The code for the validation is easy enough, and I put it in the AT SELECTION-SCREEN event.  But here's the problem -- the code fires every time the user clicks the "Reporting Period" drop-down box, never giving the user a chance to specify a two-week period.  It fires because pn-begda and pn-endda are still all zeroes.  Even if I select "Other Period" from the drop-down list, the text boxes to allow me to specify the begin and end dates don't appear.
    I've been working on this for quite a while, trying all kinds of things, but I'm spinning my wheels now.  I just want that check to happen when the user clicks the Execute button on the Selection Screen, not when he/she is still trying to enter criteria.  I'm thinking screen field validation for a system-generated Selection Screen has to be a pretty common thing, and there must be a good solution out there.
    Any ideas?

    Rich,
    Absolutely beautiful -- that's exactly what I needed to learn.  Thank you so much.
    Rob, I thought about that.  I even proposed to the users that I could default in a two-week range beginning with today, exactly as you suggested, but they didn't want that.  They felt that this report would more often than not be run to reflect data from two-week periods not necessarily starting today.  Still thought it was a good idea, but that's their call. _
    Again, thanks Rich.  Points awarded.

  • How to Create a Auto Generated number with some preceding text in Sharepoint 2010

    I am trying to create a auto generated number field in Sharepoint 2010 list item. My requirement is to have the following format number generated when new request is created in Sharepoint using form. Auto generated Ticket ID should be in the following format
    "IR13000" "IR13001" "IR13002"....... Please let me know how to get this done. I tried to use combination of default ID and Characters but its not working for new requests, its only reflecting for existing uploaded requests. I
    am trying this for taking up Ticket requests by filling up some fields in the form. Any quick help is much appreciated.
    Thanx

    Here are the steps:
    1 - Open your SharePoint site in SP Designer 2010.
    2 - Click Workflows and add a List workflow. Associate this workflow on the list where you want the Random Text to be generated.
    3 - Inside the workflow editor, select the Action "Update list item"
    4 -  Select 'Current Item'.
    5 - Click Add.. and select the field which needs to be updated with the Random Text. Make sure this column is not of type "Calculated" type, otherwise you won't see it in the list of the fields within the workflow.
    6 - Click "..." button in the next textbox which will open String Builder dialog box.
    7 - Type IR and then click 'Add or Change Lookup and select ID column from "Field from source". Hit OK.
    8 - It should look like IR[%Current Item:ID%]
    9 - Hit OK.
    10 - Save and publish the workflow. (Please note that currently this workflow is not set to auto run on creating new items. That's because we want to test it at this point of time).
    11 - Go to your list in SharePoint and create a new item. After creating, select the item and click Workflows and then run this workflow.
    12 - You should be able to see the text "IR1" in the designated column.
    13 - Once you see that it's working, go to SPD and set the workflow to run automatically on creation of the new item. Save and publish and then return to your list in SharePoint.
    14 - Create a new item there and you should see the Random value in the column.
    15 - You will also see the column in the New form. In order to remove it, go to List settings > content types > Item content type > and select Hidden for this column so that it doesn't showup in any form.
    Try it and let me know how it goes.
    Thanks,
    Ashish

  • Compare system state (number and types of objects in memory)

    We have 2 exactly identical servers running our application talking to the same database.
    When some obejct from server 1 is deleted, a message is passed to server 2 to delete the object from its cache too.
    Forget the database, I want to design a testing system which compares the system-state (number and type of live-objects) in memory for server 1 and server 2 after the operation and the message, and reports any discrepancy.
    Any ideas ?

    Are you trying to debug a distributed cache implementation?
    If you want to inspect the state of your application on multiple servers creating a JMX bean might be a solution.
    http://java.sun.com/developer/technicalArticles/J2SE/jmx.html

Maybe you are looking for

  • Can't install Itunes 8.1.1

    Everytime I load Itunes I get the "Itunes 8.1.1 is available for download" message and I attempt to download it, The file downloads and opens to install it get's to the 95% area and a error message pops up that the Itunes Installer has incountered an

  • No more custom portal upload in ISE 1.3?

    I'm a missing something really obvious, or has the option to upload and use your own completely custom guest portal been removed ? From the new Guest Access menu, i can only find the new and improved gui options with customization of logos, colors an

  • Error in MB31/Migo Message no. C6009

    Hi All, I am doing Make to order till confirmation it is working fine but when i am going for goods receipt through Mb31/ Miro following error is coming can any body help to fix this error Current order status 1000244 does not allow goods receipt Mes

  • .CHM NOT compatible with Vista?

    Hey everyone, I'm working with a programming team to determine the best Vista-compatible help format to use for an existing help project. The project was built using RH X5 for Word and the original output was WinHelp 2000. I thought that .CHM would b

  • Agilent 1100 syntax error

    Hello. I'm sorry if this is in the wrong place... I'm trying to hook up an Agilent 1100 system to a computer via ethernet and control it through labview with the ag1100 drivers. I've managed to get the computer to talk to the system and assign it an