Authorization coding in custom table

Hi frnds,
   I want to give an authorization to a custom table. I have created a new authorization group and assigned a role and user for it.
   I had done a coding to check the authorization in Maintenance generator program.
MODULE CHECK_AUTHORIZATION OUTPUT.
data : w_tddat like tddat,
       viewname type tabname value 'ZTSD_IB_TRMAP',
       act_level.
select single * from tddat into w_tddat where tabname = viewname.
  if sy-subrc <> 0  or  w_tddat-cclass = space.
    w_tddat-cclass = '&NC&'.           " 'non classified table'
  endif.
  authority-check object 'S_TABU_DIS'  "check by class
      id 'ACTVT'      field '02'
      id 'DICBERCLS'  field w_tddat-cclass.
  if sy-subrc <> 0.                    "not allowed
      authority-check object 'S_TABU_DIS' "check by class
         id 'ACTVT'      field '03'
         id 'DICBERCLS'  field w_tddat-cclass.
      if sy-subrc =  0.
       fupd  = space.
       fshow = 'X'.
       act_level = '03'.
       p_action = 'S'.
        message w106(tb) with viewname."only show allowed
      else.
        message e107(tb) with viewname."no upd auth
      endif.                           "sy-subrc from  2nd auth_check
    else.                              "act_level <> 02
      message e105(tb) with viewname . "no show auth
   endif.
  endif.
ENDMODULE.                 " CHECK_AUTHORIZATION  OUTPUT
But the problem is on debugging even for the unauthorized user the authorization check coding:
  authority-check object 'S_TABU_DIS'  "check by class
      id 'ACTVT'      field '02'
      id 'DICBERCLS'  field w_tddat-cclass.
gives sy-subrc = 0.
What is the problem with the coding.
Also can an one explain me about
       fupd  = space.
       fshow = 'X'.
       act_level = '03'.
       p_action = 'S'.
and what are the datatypes to be given for it on data declaration.
Thanks in Advance

>
neethu wrote:
> I have created a Z table and I need to create and assign an Authorization group to the table. The requirement is like, say, if there are 10 users who belong to this particluar Authorization group, then 5 users should be given display and change authorization. And the remaining 5 users should be given only display authorization & no change authorization.
>
Assuming users are accessing the table content using SM30 (or SM30 parameterised transaction) you can use authority object S_TABU_DIS to control change mode. User who are suppose to change content should have authority object S_TABU_DIS with following values in their role.
S_TABU_DIS
ACTVT = 02
DICBERCLS = AUTH_GRP
for display only
S_TABU_DIS
ACTVT = 03
DICBERCLS = AUTH_GRP
Where AUTH_RP is authorization group assigned to table
Regards,
Pawan.
Edited by: Pawan Kesari on Aug 9, 2010 4:17 PM

