Authorisation check in ABAP Query..

Hi Gurus
  Can we put Authorization check in ABAP Query ?
Your help is appreciated.
Regards,
Gajanan

Hi,
Please check this online document on how to setup authorization for SAP query.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
Regards,
Ferry Lianto

Similar Messages

  • User authorisation check in ABAP-HR program

    Hi,
    Can anyone please help me on the following query ?
    I need to check user authorisation in an ABAP report at Object level, filter only relevant records based on the user's authorisation and display appropriate messages.
    The above mentioned report is purely developed by us and is not a copy of any standard report. Hence, kindly help me with your suggestions and opinions.
    Thanks and Regards,
    Manas Menon

    Create an authorisation object (SU21)
    Put an authorisation check for this object in your report (AUTHORITY-CHECK)
    Create a role that contains this object (PFCG)
    Assign this role to all the users who require access to the report (SU01).
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 27, 2008 2:07 PM

  • Authority-Check in ABAP Query

    Hello,
            I have a requirement to add authority check on two fields "Sales Organization" & "Plant" in a ABAP Query.
    Please let me know how can I do it?
    Will I be required to add some "Authority-check" code in sq02 or is there any button/checkbox available to do the same.
    Please let me know.
    Thanks in advance.
    Best regards,
    Tejas Savla

    Hi Ronak,
    Check this thread, this might help you.
    Authorisation on field
    Regards,
    Chandra Sekhar

  • SQ01 -  Include a check box on ABAP query Selection screen

    Hi Experts,
    For my Abap Query, on the selection screen i am planning to include a check box such that if i click on the check box then a field will be displayed in the resulting output . On the other hand if i do not check on i should not be able the field in the output.
    Please tell me how do i do this.
    Thanks
    Venkata Pradeep.

    In infoset, Extras code tab
    Code section: At selection-screen output
    Do something like below:
      IF radiobutton1 = 'X'.    
         LOOP AT SCREEN.      
              IF screen-group1 = 'XXXX'.         "XXX is the filed group name you want to hide., you have to                                                                  find out what is it.
                   screen-input = '1'.        
                   screen-invisible = '0'.        
                   MODIFY SCREEN.      
              ENDIF.    
         ENDLOOP.  
    ELSE.   
         LOOP AT SCREEN.     
              IF screen-group1 = 'XXX'.        
                   screen-input = '0'.       
                   screen-invisible = '1'.       
                   MODIFY SCREEN.     
              ENDIF.   
         ENDLOOP. 
    ENDIF.

  • Authorisation checks fails in FMRP_RFFMEP1AX

    Hi,
    I've created a role giving access to transaction FMRP_RFFMEP1AX with restrictions on possible values
    for funds, budgetgroup, budgetposition.
    The authorisation checks succeed for funds and budgetgroup but fail for budgetposition : the report output shows lines which it shouldn't. I'm not an ABAP expert, but could it possible to disable programmatically certain authorisation checks ? How/where can I check this out ?
    Kind regards,
    Erik

    Hi Forhad,
    I'm not sure if the error is related to the communication between the Java and the BW or if it's a problem with the authorization.
    Are you using a customer exit or an authorization variable in your query/bookmark?
    Check if by chance your query have an hirarchy assigned to a characteristic, then, check the user's authorization and check whether you have enough authorization for the hierarchy.
    I'm unsure, but maybe note 916090 can help you.
    I hope it helps.
    Regards,
    Daniel

  • Pnp- logical db in abap query

    hi.
    i need to create an ABAP/sap query. when i created the InfoSet i used logical db-pnp.
    if i want to get only the employees which entered my organization during the last month where should i add the ABAP code,  under which section => extras -> code. i have there several options - data, initialization, at selection-screen output etc, what to choose??????????
    thanks,
    Ami

    Hi
    Welcome to SDN forum
    query has got some limitatins compared to Reports which we write using SE38
    these queries are user specific and client specific and can't be transportable and you can't write your own code as you wish like reports
    see the doc
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Step-by-step guide for creating ABAP query
    http://www.sappoint.com/abap/ab4query.pdf
    ABAP query is mostly used by functional consultants.
    SAP Query
    Purpose
    The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
    Features
    SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
    All the data required by users for their lists can be selected from any SAP table created by the customer.
    To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
    ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
    To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly
    use either SQ02 ans SQ01
    or SQVI tr code
    for more information please go thru this url:
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
    http://goldenink.com/abap/sap_query.html
    Please check this PDF document (starting page 352) perhaps it will help u.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    check the below link will be helpful for u
    Tutorial on SQVI
    once you create query system generates a report starting with AQZZ/SAPQUERY/ABAGENCY2======= assing this report to tr code for the same
    Regards
    Anji

  • How to hide some fields in ABAP Query

    Hi,
    My ABAP Query has a long list of extracted fields. I wanted to set some of these output to "HIDE".
    This allow User the flexibility to decide what fields to show.
    How can I set the field to "HIDE" in my query?
    Thanks
    bye

    Hi Tim,
    You can do this by setting the Report layout variant in following steps:
    1. First define the parameter on selection screent for report variant.
    2. Data decelaration for variant.
    3. Value request to get already present variants on report:
    4. If doesn't choose the layout take out the default report layout.
    5. Initialize the report variant.
    6. Apply the variant to the REUSE_ALV_GRID_DISPLAY funtion module.
             Here to generate report variant first to open report output and then as per according to user set the layout of report using the layout icon of ALV with summation on value fields (as required) and create layout name.
    *Data Deceleration as below:
    Data :g_save(1) TYPE c,
    **      g_default(1) TYPE c,
    g_exit(1) TYPE c,
    gx_variant TYPE disvariant,
    g_variant TYPE disvariant.
    *First Define the parameter to give layout of Report variant.
    SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE text-003.
    PARAMETERS: p_vari TYPE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK 3.
    * Process on value request
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
    PERFORM f4_for_variant.
    * Selection-Screen Checking
    AT SELECTION-SCREEN.
    PERFORM pai_of_selection_screen.
    INITIALIZATION.
    w_repid = sy-repid.
    PERFORM variant_init.
    * Get default variant
    gx_variant = g_variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
    i_save     = g_save
    CHANGING
    cs_variant = gx_variant
    EXCEPTIONS
    not_found  = 2.
    IF sy-subrc = 0.
    p_vari = gx_variant-variant.
    ENDIF.
    FORM f4_for_variant .
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
    is_variant = g_variant
    i_save     = g_save
    IMPORTING
    e_exit     = g_exit
    es_variant = gx_variant
    EXCEPTIONS
    not_found  = 2.
    IF sy-subrc = 2.
    MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    **  ELSE.
    **    IF g_exit = space.
    **    ENDIF.
    ENDIF.
    ENDFORM.                    " f4_for_variant
    FORM pai_of_selection_screen .
    IF NOT p_vari IS INITIAL.
    MOVE g_variant TO gx_variant.
    MOVE p_vari TO gx_variant-variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
    EXPORTING
    i_save     = g_save
    CHANGING
    cs_variant = gx_variant.
    g_variant = gx_variant.
    ELSE.
    PERFORM variant_init.
    ENDIF.
    ENDFORM.                    " pai_of_selection_screen
    FORM variant_init .
    CLEAR g_variant.
    g_variant-report = w_repid.
    ENDFORM.                    " variant_init
    **While Showing report pass the variant :::
    g_save = 'A'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = w_repid
    i_structure_name   = 'IT_MAIN'
    is_layout          = i_layout
    is_print           = i_print
    it_fieldcat        = i_fieldcat[]
    it_events          = i_events[]
    i_save             = g_save
    is_variant         = g_variant
    TABLES
    t_outtab           = it_main
    EXCEPTIONS
    program_error      = 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.
    Many Thanks / Himanshu Gupta

  • Getting error while assigning ABAP Query to Tr.Code

    Hi Guys,
    There is a problem iam facing with ABAP query while transporting which need to solved asap. It will very greatfull if u guys can resolve this problem.
    My problem is, I created one ABAP Query with Name ASSETOVERVIEW. I had transported this even, now when iam going to assign it to one transaction code with se93 lets say ZAOR. I need to give its description and program name in se93 right. now my question is what is program name i need to give in se93. Bcoz in SQ01 where i created the query, there is no name as 'program name' rather there is 'Name' in that we will create the query name i.e, ASSETOVERVIEW. In se93 u give tr.code and when u see down there will be radiobuttons in 'start object',in that i had checked program and selection screen (report transaction) is this right button i had checked or any other i need to check?. I had assigned this name i.e,ASSETOVERVIEW and development class and then when i check the name for syntax check its giving "'ASSETOVERVIEW' does not exist". I don't understand what program name i need to give.
    If u guys can help me out with this problem it will be very much appreciable and definetly can get the reward points.
    Thanks for as usual help in advance.
    Regards.

    Hi omer,
    1. Just run the query.
    2. one selection screen will come
    3. then using SYSTEM---->STATUS, (from menu)
       look for the program name
    4. the program name will be something wired foramt.
    /asdfasdf/asdfdas etc.
    5. Give that name in se93.
    regards,
    amit m.

  • How to get the name of an executing ABAP query in run time

    Hi ABAP Gurus,
    I need to get the ABAP query name when it's running. For example we can get the current executing ABAP program name from SY-REPID.
    My tried logic - every query generates an ABAP program like AQZZUGQUERY. 'UG' stands for user-group name and the length specified for it is 12, if the length of the user-group name is less than 12, then the rest will be filled by '='. Next 'QUERY' stands for ABAP query name and the length specified for it is 14, if less, then the rest will be filled in with '=' in the right. I've tried to extract the query name by using cut and trip (offset) operations.
    But somehow this logic is not working - always it's picking up the function name as checked in debug mode.
    Guys - Can you please provide me the solution on this.
    Thanks & regards,
    Jayanta Bej.

    Guys,
    I've cracked the issue. Instead of retrieving the query name from sy-repid, I've retrieved it from sy-cprog and the problem is resolved.
    Thanks guys for your quick responses.
    Thanks and regards,
    Jayanta Bej.

  • Problem with logical database DDF in ABAP query

    Hi All,
          I have created an ABAP query via the transaction SQ01 using the logical database DDF to retrieve customer master data from tables KNA1 & KNB1. The selection screen used is the screen 903 of the logical database DDF. But now the problem is that when I execute the query, I am getting a blank value in the tax code4(KNA1-STCD4) field though there is value in the KNA1 table for this particular field. This field was added to the table by means of a customizing include. Can anyone suggest a way to get around this problem so that I can view the content of the field STCD4 in the query.
    Thanks and regards,
    Sarath.

    I think it's not used by DDF.
    so you must check it with:
    check kna1-bran1 in s_bran1.
    A.

  • Hide/Delete lines from ABAP Query output when Quantity is 0

    Hi all,
    I'm changing an existing abap query. My requirement is to delete the rows from the report output where qantity = 0.
    I tried the following ways.
    1. In SQ01, select the quantity field and check the checkbox for "Display only field <> 0", but this didnt worked as it will 
         supress the zero from display.
    2. I tried to write code in the Infoset SQ02->Edit->Code. I wrote the following code "CHECK vbep-wmeng IS NOT INITIAL".
        Here  the problem is, the code is not executing in the test client. When I open the Infoset in test(i mean development test) 
        client the code is there, but when i execute the program its not working. I tried using "BREAK-POINT", program executions
        does not stop at the break point. There is existing code in the event "START-OF-SELECTION", this code I'm able to see in the
        query program opened through SE38. I edited the existing code and kept a break point in between, and now checked in the
        program in SE38, but the changes are not reflected. I'm able to see old code only(even after save n generate).
    3. Gave search in SCN, google etc.
    Please note.
    1. I'm not using any Logical Database in the Infoset. Its a simple join of 4 tables.
    2. Query is created in the Global Area (cross client) not client specific.
    Can anybody tell me what could be the problem and how can Over the above issues and achive the requirement.
    Thanks in advance.
    Edited by: Mr A on Feb 25, 2010 1:39 AM

    Dear Mr A,
    Can i know how did u solve the issue even i'm facing the same problem.
    Regards,
    Karan Bhasin

  • ABAP Query error

    Hello! can anyone help pls?
    I am in the process of constructing an ABAP query and I'm getting an error message which is quite puzzling.  Here's the details:
    I'm creating the query using an infoset constructed from logical database VAV.  When I try to add field VBUP-GBSTA to my basic list design, I get the following error:
    "You placed fields from different parallel branches of the hierarchical data source in the same line. . This makes no sense. The list will not be displayed as you desire. . List is only displayed in simple format for correction purposes. .  Please check the sequence. Button  allows you to color list fields according to the hierarchy. "
    I don't know why this is the case, and I really need to report on that field. Any ideas would be most appreciated!
    Thanks in advance!

    Hello Elizabeth,
    I hope you have selected VBUP also in the hierarchy in the infoset. If this is selected and the field which you are looking for (GBSTA) is assigned to a field group, then u should be able to select this in the basic list.
    Hope this helps
    Abhijit

  • ABAP query not returning correct number of records

    Hi,
    I have created an ABAP Query using logical database VFV and nodes VBRK, VBUK and VBRP.
    But, after entering values for Sales Organisation ( VBRK-VKORG ), Distribution channel ( VBRK-VTWEG ) and Date ( VBRK-FKDAT), the number of records that I get are very less in number as compared to the actual number in the database.
    Please give some pointers to the reason. I have set Lines 60 and Columns length - 83 and selected ALV List.
    Regards,
    Garima.

    Hi Garima,
    Please Check whether you are selecting all the Key fields in your Query.
    Thanks & Regards,
    Ashok kumar.

  • Abap query issue.

    Hi ,
    I have an existing abap query whose infoset has logical database ADA.
    Now I have to add a new table ANLC to this existing query .
    My main task is to add 3 new fields in the output of the existing abap query  One is a direct field from the ANLC table namely  Acquisition value and 2 other fields will be derived from the following formula :
    anlc-Acc ordinary depreciation + anlc-Ord. depreciation posted = Total accumulated depreciation.
    NBV = Acquisition value u2013 Total Acc depreciation
    Could you please sugest:
    1.  how to add  the ANLC table in the query?
    2.  How to calculate the above two fields and populate the output in an abap query?
    Thanks,
    Suchi.

    No, above mentioned is not the solution for your problem.
    I believe you want to write ABAP Query (i.e. Tcode SQ01), NOT the SQL Query in a normal program.
    Now, if you want to put abap code behind a field in your SQ01 query then you need to create custom field in your infoset. To learn how to create custom fields I have written a blog: SAP Adhoc Query SQ01 SQ02 SQ03
    Good news is that you do not need to create custom fields for the requirement that you mentioned.
    i want to fetch data where one field begins with 1* or 2* or 3* or 4* .
    For this, simply put the field on the selection screen by selecting appropriate check box and just use 1, 2, 3* or 4* in on the selection screen.
    Where should i COUNT the data selected and display it .
    when you execute the report, click on the 'Layout' icon, and select 'Column for number of rows'. It will give you last row with count. You can then save the layout as default layout so that it appears automatically.
    If you want to do anything different than above then you need to create custom fields, see my blog for that.

  • Validate plants selected in Abap Query selection screen

    Hi Everyone,
    I have a requirement wherein i have to validate 'authority check' for the plants populated in the selection screen in an already created abap query.
    I tried adding code in the code section. But i dont know how to use the select-option parameter. It already exists(VBAP-WERKS) in the table which is used for join, so i cannot add it in the additional fields. Am i correct ?
    Also, i saw that the report program for this query uses this parameter sa SP$00008. I tried using it but it gives an error The IN operator with "SP$00008" is followed neither by an internal table nor by a value list.
    Please help.
    Also, please advice whether this requirement can be catered in this query alone? or should i go with writing a new report program for this? ( i personally feel that this would beat the purpose of using Abap Query. )
    Regards,
    Tarun

    Hi Tarun,
    I am still not clear with the problem..I guess you require plant in your selection screen which you have.
    i guess if you go to sq01tcode there is a option infoset query from where you can give your selection options and value.
    have you selected all the fields in infoset and made a selection screen?
    When you have done with your infoset you just need to diplay the fields and there is a automatic program generated.
    Let me know...
    Regards,
    Nihkil.

