Generate sequence no.

Hi Experts ,
I have an multiple idocs to file scenario.( file has header ,detail(s) and trailer )
Suppose 100 idocs of same type but different countries( say 2 ) are sent from r/3 then two file should be created .I am able to create 2 files but I have  requirement that each file should have a sequence no. in the header starting from 1 and gets incremented when next file is craeted.
can someone tell me how to capture old file no. which has been generated to generate the new sequence no ( old no + 1 ).
regards,
akhil.

Hi Akhil,
When you create a number range object in TCode- SNRO, and try to access that created number range object by giving it as an input to standard RFC "NUMBER_GET_NEXT" in ECC System, it will increase the number by 1 and gives that value as an output.This output value is needed for PI for passing to specific files which can be get from ECC system using RFC Lookup.
you can check the current no of any number range object created in the same TCode-SNRO.
You can specify the range in number range object - like         0001 - 9999. Any endpoint for it to count for every occurence of file created.
Please revert if any doubts are still left.
Regards,
Anoop

Similar Messages

  • How to generate Sequence Diagrams for existing code

    Hi,
    I have a web application written in Java/Jsp's. I am looking to generate sequence diagrams automatically for the existing source code using this tool. I am not sure if this is possible using this tool. Can some one please explain me if that is possible using this IDE tool? If so can you please let me know how this can be done?
    Any response is greatly appreciated.
    Thanks in advance.
    Vijay

    Hi,
    Yes, you can reverse engineer operations and create sequence diagrams using Java Studio Enterprise.
    Just right-click on the operation in the UML model that has the source file associated with it, and select "Create Diagram from Selected elements" or "Reverse Engineer Operation".
    Thanks!

  • How to generate sequence lile -1, 1, -1, 1, ...

    How to generate sequence lile -1, 1, -1, 1, ...

    Hi,
    If you can generate a sequence like 1, 2, 3, 4, ... then you can get the results you want by saying
    CASE
        WHEN  MOD (x, 2) = 0
        THEN  1
        ELSE  -1
    ENDTo generate the sequence 1, 2, 3, 4, ... you can use CREATE SEQUENCE and NEXTVAL, or ROW_NUMBER, or ROWNUM, or CONNECT BY and LEVEL, depending on what you want.
    Edited by: Frank Kulash on Jan 27, 2012 6:31 AM

  • How to get generated sequence number from JPA/TopLink

    Hi there,
    I am using JDev 10.1.3.3 with JPA + POJO + TopLink.
    In the entity (POJO), I declared a sequence generated for a number field.
    @Id
    @GeneratedValue(strategy=SEQUENCE, generator="GEN_CUSTOMER_ID_SEQ")
    @SequenceGenerator(name="GEN_CUSTOMER_ID_SEQ", sequenceName="CUSTOMER_ID_SEQ", allocationSize=1)
    @Column(name="CUSTOMER_ID", nullable = false, precision = 12 )
    private Long customerId;
    In my program, I don't need to set the Id field because it is set automatically.
    However, I want to get the generated sequence using code. Is there a way?
    Thanks,
    Jim
    P.S. I cannot use getCustomerId because the value has not been set yet.

    If you call persist on the new Entity, or flush() the id will be assigned, and you can get it.
    There is also an API on the TopLink / EclipseLink Session getNextSequenceNumberValue(), that you can use to get a sequence value.
    -- James: http://www.eclipselink.org

  • Disadvantages of using "0" zero as first value in a generated sequence

    Does anyone have any experience with the benefits/disadvantages of using a value of 0 "zero" as the first value generated in a sequence that is also populated in a table. My past experience has always used the values of 1 "one" as the first generated value from a sequence.
    Thanks

    Benefit: You get use one "more" number from the list of values that can possibly be generated by the sequence. If you are start from '1', you have missed out on '0' :-)
    Disadvantages: If any of the queries have predicate like "sequence_generated_column_value > 0" and that your sequence starts from zero, the record with sequence_generated_column_value=0 will not appear in result set for that query (assuming it satisfies other conditions).
    May be there are many mores benefits/disadvantages to add to this list :-)

  • Error While Generating Sequence Number. Contact your system Administrator

    Hi All,
    I have developed a form to provide our client with 'an easy to fill' User Interface. This form will be used instead of the standard form present in Business Suite.
    Some columns of the table, on which form is based, are getting populated via generation of sequence numbers.
    Now the problem is, after deploying custom form developed by me in the instance, Standard form is showing this error
    " Error While Generating the Sequence Number. Please contact the System Administrator "
    I am unable to trace why this error had started appearing..
    Any suggestions would be of great help...
    Thanks in Advance,..

    Forms version 6i,
    Database version 9.2.0.6.0
    Sequences which I am using are used there in Standard form also..
    So evrytime i need to save the record, I am selecting NEXTVAL of it into
    the respective item of the datablock..

  • How to return the newly generated sequence id for an INSERT statement

    A record is to be inserted into a table with a sequence for the primary key. The newly inserted sequence value is to returned on successful insertion. Is it possible to do all this in a single statement (say executeUpdate or any other) using java.sql.* ?
    E.g.: - A student record is to be inserted into the STUDENT table. There is a sequence (by name Student_ID_SEQ) on the primary key Student_ID. Student_ID_SEQ.nextval will generate the new sequence id which will be provided as input to the SQL statement (say statement.executeUpdate) along with other student attribute values. On insertion the created sequence id should be returned. And all this should happen in a single statement (single call to database). Stored Procedures can accomplish this. But is this feasible without the use of Stored Procedures?
    Thanks.

    a better aproach is to generate the auto key on the
    database side, not on the application side.That's his problem - since the database is supplying the key for the new record his application which executed the SQL has no way to identify the record that was just added. I just create the key on the app server and accept the likelihood of overlap (which is extremely small).
    Here is a more technical explanation:
    Table Person
       ID,
       Name,
       Phone Number,
       Age
    }The field ID is an autonumber, and all other fields are not unique.
    Now, when this code executes:
    PreparedStatement pst = conn.prepareStatement("Insert Into Person (Name, Phone Number, Age) Values ?, ?, ?");
    pst.setString(1, "John");
    pst.setString(2, "405-444-5555");
    pst.setInt(3, 44);
    pst.executeUpdate();How can the app determine the ID of the person just added since no query is possible which is guaranteed to select just the record that was inserted?
    Since I am generally against Stored Procedures I would develop a way to insure that your keys were unique and generate them inside the app server.

  • How to generate sequence of pulse trains with DAQmx?

    I need to generate a sequence of pulse trains with DAQmx (the card I have is a PXI-6229 card). As an example:
    - 10'000 pulses at 20kHz every 5 seconds with an initial offset of 2 seconds (let's say 10 pulse trains in total).
    If I use the CreateVirtualChannel.vi in "CO pulse ticks" mode, I can only specificy offset, high ticks and low ticks, but not that the sequence of pulses should be repeated after some time. 
    Now I thought that I could solve this problem if it were possible to multiply two counter outputs: the first counter would generate the pulses (continuously) whereas the second one would switch between low and high on a slower timescale in order to gate the first counter, thereby providing an initial offset and the "off" phases between the pulse trains.
    Is it somehow possible to multiply two outputs with DAQmx and the card I have? Or is there another solution to the problem?
    Thanks a lot in advance for any hints!

    Hi dlanger,
    what you want to do requires a little bit more work. 
    First look at the example "Gen Dig Pulse Train-Continuous.vi" from the LV example finder.
    This example generates a continuous* pulse train. As you see, you need a sample clock VI for setting the sample mode. 
    * NOTE: Generating a finite pulse train with a M-series card requires 2 counter.
    With a pause trigger (DAQmx trigger property node) you can gate the output of that counter.
    Now you have to generate a gate-signal with the the 2nd counter. That means, only if  Ctr1-out is high Ctr0-out outputs the 20 kHz-signal. 
    Maybe you have to adjust the times in my example a bit. 
    Unfortunately there is just one "small" problem: "let's say 10 pulse trains in total" 
    This is not possible, because a 3rd counter would be necessary (*). 
    As a workaround you can modify the while-loop that both tasks are cleared after 50s. This is not brilliant, but should work fine for you. 
    A more sophisticated way is to perform a correlated DIO. So you can generate custom pattern for multiple outputs. 
    A good example can you find here: 
    Retrigger and Repeat Finite Digital Pulse Train in LabVIEW
    http://decibel.ni.com/content/docs/DOC-8473 
    or here:  
    Generating More Than 2 Pulse Trains Using CompactDAQ
    http://decibel.ni.com/content/docs/DOC-2167 
    Hope this helps.
    With best wishes,
    Ralf N. 
    Attachments:
    Gen Gated Dig Pulse Train-Continuous.vi ‏38 KB

  • How to generate sequence no increased with an increment in o/p file name

    Hi all,
             I am doing a file to file scenario in which my output file name consists of a sequence number which is increased by fixed increment.i  thought of proceeding with variable substitution by writing one udf involving Dynamic Configuration object (the udf describd in Micheal blog).However my problem is that i am unable to generate the sequence number with a fixed increment .plz guide me how to proceed to achieve the desired output filename with sequence number.
    For ex:o/p file name:chxx.bcdtspd.00000002.<datetimestamp>.dat
                                  :chxx.bcdtspd.00000003.<dattimestamp>.dat           
    The scenario is FTP so we cant use addcounter.Plz help as its urgent.
    Regards,
    Saurabh Sharma

    Hi,
    What you can do is.
    U have to use the counter which increment everytime ur mapping is executed.
    Steps which needs to be followed.
    1) Maintain one table at R3.
    2) Pass the control to R3 and update the table value with one.
    3) For the second time fetch the counter value from the table and add 1 to it and again update the table with the increment value.
    4) pass the incremented value to XI and use that counter value for ur file name.
    Here u have to always pass 1 value to R3.
    The method is called as lookup.
    Just go through the below weblog:
    Lookup - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    Thnx
    Chirag
    Thnx
    Chirag

  • How can i generate sequence numbers to my detailed block in Oracle Forms 9i

    Hi all,
    i have a detail block.
    in that block sno (serial no) (multi row column)is one column.
    What i want is when i enter into that block sno should generate automatically....like..
    1 for first record
    2 for second record..
    i need the code for this can anybode help me.
    Venkat.

    Hello,
    You could use the current record number in a When-Create-Record trigger:
    If :block.sequence IS NULL Then
       :block.sequence := Get_Block_Property( 'block', CURRENT_RECORD ) ;
    End if ;Francois

  • Generating Sequence Number

    Hi,
    I have created a Query form. I had displayed the sequence number of the record displayed by selecting rownum from the table.
    Now I have added a order by clause in the query. So the rownum is not displayed in the order.
    I have created a small procedure to generate the sequence number.
    I would like to know from which trigger I should call this procedure.
    procedure resequence is
    v_cursor_record number;
    v_position number;
    begin
    v_cursor_record := to_number(:system.cursor_record);
    v_position := v_cursor_record;
    loop
    :detail.item := v_position;
    v_position := v_position + 1;
    exit when :system.last_record = 'TRUE';
    Next_record;
    end loop;
    go_record(v_cursor_record);
    end;

    Thanks for your reply. I have tried this method.It assigns value only for the first record in the block. As the post query trigger is not passing the control to other items ,though more than 10 records are fetched the sequence is generated only for the first record.
    Any other method to achieve this?

  • Generate sequence nuumber for line items.

    Hi,
    Am using jdeveloper 11.1.1.6.0
    I have generated a form using master detail. po_header as master and po_line as child in po_line i need to generate the sequence number.
    The problem am facing is
    If i generate using create sequence in my DB. Its working fine.
    consider
    I have po_number 1234 for this po_line while i click the add button the sequence number is added. for eg: form 1 to 10 i have the po_line against po_number.
    If am created another po_number 12345 for this while i click the add button the sequence number starts from 11...., But it need to be started from 1 since its a different po.
    Could anyone help me how to acheive this?
    Regards,
    Prasad K T,

    Hi,
    in addition, have a look how you would model the line items in a database schema. Here you would have purchase orders and line items in separate tables that are linked with a foreign key. To uniquely address line items you would have a unique sequence in the line items table. What you are looking for is a combined key (purchase order AND line item ID) to have line items numbered 1 .. 10 (this however, from a database design aspect makes no sense).
    Frank

  • Need to Generate sequence of dates

    Hi,
    Given a Date as sysdate and any number like 10 and we need to generate a sequence of days with an interval on one month.
    we can consider sysdate '25-may-2012' and 10 as inputs to the function and the output need to be something like this.
    else a single select statement shall also work
    '25-may-2012'
    '25-jun-2012'
    '25-jul-2012'
    '25-aug-2012'
    '25-sep-2012'
    '25-oct-2012'
    '25-nov-2012'
    '25-dec-2012'
    '25-jan-2013'
    '25-feb-2013'Please advise.
    Regards

    Just a hint:
    iteration_number starts with 0
    select dt,iter
    from dual
    model
    dimension by (1 as x)
    measures (to_date('25-may-2012', 'dd-mon-yyyy', 'NLS_DATE_LANGUAGE = ENGLISH') as dt, 0 iter)
    rules iterate (10)
    dt[iteration_number] = add_months(dt[1], iteration_number - 1)
    ,iter[iteration_number]=iteration_number
    DT     ITER
    05/25/2012     1
    04/25/2012     0
    06/25/2012     2
    07/25/2012     3
    08/25/2012     4
    09/25/2012     5
    10/25/2012     6
    11/25/2012     7
    12/25/2012     8
    01/25/2013     9no need for -1 therefor ;-)

  • XML insertion/updation using merge and generate sequence number

    Hi,
    I am working on Oracle 11g.
    I have a doubt with XML load.
    I get an xml and I have to insert or update data into a table A. This I can achieve using MERGE statement.
    But there is one column in Table A, that I need to populate with a sequence number, based on the data sent in the xml.
    The xml does not send this column data.
    And I have to make sure the sequence is created based on the order in which records are present in xml.
    For example the MERGE is inserting five rows and then updating next two rows and again inserting 3 rows from xml into table A. The sequence number should be created in the same order for the column in table A.
    Also for each new xml, the sequence starts with 1 and ends with the number of records in the xml. So I cannot create a sequence and use seq.nextval.
    Please let me know, there is a way of achieveing this.
    Thank you!
    Edited by: 934451 on Aug 8, 2012 6:33 AM
    Edited by: 934451 on Aug 8, 2012 6:50 AM

    Hi,
    Following up on your previous thread : {thread:id=2403469}
    You can use the FOR ORDINALITY clause in XMLTable to generate the required sequence :
    MERGE INTO target_table t
    USING (
      SELECT x.seq_num, x.pk_id, x.col1, x.col2, ...
      FROM XMLTable(
             '/root/record'
             passing my_xml_doc
             columns seq_num FOR ORDINALITY
                   , pk_id   number       path 'ID'
                   , col1    varchar2(30) path 'COL1'
                   , col2    varchar2(30) path 'COL2'
           ) x
    ) src
    ON ( t.pk_id = src.pk_id )
    WHEN MATCHED THEN UPDATE
    SET t.seq_num = src.seq_num
       , t.col1 = src.col1
       , t.col2 = src.col2
    WHEN NOT MATCHED THEN INSERT
    (seq_num, pk_id, col1, col2, ...)
    VALUES (src.seq_num, src.pk_id, src.col1, src.col2, ...)
    ;

  • Link Generated Sequence-ID to excel-data

    Is it possible to link the generated ID to the excel-data in my staging area?
    I've uploaded the firstname and lastname of my employees which are stored in an Excel sheet and used the DB-sequence for the PK-column, the employee.ID.
    Now I need to upload the employee-address information which is another Excel-sheet and I would like to use the ID associated with the employee-name as a reference key in my employee-address Excel DataStore.
    Is it possible to use the generated ID from my target datastore in the staging or source datastore?

    Hello Romanna,
    You can put the target table as the source and join it with the others source tables.
    make sure to execute the join in the staging area.

Maybe you are looking for