Auto Increment for BP code in BP master

Dear All,
CAn any one provide FMS for autoincrement of BP as per following manner...
For Customer : Code must start with C followed by the customer first alphabet and then "000" +1
for eg the code must be : CA0001, CA0002, CB0001....and so on
Similarly for Vendor it must be VA0001, VB0001.....
So when user enters the first alphabet the consecutive increment number must be displayed.
s.r.p.

To generate the card code try this FS:
If $[OCRD.CardType]='C'
Select 'C'+substring($[$7.1],1,1)
         +substring(str(max(Substring(CardCode,3,4))+10001,5),2,4)
   From OCRD
   Where CardCode like 'C'+substring($[$7.1],1,1)+'%'
(But the code will be generated after filling the partner  name.)

Similar Messages

  • Bug in auto-increment for MSSQL

    I am using kodo 3.1.0 and have a scenario where I am persisting a new object
    that uses an auto-increment PK and the database has an on-insert trigger
    that inserts a log into an audit table.
    At the database level, what is happing is:
    1) kodo calls "insert into t_timeentry (........)
    2) the database calls "insert into t_timeentrylog (......)
    3) kodo calls @@IDENTITY to get the ID to associate with the new timeentry.
    The problem is, @@IDENTITY is getting back the last identity used,
    regardless of table, so it is returning the id inserted into t_timeentrylog
    and kodo thinks that's the id of the timeentry. In the end, I get a
    optimistic lock exception when I try to update the new timeentry because it
    is trying to update based on the id of the timeentrylog.
    What you need to do is call SCOPE_IDENTITY or IDENT_CURRENT rather than
    @@IDENTITY when you get auto-incremented columns. Unfortunately, those
    functions only exist in SQL 2000 (maybe 7), so people with SQL6.5 (and maybe
    7) are just out luck if they have triggers on inserts.
    Is there a work-around for this? It's causing problems throughout my
    system.
    Nathan

    If the query string you want executed to get the last auto-inc value
    does not rely on context, you can set it easily with:
    kodo.jdbc.DBDictionary: LastGeneratedKeyQuery="<sql>"
    If it is more complex, then you'll need to extend
    kodo.jdbc.sql.SQLServerDictionary and override the following method:
    public long getGeneratedKey (kodo.jdbc.schema.Column col,
    Connection conn)
    throws SQLException
    // if you need the col or table name:
    String colName = col.getName ();
    String tableName = col.getTable ().getName ();
    // execute the necessary SQL to return the last inserted value...
    Then you can plug your dictionary into Kodo with:
    kodo.jdbc.DBDictionary: your.custom.Dictionary

  • Auto increment for order numbers

    I am not sure on how to approach this and if its a backend or
    frontend issue (PHP/MySQL).
    Generally when you order something online the site will give
    you an order number that is naturally unique from other orders. I
    have the order_id field which is a primary key and auto_increments
    starting at "1". Is there a way to make it start at a higher number
    like 100000 or would that be a bad idea? Basically, I don't want
    the user to know they are order #1.
    Or would it be more wise (or even possible) to make another
    field that auto_increments starting at the higher number and leave
    the original order_id starting at 1? If that's the case, how would
    I do that? Is it controlled by PHP or MySQL?

    Those order numbers are usually segmented. For instance, some
    of it is
    based on the order date, some of it on your customer ID, some
    of it serial,
    or perhaps many other things, even your ZIP code or the
    dollar amount. You
    could construct that number at either end once you decide how
    you want it
    done.
    "Eiolon" <[email protected]> wrote in
    message
    news:ec2jgf$2hq$[email protected]..
    >I am not sure on how to approach this and if its a
    backend or frontend
    >issue
    > (PHP/MySQL).
    >
    > Generally when you order something online the site will
    give you an order
    > number that is naturally unique from other orders. I
    have the order_id
    > field
    > which is a primary key and auto_increments starting at
    "1". Is there a
    > way to
    > make it start at a higher number like 100000 or would
    that be a bad idea?
    > Basically, I don't want the user to know they are order
    #1.
    >
    > Or would it be more wise (or even possible) to make
    another field that
    > auto_increments starting at the higher number and leave
    the original
    > order_id
    > starting at 1? If that's the case, how would I do that?
    Is it controlled
    > by
    > PHP or MySQL?
    >

  • Auto increment for file names

    Does anybody know if it is possible to have the 'Open/Create/Replace.vi to search for exsisting files with a specific pattern, like data001.txt, and automatically increment the name so a new file is created called data002.txt
    Thanks
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

    Thanks to both, between the two it looks like I'll be able to do what I want.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Spend Analysis for Commodity Code in ECC6

    Hi,
    I wonder if there is any way for spend analysis references to commodity code in SAP R3 as we are not using SAP SRM?
    If there is any option in ECC6 then;
    a) Which field/view maintained for Commodity code at Material Master?
    b) Which field maintained for Commodity code at /PO/Contract/RFQ/Purchase Requisition (Header level or item level)?
    c) How spend analysis can be reported based on commodity code? (Standard report, Z custom report, BI report)
    Thanks,
    Shah.

    Hi,
    These are the reports available in ECC for Commodity wise reporting. Regarding once maintained in material master, how far these serve your purpose you can test.
    MC.3 This report will help you in getting the information on the inventory turn over ratio by Commodity.
    MC45 This report identifies the share of the usage value to the total usage. You can also see the report graphically for a selected material in detail screen.
    MCE5 This program will give you information on purchase value, invoice value during a selected period. However for these reports it is necessary to update the relevant LIS structure.
    MCEC This report can be used for Purchase budget requirement. However for this report to work, long term planning functionality should be put in use.

  • Auto increment variable in foreach loop in ssis

    i know this has been asked N number of times, but still i have a question for you guys
    i have files sitting in FTP location
    i am loading the data from the files into tables (no issues)
    but i need to assign value to a particular column as -99999999 and then auto increment that number while loading the files into the database
    I cannot have auto increment for the that particular column
    should i use a derived column, script component, execute sql task?
    can somebody point me to the right direction
    if it were a single file, assigning the auto incremental number is easy, but with for each loop, i am not able to get the solution
    Thanks

    Hi Jack,
    To achieve your goal, you can use a Row Count Transformation in the Data Flow Task to get row count for each file, and then use an Execute SQL Task after the Data Flow Task to update the total row count variable. Supposing the variable used in the Row Count
    Transformation is InsertCount, the variable used to store the total row count is TotalInsertCount. We need to set the ResultSet of the Execute SQL Task to “Single row”, and the SQLStatement to:
    DECLARE @Insert_Count INT, @Total_Insert_Count INT
    SET @Insert_Count=?
    SET @Total_Insert_Count=?
    SET @Total_Insert_Count=@Total_Insert_Count + @Insert_Count
    SELECT R_Total_Insert_Count=@Total_Insert_Count
    Then, set the Parameter Mapping of the Execute SQL Task, we map variable InsertCount and TotalInsertCount to the parameters in the SQL statement respectively. In the ResultSet page of the Execute SQL Task, map the resultset to variable TotalInsertCount.
    Please refer to the following screenshot:
    Regards,
    Mike Yin
    TechNet Community Support

  • Auto increment pseudo column

    Hi,
    If I have a sql statement like "select e.name from employees e", how can i add a pesudo column which is auto incremented for each row fetched? So something like
    incr_column name
    1 Jack
    2 Michael
    3 Freud
    Thank you

    how can i add a pesudo column which is auto incremented for each row fetched?
    Using ROWNUM Pseudocolumn :
    SELECT   ROWNUM, ename FROM emp;
    Using LEVEL Pseudocolumn :
    select sysdate+1 from dual connect by level <=30
    USing SEQUENCE Pseudocolumn :
    CREATE SEQUENCE emp_seq
       START WITH 1
       INCREMENT BY 1
       MINVALUE 1
       MAXVALUE 2000
       NOCACHE
       NOCYCLE;
    CREATE TABLE emp1 (empno number , ename VARCHAR2 (30), sal  NUMBER);
    INSERT INTO emp1
      VALUES   (emp_seq.NEXTVAL,'BEN', 5000);
    INSERT INTO emp1
      VALUES   (emp_seq.NEXTVAL,'DVEN', 5000);
    INSERT INTO emp1
      VALUES   (emp_seq.NEXTVAL,'EVA', 5000);
    SELECT   * FROM emp1;
    commit;
    SELECT   * FROM emp1;

  • Auto increment liveevent streamname folder/directory for each publish while same streamid string?

    Is it possible to auto increment a streamname when publishing to FMS?
    Instead of appending to the same folder/directory of the liveevent and stream files when publishing and unpublishing, is there an option to which if a stream is unpublished and republished to starts a new folder/directory _1, _2, _3, etc?
    Or even better, to name the folder with a timestamp of the publish? instead of _1, _2, _3 -- _2012oct8-2101, _2012oct9-0644, _2012oct10-1833
    Thanks.

    Hi,
    I think we should be able to do this.
    First - Do not specify any query string in your publish string. Just say 'livestream'. This means you are not assigning any event name.
    In the livepkgr main.asc, check out the function application.onPublish. When no event name is defined, the application uses the stream name itself as the event name. The code in livepkgr main.asc corresponding to this;
    if (queryString == undefined || (queryString.localeCompare("") == 0)) {
            /* Did not find query string so use the streamname as the event id */
            trace("Query string not specified. Using StreamName["
                  +streamObj.name+"] as eventname");
    Now, to accomplish your task, all you need to do is append some marker to this stream name.
    Essentially here:
    var liveEventName = streamObj.name
    I will leave it to you to make use of timestamps, shared objects etc. to keep track of the event name and incerement it for every publish attempt.
    As as example, if you do something like this:
    var liveEventName = streamObj.name + "Test"
    Your event name will be livestreamTest
    I hope this helps in some way.
    Thanks,
    Shiven

  • How to use auto-increment and search option for MS Access DB

    Dear All,
               I have configured our invoice in Adobe Livecycle and connected it to MS Acess 2007 as per http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/.
    All is working fine, I can insert, retrieve data from DB to invoice and vice versa.
    Now I want few things to be implemented on our invoice.
    When ever I open our invoice, it populate the first entry from DB, Is it possible to populate the last entry ?
    Auto increment invoice number from MS Access DB every time we open our invoice after save.
    How to implement search option from DB for invoice number ?
    Please let me know if someone can provide me help on my scenario, so that I can share more stuff related to invoice and DB.
    Look forward to hearing soon from experts and other team members.
    Thanks & Regards
    Riyad...

    As far as I know there is not any auto increment data type in Oracle. Instead of this you should create a sequence and get the next value of the sequence while creating a row in your table.
    CREATE SEQUENCE Test_Sequence ;
    CREATE TABLE Test_Table ( Id NUMBER , Foo VARCHAR2(4) ) ;
    ALTER TABLE Test_Table ADD CONSTRAINT Test_Table_PK_Id PRIMARY KEY ( Id ) ;
    INSERT INTO Test_Table ( Id , Information ) VALUES ( Test_Sequence.NEXTVAL , 'FOO' ) ;

  • Utilizing auto-increment/identity fields for primary key with "application" identity

    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?

    To the best of my knowledge, you cannot use auto-increment. Due to the
    differences in the way that identities are generated at the datastore
    (upon insert) vs. JDO (upon makePersistent), this feature of SQLServer is
    not supported yet.
    However, we do provide a variety of other ways of generating identity
    which may provide a closer fit to what you want, and
    our users may have some experience in solving your problem.
    On Tue, 28 Jan 2003 09:56:08 +0000, Sean Ryan wrote:
    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?--
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Can we specify prefix for an auto increment column

    Hi all,
    I want to create an auto increment column in oracle using oracle sequences.
    But i want to specify a prefix for the value appearing after increment.
    Prefix will remain constant.
    If we can how can i do that.
    And one more thing is i will call the sequence using a trigger only for a specified condition.My doubt here is can i allow nulls for auto incrementing column
    With Regards

    <s></s>
    -- Samples.
    create table tab1
    (id   varchar2(6) constraint p_tab1 primary key
    ,data varchar2(255)
    create sequence seq_tab1;
    create or replace
    trigger trg_tab1
    before insert on tab1
    for each row
    declare
      p_prefix varchar2(2) := 'AA';
    begin
      if (:new.id is null) then
        select p_prefix||to_char(seq_tab1.nextval,'fm0009') into :new.id from dual;
      end if;
    end
    -- Test
    SQL> insert into tab1(data) values('abc');
    1 row created.
    SQL> insert into tab1(id,data) values('BB9999','xyz');
    1 row created.
    SQL> select * from tab1;
    ID
    DATA
    AA0001
    abc
    BB9999
    xyz

  • BIC Code in bank master for SEPA requirements

    Hello experrts,
    we are currently running R/3 4.7 and I have a question regarding the maintenance of BIC code in bank master data. From next year on, payments inside Europe can/will be made according to SEPA requirements. One requirement is to provide the BIC code and IBAN for the tayment transfer.
    Now in bank master data there is already a field for SWIFT code. Is it enough to maintain SWIFT? Because there is no separate field for BIC. Will the SWIFT flow into the payment document and represent the BIC?
    In short words: Is SWIFT = BIC?

    Hello,
    how are you, iam also implementing SEPA .
    if you done with SEPA please suggest me how to proceed from starting to end steps.
    waiting for your reply.
    Best Regards
    Damodar

  • Auto post indicator for GL code

    Hi Friends,
    Can you tell me the table name where the Auto Post Indicator for GL code is stored.
    TIA.
    Regards,
    Mark K

    Thanks.
    Which table will give the GL code Name.
    TIA.
    Mark K

  • Auto-Increment ID for the Sharepoint 2010 List

    Hi,
    I have a requirement to have a SharePoint List with set of fields. One of the field should store the Custom ID field Ex: "2015-001". Numbers should auto increment the values i.e 011, 002 and so on.
    Can someone help me to achieve this requirement via Out-of-box.
    I tried using [ID] field and tried concatenating to bring up the value as "2015-001" but it didn't work and I read that [ID] field does not work as expected with the calculated column.
    I am aware there SP Designer workflow solution, JavaScript solution, List Adding Event Receiver solutions are available. I trying to find if there is any out-of-Box solution available.
    Share your thoughts/suggestion on this requirement

    Thanks Alex.
    We have used Infopath and we were able to achieve the Auto Increment requirement.
    There is another requirement:
    Created By and Created should be stamped together in the list. Ex: Field Name: Audit Trails - XXX,03/06/16/15, 05:08PM.
    I tried creating a field and used formula to concatenate Created By and Created field...but, When I Submit the form in Sharepoint List, Audit Trail Field is empty.
    I tried Submit/Receive data etc..but no luck
    Any Suggestions or thoughts?

  • Create Auto increment sequence number for list view report

    Hi All,
              Am using BAM 11.1.1.6 version, Have updating list report & wants to create auto increment sequence number at report level. Is it possible to create column at run time in BAM reports.
    Please help.
    Thanks.

    Hi All,
              Am using BAM 11.1.1.6 version, Have updating list report & wants to create auto increment sequence number at report level. Is it possible to create column at run time in BAM reports.
    Please help.
    Thanks.

Maybe you are looking for

  • Calling Web Service from PLSQL. Does anyone do this regularly?

    I grabbed the demo_soap package that is available on both metalink and on the regular oracle site, to try calling a web service from plsql to return the xml. I've had minor success, although I get an ORA600 error , for which I've opened up a TAR. How

  • Final cut express to final cut pro x ?

    Is it possible to move my films from Final Cut Express to Final Cut Pro X ?

  • Alert Log file

    Hi, I'm new at administrating a database (11.2.0.2 on OEL). 1) How often one need to see the alert log file? 2) Why are some Oracle errors not logged in the Alert Log?

  • How to contact adobe

    how do you contact adobe you pay for there products then cannot contact them for help as there contact us page is useless and don't give you a contact email

  • Web WMV files crash safari

    I installed Flip4Mac on my computer. Later, I upgraded to QT Pro. Now, when I try to view web embedded WMV files in Safari, the program crashes. Does anyone know why this might be happening? I didn't like QT Pro so I don't need/want it. I tried throw