How to restrict the entries of a database table based on the user name

Hi All,
I have created a Database Table. Table maintenance generator is generated for the table.
UNAME(user name) is one of the fields in the table. whenever the user creates a new entry, the field UNAME will be populated automatically with SY-UNAME value. I have used Table event '05' to do this.
My requirement is...
When a user tries to maintain the entries of the table using SM30, when 'DISPLAY' is chosen, all the records of the table should be displayed.
When 'MAINTAIN' is chosen, only those records which have UNAME = SY-UNAME(User Logged in) should be in EDIT mode. and rest all the records should be in DISPLAY mode(greyed out). It should allow to edit only those records which are created by the user logged in.
Could you please tell me how to do this..? Thanks in advance.
Thanks & Regards,
Paddu.

HI,
In table main. gen there are number of events , try to select one event like 05 for the Sy-uname.
For the  requirement:
In that event write the code like
this is basic idea not the code:
Case ' Sy-ucomm'.
when 'display'.  " button
   Nomally for the display button it will show all the records, but we need to write a code like this.
select all records frm the table.
( Need to write the code in case if the user first maintained the data then again press the display , list has to be refreshed.)
when ' Maintain'. " button.
Fetch the records that are with SY-UNAME and find out the edit function and implement it on each and every record.
endcase.
Thanks and Regards,
Bharani.

