Trancation code to table maintenance

I have a custom table with table maintenance view. Our end users don't have authorization of SM30 transation. Can we attach transaction code to the table maintenance so that user can inser or modify or delete records by using T-code. Even though he dont have authorization of table maintenance.
Please suggest

Hi,
  Try the following routine in a custom program as mentioned by Andreas:
FORM call_view .
  DATA: l_i_selections TYPE TABLE OF vimsellist INITIAL SIZE 0,
        rec_selections TYPE vimsellist.
*plant
  rec_selections-viewfield = 'WERKS'.
  rec_selections-operator = 'EQ'.
  rec_selections-value = p_werks.
  APPEND rec_selections TO l_i_selections.
  CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
    EXPORTING
      action                       = 'S'
      view_name                    = 'TCODE'
    TABLES
      dba_sellist                  = l_i_selections
    EXCEPTIONS
      client_reference             = 1
      foreign_lock                 = 2
      invalid_action               = 3
      no_clientindependent_auth    = 4
      no_database_function         = 5
      no_editor_function           = 6
      no_show_auth                 = 7
      no_tvdir_entry               = 8
      no_upd_auth                  = 9
      only_show_allowed            = 10
      system_failure               = 11
      unknown_field_in_dba_sellist = 12
      view_not_found               = 13
      maintenance_prohibited       = 14
      OTHERS                       = 15.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDFORM.                  
regards
Aveek

