Populating custom tables via Table Events.

Hi  ,
I have a ztable having the following fields:
MANDT
FAREA
REVID
NAME
EMAIL
Out of this fields I need to populate the field REVID  and EMAIL from two standard table USR21 and ADR6.
Like if I  enter user id and hit enter  tab, then the fields like  email address will automatically be fetched from given tables and populated
I found that via tablemaintenance --> events this can be done.
Can you please suggest as to how to proceed with the coding...do I have to use Select from those standard tables and then pass it to the ztable.
Please help.
Thanks,
Suchi.

I have created  a event via the table maintenance generator-environment events.
I have used 05-- create new entry as the event code and inserted the following code :
FORM zat_newentry.
  TYPES : BEGIN OF ty_requester,
          bname      TYPE usr21-bname ,
          persnumber TYPE usr21-persnumber,
          addrnumber TYPE usr21-addrnumber,
          END OF ty_requester,
          BEGIN OF ty_addreq,
          persnumber TYPE adr6-persnumber,
          addrnumber TYPE adr6-addrnumber,
          smtp_addr TYPE adr6-smtp_addr,
          END OF ty_addreq.
  DATA : i_requester TYPE STANDARD TABLE OF ty_requester WITH HEADER LINE,
         i_addreq TYPE STANDARD TABLE OF ty_addreq WITH HEADER LINE.
  SELECT bname
         persnumber
         addrnumber
         FROM usr21
    INTO TABLE i_requester
    WHERE bname = zinf_reviewer-rev.
  IF i_requester[] IS NOT INITIAL.
    SELECT persnumber
           addrnumber
           smtp_addr
           FROM adr6
           INTO TABLE i_addreq
           FOR ALL ENTRIES IN i_requester
           WHERE persnumber = i_requester-persnumber
           AND addrnumber = i_requester-addrnumber .
  ENDIF.
  zinf_reviewer-rev = i_requester-bname.
  zinf_reviewer-email = i_addreq-smtp_addr.
endform.
But while trying to create a new entry I am getting the error message saying : "An entry with the key already exists".
Please suggest.