Similar Messages

  • How to retrieve deleted entries of a database table

    Hi,
    I accedentally deleted database table from se14.
    how to retreive the table of entries.
    regards ,
    Rajesh

    you did not assigned any point to any one i guess... its not how we thanks to an answer on sdn community. (whether it had helped u solve ur problem or a concrete answer with not possible)
    But i am pretty much sure you can restore from ur latest backup and you could get your table along with data. in case u are not still gatting it. then probably you need to restore DB strcuture first (i know in AIX OS you can make a copy of DB structure using MKSYS command ) which will create structure of database and then you can restore the same backup which we are talking about using restore procedure.
    Mandeep

  • How to make data entries in a database table field as a hyperlink?

    Hello all,
    I am designing an application in BSP. The requirement is to  make some of the entries in the database
    tables as hyperlink values.
    I have a database table which has a field "country feature". The scenario is  that the user can enter any value in this field through view. The value can be a hyperlink or a free text, depending on the user requirement.
    Is there any way by which the user can enter hyperlink values in the particular field in a database table?
    Thanks in advance for your help.
    Gurmahima.

    Hey Gurmahima ,
    This is sample code for Selecting and deselecting all the checkboxes .
    All you have to do is Set a pf-status and follow the code logic .
    Here w_check is the check box field , w_line is the line your raeding and w_lines is the total number of lines(entries ) you have in table .
    set pf-status 'SELECT' .
    case sy-ucomm .
        when 'SELECTALL' .
          set pf-status 'SELECT' excluding 'SELECTALL' immediately.
          w_line = w_line + 3  .
          do w_lines times .
            read line w_line field value w_check .
            if w_check = space .
              w_check = 'X' .
              modify line w_line field value w_check.   
              add 1 to w_line .
            endif .                        " IF W_CHECK = ' '
          enddo .                          " DO W_LINES TIMES
          clear w_line .
        when 'DESELECT' .
          set pf-status 'SELECT' excluding 'DESELECT' immediately.
          w_line = w_line + 3  .
          do w_lines times .
            read line w_line field value w_check .
            if w_check = 'X' .
              w_check = space .
              modify line w_line field value w_check .
              add 1 to w_line .
            endif .                        " IF W_CHECK = 'X' .
          enddo .                          " DO W_LINES TIMES
          clear w_line .
    Hope you get it!
    Much Regards ,
    Amuktha .
    Edited by: Amuktha Naraparaju on Feb 5, 2009 6:22 AM

  • How to create mass entries in a database table

    Hi,
    I am going to do a program that can help me to charge registers in a database table. The origin of the registers is an excell file, that contains 39000 entries.
    In other programs I use this function: 'ALSM_EXCEL_TO_INTERNAL_TABLE' but this function can only read 9999 registers. So I ask for us if There is another function that can help me. The other possibility that I think is call many times this function but If is possible to find another function, I guess that is better.
    Thanks and regards.

    Please allow me to translate "charge registers" into "create entries".
    This function module works quite simple via the clipboard, you could take the code and create your own version that allows more rows. However there might be a bottleneck at some point due to your local PC power.
    You could also store as CSV or TXT and use GUI_UPLOAD function or the "frontend" classes.
    For more performant processing the data would need to be transferred to the application server and uploaded from there using OPEN DATASET and so on, please search for more information.
    Thomas

  • Maintain the entries in /IXOS/DC_TALNTUA table

    Hi,
    I want to modify the entries in /IXOS/DC_TALNTUA table for maintaining the archive mode for a particulat user.
    Is there any transaction/config  to maintian this table in SAP?
    Thanks& Regards
    Manoj  Seth

    Hi Manoj ,
    You can do this by table maintenence SM30.
    You should also confirm  that is their any existing report to do so , As per my understanding there should be as we do not handle these cases by making direct entries in table. Please confirm from your side.

  • Determining the relationship between 2 database tables

    hi all,
    is it possible to write a java program that can determine the relationship between 2 database tables, given only the database tables? can you provide examples please? thanks.

    java.sql.DatabaseMetaData provides the methods ....Just as long as the relationships are simple and the database and driver are known. For example there is no way that it is going to be able to tell you about a trigger that connects two tables.

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • How to search this value in oracle database to find out the table

    Hi expert,
    I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
    Many Thanks,

    918440 wrote:
    Hi friends,
    this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
    Handle:     918440
    Status Level:     Newbie
    Registered:     Mar 2, 2012
    Total Posts:     20
    Total Questions:     10 (10 unresolved)
    why do you waste time here when you NEVER get any answer to any question you post?

  • How to restrict update to a document in state release to the contribution g

    How to restrict update to a document in state release to the contribution group.
    Hi I’m working with UCM 10g and I want to know if it is possible to restrict the update over a document that is on state release for the group of users that made the check in of the document ?
    thanks

    Yes, it is, but IMHO in a rather complicated way:
    - you could change the security settings (security group, or more likely, accounts) during the life cycle, or
    - you could implement collaboration management, and change security settings via ACLs
    Alternatively, depending on what you mean by "updating" documents you could also:
    - check-out the document by a system account (if you want to prevent your users to check-in a new version)
    - modify the GUI so that Update (metadata) action is not available to users (in theory, they could still access it via a direct service call) by a custom component
    - introduce a Java event filter (enhancing the UPDATE service) where you will implement whatever logic you want
    I would probably opt for the last options as it seems to me to be the cleanest solution (but yes, it requires some coding).

  • How to create TNS entry for db2 database?

    hi,
    I want to create a db2 database tns entry in tnsname.ora file. How do i create?
    thanks

    There seem to be several related threads about this concern.
    Creating dblink for db2 database
    How to create TNS entry for db2 database?
    How to create TNS entry for db2 database?

  • How to edit one particular entry in custom database table

    Hi all,
    I want edit one particular entry in custom database table with or without a program.
    1.   I tried using SE16N and &SAP_EDIT but im unable to get entries to edit.
    2.   I tried using '/h' and 'code = edit' but it is prompting me to delete an entry but not edit.
    3.   I tried using modify statement. But in vain.
    I tried this statements through programatically,
                            MODIFY itab FROM wa_itab TRANSPORTING  zabc.
                            MODIFY zsample_02 FROM itab.
    please suggest with out writing a program, if possible.

    Hi ,
    Try with FM SE16N_INTERFACE.
    1 .Go to SE37
    2. Enter FM SE16N_INTERFACE and execute
    3. Give table name in Itab,
    I_EDIT                  =   
    X
    I_SAPEDIT             =    
    X
    4. Press F8
    5. Edit table entries and save.
    Thanks

  • How can i make entry in standard SAP table

    hi all
    how can i make entry in standard sap table.
    ex- lfa1
    without using programming,BDC.

    Hi,
    in the table if u find delivery and maintainance allowed with restrictions in delivery /maintainance tab u can enter data from program only.
    see the below example.
    tables: lfa1.
    lfa1-lifnr = '0878877'.
    lfa1-name1 = 'my name'.
    lfa1-ort01 = 'bangalore'.
    lfa1-land1 = 'in'.
    modify lfa1.
    rgds,
    bharat.

  • Unable to refresh the schema of FIM MA.Getting an error in Event viewer ""the current version of database is not compatible with the one expected by Forefront Identity Manager service. The current version of database is : 1116. The expected version is :1"

    Hi,
    We have installed FIM MA with an account that have all the sufficient rights.It got created successfully and worked for Full Import and Full Sync. But, due to some version incompatabilities, we have installed a patch.PFB link for the patch.
    http://support.microsoft.com/en-us/kb/2969673/en-us
    Now, we are trying to refresh the schema of FIM MA. While doing that we are facing an error "Failed to connect to database". The user account with which we are connecting has read and write permissions on DB.In the event viewer some errors are
    logged like  "the current version of database is not compatible with the one expected by Forefront Identity Manager service. The current version of database is : 1116. The expected version is :1122" with event ID 3. PFB images for more detailed
    view.
    Please advice how to fix the issue.
    Thanks
    Prasanthi.

    Hello,
    seems to me that you maybe only updated the syncengine but not portal/webservice.
    I had that error once after an recovery from scratch and forgot one of the hotfixes to apply to all services.
    -Peter
    Peter Stapf - ExpertCircle GmbH - My blog:
    JustIDM.wordpress.com

  • How to update field values in a database table using module pool prg?

    hi
    how to update field values in a database table using module pool prg?
    we created a customized table, and we put 2 push buttons in screen painter update and display.
    but update is not working?
    data is enter into screen fields and to internal table, but it is not updated in database table.
    thanks in adv
    vidya

    HI,
    we already used the update statement. but its not working.
    plz check this.
    *& Module Pool       ZCUST_CALL_REC
    PROGRAM  ZCUST_CALL_REC.
    TABLES: ZCUST_CALL_REC,ZREMARKS.
    data:  v_kun_low like ZCUST_CALL_REC-kunnr ,
           v_kun_high like ZCUST_CALL_REC-kunnr,
           v_bud_low like ZCUST_CALL_REC-budat,
           v_bud_high like ZCUST_CALL_REC-budat.
    ranges r_kunnr for ZCUST_CALL_REC-kunnr  .
    ranges r_budat for zcust_call_rec-budat.
    DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
          JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
    *data:begin of itab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of itab.
    *data:begin of Jtab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of Jtab.
    CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
    CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
    *start-of-selection.
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE USER_COMMAND_9000 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    WHEN 'ENQUIRY'.
    perform multiple_selection.
    perform append_CUSTOMER_code.
    PERFORM SELECT_DATA.
    call screen '9001'.
    WHEN 'UPDATE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
          perform update on commit.
    WHEN 'DELETE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE STATUS_9000 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
          text
    MODULE USER_COMMAND_9001 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    endcase.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE STATUS_9001 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    move itab-MANDT   to zcust_call_rec-MANDT.
    move itab-kunnr   to zcust_call_rec-kunnr.
    move itab-budat   to zcust_call_rec-budat.
    move itab-code    to zcust_call_rec-code.
    move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9002  INPUT
          text
    module  USER_COMMAND_9002 input.
    CASE sy-ucomm.
       WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          SET SCREEN 0.
          LEAVE SCREEN.
          CLEAR sy-ucomm.
       WHEN 'UPDATE'.
             perform move_data.
         UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
            IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
            ENDIF.
      WHEN 'DELETE'.
             perform move_data.
             DELETE ZCUST_CALL_REC FROM TABLE ITAB.
              IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
            ENDIF.
    endcase.
    endmodule.                 " USER_COMMAND_9002  INPUT
    *&      Module  STATUS_9002  OUTPUT
          text
    module STATUS_9002 output.
      SET PF-STATUS 'ZCUSTOMER1'.
    SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_9002  OUTPUT
    *&      Module  update_table  OUTPUT
          text
    module update_table output.
         move itab-MANDT   to zcust_call_rec-MANDT.
         move itab-kunnr   to zcust_call_rec-kunnr.
         move itab-budat   to zcust_call_rec-budat.
         move itab-code    to zcust_call_rec-code.
         move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    endmodule.                 " update_table  OUTPUT
    ***Selection Data
    FORM SELECT_DATA.
    SELECT  mandt kunnr budat code remarks  FROM zcust_call_rec INTO
                            table itab
                             WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
    ENDFORM.
    ****append vendor code
    FORM APPEND_CUSTOMER_CODE.
    clear r_kunnr.
    clear itab.
    clear r_budat.
    refresh r_kunnr.
    refresh itab.
    refresh r_kunnr.
    IF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                  EXPORTING
                                      input         = v_kun_high
                                  IMPORTING
                                      OUTPUT        = r_kunnr-high.
                     r_kunnr-option = 'BT'.
                     r_kunnr-sign = 'I'.
                     append r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
          PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        IF SY-SUBRC = 0.
                             MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
                              CALL SCREEN '9000'.
                        ENDIF.
    PERFORM V_BUDAT.
    ENDIF.
    ENDFORM.
    FORM V_BUDAT.
    IF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'BT'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-HIGH = v_bud_HIGH.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
              ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                   IF SY-SUBRC = 0.
                       MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
                      CALL SCREEN '9000'.
                    r_budat-low = ''.
                    r_budat-option = ''.
                    r_budat-sign = ''.
                    ENDIF.
            ENDIF.
    ENDFORM.
    *&      Form  update
          text
    -->  p1        text
    <--  p2        text
    form update .
    commit work.
    endform.                    " update
    *&      Form  move_data
          text
    -->  p1        text
    <--  p2        text
    form move_data .
       clear itab.
      refresh itab.
           move-corresponding  zcust_call_rec to itab.
           MOVE ZCUST_CALL_REC-MANDT   TO ITAB-MANDT.
           MOVE ZCUST_CALL_REC-KUNNR   TO ITAB-KUNNR.
           MOVE ZCUST_CALL_REC-BUDAT   TO ITAB-BUDAT.
           MOVE ZCUST_CALL_REC-CODE    TO ITAB-CODE.
           MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
         APPEND ITAB.
         delete itab where kunnr is initial.
    endform.                    " move_data
    thanks in adv
    vidya

  • Hi friends, I have a doubt in inserting a field to database table and inserting the same values in two different tables

    I have a mpp screen for a cd library management system (we are practicing on it).
    We have a main screen where a user should enter the enteries and while clicking a add button it should be inserted in a table, Here the problem rises the table name are ztransaction and zstatus.The fields in mpp are cdid,customerid,transaction id,date of issue and duedate.Now after entering all the values on clicking add button it should be inserted to database table ztransaction and the field cdid alone should be inserted both in ztransaction and zstatus.
    Thank you

    Hi Raghuram R G,
    Check for Primary key and foreign key in the Database table??? Because of this it was not inserting...check and confirm??
    Regds,
    Vijay SR

Maybe you are looking for

  • Custom Filter in Universe on top of BEX Query is not working in BO Explorer?

    Hi, I have created Condition(Filter) for an Dimension Object "Submitted by Group Hierarchy" in Universe designer tool on top of SAP BEx Query and then exported the universe to Repository. <FILTER KEY="@Select(Submitted By Group Hierarchy\L01 Submitte

  • Configurable article in sap retail?

    Hello Experts, Can we have configurable articles in sap retail? Please tell me your opinions.. Thanks

  • How can I get my address book data back?

    After upgrading to OS6, my address book has gone from almost a thousand entries to being totally empty. This is a *very* big deal for me bc I have no address book application on my PC. I had always assumed that if iTunes were backing up my iPod, that

  • JAXB Validation

    Using JAXB I have generated and compiled classes for my schema and everything appears ok. I can create new objects using the ObjectFactory and I am able to validate those objects. If an object is invalid I know how to inspect the resultant Validation

  • Open portal page via HTML URL out of the "Dynamic Navigation"

    Hi everybody, In our portal environment we have a page (page1) in which user can enter date. On another page (page2) in a different navigation node there is a report that shows the data. We want to provide a possibility to navigate directly from page