Maybe you are looking for

  • Mailbox move failure - EX2010 to 2013 - IExchangeFastTransferEx.SetProps failed ‎(hr=0x8004010f, ec=0)‎

    Hi, I've been having problems moving my mailbox from Exchange 2010 to 2013 as part of an upgrade I'm doing.  I've moved a couple of other mailboxes without issues, and the account can move between different DAG groups on Exchange 2010. The process do

  • Import error message "-4960"

    Using iMovie 4. I have already done this movie, from video clips from my camcorder. I have saved the clips, put them on an external drive, but now I had to bring them back onto my desktop to make another version. Some of the clips will import, but mo

  • Oracle 11.2.0.1 & oo4o(32bit)で表関数を使用するとエラーとなる

    お世話になっております. 通常サーバー: asianux 3 (32bit) , Oracle Database 10g Enterprise Edition Release 10.2.0.1.0, ビッグデータ用サーバー: asianux 4 (64bit) , Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit クライアント: Windows 7 (64bit) Excel 2010(32bit) Oracle

  • CIN Details for Export Customer

    Dear Experts, We are having export sceneraio in our company. Everything is working fine wih configuration. But at the time outgoing excise invoice it is showing error that customer CIN details has to be maintained. My question is Does the foriegn cus

  • Repository Service - Checking a custom property!

    Hi All I am trying to create repository that will check a custom property 'RepGroup' and then act on it if the the property contains a certan value. However I am not sure how to do this - does anyone have an example I could see? Many Thanks Phil