Similar Messages

  • Event code in table maintenance generator

    Hi All,       Need to call event in Table maintenance generator of the z table. I have to use 1st event (Select ’01’ – Before saving data in the database).     Need to do fallowing job: Table cleaning : Delete all records with value year =< 2011 -New rule :      No save can be done with value (Pst Var, PA,PSA, Cost = ‘ *,*,*,*’). I am attaching table entry with this mail, I have written the code for this but not sure please suggest me modification if required for this.Because i have never done this before. Thanks and Regards Sankil     

    hi Sankil
    Some variable is not available in your code and you did not modify EXTRACT table.
    Try to modify your code as blow:
    This event has no standard routine. The following global data is available for the realization of the user routine:
    •internal table TOTAL
    •field symbols
    •field symbols <ACTION> and <ACTION_TEXT>
    •<STATUS>-UPD_FLAG
    If internal table data are to be changed before saving, t he changes should be made in both the internal table
    TOTAL and in the internal table EXTRACT.
    FORM abc.
    DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
    LOOP AT TOTAL.
    IF <ACTION> = desired constant.
    READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.
    IF SY-SUBRC EQ 0.
    F_INDEX = SY-TABIX.
    ELSE.
    CLEAR F_INDX.
    ENDIF.
    (make desired changes to the line TOTAL)
    MODIFY TOTAL.
    CHECK F_INDX GT 0.
    EXTRACT = TOTAL.
    MODIFY EXTRACT INDEX F_INDX.
    ENDIF.
    ENDLOOP.
    SY-SUBRC = 0.
    ENDFORM
    refer event 01: http://help.sap.com/saphelp_nw04/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm
    regards,
    Archer

  • How to see column in table maintenance  generator?

    Hi All,
    Can we write code in table maintenance generator ? where can we write code?
    suppose I have created table maintenance generator but column is not visible what might be reason? How to deal with this?
    Can any 1 help me in this regard?
    Thanks in advance.

    Hi,
    column is not visible
    This may be because of additioni of a new field in the table after you have generated the TMG.
    Delete and re-create the object in TMG again.
    writing code in table maintenance generator
    Yes, you can write.
    SE54 --> Environmnt --> Events --> New Entry
    Select the event ..eg.
    01 for Before saving the data in the database
    02 for After saving the data in the database
    Press enter. Click on the editor button and start writing your codes in the routine.
    Regards,
    Firoz.

  • Table maintenance - autorization check on field level

    Dear all,
    I generated a table maintenance view for a custom table via SE11 --> Utilities --> Table maintenance generator.
    The table for which the maint. view was generated has a field bukrs. When a user enters a company code via table maintenance in SM30, i want to check if he has the right authorizations for that company code. This check, is this something i have to implement in the modification events or are there other alternatives?
    Suppose i want a non-key field to be unique, is there a way to automatically check this, or has this to be done via implementation of the same events?
    Kind regards,
    J

    Hi,
    You can do it via the events.
    There is one more alternative also.
    Create a Z report with the plant as parameter or select-options.
    Do an authorisation check on it using the authority object.
    Then call the FM of SM30.
    The FM of SM30 is 'VIEW_MAINTENANCE_CALL'
    See the following code
    PARAMETERS: y_p_lgnm TYPE lgnum.
    DATA : y_v_string   TYPE string.
    CONSTANTS: y_k_u        TYPE char1   VALUE 'U',
               y_k_x        TYPE char1   VALUE 'X',
               y_k_lgnum    TYPE char7   VALUE 'LGNUM',
               y_k_lgtyp    TYPE char5   VALUE 'LGTYP',
               y_k_eq       TYPE char2   VALUE 'EQ',
               y_k_viewname TYPE tabname VALUE 'YLOMANAGTROL'.
    *                   INTERNAL TABLE DECLARATION.
    DATA: y_i_seltab TYPE STANDARD TABLE OF vimsellist.
    *                   WORKAREA DECLARATION.
    DATA: y_wa_seltab TYPE vimsellist.
    START-OF-SELECTION.
    *authority check for warehouse number
      AUTHORITY-CHECK OBJECT 'L_LGNUM'
                  ID y_k_lgnum FIELD y_p_lgnm
                  ID y_k_lgtyp FIELD '*'.
      IF sy-subrc NE 0.
    * user not authorised
        CONCATENATE y_p_lgnm text-003 INTO y_v_string SEPARATED BY space.
        MESSAGE s015(ylo1) WITH text-001
                                sy-uname
                                text-002
                                y_v_string.
      ELSE.
    *Clear Internal Table
        CLEAR y_i_seltab.
        CLEAR y_wa_seltab.
    *passing the selection parameters to the function module
    *view_maintenance_call.
        y_wa_seltab-viewfield = y_k_lgnum.
        y_wa_seltab-value     = y_p_lgnm.
        y_wa_seltab-operator  = y_k_eq.
        APPEND y_wa_seltab TO y_i_seltab.
        CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
          EXPORTING
            action               = y_k_u
            view_name            = y_k_viewname
            show_selection_popup = y_k_x
          TABLES
            dba_sellist          = y_i_seltab.
      ENDIF.
    In my case i had a table YLOMANAGTROL with field LGNUM.
    So i put an authority check on LGNUM.
    Regards,
    Ankur Parab

  • Open T-code on double click of field in table maintenance

    Hi Gurus,
    I have one scenario, I have to show a transaction on double click event on a field of Table Maintence.
    Please guide me in this .
    Is there is any event in Table Maintenance Events to capture double_click of a field.
    Regards,
    Sowmen

    1. In the field attributes of the particular field there is a chechbox  in display tab which says respond to double click, check that.
    2. Assign the fuction code "PICK" for function code F2 in GUI status.
    3.Now whenver you double click the field function code "PICK" gettes triggeed.
    Now you can wrie yyou code based on this function code.
    CASE sy-comm.
    WHEN 'PICK'.
    *If you want the name of the field and the value in that field use the below code.
    GET CURSOR FIELD gv_field VALUE gv_cursor_value.
    *DO your operation based on the field and the value.
    ENDCASE.
    Regards,
    Smithesh

  • Reg :-maintain a table maintenance view for the z table.suggest me the code

    i have question.i have created a z table related to pp module.the requirement is to maintain {table maintenance view} for this z table.how could this be done.can any one suggest me the code for this?

    Hi ,
    We have a lots of queries on table maintainance creation in the forum posted and replied to.Pls have a look at it first.
    In se11 -> change mode of the ztable -> goto -> utilities -> table maintainance generator -> click on it...
    it will give a new screen-> enter the required details like function group , authorisation(use &NC& or leave it blank if you dont know)  and screens
    2 step and 1 step means=> number of screens displayed in maintainace
    if step1 is selected then we have a screen which will be like a table control for data entry.........
    for step2 we have a table control screen and a more detailed individual field display as second screen
    click on the button 'find screen numbers' so that system automatically proposes the screen numbers
    after which click on the "create" button and follow the required instructions/messages
    once done go to SM30 enter the table name to check if maintainance has been created properly
    Hope it helps,Pls check and revert
    Regards
    Byju

  • Can we assingn a transaction code to the table maintenance genarator

    Hi Gurrus ,
                           Can we assign a transaction code to the table maintenance genarator code .

    Hi,
    refere this link,
    http://fuller.mit.edu/misc/creating_sm30_transaction.htm
    VIEW_MAINTENANCE_CALL : or SM30 is actually called u201CCall View Maintenance
    In a nutshell, this program provides a simple selection screen with VKORG, radiobutton for either dollar amount or quantity, and two pushbuttons: Display and Maintain. Then the program fills in the action field and the selection table (i_sellilst) according to the useru2019s selections. When the button is pushed, the screen goes to the same screen as SM30 (sans the first selection screen, of course) and brings up the values that fit the criteria. When the user clicks u201Cbacku201D (green arrow)
    reward if found useful..
    cheers
    Mohinder Singh
    Edited by: Mohinder Singh Chauhan on Jun 2, 2008 12:52 PM

  • To find T.Code for a table (Table Maintenance)

    Hi all,
    I know the table name which has a t.code. i.e, a table maintenance has been generated and it is being assigned to a T.Code. Can we find out the T.code of the table from the Table name ???
    Regards
    Jiku

    Hello Jiku,
    Go to SM30 transaction you can give the table name, it will take you to the view.
    With Regards,
    Avisesh.

  • How to use the table maintenance events for validating the input entries..?

    Hi,
    I have created a Z table with 6 fields in which all are KEY fields. All are of CHAR type. I have created the Table Maintenance Generator for the same. While maintaining the entries in the table, even though I maintain a blank entry for a field it is saving the entry. But, I don't want that way. All the fields are mandatory in my table. One should enter all the fields. Otherwise it should not allow to save the entry. So, I think it can be done using the Table Maintenance Events. can someone tell me how to use the Table Maintenance Events. and which event to use for my reuqirement and what is the logic to be written.
    Or Is there any other way to solve my problem.
    Please share your inputs. Thanks in advance.
    Best regards,
    paddu.

    In the table maintenance generator, Environment --> Modifications --> Events then a screen will be appear here,we need to create the Events.In the EVENTS screen, press new Entries, there give 01(Before Saving the Data in the Database) and give a name(This will become a PERFORM), then click the Editor pushbutton, this will be there at the right side of the entry, then a popup will be appear, you can create an include program, there inside of the include program write ur code.
    Here is documentation for Event 01(Before Saving the Data in the Database )
    Event 01: Before Saving the Data in the Database
    Use
    This event occurs before new, changed or deleted entries are written to the database. Other activities can be performed, for example:
    hidden entry processing
    fill hidden fields
    flag data to be written to hidden tables after the database change.
    To have the changes saved by the central maintenance dialog routines, SY-SUBRC must be set to 0 at the end of the routine.
    Realization
    This event has no standard routine. The following global data is available for the realization of the user routine:
    internal table TOTAL
    field symbols
    field symbols <ACTION> and <ACTION_TEXT>
    <STATUS>-UPD_FLAG
    If internal table data are to be changed before saving, t he changes should be made in both the internal table TOTAL and in the internal table EXTRACT.
    FORM abc.
    DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
    LOOP AT TOTAL.
    IF <ACTION> = desired constant.
    READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.
    IF SY-SUBRC EQ 0.
    F_INDEX = SY-TABIX.
    ELSE.
    CLEAR F_INDX.
    ENDIF.
    (make desired changes to the line TOTAL)
    MODIFY TOTAL.
    CHECK F_INDX GT 0.
    EXTRACT = TOTAL.
    MODIFY EXTRACT INDEX F_INDX.
    ENDIF.
    ENDLOOP.
    SY-SUBRC = 0.
    ENDFORM.
    Regards,
    Joy.

  • Table maintenance events

    Hello,
    Does anyone has a code example of table maintenance events?
    I have a custom table ( zitab ) , with a maintenance view in SM30. I would like to use the table maintenance events for some authorisation check before the data is displayed, then, depending on the authorisation, display what the user is authorised to see. After data input, perform validation, if errors occur, inform the user what the problem is, if not, save in tha z table.
    Can this be done in sm30 or I need to write a new program?
    Thank you!

    Can someone please explain me why I have this short dump (before save event)?
    Error analysis
        The statement
          "MOVE src TO dst"
        requires the operands "dst" and "src" to be comvertible.
        Since this statement occurs in a Unicode program, the special
        convertibility rules for Unicode programs apply. In this case, the
        following rules have been broken:
    Source Code Extract
    Line  SourceCde
        1 ----
        2 ***INCLUDE LYTableF04 .
        3 ----
        4
        5 form before_save.
        6
        7 DATA: l_field_is_blank.
        8   DATA: BEGIN OF s_ytable.
        9           INCLUDE STRUCTURE ytable.
       10           INCLUDE STRUCTURE vimtbflags.
       11   DATA: END OF s_ytable.
       12
       13   LOOP AT total.
       14     CLEAR s_ytable.
    >>>>>     MOVE total TO s_table.
       16
       17   ENDLOOP.
       18
       19 endform.
    In all examples that i read on this forum this code works, I don't know why it fails for me.

  • Aotu numbering in table maintenance view

    Hi experts,
    Can anybody help me in auto genereating serial number in table maintenance view. I have created table maintanance view for a z table for which first field is serial no. The requirement is this serial number should be auto genereted. increment by 1. I have writeen the code for the same in PAI event, but it getting incremented by number of rows. e.g for secind row counter is incremented by +2. for thrid row it is +3 and so on....
    plz help to achieve consistency .
    Thnks n regards,
    Ashmita Singh

    What happens if the user deletes a recird from the table?
    Suhas,
    Happy New Year
    Disable delete function and provide a deletion indicator. This should be fine right.
    The problem would be when the maintenance dialog is regenerated.
    @OP - So as suggesgted use events.
    Similar threads were discussed before many times. May be you culd search it once.

  • Table maintenance view - tcode

    Hi experts,
    We have a tcode (already in production) created for table maintenace view of z-table.
    Everything is working fine.
    Now I added one new field to the z-table and changed the table maintenance view accordingly. In SM30 I can maintain the table without difficulties - the new field is visible and maintenable. However, when I call the transaction code created for this view, it doesn't have the new field yet.  I tried a lot but without success to update the tcode accordingly.
    How can I get the tcode adjusted with the new field?
    Thanks for your advise and help in advance!
    Your feedback will be << appreciated >>.
    Regards,
    Sally
    Please do not offer rewards.
    Edited by: Rob Burbank on Dec 6, 2009 5:22 PM

    It's about one week you asked the question, but I answer in case you didn't understand what happened:
    First, screens 1000-1010 can't be used in a table maintenance dialog (an error is mentioned by SAP when you try to use these numbers). So, I really don't understand how you can get 1000 in your table view!
    So, I think that your transaction is linked to a custom program (not the SM30 view). So you just need to adapt manually the custom program. Note: maybe the program is a partial copy of the SM30 function group, so maybe you may just copy the dynpro 1000 of the SM30 function group  to the dynpro 1001 of your custom program...
    Note: when you want to create a transaction which is linked to a table maintenance view (SM30), you must define a Z* transaction of type parameter, with reference to SM30 transaction, select "skip initial screen", do not choose any dynpro, and choose VIEWNAME = your view and UPDATE = X as parameter values.

  • Table maintenance view Events

    Hi
    In My Z Table maintenance view i  had implemented a new event 01- Before save. But my table entry's are not getting saved now and also i am not getting any error message.
    Please help me on this.
    Regards,
    Naidu Vecahalapu.

    Hi Naidu,
    In the event code of the table maintenance view, please ensure that the SY-SUBRC is ZERO before exiting the sub-routine. Otherwise your changes (insert, update or delete) won't get updated and also you won't get any error message.
    Regards
    Suresh

  • Table Maintenance View Generator - 46C to 60 compatibility

    Table Maintenance View Generator - 46C to 60 compatibility
    I think SAP changed the way it generated its View Maintenance Screens some time after release 46C such that view maintenance dialogs in 46C are maintainable in subsequent releases but that view dialogs created in subsequent releases are not compatible in 46C.  <u>This is my hypothesis.</u>
    <b>Can someone confirm?  Is there a way to revert 60 code to the way the dialog was generated in 46C?</b>
    The error in the transport log from a 60 system to a 46C system is:
    "Field '<VIM_TOTAL_STRUC>' is unknown. It is neither in one of the specified"

    Hi April,
    You can use standard program <b>RSWBO052</b> to change the package. Enter the object and mark the checkbox -> Execute -> Place the cursor in the object -> Right click mouse -> Reassign -> Enter new package -> Save.
    or you can go to transaction SE80 -> Select Package -> Enter &TMP -> Hit Enter -> Find your object -> put the cursor and right click -> Other functions -> Object Directory Entry -> Change -> Change the package -> Save.
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward point if helpful.

  • How to create Transaction code for Table Maintanance generator.?

    Hi,
    I have created a Z Table. and I maintained the Table maintenance generator for the same. Now, my requirement is.. I have to create Transaction code for maintain and Display of this Z table.
    Can someone help me how to create the transaction code for Maintain and Display of the table. I know that we have to create a Transaction code for 'SM30'. Can someone tell me the steps to do the same. When I goto SE93 and say CREATE transaction, I get 5 options, Which one to select and what are the details should I provide in the subsequent screens.
    Thanks in advance.
    Best Regards,
    Paddu,

    Hi,
         Check the below steps......
    1. Go to Tcode u2018se93u2019.
    2. Select ' Transaction with parameters'.
    3. Then Transaction 'SM30' with click on skip initial screen
          VIEWNAME : XXX9tABLE NAME)
          UPDATE   : X
    4. Maintain the  Table maintenance generator
      Authorization group : &NC&
      Authorization object :
      Function group : name(xxx)
    Maintenance Screens :
    Maintenance type : One step
    Maint Screen No : Overview screen (2)
    If still u have problem I will send u steps with Screen shot ...send me Yr id.
    Regards,
    Biswanath

Maybe you are looking for