Automatic Creation of primary key at the time of creating entries

Hi All,
I have a requirement to generate the primary key automatically at the time of creating entries. I have managed to do so by writing an event code for the maintainance object in SE54.
However called only when I create entries throught the Maintainance View.
It does not get called when I write an insert statement in the program.
Please suggest a way to achieve this.
Thanks in advance,
Archana.

for assigning the primary key while using insert statement, write a piece of code to get the last pk value, increment it by 1 and then assign this value to the pk field of the next record while inserting. if you are using a fn mod to insert values, just have this piece of code right before the insert query. a better way would be to use a GUID which will be unique globally. there is a fn mod GUID_CREATE which you can use to generate GUID. i don't think there is a way to automate this while making entries using se11, unless you change the code that actually creates the entry in the database.

Similar Messages

  • Automatic creation of Material Master at the time raising the PO !!!

    Hello All,
    I am stuck in a scenario of our client which should be implemented (or mapped) in SAP.
    Scenario: At the time of creating the PO (in there legacy system -in house developed) they can choose the items from the existing master data or/and they can also add a new item (which is not present in the master data records at the time of creating the PO).
    Now as soon as the system realise that a new item is inserted into the PO, it will create that item record automatically in the backend (database) and the master data will be present from there on.
    The items they are dealing with are all fashion accessories and they generate order on the following basis:
    1. Demand of particular item in market.
    2. List of items provided by the vendor.
    3. Based on the requirement in there outlets.
    So for them its very difficult to fix there master data records, as it can be changed daily or monthly as per the market conditions. At the same time every time they order, its almost around 100 different items (some time 80 of them are new) in a single PO so they cannot create 80 records manually each time.
    These items are not consumable material so obviously they are maintaining the stock for them. They are also not going to use IS Retail.
    I am not at all sure how can we map this particular practice in SAP, it would be really appreciated if any one could help me on this problem.
    Please let me know if you need any other details from my side.

    Hi,
      As you have two different systems one in house developed and another SAP, and the PO creation part starts from Legasy system which creats the PO in SAP, you can do some development as per below
    1:  While Passing the details from legasy to SAP, use two columns in legasy one will contain the Material Code of ECC (for laready exist material ) and another for deescription of material.
    2: In case material is new for which there is no material master in ECC pass only description from legasy systems.
    3:While getting triggred from Legasy to ECC to create the PO, first check whehter all the material code exists or not in ECC.
    4:If some material are not created (only description present) for those material first create the Material Code using BAPI 'BAPI_MATERIAL_SAVEDATA'.
    5: Aftre creation of Material code create the PO using BAPI ' BAPI_PO_CREATE1'.
    6:For the new created material , trnasfre the master record from ECC to Legasy systemso that next time user can see that material in your legasy system.
    Regards,
    Zafar

  • Automatic creation AUC sub assets at the time of settlement

    Hi,
    I have created the investment profile,AUC asset class,Source structuce(Hard,Pave and Soft) and cost element group(Hard,Pave and soft) . Then assign these three source structure to Investment profile.
    I created WBS element under project and released the WBS.
    After that I posted the values against the WBS different cost element . At the time of AUC seetlement thru CJ88.I am getting Three AUC asset with Sub number -0(1000-0,1001-0 and 1002-0) automaticaly. But Business is expecting to settle automatically(1000-0(Hard),1000-1(Pave),1000-2(Soft) respectively.
    Is there any way to settle AUC sub asset wise(Eg: 1000-0, 1000-1 ans 1000-2)automatically.
    Please share your suggestion on this.
    Appreciate your help!
    Regards,
    Prakash Reddy.

    Hello VIrendra,
    I am trying to settle WBS to AUC settlement thru CJ88. In this case We need to settle WBS to  AUC sub number wise 0,1 and 2 respectively based on the cost element. Is there any settings required to create AUC asset sub number wise creation?
    Thanks& Regards,
    Prakash Reddy.

  • Automatic creation of BP relationship at the time of creation of BP

    When a user creates a new account using BP transaction we need to create a 'Has the responsible employee' relationship automatically. If we try to create the same on save ( Using function BUPR_RELATIONSHIP_CREATE in BAdI PARTNER_UPDATE ) it doesn't work as the account would not have got created at the time of save. Hence we took a different approach of trying to create the relationship when the user clicks on 'Relationship' button ( in portal it is 'Relationship' tab ). We couldn't find a suitable BAdI which would contain the details of the recently created account as its import parameter.  Is there any other approach we could use to solve this issue? Please let me know your ideas on the same.

    Hi,
    You can implement this functionality using the BDT.
    --> in the PAI event, update the relationships in memory using function BUB_BUPA_RELATIONS_MODIFY.
    For BDT use, take a look at the following thread:
    Re: How do I update custom fields in a partner when I save the record?
    Michael.

  • Automatic Creation of Sales Order at the Time of PGI

    Hi Experts,
    Is it possible to create automatic Sale Order at time of PGI "while creating Outbound deleivery w/o reference to Sale Order'?
    Like in MM there is feature (standard) that PO can be create through Inventory management also,
    at the time GR w/o PO system creates PO in background.
    Please help me out,
    Regards
    Arvind

    Hi Srinath,
    Thankx for u'r immidiate reply,
    "This is my business requirement in implementation, i.e. customer directly purchase Organic Manure from plant stock and pay bill against the quanty purchased." although the reoprting purpose will be resolved by sale bill report."
    And as we know that Document (copy controls) flow from Inquiry>Contract>Order>Out bound deleivery>Billing. this is standard in the system.
    i.e. Copy Order to Order (VTAA)
    Order to delivery (VTLA)
    Order to Bill  (VTFA)
    Del to Bill (VTFL)
    This T-codes have assignments of source to copy in the target with routins (for the flow of data from field to field)
    I am trying to understand that flow of data to be copied in backward flow i.e. from PGI to order, and i am expecting that this can be done, but unable clarify my self that should it be done or not.

  • Automatic Clearing of Down payment at the time of creating Invoice

    Dear All,
    I have created a Service Purchase order. This is assigned to a WBS element.Then i created a vendor downpayment request against this order using F-47 then posted same from F-48. Then i created service entry sheet and accepted it.Now when i am creating a invoice in MIRO for this Service order, system gives an information message that Downpayment exists. But invoice amount is not reduced by the amount. Also downpayment is not reversed automatically. Is there any way to achieve this? I had to manually Clear downpayment after invoice is posted.I want that to happen automatically.
    Regards,
    Kamal

    Hi Rafi,
    Thanks for this information. We are running on ECC 6.0 / EHP4 & also the biz funtion activated. .
    As of now, we are receiving just an info msg at the time of MIRO.
    Is mere activation of this biz funtion enough or do MM & FI need to configure something to achieve automatic downpayment clearing?
    regards

  • How to get the new Primary Key after the Automatic Row Processing (DML)

    Hi,
    I have a nice master detail form.
    I want, immediately after submitting the page when creating a new record in the master table, that the user may input the associated table (the detail table). For that I have created a branch that goes back to the very same page after creating the record (ie submitting the page with the button Create). In the Action of the branch, i have put P30_FICHE_ID (the item containing the primary key of the master table) with its value : &P30_FICHE_ID.
    Unfortunately I see that the item is not populated with the very new primary key. it seems normal becaus after submitting the page the tiem is not populated. This is my question : how to retrieve the newly created primary into the item P30_FICHE_ID in order to begin immediately to add rows to the detail table ?
    Hope I'm clear. My english not perfect.
    Thank you for your kind help !
    Christian
    Edited by: Christian from France on Oct 16, 2009 6:36 AM

    Christian,
    After creating Master-detail form, goto your Detail page. In this page you can see one conditonal brach which will point to 'Master' page.
    Edit this branch and here you can see this branch fires when request is in 'SAVE,DELETE,CREATE' (in Expression1). Now change the value in Expression1 to 'SAVE,DELETE'. This will do the needful :-)
    Cheers
    Hari
    Edited by: Hari_639 on Oct 16, 2009 8:02 PM

  • Auto Creation of Storage Location at the time of Goods receipt

    Dear All
    Please tell me how can i create storage location automatically at the time of Goods receipt.
    i already made the configuration in OMJ8 for movement type and required plant
    still, at the time of creating PO its not getting created..
    Please advice
    Narendra C.

    Hello Narendra,
    If you are trying for automatic creation of strorage location for goods movement to special stock, then ithe data will nit be created. This standard SAP functionality.
    Also if you have maintained storage location in the preceeding documents, then it will automatically fetched during goods reciept.
    BR,
    Tushar
    Edited by: Tushar Patankar on Feb 4, 2011 12:50 PM

  • Without equipment creation serial number required at the time of delivery?

    Dear SAPIENTS,
    Without equipment creation serial number required at the time of delivery? In customizing i have defined that equipment not required in serialization profile. But still i am getting equipemnt number at the time of delivery of sales order.
    Regards,
    Kaushal Rai

    Dear Venu,
    You want to generate Alphanumeric Serial Number that is possible by following Enhancement for Serial Numbers:
    Pls find here some details about generating alphanumeric serial numbers as below :
    You can generate alphanumeric serial number with the following BADI / Customer Exit:
    Name of Enhancement : IQSM0001
    Name of Function Module Exit: EXIT_SAPLIPW1_001
    Name of Include : ZXQSMU01
    ZXQSMU01:
    This user exit can be used to create the serial numbers automatically for material of a production order. Number of serial numbers generated will be equal to the total number of quantity. The purpose behind development of this user exit was to attach prefix in each serial number generated.
    so as per your requirement you can generate serial number like ABC0001 etc.
    Process Steps:
    For exit: EXIT_SAPLIPW1_001
    1. Get serial number profile for a material in respective plant.
    2. Check if the profile is u2018XYZu2019.
    3. If profile is u2018XYZu2019 generate the serial numbers for the given quantity of material in production order.
    General Program Structure
    For exit: EXIT_SAPLIPW1_001
    1. Get the serial number profile using function module 'MARC_SINGLE_READ' for a material.
    2. Check if the profile is u2018XYZu2019.
    3. If the serial number profile is u2018XYZu2019 then generate the serial numbers for the given production order quantity of a material.
    4. Concatenate ABC as a prefix to the all generated serial numbers
    Provide above details reg. implementation BADI / Enhancement to your ABAPer and go ahead.
    You can implement above Enhancement in CMOD.
    Hope this helps.
    Revert in case of any doubt.
    Award points if useful.
    Regards,
    Tejas

  • About Automatic generation of Primary key

    I have created one Z table. Its composite primary keys are vkorg
    and Sales Representive Number. I have to assign Sales Representive number
    through system. How it should be done?
    Message was edited by:
            Nilesh Vakil

    Nilesh , You asked the Same question in ABAP General
    Please Refer the link.
    Re: About Automatic Generation of Primary key
    Regards
    Rusidar S
    Message was edited by:
            Rusidar Subramani

  • Automatic and manual batch determination at the time of Goods receipt

    hi,
    where i can have the settings for automatic and manual batch determination at the time of Goods receipt and goods issue..
    E.g.: If i am receiving material from vendor then my requirement is system will generate batch automatically...
    Where  we can get this setting?
    Tx
    Uts

    Dear,
    You assign the batch number either
    Manually
    Automatically, using internal batch number assignment, refer to Customizing for Batch Management under Internal batch number assignment.
    Internal batch number assignment is activated for the complete client, unless you exempt individual plants or materials using a customer exit (see Configure customer exits for intern. batch number assignment in Customizing for Batch Management).
    The R/3 System informs you that the internal batch number assignment is active. You are however only informed once per transaction, for example, when you enter the first item on the multiple-entry screen.
    Please refer: http://help.sap.com/saphelp_45b/helpdata/en/25/283cb44f7811d18a150000e816ae6e/frameset.htm
    Regards,
    Syed Hussain.

  • TS3694 I bought the iphone 5 has not been one week do not understand why the home key of the time activities at stops working, not crash or fall. hope its help, probably due to software, not hardware failure, what do I do now?

    I bought the iphone 5 has not been one week do not understand why the home key of the time activities at stops working, not crash or fall. hope its help, probably due to software, not hardware failure, what do I do now?

    Restore iPhone with current iTunes on computer. See if better. If still problem, make Genius reservation or set up Service and take or send to Apple for resolution. Of if easier for you, take receipt and iPhone, box and everything and return to where you bought it.

  • DBMS_CDC find only the columns that are changed along with the primary key in the table

    Hello,
    We are having a requirement to find the change data in the production environment.
    We are planning to use the DBMS_CDC utility.
    But for  example in the create change table 1 picked emp_id,ename, address, salary,dob.
    I have a sample data of
    empid
    ename
    address
    salary
    DOB
    1
    test1
    24 test street
    2000
    20-Jan-98
    2
    test2
    25 test street
    2500
    15-Aug-97
    if ename for empid 1 is changed to test1_test3 from test1.
    My CDC is capturing  the values in the old and new values in the 5 columns.
    But i need to get only the empid (primary key of the source table) and the ename column as only that's been updated not the rest of the 3 columns.
    Can i accomplish this.
    Please advice.

    Hello,
    Thanks for the information.
    but if i change the change table  then i will miss the other columns right?
    I want to get the columns( empid and ename) only if ename is changed. i.e when ever any column in emp table changes i need to get all the columns where the data is changed along with the primary key columns empid.
    Is there any way i can tweak the parameters so that i can achieve this or is there any other way using the cdc i can get this data.
    Thanks

  • Creating a primary key with the parallel option and the tablespace option

    I know I can create a unique index with these options and then make the primary key with the "using index" clause. anyway to do this and skip the create unique index and just create the primary key ?

    SQL> ALTER TABLE t
      2  ADD CONSTRAINT pk_t
      3  PRIMARY KEY (testcol)
      4  USING INDEX
      5  TABLESPACE example
      6  PARALLEL (DEGREE 2);
    PARALLEL (DEGREE 2)
    ERROR at line 6:
    ORA-03001: unimplemented featureYou can name the tablespace but you must do an alter index thereafter.

  • How do you change the value of the primary key in the CMP?

    Hi,
    The cmp that I built has the phone as the Prikey field.
    The bean has the get/set methods. The servlet invokes the cmp
    to change the phone number. How could I do that?
    The setXXX for the priKey can not be called outside of the ejbCreate() so
    how would I change the prikey value of a particular row of the table. Do I have
    to remove the bean then create the new bean with the new priKey value?
    Please help,
    Thanks

    Thanks Mona
    Tom.
    Mona Ramlawi <[email protected]> wrote:
    Hi TOM,
    The primary key is the unique identifier of an Entity Bean.
    To change it, you have to remove the bean instance = database delete
    then you have to create a new one with the new primary-key value =
    database insert.
    Hard luck tom, maybe you should consider changing your primary key. You
    can easily change it to an AutoNum
    Tom wrote:
    Hi,
    The cmp that I built has the phone as the Prikey field.
    The bean has the get/set methods. The servlet invokes the cmp
    to change the phone number. How could I do that?
    The setXXX for the priKey can not be called outside of the ejbCreate()so
    how would I change the prikey value of a particular row of the table.Do I have
    to remove the bean then create the new bean with the new priKey value?
    Please help,
    Thanks

