Authorization object coding in ABAP report

Hi,
I am working on a report. The output of the report is details regarding vendor based on purchasing organization. When user executes the reports, they should be only able to see details if they are authorized to (create, change and display) for the purchasing org of vendor.
The authrorization object by SAP security team is 'M_LFM1_EKO' for standard access to vendors (via MK01, MK02 AND MK03).
How can I use same authorization object to do check in my program for the user in ABAP so that if user is not authroized he will not be able to see details during output for those vendor.
Regards,
Tgshah.

Hi ,
Basically you need to call Authority-check using the pattern option and then pass the object name and field name .If the user has been assigned that object in his profile sy-subrc will succed otherwise fail .
AUTHORITY-CHECK OBJECT 'M_LFM1_EKO'
         ID 'ACTVT' FIELD '1/2/3'
         ID 'EKORG' FIELD 'value of purchase organization'.
IF sy-subrc eq 0 .
WRITE :'authorization' .
ELSE .
  WRITE 'no authorization' .
ENDIF.
The below lonk explains it more ...
[http://help.sap.com/saphelp_40b/helpdata/fr/d4/e02c7dd435d1118b3f0060b03ca329/content.htm]
Thank you .
Anjaneya .

Similar Messages

  • BW authorizations objects in Custom abap report

    Hi,
    we develop a BW custom abap report which we have to roll out to certain end users.
    We would like use our BW authorization design, and need therefore to incorperate these auth. objects into the abap.
    What is the best way to this? Can we use function modules?
    Any help welcome?
    Regards,
    Hans

    Hello Hans,
    please check out the following
    http://help.sap.com/bp_biv235/BI_EN/documentation/Authorization_BW_Proj.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/39f29890-0201-0010-1197-f0ed3a0d279f
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e1cba990-0201-0010-43ae-af579aee7a73
    Hope it helps..
    thanks,

  • Authorization objects in webdynpro ABAP

    Hello.
    How I do to get authorization objects in Webdynpro ABAP.
    Thanks.
    Luis A.

    >
    LUIS TAFUR wrote:
    > Hello Abhi.
    >
    > No, I've already finished the "Z" development inside of it, I use different standard functions. Now I need a transaction, example su24 or another transactions for to inspect the authorization objects in my program.  I don't like create a new object for my development.
    >
    > Thanks. Luis A.
    If I understand you correctly you are saying that you called some standard SAP functionality from within your custom Web Dynpro Applicaiton and now you would like to know what authorization objects will be triggered when you run you WDA.  Is that correct?
    You could use SU24 similar to way that you search for Tcode assignment to authorizations.  Choose External Service as your Type of Application.  Then choose WEBDYNPRO as your type of External Service.  Then supply the application name of the WDA application.  However this doesn't sound like it will give you exactly what you want - searching for all auth checks within an application. Maybe I'm not fully understanding the correlation you tried to make to SU24.

  • How to get list of custom objects used in abap report program?

    Hi friends,
    I have a requirement in which I have to scan the entire abap report and retrieve list of custom objects used in it for example custom tables, data elements, structures, table types etc,. Is there any provision in SAP like fuction modules to do this functionality?  As of now I am coding everything manually where so many possibilities are there for all kinds of objects. Provide your answers and suggestions...
    Thanks,
    Nastera

    Hi,
    The best way to do this is environment analysis. Follow the steps:
    1. Open se38, type in the program name (don't click on on display/change or create button, stay on first screen only)
    2. Click on environment analysis button (hot key SHIFT+F4)
    3. It will throw a pop-up, which will ask for type of object you want to see, which are linked /used by this program. select all (or may be if you are only interested in Tables, then select table only)
    4. Hit 'Enter'
    You will get the full list of all objects used in this report program. Just note down the one which starts with Z or Y and that's it.
    Cheers,
    Anid

  • Authorization object for running a report in background

    Good day experts,
    I tried running a report in background, I choose immediately so that it doesn't have to be scheduled. But when I checked it in my own jobs, It remains at scheduled status. When I tried it on my admin account, It works and with status finished. It seems to be an authorization problem. What object could I be missing with my user account? I tried S_TCODE SMX and SP02 but still not working.
    Thanks in advance!

    Hi karshbax,
    What you're looking for is authorization object S_BTCH_JOB. You need authorization for field JOBACTION = RELE.
    In future use transaction SU53. It shows last error authorization error, so if this is authorization problem then after try of manual releasing of job you'll find in SU53 precise info what went wrong.
    Best Regards
    Marcin Cholewczuk

  • CALLING BUSINESS OBJECT FROM AN ABAP REPORT

    Hi friends,
               I have a business object to which a Custom Function Module is assigned in one of its method.This Function Module calls a Bapi to update a Service Order.I need to capture the status of Idocs regarding success or failure from the function Module in the ABAP Report.I would like to know if there is any way to call this business object from my report and get the status of IDOC.
    Regards,
    Dev Reddy

    sorry I think i was not clear in explaining .I am calling a BAPI to update 'Priority' field of service orders in a custom function module(remote enabled) and I have assigned this bapi to a custom business object. Also I have developed an ALE interface thru BDBG transaction which automatically generates custom basic idoc type,messsage type ,Ale i/b and o/b function modules.
    Actually my requirement deals with a report where we have list of service orders in an internal table and pass each service order to update Priority field.
    Is there any way to create an IDOC from the report and update the priority field and pass back the status of IDOC.
    I have tried calling ALE O/B function function module generated thru BDBG transaction in my report but as a result i am unable to get any of the message whether idoc is created or not.
    Here is my report code.
    data: it_methods type table of BAPI_ALM_ORDER_METHOD with header line,
          it_header type table of BAPI_ALM_ORDER_HEADERS_I with header line,
          it_header_up type table of BAPI_ALM_ORDER_HEADERS_UP with header line,
          RECEIVERS TYPE TABLE OF BDI_LOGSYS WITH HEADER LINE.
    T_METHODS-REFNUMBER = '000001'.
    IT_METHODS-OBJECTTYPE = 'HEADER'.
    IT_METHODS-METHOD = 'CHANGE'.
    IT_METHODS-OBJECTKEY = '000004000768'.
    APPEND IT_METHODS.
    CLEAR IT_METHODS.
    IT_METHODS-REFNUMBER = '000000'.
    IT_METHODS-METHOD = 'SAVE'.
    APPEND IT_METHODS.
    IT_HEADER-ORDERID = '000004000768'.
    IT_HEADER-PRIORITY = '2'.
    APPEND IT_HEADER.
    IT_HEADER_UP-ORDERID = '000004000768'.
    IT_HEADER_UP-PRIORITY = 'X'.
    APPEND IT_HEADER_UP.
    CALL FUNCTION 'ZZ_FM_SM_ORD_PRIOR_UPDATE'
    EXPORTING
       OBJ_TYPE                      = 'ZBOSMPRUPD'
       SERIAL_ID                     = '0'
      TABLES
        ITMETHODS                     = IT_METHODS
        ITHEADER                      = IT_HEADER
        ITHEADERUP                    = IT_HEADER_UP
        RECEIVERS                     = RECEIVERS
      COMMUNICATION_DOCUMENTS       =
      APPLICATION_OBJECTS           =
    EXCEPTIONS
       ERROR_CREATING_IDOCS          = 1
       OTHERS                        = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks,
    Dev Reddy

  • Authorization object coding -problem. Pls suggest.

    Hi experts
    I have created authorization fields and assigned in objects properly.
    My case is i am calling the transaction ZMAST which is create through table maintenance(ZMASTER) of the table ZMASTER.
    Now where to implement this coding part and how to do.
    Please explain me clearly the steps , the following coding part i put in dialog programming right now and can you tell me will this code work fine.
    If we can do in Table maintenance Events, do we need to write in standard program. pls suggest me on this.
    WHEN 'MAST'.
    AT SELECTION-SCREEN.
    AUTHORITY-CHECK OBJECT 'ZRAJ_TEST1'
    0 ID 'ACTVT' FIELD '03'.
    IF sy-subrc <> 0.
    MESSAGE 'No authorization' TYPE 'E'.
    ENDIF.
    CALL TRANSACTION 'ZMAST'.
    Thanks in advance.
    Regards
    Rajaram

    Hi,
    The coding can be done in the "Events" section of the table maintenance.
    Chk this link for further help on this:
    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
    Best Regards,
    Anjali

  • Read some HR archive files (object PA_PIDX) using Abap report

    Hi experts,
    an ABAP program that is supposed to read some HR archive files (object PA_PIDX) but all we can read is the object, we cannot access the individual lines. Please help
    My code
    Output of the report as well as output of archive program
    Cycles comptab. archivés
    0000000038
    0000000040
    0000000044
    0000000045
    0000000047
    0000000050
    Cycles comptab. ignorés (pour détails voir protocole de job)
    0000000001  Simulation
    0000000002  Simulation
    0000000003  Simulation
    0000000004  Simulation
    0000000005  Simulation
    .....etc
    Please help
    Edited by: Blaiso on Apr 1, 2011 5:54 PM
    Edited by: Blaiso on Apr 1, 2011 5:59 PM
    Moderator message: please post only relevant code parts, your post must be less than 5000 characters to preserve formatting.
    Edited by: Thomas Zloch on Apr 2, 2011 9:59 PM

    Hi Ajay,
    1.  You have to create a separate field catelogus and AIS according to your requirement with the required fields you want . Because the standard structures and field catelogues contains many fields from all tables. So before doing the read operation you have to deactivate the standard AIS and activate your newly created AIS .
    2. Can you give some more details for this question to be answered.
    3. The important archiving tables used are ARCH_IDX,ARCH_RPRG,ARCH_DEF.
    4. While scheduling the Read process in batch mode , it will give you three criterias to be entered.
         . Spool Parameters
         (ii). Start date
         (iii). Archive selection of files.
        Unless you enter values for any one of these options , You cannot execute the batch job.
    Hope this would help you.
    Regards - Swarna.

  • Programmatically assigning Authorization Objects to roles

    Hi there,
    I have created an authorisation object with eight fields. The fields control which parts of my application are accessible to the user. (Each field is one category, each category has several subcategories).
    What I want to do is the following:
    There shall be a custom authorization dialog, wherein the system administrator can configure the access of the application for a specific user.
    In plain text: I want to develop an interface which makes it possible to assign authorisation objects with specific values to a user or to an already existing role.
    Is there any functionality, that allows me to perform this assignment and regenerate the users profile?
    I already discovered, that the table UST12 contains the connection between the authorization profile of a role and an authorization object, as well as the assigned values. Anyhow, just to write new values to that table has no affect to the authorization when calling "authority-check object" in an ABAP report.
    Does anyone know, whether there are standard functions in the ERP System, that support the changing of authorization objects and the regeneration of roles?
    Thank you very much,
    Gregor
    Edited by: Gregor Bender on Mar 11, 2008 8:41 AM

    >
    Gregor Bender wrote:
    > I already discovered, that the table UST12 contains the connection between the authorization profile of a role and an authorization object, as well as the assigned values.
    Nope, sorry, it's not the connection but only one of the many.... Roles and profiles are stored in quite a lot of different tables so manipulating one table directly will hardly ever get you the desired situation. It may even lead to problems due to inconsistencies.
    For mass regenerating profiles there's transaction SUPC.
    For manipulating the contents of roles/profiles have a look at scripting with SECATT or LSMW in combination with PFCG.
    If you want to write code to add objects to roles you have to look at least in tables AGR_1250, AG_1251 and AGR_1252. The UST* tables are updated when generating profiles and/or comparing users.

  • Abap report attributes : Authorization group

    Hello,
    I would like to know if there is an enhancement to force the developer to assign an authorization group to the new created abap report, when filling the attributes
    Thank you by advance
    Philippe

    Hello,
    Thank you all for your answers.
    In both FUNCTIONs , EXIT_SAPDSAHD_010 (include ZXSEUU09) and
    EXIT_SAPLSEDTATTR_010 (include ZXSEUU20), I inserted a break <sy-uname>.
    When creating a new abap report (i.e. a local object), I reach only the
    break in include ZXSEUU20, and never after having filled up the program
    attributes popup, always before.
    My initial goal was to force the developer to enter a value in the authorization
    group.
    Do you have an idea of what is going wrong or is it the normal behaviour?
    Thank you,
    Philippe

  • Authorization object in zee report

    Dear experts,
    How to restrict a user from viewing ohter sales office.
    What are the steps to be followed.
    Who will create authorization 0bject or authorization group abaper or functional person.
    I am using AUTHORITY-CHECK in my report for a authorization object which is already created but
    it is not giving the correct results.
    Do I have to make a new authorization object and class for this.
    How should I control my zee transaction which is attached to this report.

    Hi,
    How to restrict a user from viewing ohter sales office.
    What are the steps to be followed.
    Who will create authorization 0bject or authorization group abaper or functional person.
    You need to identify the correct authorization object. BASIS team can help you in this.
    Usually all security related activities is taken care by the BASIS team. It depends on project to project.
    I am using AUTHORITY-CHECK in my report for a authorization object which is already created but
    it is not giving the correct results.
    What do you mean by not giving correct results. You might be having access to the sales areas you are trying to execute. That why check is successful.
    Do I have to make a new authorization object and class for this.
    Not required i hope as you already got the reply for this.
    How should I control my zee transaction which is attached to this report.
    Give the right authorization group in T-code as well (SE93). Even if you don't give, since you already have the check in the program, no issues i hope. But it is always advised to control this through BASIS at user role level rather than at ABAP level.
    Please note that authorization check statement won't give any error. You need to through the error if sy-subrc NE 0
    after the AUTHORITY-CHECK statement.
    Hope you are clear now:)
    Thanks,
    Vinod.

  • Is there any BAPI or FM to authorization object to user in ABAP program??

    Hi guys.
               My requirment is to assign  authorization object to user in ABAP program,is there any FM OR Bapi to do this?

    Hai  ,
    In order to do the authority check in the program ,   in your report at selection-screen event   you need to check for the corresponding authority output .
    example :
    T SELECTION-SCREEN ON p_carrid.
      IF p_carrid IS INITIAL.
        MESSAGE 'Please enter a value' TYPE 'E'.
      ENDIF.
      AUTHORITY-CHECK OBJECT 'S_CARRID'
                          ID 'CARRID' FIELD p_carrid
                          ID 'ACTVT'  FIELD '03'.
    Regards,
    K.VinayKumar

  • Authorization Object is not working when report is modified.

    Hi BW Guru's
    We have Company Code as Authorization Object .and we have 3 company Codes (xxxx,yyyy,zzzz).where the users under Company code xxxx are not supposed to view company code yyyy,zzzz data etc.
    I modified an existing Report and transported to production.But the Authorization Object is not working for that report.The Report is defaultly displaying all the company codes data(xxxx,yyyy) for all the users.But for the other reports its(company code ) is working fine.
    What could be the problem?Is theproblem in transporting the objects.But i transported all the objects inluding auhorization object.
    Please send me the solution as it is very much urgent.
    The solution will be def. awarded with full points.
    Regards
    Sanjay

    hi Sanjay,
    please don't post the same question again, check and response back from your previous thread
    Re: Authorization Object is not working when report is Modified.
    hope this helps.
    would be nice if you reward for helpful answers to all of your previous postings, e.g
    docs related to RRI

  • Report to check authorization object used in customized programs

    Hi Guys,
    An auditor came and he raised a question to us, he asked whether all of our customized transactions and programs are maintained with authorization checks? The question is how can we check what authorization objects are used for our customized programs and transaction codes? The developer did not maintain the objects used for that program in SU24 table. Is there a program or a report to show us all the authorization object used for a customised program or transaction? Example : T-code MIGO we can check in SU24 table for all the authorization object used. How do we check for customized tcodes? Please advise. Thanks!
    Edited by: Jarod Tan on Nov 25, 2010 9:42 AM

    Note that some programs are built in such a way that no (visible) auth check is necessary, or even desired at all.
    To determine the necessity of an auth check, you should check that starting it has an entry point (tcode, rfc, service) which is appropriately restricted. The rest (whether and where and how a further check is evaluated) is entirely dependent to what the program actually does.
    Well designed applications generally have centralized functions and methods, and the checks are in there or a "base check" they use.
    Others again use the same in UI programming to determine the visibility of functions, to make the application more intuitive for the user. This on it's own is however not a sufficient auth check to rely on.
    Code review is an art form!
    Cheers,
    Julius

  • ABAP reports to ABAP Objects

    Hi all,
    What are the steps to be taken while converting a normal ABAP report program to ABAP objects? Also, How do we write a module(of a module pool program) in ABAP objects?
    Thanks in Advance,
    Aswin

    Use methods of a class instead of subrouties wherever possible.
    Declare the global variables in the attributes section of a class.
    Make sure that your design itself is more data centric than process centric.
    Regards,
    Ravi

Maybe you are looking for

  • Anybody know how to fix the sluggishness with iTunes for my laptop?

    My laptop is outstanding, never crashes, no viruses, no slowing down, quick starts, very reliable.  Just a perfect computer. However with iTunes it stinks, it's slow, it responds slow, it'll freeze for sometimes up to (no joke) ten minutes waiting fo

  • Computer goes to blue screen when ipod plugged in.

    I have tried all angles on this and still haven't been able to figure out.  Can somebody please offer some new knowledge?  I have tried some older suggestions awithout resolution.  Here is what is happening using Windows 7/lastest updated itunes and

  • New computer + old hard drive... will I lose my data???

    My old macbook is going to be replaced with the new core 2 duo macbook. I took out my hard drive so that when the new computer shows up at my door, I can pop in my old hard drive. The problem is, I didnt backup my data. When the new computer comes, w

  • Loading a class from specified classpath

    Hello, I would like to create an instance of a class in a specific directory. So, I am doing this way : System.setProperty("java.class.path", classPath.getAbsolutePath()); Class object = Class.forName(name); Object instance = object.newInstance();It

  • Who have knowledge from Femtocell technology at Sony (Xperia Z2 and Zperia Z)

    Contact request for a person who have knowledge from Femtocell technology at Sony (Xperia Z2 and Zperia Z). I have been unable to resolve mobile data connectivity issues occuring with femtocell. Me and the operator have been trying to find a resoluti