SAP query -Security at plant/Comp Code  level

Hi,
How can we secure SAP queries on Plant level/Co code level ?
I developed Query using Sq01.
Regards
Pravenn

Hi,
GO TO SE93....
Just create a parameter transaction with reference to START_REPORT transaction. When creating a parameter transaction you have to set the following parameters:
D_SREPOVARI-REPORTTYPE = AQ
D_SREPOVARI-REPORT = precisely the first 12 characters - query user group (including trailing spaces), 13-th character is G for global queries
D_SREPOVARI-EXTDREPORT = Query name as shown in SQ01.
Do not forget to check the flag "Skip first screen".
or
within SQ01 go to "Query>More Functions>Display report name".
Then you create a t-code from SE93 with the shown report name...
May be you also use this report, This i have copied from the SDN.
REPORT ZRUN_QUERY .
* DECLARACIÓNES *
DATA:
REPORTNAME LIKE AQADEF-PGNAME.
* PANTALLA DE SELECCION *
SELECTION-SCREEN BEGIN OF BLOCK B0 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS: P_BGNAME LIKE AQADEF-BGNAME OBLIGATORY,
P_QUNAME LIKE AQADEF-QUNAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN END OF BLOCK B0.
* CUERPO DEL PROGRAMA *
CALL FUNCTION 'RSAQ_REPORT_NAME'
EXPORTING
WORKSPACE = SPACE
USERGROUP = P_BGNAME
QUERY = P_QUNAME
IMPORTING
REPORTNAME = REPORTNAME.
CALL FUNCTION 'RSAQ_SUBMIT_QUERY_REPORT'
EXPORTING
QUERYREPORT = REPORTNAME
VARIANTE = SPACE
EXCEPTIONS
ONLY_WITH_VARIANT = 1
VARIANT_NOT_EXIST = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Please search SDN for "transaction AND sq01" you will get lot links , that will give useful info related to creating transaction code to SQ01.
aRs

