Authorization chaeck in report based on Table

My client want report to be displayed based on the Authorization. For example when user is entering Input parameters like Plant, Sales org. and executing the report it should check for the Authorization of the user for that plant and Sales org.
the reason being they don't want to allow other division to see the important data of that report. As this report is used by all the division and i can not put check in Role assignment as many of the roles are there with same t-code of report and where plant and sales org is mentioned as * in that roles.
i want to put check based on ABAP coding and write with the help of Table and Field in order to Check the Authorization of Plant and sales org for that particular USER PROFILE.
Bacause changing in the profile will have huge effect on the report functionality as this reoprt is used in ALL over india level and our client Business spread all over iNdia Level.
If anybody know how to do that can help alot.

hi,
Check the foll.:
AUTHORITY-CHECK OBJECT object     ID name1  FIELD f1
Explanation of IDs:
object
Field which contains the name of the object for which the authorization is to be checked.
name1 ...
Fields which contain the names of the
f1 ...
Fields which contain the values for which the
AUTHORITY-CHECK checks for one object whether the user has an authorization that contains all values of f.
Create an object say, z_auth with auth fields as plant(WERKS), Sales Org(VKORG) etc..whatever is relevant.
Now, in ur report, U can write..
say, pa_plant is a parameter in ur seln screen.
AUTHORITY-CHECK OBJECT 'ZAUTH'
             ID 'WERKS' FIELD pa_plant.
      IF sy-subrc NE 0.
"No authorization for plant <pa_werks>"
        MESSAGE exxx WITH pa_plant.
      ENDIF.
I hope this helps.
Plz Reward suitable points, if it helps.
Rgds,
Raghu.