Similar Messages

  • Custom Table Authorization Control

    Hi gurus-
    I got the following scenerios-
    The scenario is-
    We have a custom table. On that custom table, there are couple of fields that we want to control access (display access, edit access, no access etc.) based on different user profile role. I know you can control access on table basis by Authorization Group but for access control within a field (some records within that field will be accessed by only few people, other records by other group of people), how can these be accomplished, if possible. Authorization Object Controls access for a particular field. But my understanding is for all records in the field. Can you subdivide those into different groups of records?
    The logic is-
    After user enters input values (key fields in the custom table maintenance program), the program looks up the authorization group for the user and checks if the key combination has authorization to change access, if yes it executes the program, otherwise returns an error message. Can you accomplish that with the use of another field like Profile Group to maintain a list of records for different user groups?
    Any help will be greatly appreciated!!!
    Thanks!

    Hi,
    you can ask your ABAP consultant to code in the table maintenance events. We need to call appropriate authorization objects in the events and allow/disallow the changes for a field/record based on the authorization.
    If you want more details on TMG events, just search in SCN. We have lot of information on this.
    Thanks,
    Vinod.

  • Converting garbled characters for JAPANESE characters in a custom table

    Hi all,
    I have a custom table that store Japanese characters.
    After my company has upgraded to ECC6.0, this data in the custom table has become garbled and its alot of it garbled.
    Is there any SAP tool that can I use to make the correction on those garbled Japanese characters?
    Thanks,
    William Wilstroth

    Hi Nils,
    I really really really had a field day reading and testing around UC... To my dissappointment, I do not have the authorization to use SUMG and SCP too as well as a few of the TCODES...
    I finally told my higher level technical mgnt. that this table might need some changes...
    Has this problem of mine got anything to do with MDMP since its no longer supported in ECC6 and I found one coding that search for MDMP in RSVTPROT...
    My colleagues suggest that the data be corrected from table DBTABLOG... which i find, in my opinion, is not the right way...
    Thanks,
    William

  • Create Object for archiving Custom Table

    Hi guru!!
    I have a problem, I must create a archiving object for custom table..
    I must create a report for READ, DELETE and ARCHIVING this type of table..
    colud you help me?
    thanks a lot guru!!!

    Hi,
    Steps..
    GO TO SE11
    Give the table name
    Press change..
    In the menu..UTILITIES -> TABLE MAINTENANCE GENERATOR.
    GIve the authorization group &NC&
    Choose the single step radio button..
    Give the screen number 1.
    Give the function group..Give the table name itself as the function group.
    Press create. button.
    Now the screen is generated..go to sm30 and maintain the table entries..
    Thanks,
    Naren

  • How to create cutom authorisation group for custom table?

    Hi,
    I created once custom table.
    i want to allow only some users to create entries.
    how can i achieve this?
    if with creation of z authorisation group tell me procedure
    thanks in advance.

    Hi,
       See to this link it may help you.
       How to create Authorization group
       Custom Authorization Objects

  • Customized table could not maintain in PRD

    Hi all,
    I have created a table ZTABCUST with table maintenance as below.
    Delivery Class : C (Customizing table, maintenance only by cust., not SAP import)
    Data Browser/Table View Maint. :  X Display/Maintenance Allowed
    Table Maintenance Dialog
    Authorization Group : &NC&  (w/o auth. group)
    Authorization object : S_TABU_DIS
    Function Group : ZGAA004
    Package : ZSD
    Maintenance type : one step
    Maint.Sceen No :  Overview screen : 1
    Dialog Data transport Details
    Recording routine : Standard recording routine
    Compare Flag : Automatically Adjustable
    I have transported this into Production.
    But when i try to update my customized table in PRD using SM30/SM31, the system show message
    "Client 300 has status 'not modifiable' ".
    and I couldnt update my customized table.
    How and what should I do in order to make my customized table to be modifiable in Production?
    I need this to be solved urgently.Points rewarded.

    Please do the following.
    goto"Delivery and maintaince" tab. Then make the Data browser/Table view maint.  as
    X Display/ Maintenance allowed. then activate it . then create the table maintenance generator again..

  • How to "auto" generate "Primary Key" in custom table?

    Hi Folks,
    Requirement:
    I need a function module or program that can create automatically a primary key.
    Scenario:
    I have a program that creates an entries and save it to a custom table at the same time, but a primary key should always be generated respective to the entries saved.
    Example:
    Material(MATNR) 4001001, Plant(WERKS) XX01, ID[Primary Key-auto generated]
    (I'm thinking of a similar concept/logic on how a unique IDOC number is being generated or how SAP standard creates a unique entry)
    I try to look for any SAP FM that can generate a PK, but there's no luck.
    Thanks.
    Regards,
    Jun

    Hi Keshu and All,
    The links are helpful, however:
    #1. I don't have authorization to create a new object in transaction SNRO, but the way I see the objects in SNRO is just for defining the length(number of characters) for the ranges that will be use if I'm not mistaken.
    #2. FM NUMBER_GET_NEXT - yes it can populate incremental unique entries but it's only occurring at runtime ?? So when the program get terminated it's not being saved nowhere.
    So after if I use FM NUMBER_GET_NEXT, I always have to look for all the last primary key in my custom table, then target it as my starting point for creating a new PK.  I think this will give a performance issue, any comments?
    For better visualization, I have scenario:
    1.  (ZQ_CREATE_PK) Create unique incremental PK for material, batch, so on..
    2.  Append line/entries to ZQ_TABLE
    3.  Repeat #1 and #2
    4.  User exits the program
    5.  Back to 1 --> At this point, I need to get the "LATEST" PK then start this as a starting point again to generate PK and append it to ZQ_TABLE
    I'm assuming that SAP has other SAP FMs related in creating this scenario.   Similar to IDOC # creation..
    Thanks.

  • Is it possible to restrict changing records in customizing table in SM30?

    Hi.
    Is it somehow possible to set authorizations in a way, that a user could change only certain entries in a customizing table using SM30? What I want to achieve with this - we have an internationally used system, where consultants from different countries are working often on the same customizing tables and we would like to restrict tham to be able to change records only relevant for those countries, so they cannot change the records for other countries by mistake / on purpose. The records are usually identified by a certain "grouping" field (for instance MOLGA in table T511K or MOABW in T554S).
    So far I couldn't find anything apart from the S_TABU_DIS object, which is too rough for this requirement.
    Or maybe is there another way to achieve security in such a scenario?
    Thanks in advance for any ideas.

    Hi dusan,
    1. If u are talking about SM30 for standard table,
       then i don't think there is any such standard feature / facility,
       for restricting.
    2. If its our own Z Table, then we can go for events in table maintenance
      and write our code for same.
    3. But if such restrictions/validations are required,
       then its better to have a module pool for such thing.
      SM30 is for very simple and basic table maintenance.
    regards,
    amit m.

  • Table Maintenance: Manual Transport for Entries in Customizing Table

    Dear forum,
    i'm facing a tricky problem at the moment. My customer wants the maintain a customizing table, but he does not want to transport the entries automatically (don't ask me for the reason), but manually.
    The online help tells me, that this can be done.
    In the SE11 i chose untilities -> table maintenance generator and for the subscreen "dialog data transport details" i chose "no or user, recording routine".
    Continuing wiht the SE11 i chose untilities -> table maintenance generator -> environment -> maintenance objects -> transport "manual transport".
    In the SE54 i created the events 10, 11 and 12 with the recommended coding from the online help.
    But when i start the Maintenance via SM30 the points in the menue table view -> transport or edit -> transport are not active.
    The function group does not include any generated statuses to activate the menue-points. What is missing toi get the popup, that asks me for the transport number?
    Can somebody help me out or tried this before?
    With kindly Regards,
    Robert

    wrong!
    the online documentation says:
    Manual transport
    The object maintenance transaction offers a manual link to transports. You can branch to it by selecting the Transport menu option. In the transport session, you can then select objects to place them in a Change request. A special transport program may be available instead of the menu option Transport, to place the object in a change request. The setting Manual transport means that changes to the object are not automatically recorded. If the maintenance transaction offers an automatic transport link, in addition to the manual one, you should select the setting Automatic transport.
    What has to be done to realise it except creating the events?

  • Is table maintenance generator only for custom table?

    hi ,
    i have doubt is table maintenance generator only for custom table?

    hi swamya,
    Table Maintanance Generator is used to create/change/delete table entries in a particular table.
    In the production system, end-users will not be having access to transaction codes like SE11 and SE16. Developers will not be having access to many transaction codes including the above two.To view the contents of the database table, we will use SE16n in Production system. All these authorizations will be maintained by BASIS team, by creating access profiles.So in order to edit or create the contents of a database table, we should go for table maintenance generator. In real time, authorizations will be maintained in production system.
    The second reason is, we can edit or create multiple entries at a time, using tablemaintenance generator.
    Apart from that we have options like 'Enter conditions' in table maintenance screen SM30.
    hope this helps in clearing ur doubt.
    Regards
    Saurabh

  • Retriction of access the custom table

    Hi Experts,
        I created a custom table. Here I have 5users. the first 3 user want to access the custom table in change mode. the remaining 2 users want to see table in diplay mode only.
        But here SAP is allow access the table in change mode only to one user. Is it not possible to do this one to multiple users?
       Please tell me.
      Thanking  you.

    Hi,
    Here lock concept comes into picture, as you are saying like 3 users in change mode where if one is editing the records and if another opens then obviously table locks. Check this and ask your Basis guys for the authorizations setting like for 3 users change action and for the another 2 users display action.
    Cheers!!
    VEnk@

  • Query for getting all Custom tables

    Hi,
    Is there any sql query present to fetch the name of all the custom tables(Not the tabless inbuilt tables which is given by oracle) present in any module like iExp,iRec or anything.
    Thanks

    Please use appropriate forum for posting your issues. You will get a better response in the forum http://forums.oracle.com/forums/forum.jspa?forumID=40
    As per my knowledge, its all matter of how you have managed the custom coding, if there is a fix pattern or naming convention, it will be easy to find the same.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to create customizing table

    Hello All,
    How to create a customizing table? what should be the delivery class for this customizing table?
    how to to maintain table maintainance geneartor?
    Please explain me step by step:
    and also please explain me how to create a view?
    Regards,
    Gupta

    Hello Lisa,
    Use transaction SE11 and enter the name of the table (ZABC) and execute CREATE. Enter the required fields which u need in the table select the fields which are primary keys. Make sure your first field in the table is MANDT and is also a key. and press save...Your table is created.
    the delivery class depends on the nature of the table you created. If the table you created is used to maintain transactional data like sales order numbers, deliveries etc then use set the delivery calss = 'A' but if you table will be used a config table let us say for this delivery type and shipping point ....FLAG = 'X' and if you use this table in the program to determine certain actions to be done like create transfer orders for deliveries if FLAG = 'X', in these kind of situations you use delivery class = 'C' where the table not not be populated with transactional data.
    Once the table is created click on "Utilities -> Table Maintenance Generator -> on the scree enter the authorization group if none then enter &NC&,  function group = name of the table (ZABC) and execute CREATE which can be found in the titile

  • Custom table entries suddenly deleted

    We have a custom table in our production system that had 14000+ entries last Friday.  Now, they're all gone.  Production system is not modifiable, no one has authorization to SE16 or SM30 for deletions.  No program that deletes the data has been run in this timeframe (based on ST03 data).   What other ways could this data have been deleted?  We're puzzled.

    Kirsten,
    you may want to check two things:
    1.) Is there a delete or clean-up report for your custom table (check via the where-used list)? If yes it is very likely that someone ran it...
    2.) It could also be that something happened directly on DB level. The admin accidentally dropped the wrong table, etc. This is not very likely but I have seen that happening before. Maybe the DB admins can even tell you at which time the table got deleted...
    Tim

  • Custom table entries transportable / maintainable in production environment

    Hi,
    I have a custom table with table maintenance generator (automatic transport of table entries). I would also like to maintain the table entires in the production environment (i.e. using SM30 transaction, rather than transporting the entries from Quality). I hope there is a cofiguration to do this.
    Could any one help me on this.
    Thanks in advance.

    Adding to what others have suggested, it is not advisable to give SM30 access to your users. Its better to create a parameter transaction for the maintainance dialog and give the user access to that transaction. Other way of restricting the access is using authorization group selection while creation of maintainance dialog (&NC& will give access to every one). Check the below link to see how to create a parameter transaction for sm30.
    [Parameter transaction for sm30|http://www.divulgesap.com/blog.php?p=MTg=]
    Cheers,
    Ravikiran

Maybe you are looking for