Similar Messages

  • SAP Query Custom Field with ABAP Code

    Hi All,
    I have a custom field in my SAP query which has some ABAP code under it. The code finally writes some value to a variable. My question is do i need to explicitly link the variable in the ABAP code to the custom field OR it's done automatically. For some reason i don't see any value for this custom field. Thanks.

    Thanks Sandra

  • Sap Query Additional Fields using  Abap Code

    Hi Experts,
    I am relatively new to the world of SAP query (Log Database PNPCE), I have written a number of additional fields to retrieve previous info-type data using the select statement E.G
    prev_endda = p0008-begda - 1.
    SELECT  single bsgrd
          INTO FTE1
          FROM
            pa0008
          WHERE pernr EQ  P0008-pernr
          AND   endda EQ prev_endda
    Although I can retrieve the previous info-type data , I was wondering if there was a easy way where I could take this a step further and show the Previous , Previous record. I.E
    Pernr     FTE Current    FTE1      FTE2
    101              60%          30%       75%
    I guess what I am asking is , is there a way to loop through the HR info-type records, does anybody know if there is a standard function or macro I can use to achieve this.
    Your help is much appreciated.

    Hi ,
    Thanks for our reply.
    I have pasted some example code into my additional field which I have created in SAP Query But im not sure how the loop bit works and how I can populate the additional fields that I have created , could you please explain this
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        pernr                 = '000000019'
        infty                 = '01'
        BEGDA                 = '18000101'
        ENDDA                 = '99991231'
      tables
        infty_tab             = p0008
      EXCEPTIONS
        INFTY_NOT_FOUND       = 1
        OTHERS                = 2
        LOOP AT p0008.
    NOT SURE WHAT TO PUT IN THIS SECTION *****
      ENDLOOP.
    I have created 3 additional Fields in the infoset Current FTE ,FTE1 FTE2 , and I want to loop through the records and populate the relevant Additional field with the employees FTE  (I only want to populate  where there is a change)
    Sample Data
    Begda              Endda             FTE        Salary
    1/1/2010         31/12/999       60%         19K          (Current  FTE)
    01/08/2009     31/12/2009     100%       27k           (FTE1)
    01/07/2008     31/7/2009         50%       17K          (FTE2)
    Thanks in anticipation
    DM

  • To Find the SAP Query from the tranaction code or the program name

    Hi,
    I have a situation wherein I have to modify the sap query associated with an transaction code.But the problem is that I am unable to find the SAP Query.
    <b>Please let me know how to find the SAP query from the transaction code or the program name.</b>
    Thanks and Regards,
    Rupesh

    Hi Rupesh,
    1 use FM
      RSAQ_DECODE_REPORT_NAME
    2. This is one of the best and easiest way.
    3. It will provide u the following info.
       WORKSPACE
       USERGROUP
       QUERY    
       CLIENT   
    4. Thru TCode U must know the program name first.
       This can be discovered using SE93.
    Hope it helps.
    Regards,
    Amit M.

  • SAP Query - Additional field that collects information from table RESB

    Hello gurus. I have a question.
    I want to create a SAP Query that shows me the stock level of a list of materials, and also show me the total quantity of order reservations in an additional field.
    I created an InfoSet with table MARD, which is the one that holds the Stock information in a plant. Then I created an additional field which would read information from table RESB, the table that holds order reservations per material.
    So I wrote this piece of code:
    SELECT * FROM RESB
    WHERE MATNR EQ MARD-MATNR and
           WERKS EQ MARD-WERKS.
    ENDSELECT.
    if ( sy-dbcnt NE '0').
          MOVE RESB-BDMNG to ZQTY.
    ELSE.
          MOVE '' to ZQTY.
    ENDIF.
    This works fine. However, this is currently just catching the first record in table RESB that matches my condition.
    What I would like is to collect every instance of RESB-BDMNG and add them to field "ZQTY", have it loop in RESB until it finishes finding every record that match the MATNR and WERKS. With this I could get the total number of order reservations that this material has in that table.
    Could someone share some coding that would help me achieve this?

    Yes! That did it. That's what I needed to do. Thank you so much.
    While I'm at it, let me ask you a related question.
    When I execute the query, in the first records of the query where there's no value from RESB to transfer, the value of field ZQTY appears empty. Once it finds the first record in RESB and it populates ZQTY with a value, then the rest of the records with no hit get the proper value of 0.
    Do you know why the first records in the query appear empty and not with a 0? Is there anything I should add to the coding to fix this?

  • SAP Query - Adding new fields to SAP query

    Hi experts,
    I got an issue to work on SAP query.
    I have Transaction code and need to know the infoset to add additional two fields to the existing output.
    Please let me know how to find infoset/ Query for the specfic transaction and how to add fields.
    Regards,
    Venkata

    first check the transaction code given to you.. if it is report transaction (check using SE93), then get the report name for example AQFKTES_SGS_IV==MMIV0003======, then after aQFK,TES_SGS_IV woulbe be your user group and MMIV0003 would be your query. Now go to SQ03 with the user group (you need to check the query areas also which would be Environment---> query areas) because some can be client depended some can be just cross client. and then go to sq01 from user group. It will direct you to the queries of the user group you mentioned in SQ03. Now you should be able to find the query you are looking for. The infoset will also be displayed linked to the query. The infoset can be displayed via SQ02 transaction.
    If it is parameter transaction code, you need to check the parameter values to find the query details. Rest of the approach is same as mentioned above.

  • SAP Query not running

    Hi,
    I am doing SAP query, If I select Company Code, i need to get the resule of
    GL a/c, Buss Area, Cost Center, Profit Center
    For this in table joints i taken KNA1, KNB1, SKB1, CSKS
    then also i could not run the report.
    Rgds
    sunfico

    Hello
    When you have chosen a query and a user group on the initial screen, you can execute the query online or in the background.
    Executing Queries Online
    Executing Queries in the Background
    Improving Response Times
    Interactive Functions for ABAP Lists
    Direct Interaction
    Check this link for further notes executing queries
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/b7/26ddebb1f311d295f40000e82de14a/frameset.htm
    regards

  • Blocking logistic invoice verification at company code level

    Dear all,
    May I know what is the system setup (SPRO) for this:
    Blocking logistic invoice verification at company code level ?
    Thanks
    tuffy

    Hi There
    I think it can be solved in 2 ways,,
    1. Number range, if you have not defined for the particular company code for this year,,
    2. Authorization for the Comp Code level (Check with your basis team ,, it will be the easieast way to block it for CC level and when ever you want they can just remove the block, (insterad of doing the changes in config, if basis can control the authorization it will be the best way)
    Hope it helps,,
    Thanks
    Senthil

  • Drilldown on SAP Query

    Hi all,
    I have created an SAP Query and assigned a Transaction Code to it. All works perfectly.
    I now want to be able to drill down on the List Report.
    For example, I want to double-click on the Purchase order number and the Purchase Order must then be displayed.
    Is this possible and if so, how???

    Paul
    It's been a while since I've used SAP Query, but I'm almost certain that this is not possible.  The reason is that you'd have to tell the system how to react to a user action such as a double click, and for that you'd have to program the event and the subsequent action to be taken after the event is triggered, and I'm pretty sure SAP Query doesn't offer this capability.
    I don't think you can even do that with SQVI which is what most people use now.  If all you want to do is select some data and then display a document for a given event, then create an ALV if you want the look and feel of an SQVI screen, or create a simple list report with interactive events.
    Regards
    Kurt

  • Backup data in Company code level

    Hello,
    Does anyone know any SAP tools which can backup Company code level data. Eg FI Doc, Customer Master, Vendor Master..
    Cheers,
    Benny

    Hi Anil,
    Thanks for reading my message.
    Our SAP server is 4.7, which has ~500 company codes. Currently we would like to extract 2 company codes data and restore in another ECC 6.0 server. Assume both servers have the identical configurations. From our understanding, backup and restore would be one of the approaches to achieve that.
    Is there any SAP tools that allow us migrate all company code level data to the ECC 6.0 server? Eg FI Doc, Customer Master, Vendor Master, PO, SO, Asset accounting datau2026.  
    Cheers,
    Benny

  • SAP Query SQ01 restriction at Plant level

    Hello All,
    Is possible to restrict SAP SQ01 Query report at Plant level? I mean if it can be restricted through Auth object at Role level?

    Hi,
    OK, when a query is created you can hard code selection parameters into the query itself (i.e. default in the company code).  That way you have have queries:
    ZQ_SHIP_LIST_1000
    ZQ_SHIP_LIST_2000
    ZQ_SHIP_LIST_3000
    Where the 1000, 2000, 3000 represents a data element by which you are separating them.
    As Arpan mentioned you could tie this in with your user group policy to make sure users in certain groups (e.g. arranged by plant) are only allocated queries for their respective area.
    A downside of this is that you will potentially have a lot more queries.  Depending on how your S_QUERY auths are set up, the selection screen entries could be modified.
    Ultimately both methods are a faff and my POV is that if you want to report on business data then it's best to code reports from scratch (including the required auth checks) or use something like BW with restrictions tied to the data model.

  • At line-selection in SAP Query ( Infoset ) code

    Hi all ,
    Here is one for you :  can I put somehow the following code in a Sap Query ( at infoset level of course ) :
       at line-selection.
      set parameter id 'BUK' field XXX-bukrs.
      set parameter id 'BLN' field XXX-belnr.
      set parameter id 'GJR' field XXX-gjahr.
      call transaction 'FB03' and skip first screen.
    (In other words I would like to see the documents behind a line in the list)
    Some explains : my query's output would be ABAP list , the bukrs, belnr, gjahr fields are on the lines of my resulting list, and my problem is with those XXX 's - I don't know where are stored the lines of my ABAP list.
    I'm pretty new at ABAP so any idea and explains about the generated SAP Query code
    is appreciated . I looked at the final code but seemed very complex for my level.
    Please guide me in this area ( I know the basic things like writing pretty simple reports )
    Thanks !
    Best of all
    Zoli

    Hi,
    You need to add extra piece of code as below:
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                I_callback_user_command = 'USER_COMMAND'   "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
    *   Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
    *     Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *     Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
    *     Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    "For further information please refer the link below :
    http://www.sapdev.co.uk/reporting/alv/alvgrid_ucomm.htm
    Thanks,
    Sriram Ponna.

  • Vendor - MArk for Deletion at Comp code & Pur Org Level

    Hi Gurus
    I want a list of vendors (about 150 Vendor)  to be  Marked for Deletion at Comp code & Pur Org Level  
    How to proceed ?

    hi,
    To be able to archive, you must set the deletion flag in the master record. You can set this flag for a complete vendor or for individual company codes or purchasing organizations.
    You can archive data from different tables using the archiving object FI_ACCPAYB...
    Mark a vendor for deletion centrally as follows:
    Choose Master records ->Maintain centrally -->Mark for deletion.
    The initial screen appears.
    Enter the vendor account number and, if you wish, the company code and a purchasing organization.
    If you do not specify the key for a purchasing organization, you cannot delete this area at a later date, should you wish to.
    Select ENTER .
    The screen for specifying data for deletion appears.
    Select data to mark for deletion by clicking next to the appropriate field.
    Save your entries by choosing Vendor ->Save.
    The system displays the initial screen, with a message confirming that the data has been saved.
    Mark a vendor master record for deletion for the Accounting Department as follows:
    Choose Master records -> Mark for deletion.
    The system displays the initial screen.
    Enter the vendor's account number and the company code.
    Select ENTER .
    The system displays the screen for selecting areas to mark for deletion.
    Select the data either in the company code or in all areas to mark for deletion.
    If you click next to the All areas field, the system will later delete all data for all company codes and for all purchasing areas in this vendor master record.
    Save your entries by choosing Vendor -> Save.
    After you mark a vendor master record for deletion, you can still post to the vendor account. This is necessary, since you might still need to clear open items. When you post, the system issues a warning that you are posting to an account that is marked for deletion.
    Displaying Archived Vendor Master Data
    To display single documents for the archiving object FI_ACCPAYB using Archive Information System you require an information structure that has been created based on one of the following standard field catalogs provided by SAP:
    ●     SAP_FI_ACCPAY_1 (vendor master data FI)
    ●     SAP_FIACCPAY_2 (vendor master data SD)
    Each information structure must be active and filled.
    Edited by: Priyanka Paltanwale on Aug 21, 2008 9:09 AM

  • How identify the data is client level,plant level or company code level

    Dear sirs,
    GM
    How identify the data is client level,plant level or company code level?
    If there is any T.code for same in SAP plz send me otherwise any procedure?
    Hopeeeeeeeeee....

    Hi,
    Once you gain experience, you will not look at any table any field or any view...You will do it just like how you use keyboard once you pass type writing....
    That is why every area of work, including master data is handed over to specialized teams...that will be their work day in and out....for some one newly entering, it will be little bit tough...once you practice, you will not be worried any more.  Of course, basic data at client level, purchasing data plant level etc...some thumb rules are there...still, you will take big blow by following such thumb rules because if you verify storage condition assigned in the storage location is not storage location level!!!!!!!!!!!!!!!
    that is experience!!  In this forum, it is good to practice rewarding...else, there may not be any more replies
    Good Luck
    Message was edited by:
            Gopala Turaga

  • Restrict all ECC6 roles on Comp Code / Plant restrictions

    Hi
    thanks for your time and trying to help in advance
    we have a requriement where we need to restrict all roles in ECC6 to a combination of Comp Code & plant to which they belong with few exceptions
    we dont want to go the route of derived roles due to huge maintennace , are there any custom developments options where in we can restrict based on an user exit or create a custom table and check with the user runs a bunch of tcodes ( problem is its not just one as in ECC6 we need this restriction for large number of tcodes and multiple roles
    is it worth looking at any options ?
    thanks

    Hi,
    Do the job with derived roles.  This will save considerable time and expense over trying something like dynamically entering CC/Plant into an auth check as it would involve modifying hundreds of SAP programs (as you have already identified).
    If you suddenly have a new restriction requirement then your company/client need to accept that there will be an overhead for the change.
    One method that may be mentioned is "value roles" or "enabler roles" (if you use the search for term = enabler, you will get some info), but while they may slightly reduce time to implement these, the ongoing support will be increased and there is a high potential to leave your build in tatters.

Maybe you are looking for

  • Error in license check on (what is supposed to be) the ABAP developer edition 7.02

    I obtained (at least what I thought to be) the Developer Edition (7.02), the information for which gave the impression that it had a permanent license, but the license seems to have expired , and now I cannot log on:  Status bar says Logon not possib

  • When Deploying SharePoint 2010 solution using Powershell gives me nothing

    When Deploying SharePoint 2010 solution using Powershell gives me nothing And when go to Central Admin >> System Settings >> Farm Management >> Manage Farm Solution I found my Solution Status is Deploying and still deploying and nothing.

  • Rapidwiz error

    Help please : I run rapidwiz thus: ./rapidwiz and I get some errors starting with the one: Preparing to start up Rapid Install... cp: cannot stat '/opt/oracle/startCD/disk1/rapidwiz/jre/Linux' : No such file or directory cp: cannot stat '/opt/oracle/

  • AirPort Client Update 2009-002 Issues!

    ok so i installed the AirPort Client Update 2009-002 and all seemed well. However, after not using the mac for a day i turned it on and the clock had gone back to jan 1st 2008 and the laptop would not pick up our wi-fi. After allowing some incoming c

  • ADF Mobile: JSON support for REST services?

    Will the JSON format be supported for REST services using ADF Mobile? Is there a workaround for now that can be used?