Similar Messages

  • Authorization of alv report based on plants

    I have created a new alv report for sale order statement.The problem is which can be seen in all plants
    irespective of the user.Suppose our company has 5 palnt
    Plant 1100 to 1500
    The problem is suppose a user he has only rights in a prticular plant but he can see all the palnt sale order details
    How can we authorize this particular alv report based on the plants

    Hello,
    My assumption: You have Company Code(T001-BUKRS) in the selection-screen.
    Plz check the code snippet below:
    DATA:
    IT_PLANT TYPE STANDARD TABLE OF WERKS,
    WA_PLANT LIKE LINE OF IT_PLANT.
    DATA:
    IT_R_WERKS TYPE RANGE_T_WERKS_D,
    R_WERKS TYPE RANGE_S_WERKS_D.
    SELECT BWKEY INTO TABLE IT_PLANT
    FROM T001K
    WHERE BUKRS = '1000'. "--> Here you have to use your sel. scr. parameter
    IF SY-SUBRC = 0.
      SORT IT_PLANT BY WERKS.
    ENDIF.
    LOOP AT IT_PLANT INTO WA_PLANT.
    * Check the authority for the plant
      AUTHORITY-CHECK OBJECT 'M_MSEG_WMB'
               ID 'ACTVT' FIELD '03'
               ID 'WERKS' FIELD WA_PLANT-WERKS.
      IF SY-SUBRC = 0.
        R_WERKS-SIGN = 'I'.
        R_WERKS-OPTION = 'EQ'.
        R_WERKS-LOW = WA_PLANT-WERKS.
        APPEND R_WERKS TO IT_R_WERKS.
        CLEAR R_WERKS.
      ENDIF.
    ENDLOOP.
    IF IT_R_WERKS IS NOT INITIAL.
      "Select data using the Plants for which user is authorised
    ELSE.
      "User has no authority to display any Plant data
    ENDIF.
    Hope this is of some help to you.
    BR,
    Suhas
    Edited by: Suhas Saha on Mar 18, 2009 10:18 AM

  • Generating an  html report based on table at sql 2005 db

    Hi
    I want to create an html report based on a table named inventory on sql server 2005 database.
    first code used to generate an output report
        try {
                // TODO add your handling code here:
                String s = "<html> <body> <table border=1><caption> Inventory Report </caption>";
                s += "<tr><td>Item_id<td>item_name<td>Existing quantity</td><tr><td>3<td>4<td> <td>";
                byte[] sb = s.getBytes();
                FileOutputStream fs = null;
                try {
                    fs = new FileOutputStream("D:\\Report\\Report.html");
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
                fs.write(sb);
                fs.close();
            } catch (IOException ex) {
                Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
    Second jdbc  code for connection and select all records in the table
    try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                 con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
                st = con.createStatement( );
    ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity  from Inventory");
         String s="";
    while(rset.next())
        s+=(rset.getString(1)+"\t\t"+rset.getString(2)+"\t"+rset.getString(3)+"\t"+rset.getString(4)+"\n");
          st.close();
                con.close();
         catch(ClassNotFoundException ex)
             ex.printStackTrace();
          catch(SQLException ex)
             ex.printStackTrace();
            }                             I want someone helps me to merge two codes into one code to generate an output html report.
    thanks in advance

    This is my trial but not the desired result ,it's displayed the title and a line only
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            // TODO add your handling code here:
                          String s = "<html> <body> <table border=1> <caption>Report title</caption>";
                byte[] sb = s.getBytes();
                FileOutputStream fs = null;
                try {
                // TODO add your handling code here:
                try {
                    fs = new FileOutputStream("D:\\Report\\myeport.html");
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
                fs.write(sb);
                fs.close();
            } catch (IOException ex) {
                Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
                try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                 con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
                st = con.createStatement( );
    ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity  from Inventory");
    while(rset.next())
                   s+=("<tr><td>"+rset.getString("Item_Code")+"</td><td>"+rset.getString("Item_Name")+"</td><td>"+rset.getString("item_cost")+"</td><td>"+rset.getString("item_quantity")+"</td></tr>");
                try {
                // TODO add your handling code here:
                try {
                    fs = new FileOutputStream("D:\\Report\\myeport.html");
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
                fs.write(sb);
                fs.close();
            } catch (IOException ex) {
                Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
         st.close();
                con.close();
         catch(ClassNotFoundException ex)
             ex.printStackTrace();
          catch(SQLException ex)
             ex.printStackTrace();
        }

  • Authorization for running report based on Remote Cube

    Hi ,
    I have created a report based on Remote cube in BI 7.0
    I have created a DTP with Direct access to load the Remote cube.
    While running the report based on Remote cube , I am getting error
    'You are not authorized for the DTP '
    The report is running only when I assign the '*' value  to the authorization objects for the role in which the report is stored:
    S_RS_DTP = * (For DTP)
    S_RS_TR = *   (For Transformation)
    S_RS_DS = * (For datasource)
    I want to restrict the values to the objects related to my report only rather than * which means ALL.
    Please help what values to assign for these authorization objects for the Role.
    Thanks.

    Hi,
    You need to make necessary settings in RSECADMIN for the Authorization Objects. The default values will be * . You have to customize them to suit your requirement.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/101fb4f5-eb7c-2c10-5daa-b479c47f0a14
    Regards,
    Suman

  • Authorizations for WEBI report based on BPC data model

    Hi All,
    We are strugelling with setting up authorisations for the reporting on BPC data model.
    We created Bex query on top of Multiprovider that consists of BPC cube. The Bex query is source for WEBI output. The authorisations has been set up on BPC data model (cube) in BPC application but they are not passed nor to Bex query nor to Webi. Example: The query is build on top of OPEX BPC data model, this data model is restricted based on Oranizational Unit. My test user is allowed to see only Org Unit = 'Australia' in the OPEX BPC data model, however when I'm running the report I can see absolutely everything.
    We are not connecting/using any BI cubes itself for this reporting. We are intrested only in the WEBI report based on BPC data models.
    We were trying to use BPC data model (without any extra settings) as the source for BEx report, we were also trying to use virtual BPC data model as the source for Bex transient query - but non of these have helped.
    Can you please advise how the authorisations should be set up for WEBI reporting on BPC data models?
    Kasia

    Anybody can help with this issue please?

  • Reports based on SQL view contain no data. Reports based on tables work just fine

    When we load a report into Crystal reports server that is based on a SQL view the report will run but will contain no data. A report that pulls data from SQL tables works just fine. Running the crystal report on standalone crystal reports works just fine.
    I am completely lost on this one. If you have any ideas please send them my way.

    Are you missing an ODBC / TNS entry on your CMS (or report processing, if clustered env) server?  This could definately be an issue if the report will run locally within CR client, but not when hosted on the enterprise environment.  Another test would be to run the report from CR client ON the CRS / BOE server..

  • Report S_ALR_87013105 : no authorization for the report/ table 7KU6_001

    Hi Gurus,
    While executing the program S_ALR_87013105 (Detailed Reports 
    For Sales Order : Plan/Actual Comparison ) system showing the selection log.
    "Have no authorization for the report/table  7KU6_001 and 7KU6_002".
    But for the user the authorization check through SU53 was successful.
    Pl can any one suggest on this issue.
    Thanks in advance,
    Vijay

    Hi,
    Contact your basis consultant to provide the missing authorisation. This is one of the authorisation object.
    Regards,
    Sankar

  • Report based on two fact tables

    Hi,
    i've the same issue, of thread
    report based on 2 different Fact tables I've read reply marked as "CORRECT" but I don't understand what to do precisely. Can you explain better?
    How Can I create an alias?
    What about "If the dimensions are directly linked then mention detailed level else mention the total level which has no direct join b/w fact and dimension... "???
    I hope in your help. Thanks
    Thanks
    Giancarlo

    HI Daan,
    thanks for reply. Can you explain better point number 2?
    I have created an alias for my table (because i use MOLAP approach, i haven't a table but a cube view generated by View Generator Plug-in). Now what i must do with my alias table? Furthermore can you explain better point 2? Finally how i must create complex joins of my new fact table ?
    I am newbye of Administration Tool, so i would need of a visual explanation or of a step by step explanation. Can you give me it?
    I need of your help, because I must finish a project for my customer
    All regards
    Giancarlo
    Edited by: user5380662 on 27-mag-2010 5.07

  • T-code or SAP Table Sales report based on Document Pricing Procedure

    Hi Experts,
    Please suggest me some SAP Standard T-code or Sales Report based on Document Pricing Procedure and Sales Area.
    Or suggest me SAP Table for the above mentioned combination. Thanks in advance.
    With Best Regards,
    Bharat B

    Hi
    There is no standard t code available. You have to go for Zee using the below tables
    first you need to get the VBAK-KALSM(Pricing procedure)or VBRK-KALSM  next you have to pass the VBAK-KALSM to table T683V-KALSM(field) now you will get all the Document Pricing Procedures (KALVG) assigned to these pricing procedures along with sales area.
    So using these tables you can get the required data.
    regards
    Prashanth
    Edited by: Prashanth@SD on Jan 18, 2011 7:58 AM

  • Dynamic query table for report based on LOV selected

    Hi,
    Need some suggestion and guidance how to dynamically query table via lov for report .
    Scenario:
    Table, TABLE_LIST, has tablename (table in DB) and filter (for where clause) column. The TABLENAME_LOVE is derived from table TABLE_LIST.
    SELECT TABLENAME D, TABLENAME R FROM TABLE_LIST
    In Page 2,a page select list item,P2_TABLENAME to use TABLENAME_LOV
    All data in tables in the table_list have identical structure (columns, triggers, primary key, and so on).
    I want to have the report region query from the table based on selected LOV.
    Example,
    Tablename Filter
    TB1
    CD2 ACTIVE='Y'
    When select TB1, the report regin will query based on TB1.
    When select CD2, the report regin will query based on CD2 WHERE ACTIVE='Y'
    Question:
    How can I query based on &P2_TABLENAME. WHERE &P2_FILTER.
    Like
    select col1, col2 from &P2_TABLENAME WHERE &P2FILTER
    Greatly appreciate any suggestion and some guidance.
    Tigerwapa

    Hi,
    You should always post your Apex version, DB version and other information as suggested in the FAQ.
    And the moment you talk report you should state whether it is IR or Classic.
    As for your query, have you explored the Report type "SQL Query (PL/SQL function body returning SQL query)" ?
    That might be a good fit for what you are trying to achieve.
    Regards,

  • Report based on plsql table type

    Is it possible crete a report (updatable) based on plsql table type?
    thank in advance
    Franco Galante

    Sorry for my cryptic question, i wanted to mean create a report based on a stored procedure
    function which return a plsql table type variable.
    This idea could give me the chance to work with variable (plsql table) instead of db table.
    hope i'm enough clear
    thank you again
    Franco Galante

  • Report based on Ref Cursor and lock package/table (ORA-04021)

    Hi,
    I have reports based on Ref Cursor. Report builder and Reports Background Engine make pins for package, which consist of Ref Cursor, and for tables, which is used in package. So I can't grant any privileges on these tables anybody.
    For example, after next statement:
    GRANT SELECT ON table_name TO user_name
    I received the next error:
    ORA-04021: timeout occurred while waiting to lock object table_name
    Thanks

    Hi,
    I have reports based on Ref Cursor. Report builder and Reports Background Engine make pins for package, which consist of Ref Cursor, and for tables, which is used in package. So I can't grant any privileges on these tables anybody.
    For example, after next statement:
    GRANT SELECT ON table_name TO user_name
    I received the next error:
    ORA-04021: timeout occurred while waiting to lock object table_name
    Thanks

  • How to find ECC tables/ reports based on which a DB View is created?

    Hi All,
    We have customized data source created based on a View/ Table.   How can i find the ECC tables/ reports based on which this View has been created and also the logic behind which the different fields extract data from ECC..
    Please advice.
    Thanks & Regards
    Sneha

    Hi Sneha,
    The only logic, i guess, that could be used is either defining the join fields or some restriction put in the selection conditions tab of the view. for e.g. if the view should only return Doc type XYZ, the same could be implemented in selection conditions tab. for transaction to check the view, it was already posted above.

  • Report based on 2 different Fact tables

    Hi all
    Is it possible to make a report based on 2 Fact tables wich are not linked to exactly the same dimensions?
    FactTable1 : linked to Time,Product,Geography
    FactTable2: linked to only Time
    The FactTable2 will contain only one measure which is a constant value per year and It will be used to be compared to the FactTable2's measure (It's a kind of reference).
    So do FactTable2 need to be linked to Geography and product to be able to create this report??
    Regards.

    I tried to set the level for the metrics...now it doesn't make the CAST anymore, but i get a result set bigger than i need...
    BI Server seems to make the union of 2 instead of the intersection...
    For example, if i have 5 customers, but only 2 customers have a service request (order) associated, then the server returns the following report
    Customer Code | Service Request Code | # asset(Fact 1) | # order (Fact2)
    0000001_________NULL_______________ 5____________ 0
    0000002_________NULL_______________ 4____________ 0
    0000003_____ 700000930______________ 3___________ 1
    0000004_____ 700000930______________ 3___________ 1
    0000005_________NULL_______________ 3____________ 0
    while my goal is to get just the list of customers having at least a service request (order)...
    I tried to create a filter on the column "Serve Request Code", but it doen't have effect, cuz the server lunchs 2 different sql queries to create the report:
    select D1.c3 as c1,
    D1.c2 as c2,
    D1.c1 as c3,
    D1.c4 as c4
    from
    (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4
    from
    (select count(distinct T111689.ROW_ID) as c1,
    T112015.SR_NUM as c2,
    T111844.OU_NUM as c3,
    T111844.ROW_ID as c4,
    ROW_NUMBER() OVER (PARTITION BY T111844.ROW_ID, T112015.SR_NUM ORDER BY T111844.ROW_ID ASC, T112015.SR_NUM ASC) as c5
    from
    CW_CASE T112015 /* Dim_CW_CASE_Case_Order */ ,
    CW_CUSTOMER T111844 /* Dim_CW_CUSTOMER_Customer_Order */ ,
    CW_ORDER T111689 /* Fact_CW_ORDER_Order */
    where ( T111689.ACCNT_ID = T111844.ROW_ID and T111689.SR_ID = T112015.ROW_ID and T111844.ROW_ID = T112015.CST_OU_ID )
    group by T111844.ROW_ID, T111844.OU_NUM, T112015.SR_NUM
    ) D1
    where ( D1.c5 = 1 )
    ) D1
    +++Administrator:330000:330001:----2009/02/04 14:42:22
    -------------------- Sending query to database named WBIP (id: <<901676>>):
    select D2.c2 as c1,
    D2.c1 as c2,
    D2.c3 as c3
    from
    (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3
    from
    (select count(distinct T149849.ROW_ID) as c1,
    T111844.OU_NUM as c2,
    T111844.ROW_ID as c3,
    ROW_NUMBER() OVER (PARTITION BY T111844.ROW_ID ORDER BY T111844.ROW_ID ASC) as c4
    from
    CW_CUSTOMER T111844 /* Dim_CW_CUSTOMER_Customer_Order */ ,
    CW_ASSET T149849 /* Fact_CW_ASSET_Asset */
    where ( T111844.ROW_ID = T149849.OWNER_ACCNT_ID )
    group by T111844.ROW_ID, T111844.OU_NUM
    ) D1
    where ( D1.c4 = 1 )
    ) D2
    thanks in advance,
    Nazza

  • How to biod Crystal Reports based on ABAP Tables/Views

    Hi,
      Can any one post me some document stuff on building Crystal reports based on ABAP Tables/Views please!
    Thanks,
    Madhu.

    Hi,
    Check out the links below for Crystal Reports :
    Re: Crystal report in SAP BW
    http://support.businessobjects.com/documentation/product_guides/
    http://help.sap.com/saphelp_nw04/helpdata/en/86/06a8d3be17fc47aa8d850e50cf5f24/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/46/dfd33b1ed4b47de10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/34/c0523e83464644e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5f72b7c0e943d99f4f5cef2bfacfe1/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/06/00a63b60f26e3be10000000a114084/frameset.htm
    Hope this helps.
    Cheers,
    Kedar

Maybe you are looking for