Maybe you are looking for

  • How to reference a column value in a particular block.

    I am having problem in referencing a column in a particular Block in WEBi report. Scenario: I have only one query in the query panel and i am creating a sample report having different blocks.                Now there are four blocks in my report,    

  • How to extract data from ODS to non-SAP system

    Hi, Can anybody tell me, step by step, how to extract data from ODS to a non-SAP system? Is it possible to do it without programming effort? And is there volume limits for this kind of extraction? The non-SAP system is an unix system. Thanks in advan

  • How can I avoid having to save edited photos to desktop?

    I use iPhoto '09 for organizing my photos and Photoshop Elements 6 for Mac for editing my photos, most of which are JPEGs. My procedure is to make a duplicate of the photo I wish to edit and then hand it off to PSE 6 for editing via the Edit in Exter

  • What exactly is photo stream?

    I have just upgraded to lion on my iMac and had already brought my iphone and ipad up to iso5.  I turned on photo stream and a few other things in icloud, like notes, etc, but not contacts or book marks, I don't want all of them from my imac on my ph

  • I have no idea how to use the new "messages" instead of ichat

    i have recently got my first macbook. it isnt the first time i used one.  my friend has the macbook pro as well.  she has the "ichat" app for connecting with her friends.  but i have the "messages" app and i have no idea how to use it.. i cant find t