Similar Messages

  • Calculations while entering data into table via table maintenance generator

    Hi all,
    This is the following requirement.
    I created a ztable and also I created the table maintenance generator.  I have two fields which accept integer data.
    The requirement is when I enter value in the first field from the tcode SM30 the data should be populated into the second field automatically by subtracting the first value from 100.
    Can anyone explain me how I can do that.
    Thanks,
    Daniel

    hi,
    take the help of events in TMG and write the code in that event
    like field2 = field1 - 100
    steps to create events
    Step: 1: Create a table
    Step: 2: In SE11, go to Utilities --> table maintenance generator.
    Step: 3: Follow the path Environment --> Modification --> Events.
    Step: 4: Click new entries, select a table maintenance dialog event which suits your requirement.
    Step: 5: Create a form routine.
    Step: 6: Include your logic in the routine created in step 5.
    Hope this helps you.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc
    Re: bdc
    reward if helpful
    prasanth

  • Dynamically changing name of JPA Table via @Table(name=..)

    In my application I need to change dynamically the name of a table to create, which is annotated
    via @Table(name="MyTable")
    The problem is that the application handled all tables with an internal prefix so that MyTable would
    be changed to something like "application1_MyTable". In xml mappings it is possible by injecting
    a modified version of the xml mapping content, in plain jdbc only dynamic statements must be used
    for this kind of renaming. But how can I achive this with (immutable) annotations?

    Serethos_0 wrote:
    No, I'm betting that you really don't.
    Sounds like a very bad design.
    I'd be shocked if you could manage to give a good, coherent reason beyond "because I said so".There is always a trap which can force you to support a bad design despite better knowledge:Or, if you're really smart, refactor the trap out of existence.
    legacy issues. Depending on the project an old chunk of application code lets you only change
    design to a certain degree (based on time, effort, dependencies to other systems). In my case
    there is a need to keep the distinction of tables by a dynamic prefix.I'll agree that I might not understand fully. Why not temporary tables or materialized views? Is your idea the only way to accomplish this?
    %

  • Block sensitive table via Table browser

    Hello
    We have implemented HCM on out existing R/3 and now we have all the sensitive data in the production.
    In my production system there are some users who has SE16(data browser) and thet can dump those sensitive data from the production system.
    I want to restrict those sensitive data for non HR users.Can any one guide me that how to do.I have some small idea this can be done trough authorization object.(S_TABU_DIS)
    Pls provide me step by step procedure guide for this.I am totally new to SAP Basis and pls provide me the procedure doc if u have.
    Thanks
    Roshantha

    am not a basis guy but creating an authroization object and restricint it via profile would do the trick. pls check it....u can restrict at table level only for the users and not at data level

  • Strange data inserted into table via table trigger

    Hi ,
    There is some strange phenomenon happen occasionally where some tables update records will have a TRIGGER to insert records into a table and once in a while, the record has some strange data inserted which looks like a memory corruption. It is running on 10.2.0.3.
    Does anyone ever encounter this before?
    Strange result:
    PRIM_KEY
    -3.614364951000000000000000000000000E-47
    -3.614364951000000000000000000000000E-47
    Normal result:
    PRIM_KEY
    1137KT
    1137KT
    ana

    Hi,
    What is strange in this? Its not memory corruption. Its just one of the numeric form of representation of number
    -3.614364951000000000000000000000000E-47it means -3.614364951 * 10 to the power of -47.
    Whatever value has been entered into the table depends on your business logic you coded, and user input.
    Regards

  • Customer Classification..table update AUSP

    Hi Guru's
    I have to update the customer classification via table AUSP
    Table AUSP is only table which stores the Information Characterstics Values maintained for a Class type.
    I am updating this table directly via Z program.
    data : it type STANDARD TABLE OF ausp WITH HEADER LINE.
    it-objek = 'N231512'.
    it-ATINN = '0000000068'.
    it-atwrt = 'ST'.
    it-klart = 'Z01'.
    it-mafid = 0.
    it-atzhl = '001'.
    it-adzhl = '0001'.
    it-mandt = '200'.
    APPEND it.
    MODIFY ausp from table IT.
    But when i am going in XD03 to see the characterstic value (ST in this case) . Then ST is not getting set in XD03 classification view.
    also when i am setting the same value ST via XD02 then value is getting updated in Table AUSP with duplicate entry what i have updated via above progm.I don't know how table is allowing duplicate entry.
    suggest me  somthing
    Best Regards
    Subham

    Hi,
    Please don't update directly to the table AUSP.. Also the ATINN will be different in each client for one particular classfication data..
    I would suggest use the LSMW
    Standard Batch/Direct Input
    - Object: 0130
    - Method: 0002
    - Program name: RCCLBI03
    - Program type: D
    Regards,
    Nagaraj

  • Change/display customizing tables via IMG only - SM31

    Hi Experts,
    I've posted this message previously in another forum area on SDN. In the absence of a response, I've posted it here, hoping that this is a more appropriate area.
    We are attempting to maintain table LRF_WKQU through SM31 in our QA system.
    The following message appears:
    Change/display customizing tables via IMG only
    Message no. SV000
    I've also noticed that a number of other tables show the same response.
    We are able to perform maintenance of this table in our Production system via SM31.
    I've checked the table properties, and they are the same on both systems.
    Does anyone know if there is a system setting or such like, that will allow for maintenance of tables via SM31 and not the IMG?
    Thanks,
    Chris

    Why do you want to change customizing tables outside the IMG. In the case of this table LRF_WKQU you mention there are a few more tables which might also be updated  when you use the IMG. Without IMG the risk is very big on inconsitencies.
    The other tables being updated through IMG (for table LRF_WKQU) are
    T346
    T346T
    T346L
    Whe you use SM31 (or SM30), these tabels will not be updated. This does not have to cause a problem, but I think for that reason (because it MIGHT cause a problem). SAP shows you this message.

  • Error while determining ref.mov.type for WM via Table 156S: 647/ / / /L/ /

    Guyz,
    Firstly despite the plant+storage location + warehouse no. assignments are done , my replenishment delivery (delivery for stock transport order between plants under same company code) is not picking up storage location and warehouse no and thus stopping me from doing picking and PGI (post goods issue).
    However in VL02N when i'm trying to change storage location for line item, i'm getting following weird error
    *Error while determining ref.mov.type for WM via Table 156S: 647/ / / /L/ /*
    I found a SAP Note(133223) regarding this error and VL02 transaction but that note was specific to older versions. I'm on ECC 6.0
    Any suggestions please ?
    Thanks

    Warehouse managment has its own movement types, most identical to inventory management movement types.
    These WM movement types are determined via reference movement types.
    the error you have just looks like your customizing is not complete.
    IMG > LE > WM > Interfaces > IM > define movement types.

  • Loading some records into Custom-R/3 table manually

    Hai
    I created one custom R/3 table. One of my friend load some records into that cutom table manaully. I want to load some more records manually.
    So how can i load some records into the custom R/3 Table manully . Please let me know
    i ll assing the points
    kumar

    Hi,
    you can do it with SE16 / SE16N or, if exists, via the maintenance tool SM30.
    Out of an excel sheet with the same structure can can copy the entries completey by cut & paste.

  • Table used in Event Alert

    Hello everyone,
    Is is possible to use a custom table (a table I created) for being used in an Event Alert?
    I tried, but when I wanted to enter it in the Event Details, the table was not in the List of Values.
    Thanks!

    Hi,
    Please see the following documents.
    Note: 103418.1 - Beginner's Guide: Create a Custom Event Alert to Fire against a Custom Table
    Note: 106642.1 - How to Save an Event Alert Calling a Custom Table in a Custom Application
    Note: 60879.1- How To Setup Custom Oracle Alerts On Custom Applications
    Note: 153113.1- Custom Event Alert not Firing
    Regards,
    Hussein

  • Inserting Into MYSQL Table Via Air/PHP = Not Allowed?

    I'm having trouble inserting data into my mysql database tables through my air app. All the code is pretty much exactly the same as in some examples I've seen but it simply won't do it. Is this because of some sort of security restriction because the air app is on my machine and the server with my mysql database on is elsehwhere? Or is it possible to insert data via an air app?
    Here is the example I've been following:-
    http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html

    jimmyoneshot wrote:
    Thanks for the answers boys. I've decided I'm going to change it into a flex app instead as then there won't be any problems. It simply means I'll have to add a logon system to it.
    While were on the subject do you guys happen to know of any examples anywhere of how someone can REMOVE data from an sql table via flex/php?
    What I'm looking for is basically when a user uses my app and enters info into some text inputs, if that specfic info exists within a table then that data will be removed from the table. The way this works is that they will choose an item within a tilelist which is populated by the data from this mysql table and this will insert the data of the selected item into the text inputs and then they click a remove button to remove that item. Can't find anything similar anywhere though.
    You will have to use a common identifier, eg:
    give each row in your database an ID.
    then pass that ID value on the button press to a PHP script, which does something like:
    $deleteID = $_POST["delID"];
    mysql_query("DELETE FROM exampleTable WHERE ID='$deleteID
    maybe check that a row with that ID exists first for verification, then pass back a value indicating if removal was a success or not.
    You can delete on other values, but remember they have to be unique for the database, else you'll run the risk of deleting multiple values.
    Or you could delete on a compound key, depends on the data you're storing in the grid.

  • Updating Custom field in Table BUT000 using BAPI 'BAPI_ISUPARTNER_CHANGE'.

    Hi,
    I have added a new custom field in table BUT000. Now i want to update that field with 'X' and i have used EXTENSIONIN parameter in the BAPI 'BAPI_ISUPARTNER_CHANGE'. i have populated the field name(Custom field name) and value 'X' to that structure and passed to BAPI. But that field value was not getting updated. So can any one help me how to resolve this issue.
    Thanks,
    Sushma

    Hi Ravi,
    Thanks for your response.
    I have passed the Structure name  in parameter EXTENSIONIN, but still i am facing the same problem.
    Thanks,
    Sushma

  • Error at reading RSQONCOND system table via RFC_READ_TABLE

    Hello dear experts,
    I try to read RSQONCOND system table from our external java application via JCO and RFC_READ_TABLE function but receive the following error:
    Could not execute function '[MBI_SAPBW_F0012] Could not execute function 'RFC_READ_TABLE'. Error with ASSIGN ... CASTING in program SAPLSDTX .'. Table: RSQONCOND; columns: INFOSET, ONCOND; where clause: (INFOSET EQ '0SRVE_IS1') AND OBJVERS EQ 'A'
    We used our code successfully with other system tables but in case of RSQONCOND  we got this error, so our code must be fine (if this particular request doesn't require some specific attributes or settings).
    One more thing... I noticed that WCOND attribute in RSQONCOND is of String data type, can it be the cause of the error? But at the same time error takes place even when I try to retrieve the only one record without WCOND attribute (e.g. just INFOSET).
    I also have the same error if to use SE37 transaction with RFC_READ_TABLE  and the RSQONCOND table name in parameters.
    Is it possible to get data from the mentioned system table via RFC_READ_TABLE at all? What the cause of the error? Does any alternatives to RFC_READ_TABLE exist to get the data I need?
    << Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
    Thanks in advance,
    Vova
    Edited by: Rob Burbank on May 20, 2011 4:22 PM

    Thank you very much, Sandra for your reply.
    Unfortunately I'm limited by the scope of our application and cannot make any changes on the SAP server, so adding our own custom functionality on the SAP servers is not an option.
    I've also found RFC_GET_TABLE_ENTRIES which doesn't throw an exception but returns somehow encoded values of the STRING datatype (for example from the RSFOBUEV000 or RSQONCOND tables). So, one of the way out is to decode values but I cannot find how.
    Does somebody know how to cope with the issue of retrieving values of the String datatype from third party applications without modifying SAP server?
    We use java and jco library to get access to SAP server.

  • Users details not getting populated in the portal tables..

    Hi,
    We have implemented single sign on (SSO) and we do not create users in the portal as user/pwd come from OID.
    Now becoz of this the portal tables are not getting populated.I require that all the users of the OID to be populated in the portal tables. How can I do it.I depserately require it.

    You can use the function wwsec_api.activate_portal_user to create the shadow records in the portal repository.
    Ref. : http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1014/wwsec_api.html

  • Custom Infotype - Using Table control in the screen.  IN OM

    Hi,
    I am having a requriement where in I need to create a custom infotype using table control in the screen. I have to create this in OM and I am using PPCI transaction to create the info type. I am able to create the infotype with fields but not table control. Please let me know if any one of you came across and help me with the process I need to follow.
    Thanks in advance.
    Venkat.

    Hello,
    After you create the info type throug PPCi, you can directly go to the Sceen module program created automatically while creating Info type and edit the screen.
    activate it after your changes.
    Regards,
    Srujan.

Maybe you are looking for

  • Scroll Bar is not coming when creating Excise invoice in case of Depo Sales

    Dear All, We are upgrade system from 4.6 C to 6.0, when we create Excise invoice for Depo with reference to Delivery document no., when i am enter and select the item and go to excise invoice tab(incoming) there i dosenot get scroll down option which

  • Prepared stmt

    How does 'Like' keyword work in prepared statement. It is not working when I am trying to use the following statements.... squery = "SELECT COUNT(*) As COUNT FROM table_name WHERE RTRIM(LTRIM(column1)) LIKE ?"; pstmt = con.prepareStatement(sQuery) ps

  • Border around button on mouse over

    hi, I am trying to get a white border around a buttonwith green background on mouse over but the button always get filled with blue. <Button Height="35" Grid.Row="0" Background="Green" Grid.Column="1" Width="80"> <Button.Style> <Style> <Style.Trigger

  • Dear APPLE please make app that record screen. Thanks Good Bye

    Please make this app I want make a Let't play

  • CS5 12.0.4 CPU use when idle.

    12.0.4 has caused Photoshop CS5 to use approximately 15% of CPU under OS X 10.6.7, even when no documents are open. I haven't made any changes to my system save for the update. As I need Photoshop to be open often while I just look at a couple of pho