Group Ordering

Hello,
I want to display items with a group but I don't want the break order to be either ascending or descending, I want the order to be by my "ORDER BY" clause which uses a field called ROW_ORDER. However my report keeps getting sorted by the ORGANIZATION.
My SQL is:
SELECT ALL
ORG_DATA_TABLE.ROW_ORDER, ORG_DATA_TABLE.ORGANIZATION,
ORG_DATA_TABLE.PREFERRED_FIRST_NAME, ORG_DATA_TABLE.PREFERRED_MI,
ORG_DATA_TABLE.PREFERRED_LAST_NAME, ORG_DATA_TABLE.E_MAIL,
ORG_DATA_TABLE.SDN_PHONE, ORG_DATA_TABLE.PDN_PHONE,
ORG_DATA_TABLE.BUILDING, ORG_DATA_TABLE.ROOM,
ORG_DATA_TABLE.OPERATIONAL_TITLE, ORG_DATA_TABLE.FIRST_NAME,
ORG_DATA_TABLE.MI, ORG_DATA_TABLE.LAST_NAME
FROM ORG_DATA_TABLE
ORDER BY ORG_DATA_TABLE.ROW_ORDER
Thanks in advance for any assistance.

Hi Alan,
Suppose you have a query like
SELECT DEPTNO, MGR, ENAME, SAL FROM EMP ORDER BY SAL
(MGR is the department Manager ID, so suppose that every department has one manager)
Now in your data model you have DEPTNO and MGR in the master group, and ENAME and SAL in the detail group. Now if you want your groups to be ordered by MGR, and not DEPTNO, go to the Property Inspector of DEPTNO (in the data model), and choose Break Order > None. Make sure that Break order for MGR is acsending.
So you can choose which column to order the groups by, but they have to be in the master group. So your groups will be ordered by what you choose in the "Break Order" property, while the detail records will be ordered by the SQL query "order by" clause (provided the order by column is in detail group).
Navneet.

Similar Messages

  • Error during the group order close

    Hi,
    I implemented the IS MILLS Solution. During the close period is necessary to close the group order to avoid more good issues or confirmation
    Even the group order has the following status: Technically close and close. When I try to close the individual orders the system generate the following message: Is not possible to close the individual order because the group order is not technically close or with the status Deletion Flag. The error message is: MILL_OC-046.
    Does any body knows why this error come out or if is necessary to change the status of the group order to Deletiong Flag to close the individual order?
    Any help I really appreciate
    Regrads,
    Isaias

    Hi PPIO,
    I would like to understand why is necessary to change the status to deletion flag if this status is used when I wanted to deleted the order form the data base during the archiving process.
    Is there the only option to close the individual order?
    Thanks,
    isaias

  • Group Order Confirmation Distribution Quantity

    Hi I am implementing the IS-MILLS.
    During the group order confirmationn proces the systems distributed the quantity of the individual orders.
    Sometime the operator make a mistake and is necessary to cancel the confirmation.
    The first time the operator does the confirmation the Confirmed Quantity field in the distribution screen is fine. But after the confirmation is cancelled and the confirmation is execute againg this field has the quantity of the first confirmation (thas was cancelled already) plus the quantity of the new one.
    Does any one know if is possible to corrected or modified this behaivor in such a way that after the cancelletion the field has cero quantity.
    Example: Suppose the group order has two individual order
    First time confirmation:
    Yield quantity: 1000
    Confirmed Quantity: Individual orde 1 = 500
    Confirmed Quantity: Individual orde 2 = 500
    Distribution Quantity(Yield to Confirm)  Individual order 1 = 500
    Distribution Quantity (Yield to Confirm) Individual order 2 = 500
    Confirmation Cancellation first time: After this the order has 0 yield quantity confirmation.
    Confirmation after cancellation:
    Yield quantity: 1500 ( quantity corrected)
    Confirmed Quantity: Individual orde 1 = 1250 = ( 500 first time + 750 second time)
    Confirmed Quantity: Individual orde 2 = 1250
    Distribution Quantity(Yield to Confirm)  Individual order 1 = 750
    Distribution Quantity (Yield to Confirm) Individual order 2 = 750
    Any help will be very useful
    Thank you
    Isaias Morales

    This error usually occurs when the quantity at line level does not match with the sum of the distribution of that line. This you can check while selecting that line and then pressing the distribution button on the form.
    Thanks & Regards
    Ankur Dawra

  • ACS 4.x LDAP Group Order

    Hello there.
    A customer of mine is complaining about the LDAP groups order. When he  needs to make group mappings to one of the many groups he have in his database, he face  problems to find them, because they're not in alphabetical order. Is  that a way to get it in this way?
    There's a screenshot to illustrate what's going on.

    Hi,
    The LDAP Group set will populate the groups as defined in the AD.
    I don't think it does take the pain to arrange them in an alphabetical order.
    Regards,
    Anisha
    P.S.: please mark this thread resolved if you think your query is answered.

  • How to group order & AR for the customers under one customer hierarchy

    There are serveral customers under one customer hierarchy, we could easily get the group value in COPA (KE30) via
    the "customer hierarchy" parameter in the navigation channel. Could we also get the group value towards the incoming sales
    order and Account Receivable? Thanks for the suggestion...

    Hi,
    Please check "FDM_COLL01". It is very useful report, you can drill down the report inside aswell.
    Rgds
    Murali. N

  • How do I change tab group order?

    I have 3 tab groups. From tab group 1, when I press ---Ctrl + `---, it goes to tab group 2. From tab group 1, when I press ---Ctrl + Shft + `--- it goes to tab group 3. How do I change the order so that when I press ---Ctrl + `--- from tab group 1 it goes to tab group 3 and when I press ---Ctrl + Shft + `--- from tab group 1 it goes to tab group 2? Basically, I would like to change the order of tab groups that the keyboard shortcut goes through.
    Thank you.

    Heard about Tab Groups? They organize your tabs, eliminating clutter. Try it http://mzl.la/d21MyY

  • Changing group order

    I constantly have to mail a group of people for work. I put them in a group in address book, so i don't have to type in all the names one by one. Is there a way to change the order in which these names get filled in? Like i want the person with the "highest" job rank to appear first in the mailing list…

    Hi,
    There is no corresponding group policy settings which can change binding order of NIC. However, in the article you provided, it says that we can create a fixed metric by changing
    the InterfaceMetric registry value or set the interface metric by using a script. In this way, we can choose to use Group Policy Preferences Registry extension to deploy the registry change to clients, or we can use group policy to deploy the script to clients.
    Regarding GPP registry extension, the following article can be referred to for more information.
    Registry Extension
    http://technet.microsoft.com/en-us/library/cc771589.aspx
    If we choose to deploy script via group policy, we can assign computer startup script or user logon script.
    Regarding this point, the following article can be referred to for more information.
    Assign computer startup scripts
    http://technet.microsoft.com/en-us/library/cc779329(v=WS.10).aspx
    Assign user logon scripts
    http://technet.microsoft.com/en-us/library/cc781361(v=WS.10).aspx
    Best regards,
    Frank Shen

  • Task Group Order IN DAC

    Hi Experts,
    I have two task groups, those are assigned to one subject area. Where can i mention the order of taskgroup execution.
    Thank you.

    As far as I know, we can specify order of tasks and no option to specify order for taskgroups. Might be based on the target tables present the DAC itself handles which taskgroup should execute first and so on. DAC identifies this while we build the execution plan. Someone correct me if i'm wrong.

  • Specified Grouping Order

    Good Morning,
    I am using Crystal Reports version 11.5.  I am grouping by a character field.  When there is a large list of values, and I want to group in a specified order, not all values are showing in the Named Group drop down.  Is there a limit to how many groups can be set in specified order?  I am only seeing a subset of my values.
    Thanks!

    Hi -
    Unfortunately, the problem is that when I try to set the specified order, the value I am trying to choose is missing.  It shows on the report if grouped ascending or descending, but when I try to use specified order, I do not have my complete list of values to choose from.  Does that make sense? 
    For example, I am grouping by a drug category.  My list should show
    ACE INHIBITORS AND CA CHANNEL BLOCKERS
    AGENTS FOR PHEOCHROMOCYTOMA
    ANTIHYPERTENSIVE COMBOS
    ANTIHYPERTENSIVES - CENTRAL
    ARB/CCB
    ARB/CCB PLUS DIURETICS
    ARB'S
    ARB'S AND DIURETICS
    Instead, I am only able to choose from
    ANTIHYPERTENSIVES - CENTRAL, ARB/CCB PLUS DIURETICS and ARB'S AND DIURETICS
    in the drop down for Named groups.  I cannot set the specified order when only a subset is showing without changing my SQL code to account for the problem.
    Thanks

  • How to change group order?

    Hello.
    I created three groups in my query.
    There are links from
    G_1 to
    G_2 to
    G_3
    Is there a way to sort (link) these groups as:
    G_3 to
    G_2 to
    G_1
    Thanks.

    Hi,
    Remove the old links and create according to your requirement.
    Regards,
    Sailaja

  • Help:ranking report(order by sales amount) can't have break up groups!

    break group:vendor/department/sub_class
    and order by sales amount in sub class level;

    I have split the report into 3 and change the group order after I think about the data model, at last solve the problem.
    my problem is user want vendor performance report summary by vendor or by department or by subclass as option. and after select the summary level, user can select order by sales_amount,sales_gp or vendor_id.

  • Sqlserver query using Group by and Order by

    SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
    MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
    MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
    AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
    MIN(BILL_DETAIL.x_cost_rate) as COST_RATE,
    MIN(BILL_DETAIL.x_cost_total) as COST_TYPE,
    LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
    FROM table_x_gsa_bill_detail BILL_DETAIL
    WHERE (1=1)
    GROUP BY (DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS || ',' || COST_TYPE || ',' || BILL_RATE)
    ORDER BY DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS ||
    ) dt WHERE rn BETWEEN 0 AND 1
    Can any one pls help me using of Case Condition keyword instead of Decode in the above query ??? iam not able to convert above query for group by and order by..
    Actually i need to do group by the aggragate values which i got the values from the fields of BILLABLE_YN,BILLABLE_TO,DETAIL_CLASS, COST_TYPE, BILL_RATE.
    where as in oracle i can run above query using decode keyword where as in sqlserver iam not able to use BILLABLE_YN field alias of above query in group by .
    i tried like by using following way but it is wrong because here iam not using aggragate values of fields in group by funtion please help me in converting query in sqlserver. GROUP BY (case BILLABLE_YN when 1 then 'Billable' when 0 then 'Non-Billable' else
    'Non-Billable' End BILLABLE_YN + ',' + BILLABLE_TO + ',' + DETAIL_CLASS + ',' + COST_TYPE + ',' + BILL_RATE)
    Krishna

    CREATE TABLE DETAIL
    ([objid] int,[x_billable_to] varchar(19), [x_bill_quantity] int,
    [x_billable_yn] int, [x_bill_rate] int, [COST_TYPE] varchar(19) )
    INSERT INTO
    DETAIL
    ([objid], [x_billable_to], [x_bill_quantity], [x_billable_yn], [x_bill_rate],[COST_TYPE])
    VALUES
    (1, 'Customer', 3, 1, 20,'Parking'),
    (2, 'Customer', 1, 1, 25,'Toll'),
    (3, 'Customer', 2, 1, 20,'Parking') 
    Pls convert following query for executing query in sqlserver  ..for the column ID_List it should return data like 1,2,3
    SELECT * FROM (SELECT 1 rn,
            SUM(BILL_DETAIL.x_bill_quantity)      as BILL_QUANTITY,
            MIN(BILL_DETAIL.x_billable_to)        as BILLABLE_TO,
            MIN(BILL_DETAIL.x_billable_yn)        as BILLABLE_YN,
            AVG(BILL_DETAIL.x_bill_rate)          as BILL_RATE,
            LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
         FROM   BILL_DETAIL
          WHERE (1=1)
     GROUP BY (DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to  +  ',' + COST_TYPE + ',' + x_bill_rate)
          ORDER BY DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to  +  ',' + COST_TYPE + ',' + x_bill_rate
           )dt 
    WHERE rn BETWEEN 0 AND 1
    Krishna
    sounds like this
    SELECT *
    FROM
    SELECT 1 rn,
    SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
    MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
    MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
    AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1) AS ID_Listing
    FROM BILL_DETAIL bd
    CROSS APPLY (
    SELECT BILL_DETAIL.objid + ',' AS [text()]
    FROM BILL_DETAIL
    WHERE objid = bd.objid
    FOR XML PATH('')
    )bd1(ID_LIST)
    WHERE (1=1)
    GROUP BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
    ORDER BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
    )dt
    WHERE rn BETWEEN 0 AND 1
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Report on sales order on hold

    hello sdn friends,
    how to develop an report to display to open sales orders on hold.
    i dont have any idea about this,please help regarding this.

    Hi,
    Check the program
    TABLES:vbak,
           vbap,
           tvko,
           tvak,
           mara,
           tvtw,
           kna1,
           vbpa.
    TYPE-POOLS : slis.
                               GLOBAL TYPES
                       naming convention: "TY_name"
    TYPES : BEGIN OF ty_vbak       ,
            vbeln  TYPE vbak-vbeln ,
            auart  TYPE vbak-auart , " DRFK904686
            vkorg  TYPE vbak-vkorg ,
            vtweg  TYPE vbak-vtweg ,
            vkgrp  TYPE vbak-vkgrp ,
            bstnk  TYPE vbak-bstnk ,  "DRFK904686(+)
            kunrsl TYPE vbak-kunnr ,
            END OF ty_vbak         .
    TYPES: BEGIN OF ty_vbap        ,
            vbeln TYPE vbap-vbeln  ,
            posnr TYPE vbap-posnr  ,
            matnr TYPE vbap-matnr  ,
            matkl TYPE vbap-matkl  ,
            kwmeng TYPE vbap-kwmeng,
            vrkme  TYPE vbap-vrkme ,   "order unit
            zmeng  TYPE vbap-zmeng ,
            zieme  TYPE vbap-zieme ,  "order unit
            netpr  TYPE vbap-netpr ,  "price
            netwr  TYPE vbap-netwr ,  "DRFK904686(+)
          END OF ty_vbap           .
    TYPES:BEGIN OF ty_vbuk     ,
          vbeln TYPE vbuk-vbeln,
    Start of addition DRFK904686
          lfstk TYPE statv     ,
          lfgsk TYPE statv     ,
          fkstk TYPE statv     ,
    End of addition DRFK904686
          END OF ty_vbuk       .
    TYPES:BEGIN OF ty_vbpa     ,
            vbeln TYPE vbpa-vbeln,
            kunrsh TYPE kunnr    ,
          END OF ty_vbpa       .
    TYPES:BEGIN OF ty_makt  ,
            matnr TYPE matnr,
            maktx TYPE maktx,
          END OF ty_makt.
    TYPES:BEGIN OF ty_t023t,
           matkl TYPE matkl,
           wgbez TYPE wgbez,
         END OF ty_t023t.
    TYPES:BEGIN OF ty_kna1    ,
           kunnr TYPE kunnr   ,
           name1 TYPE name1_gp,
         END OF ty_kna1.
    TYPES:BEGIN OF ty_final         ,
            vbeln  TYPE vbak-vbeln  ,
            auart  TYPE vbak-auart  ,
            vkorg  TYPE vbak-vkorg  ,
            vtweg  TYPE vbak-vtweg  ,
            vkgrp  TYPE vbak-vkgrp  ,
            bstnk  TYPE vbak-bstnk  , "PO Number; DRFK904686(+)
            kunrsl TYPE vbak-kunnr  ,
            name1  TYPE name1_gp    ,
            matnr  TYPE vbap-matnr  ,
            maktx  TYPE maktx       ,
            matkl  TYPE vbap-matkl  ,
            wgbez  TYPE wgbez       ,
            kwmeng TYPE vbap-kwmeng ,
            vrkme  TYPE vbap-vrkme  ,   "order unit
            zmenge TYPE vbap-kwmeng ,
            netpr  TYPE vbap-netpr  ,  " price "vv
            netwr  TYPE vbap-netwr  ,
            zmein  TYPE vbap-meins  ,
            kunrsh TYPE kunnr       ,
            name2  TYPE name1_gp    ,
    Start of addition DRFK904686
            lfstk  TYPE statv     ,
            lfgsk  TYPE statv     ,
            fkstk  TYPE statv     ,
    End of addition DRFK904686
          END OF ty_final         .
                              GLOBAL CONSTANTS
                       naming convention: "c_name"
    CONSTANTS: c_sh                         TYPE vbpa-parvw        VALUE 'WE'                   ,
               c_formname_top_of_page       TYPE slis_formname     VALUE 'F_DISPLAY_TOP_OF_PAGE',
               c_en(2)                      TYPE c                 VALUE 'EN'                   ,
               c_a                          TYPE char1             VALUE 'A'                    .
                        GLOBAL ELEMENTARY VARIABLES
                        naming convention: "w_name"
    DATA :w_list_top_of_page      TYPE slis_t_listheader,
          w_kwmeng                TYPE vbap-kwmeng      ,
          w_meins                 TYPE t006-msehi       ,
          w_zmein                 TYPE t006-msehi       ,
          w_repid                 TYPE sy-repid         ,
          w_zmenge                TYPE vbap-kwmeng      ,
          w_events                TYPE slis_t_event     ,
          w_datum                 TYPE sy-datum         ,
          w_umrez1                TYPE marm-umrez       ,
          w_umren1                TYPE marm-umren       ,
          w_umrez2                TYPE marm-umrez       ,
          w_umren2                TYPE marm-umren       ,
          w_text(25)              TYPE c                .
                              GLOBAL STRUCTURES
                        naming convention: "st_name"
    DATA:st_vbak  TYPE ty_vbak  ,
         st_vbap  TYPE ty_vbap  ,
         st_vbpa  TYPE ty_vbpa  ,
         st_makt  TYPE ty_makt  ,
         st_t023t TYPE ty_t023t ,
         st_knasl TYPE  ty_kna1 ,
         st_knash TYPE  ty_kna1 ,
         st_vbuk  TYPE  ty_vbuk ,
         st_final TYPE ty_final .
    DATA:st_fieldcat    TYPE slis_fieldcat_alv ,
         st_layout      TYPE slis_layout_alv   .
                           GLOBAL INTERNAL TABLES
                         naming convention: "i_name"
    DATA:i_vbak  TYPE TABLE OF ty_vbak  ,
         i_vbap  TYPE TABLE OF ty_vbap  ,
         i_vbuk  TYPE TABLE OF ty_vbuk  ,
         i_vbpa  TYPE TABLE OF ty_vbpa  ,
         i_makt  TYPE TABLE OF ty_makt   ,
         i_t023t TYPE TABLE OF ty_t023t ,
         i_knasl TYPE TABLE OF ty_kna1  ,
         i_knash TYPE TABLE OF ty_kna1  ,
         i_final TYPE TABLE OF ty_final .
    DATA:i_fieldcat    TYPE slis_t_fieldcat_alv ,
         i_variant     TYPE disvariant          .
    DEFINE m_fieldcat.
      add 1 to st_fieldcat-col_pos.
      st_fieldcat-fieldname   = &1.
      st_fieldcat-ref_tabname = &2.
      st_fieldcat-seltext_s   = &3.
      st_fieldcat-seltext_l   = &4.
      st_fieldcat-datatype    = &5.
      append st_fieldcat to i_fieldcat.
    END-OF-DEFINITION.
                          PARAMETERS & SELECT-OPTIONS
                     aming convention: "p_name" & "s_name"
    SELECTION-SCREEN  BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *SELECT-OPTIONS : s_vkorg    FOR  vbak-vkorg  OBLIGATORY,
                    s_vtweg    FOR  vbak-vtweg  OBLIGATORY,
                    s_kunrsl   FOR  vbak-kunnr            ,
                    s_kunrsh   FOR  vbpa-kunnr            ,
                    s_matnr    FOR  vbap-matnr            ,
                    s_auart    for  vbak-auart            . "DRFK904686
                 s_datum    FOR  sy-datum  OBLIGATORY DEFAULT sy-datum."DRFK904686
    SELECT-OPTIONS : s_vkorg    FOR  tvko-vkorg  OBLIGATORY,
                     s_vtweg    FOR  tvtw-vtweg  OBLIGATORY,
                     s_kunrsl   FOR  kna1-kunnr            ,
                     s_kunrsh   FOR  kna1-kunnr            ,
                     s_matnr    FOR  mara-matnr            ,
                     s_auart    FOR  tvak-auart            .    "DRFK904686
    PARAMETERS:   p_meins TYPE vbap-meins.
    SELECTION-SCREEN  END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-002.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) text-006 FOR FIELD p_var.
    PARAMETERS: p_var TYPE disvariant-variant.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b5.
                              INITIALIZATION
    INITIALIZATION.
    Report id assigned to Global variable
      w_repid = sy-repid.
    EVENTS TABLE BUILD
      PERFORM f_eventtab_build USING w_events[].
    Processing of listheader
      PERFORM f_comment_build  USING w_list_top_of_page[].
      CLEAR i_variant.
      i_variant-report = sy-repid.
    Read default display variant (description only, w/o field catalog)
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = c_a
        CHANGING
          cs_variant = i_variant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc EQ 0.
        p_var = i_variant-variant.
      ENDIF.
    Start of addition DRFK904686
                          AT SELECTION-SCREEN ON s_vkorg
    Sales Organisation
    AT SELECTION-SCREEN ON s_vkorg.
      PERFORM f_validate_vkorg.
                          AT SELECTION-SCREEN ON s_vtweg
    Distribution Channel
    AT SELECTION-SCREEN ON s_vtweg.
      PERFORM f_validate_vtweg.
                          AT SELECTION-SCREEN ON s_kunrsl
    Sold-to-party
    AT SELECTION-SCREEN ON s_kunrsl.
      IF NOT s_kunrsl[] IS INITIAL.
        PERFORM f_validate_cust.
      ENDIF.
                          AT SELECTION-SCREEN ON s_kunrsh
    Ship-to-party
    AT SELECTION-SCREEN ON s_kunrsh.
      IF NOT s_kunrsh[] IS INITIAL.
        PERFORM f_validate_shipto.
      ENDIF.
                          AT SELECTION-SCREEN ON s_matnr
    Material Number
    AT SELECTION-SCREEN ON s_matnr.
      IF NOT s_matnr[] IS INITIAL.
        PERFORM f_validate_matnr.
      ENDIF.
                          AT SELECTION-SCREEN ON s_auart
    Order Type
    AT SELECTION-SCREEN ON s_auart.
      IF NOT s_auart[] IS INITIAL.
        PERFORM f_validate_auart.
      ENDIF.
    End of addition DRFK904686
                   AT SELECTION-SCREEN ON VALUE-REQUEST
    F4 for Layout Variant
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var.
      PERFORM f_get_alv_variant CHANGING p_var.
                          AT SELECTION-SCREEN ON
    Validate Layout Variant
    AT SELECTION-SCREEN ON p_var.
      IF NOT p_var IS INITIAL.
        PERFORM f_check_alv_variant USING p_var.
      ENDIF.
                               START-OF-SELECTION
    START-OF-SELECTION.
    begin of changes DRFK904686
      PERFORM f_fetch_vbuk.
      PERFORM f_fetch_vbak.
    *perform to fetch the data from vbuk.
    *perform to fetch the data from vbak.
    PERFORM f_fetch_vbak.
    *perform to fetch the data from vbuk.
    PERFORM f_fetch_vbuk.
    end of changes DRFK904686
    *perform to fetch the data from vbpa.
      PERFORM f_fetch_vbpa.
    *perform to fetch the data from vbap.
      PERFORM f_fetch_vbap.
    *perform to fetch the material description.
      PERFORM f_fetch_makt.
    *perform to fetch the material group description.
      PERFORM f_fetch_t023t.
    *perform to fetch the customer name
      PERFORM f_fetch_knasl.
    *perform to fetch the customer name
      PERFORM f_fetch_knash.
    *perofrm to move the data into final table
      PERFORM f_move_final.
    Finding no of entries in Internal Table
      IF LINES( i_final ) EQ 0.
        MESSAGE s000 WITH 'No documents found for the  selection criteria'(019).
        EXIT.
      ENDIF.
    *perform for fieldcatalog building
      PERFORM f_build_fieldcat.
    *perform to display the list
      PERFORM f_list_dispaly.
    *&      Form  f_validate_vkorg
          text
         -->P_S_VKORG  text
    FORM f_validate_vkorg.
      SELECT vkorg
         FROM tvko
         UP TO 1 ROWS
         INTO tvko-vkorg
       WHERE vkorg IN s_vkorg.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Sales Organization is invalid'(033).
      ENDIF.
    ENDFORM.                    " f_validate_vkorg
    *&      Form  f_validate_vtweg
          text : This form is used to validate the Distribution Channel
    FORM f_validate_vtweg.
      SELECT vtweg
            FROM tvtw
            UP TO 1 ROWS
            INTO tvtw-vtweg
          WHERE vtweg IN s_vtweg.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Distribution Channel is invalid'(032).
      ENDIF.
    ENDFORM.                    " f_validate_vtweg
    *&      Form  f_validate_cust
          text: This form is used to validate the Sold-to party .
    FORM f_validate_cust.
      SELECT kunnr
             FROM kna1
             UP TO 1 ROWS
             INTO kna1-kunnr
           WHERE kunnr IN s_kunrsl.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Customer is invalid'(034).
      ENDIF.
    ENDFORM.                    " f_validate_cust
    *&      Form  f_validate_shipto
           text: This form is used to validate the Ship-to party .
    FORM f_validate_shipto.
      SELECT kunnr
             FROM kna1
             UP TO 1 ROWS
             INTO kna1-kunnr
           WHERE kunnr IN s_kunrsh.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Ship-to party is invalid'(035).
      ENDIF.
    ENDFORM.                    " f_validate_shipto
    *&      Form  f_validate_matnr
          text: This form is used to validate material.
    FORM f_validate_matnr .
      SELECT matnr
        FROM mara
        UP TO 1 ROWS
        INTO mara-matnr
      WHERE matnr IN s_matnr.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Material is invalid'(036).
      ENDIF.
    ENDFORM.                    " f_validate_matnr
    *&      Form  f_validate_auart
          text: This form is used to validate Order Type
    FORM f_validate_auart .
      SELECT auart
          FROM tvak
          UP TO 1 ROWS
          INTO tvak-auart
        WHERE auart IN s_auart.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Order Type is invalid'(037).
      ENDIF.
    ENDFORM.                    " f_validate_auart
    *&      Form  sub_get_alv_variant
          To display variant selection dialog box
    FORM f_get_alv_variant  CHANGING p_layvar TYPE disvariant-variant.
      CLEAR i_variant.
      DATA lw_exit(1) TYPE c.
      i_variant-report   = sy-repid.
      i_variant-username = sy-uname.
    Display variant selection dialog box
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant    = i_variant
          i_save        = c_a
        IMPORTING
          e_exit        = lw_exit
          es_variant    = i_variant
        EXCEPTIONS
          not_found     = 1
          program_error = 2
          OTHERS        = 3.
      IF sy-subrc EQ 0.
        IF lw_exit IS INITIAL.
          p_layvar = i_variant-variant.
        ENDIF.
      ELSE.
        MESSAGE i000 WITH 'No display variants found'(007).
      ENDIF.
    ENDFORM.                    " sub_get_alv_variant
    *&      Form  sub_check_alv_variant
          to check whether a display variant exists
    FORM f_check_alv_variant  USING p_layvar TYPE disvariant-variant.
      CLEAR i_variant.
      i_variant-report   = sy-repid.
      i_variant-username = sy-uname.
      IF p_layvar NE space.
        MOVE p_layvar TO i_variant-variant.
    Checks whether a display variant exists
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
          EXPORTING
            i_save     = c_a
          CHANGING
            cs_variant = i_variant.
      ENDIF.
    ENDFORM.                    "f_check_alv_variant
    " sub_check_alv_variant
    *&      Form  f_fetch_vbak
    from to fetch sales org, dis chanel,sales group sold to party from vbak
    FORM f_fetch_vbak .
    *{ begin of change DRFK904686
      IF i_vbuk IS NOT INITIAL.
        SELECT vbeln
               auart
               vkorg
               vtweg
               vkgrp
               bstnk
               kunnr
          FROM vbak
          INTO TABLE i_vbak
             FOR ALL ENTRIES IN i_vbuk
         WHERE vbeln EQ i_vbuk-vbeln
           AND auart IN s_auart
           AND vkorg IN s_vkorg
           AND vtweg IN s_vtweg
           AND kunnr IN s_kunrsl  .
    end of change DRFK904686 }
        IF sy-subrc EQ 0.
          SORT i_vbak BY vbeln.
        ELSE.
          MESSAGE s000 WITH 'No documents found for the  selection criteria'(019).
          EXIT.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f_fetch_vbak
    *&      Form  f_fetch_vbuk
      from to fetch open sales doc from vbuk
    FORM f_fetch_vbuk .
    IF i_vbak IS NOT INITIAL.
       SELECT vbeln
         FROM vbuk
         INTO TABLE i_vbuk
          FOR ALL ENTRIES IN i_vbak
        WHERE vbeln EQ i_vbak-vbeln
          AND ( lfstk NE 'C'
          OR    fkstk NE 'C' ) .
      SELECT vbeln
             lfstk               
             lfgsk       
             fkstk            FROM vbuk
        INTO TABLE i_vbuk
       WHERE ( ( lfstk EQ 'A'
         OR lfstk EQ 'B')
         OR (  fkstk EQ 'A'
         OR    fkstk EQ 'B' ) ) .
    ENDIF.
    ENDFORM.                    " f_fetch_vbuk
    *&      Form  f_fetch_vbpa
         from to fetch ship to party from vbpa
    FORM f_fetch_vbpa .
      IF i_vbak IS NOT INITIAL.
        SELECT vbeln
               kunnr
          FROM vbpa
          INTO TABLE i_vbpa
           FOR ALL ENTRIES IN i_vbak
         WHERE vbeln EQ i_vbak-vbeln
           AND kunnr IN s_kunrsh
           AND parvw EQ c_sh.
      ENDIF.
    ENDFORM.                    " f_fetch_vbpa
    *&      Form  f_fetch_vbap
      from to fetch sales doc, mat no, mat group,order UOM from vbap
    FORM f_fetch_vbap .
      IF i_vbpa IS NOT INITIAL.
        SELECT vbeln
               posnr
               matnr
               matkl
               kwmeng
               vrkme
               zmeng
               zieme
               netwr
               netpr
          FROM vbap
          INTO TABLE i_vbap
           FOR ALL ENTRIES IN i_vbpa
         WHERE vbeln EQ i_vbpa-vbeln
           AND matnr IN s_matnr.
      ENDIF.
    ENDFORM.                    " f_fetch_vbap
    *&      Form  f_fetch_makt
    form to fetch the material description
    FORM f_fetch_makt .
      IF i_vbap IS NOT INITIAL.
        SELECT
            matnr
            maktx
       FROM makt
          INTO TABLE i_makt
           FOR ALL ENTRIES IN i_vbap
         WHERE matnr EQ i_vbap-matnr
           AND spras EQ c_en.
      ENDIF.
    ENDFORM.                    " f_fetch_makt
    *&      Form  f_fetch_t023t
       form to fetch the material group description
    FORM f_fetch_t023t .
      IF i_vbap IS NOT INITIAL.
        SELECT
            matkl
            wgbez
       FROM t023t
          INTO TABLE i_t023t
           FOR ALL ENTRIES IN i_vbap
         WHERE spras EQ c_en
           AND matkl EQ i_vbap-matkl.
      ENDIF.
    ENDFORM.                    " f_fetch_t023t
    *&      Form  f_fetch_kna1
       form to fetch the sold to customer name
    FORM f_fetch_knasl .
      IF i_vbak IS NOT INITIAL.
        SELECT
            kunnr
            name1
       FROM kna1
          INTO TABLE i_knasl
           FOR ALL ENTRIES IN i_vbak
         WHERE kunnr EQ i_vbak-kunrsl.
      ENDIF.
    ENDFORM.                    " f_fetch_kna1
    *&      Form  f_fetch_knash
       form to fetch the ship to customer name
    FORM f_fetch_knash .
      IF i_vbpa IS NOT INITIAL.
        SELECT
            kunnr
            name1
       FROM kna1
          INTO TABLE i_knash
           FOR ALL ENTRIES IN i_vbpa
         WHERE kunnr EQ i_vbpa-kunrsh.
      ENDIF.
    ENDFORM.                    " f_fetch_knash
    *&      Form  f_move_final
    form for moving all the fields into the final internal table for
    *dispalying the final output.
    FORM f_move_final .
      SORT : i_vbak  BY vbeln,
             i_vbpa  BY vbeln,
             i_makt  BY matnr,
             i_t023t BY matkl,
             i_knasl BY kunnr,
             i_vbuk  BY vbeln,
             i_knash BY kunnr.
    *looping at i_vbap and moving mat no,mat group,quantity and
    *UOM into final table.
      LOOP AT i_vbap INTO st_vbap.
        IF st_vbap-kwmeng IS INITIAL.
          st_vbap-kwmeng = st_vbap-zmeng.
          st_vbap-vrkme  = st_vbap-zieme.
        ENDIF.
        MOVE: st_vbap-matnr  TO st_final-matnr,
              st_vbap-matkl  TO st_final-matkl,
              st_vbap-kwmeng TO st_final-kwmeng,
              st_vbap-netwr  TO st_final-netwr,
              st_vbap-vrkme  TO st_final-vrkme.
        IF p_meins IS INITIAL.
          MOVE:st_vbap-vrkme  TO st_final-zmein ,
               st_vbap-kwmeng TO st_final-zmenge.
        ELSE.
          CLEAR : w_kwmeng,
                  w_meins,
                  w_zmein.
    *Order Quantity
          w_kwmeng = st_vbap-kwmeng.
    *Order Unit
          w_meins = st_vbap-vrkme.
    *Report Unit
          w_zmein = p_meins.
          CLEAR : w_umrez1,
                  w_umren1,
                  w_umrez2,
                  w_umren2.
          SELECT SINGLE umrez
                        umren
                  INTO (w_umrez1,
                        w_umren1)
                   FROM marm
                  WHERE matnr EQ st_vbap-matnr
                    AND meinh EQ w_meins.
          SELECT SINGLE umrez
                        umren
                  INTO (w_umrez2,
                        w_umren2)
                   FROM marm
                  WHERE matnr EQ st_vbap-matnr
                    AND meinh EQ w_zmein.
          IF w_umrez1 IS NOT INITIAL AND w_umren2 IS NOT INITIAL.
            w_zmenge = w_kwmeng * ( w_umren1 / w_umrez1 ) * ( w_umrez2 / w_umren2 ).
        update new report unit and quantity
            MOVE p_meins  TO st_final-zmein.
            MOVE w_zmenge TO st_final-zmenge.
          ELSE.
       if failed to convert update report unit and quantity with order values
            MOVE st_vbap-vrkme TO st_final-zmein.
            MOVE st_vbap-kwmeng TO st_final-zmenge.
          ENDIF.
        ENDIF.
    Start of changes DRFK904686
    To get the delivery, overall and billing status
        CLEAR st_vbuk.
        READ TABLE i_vbuk INTO st_vbuk
                    WITH KEY vbeln = st_vbap-vbeln
                    BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE : st_vbuk-lfstk TO st_final-lfstk,
                 st_vbuk-lfgsk TO st_final-lfgsk,
                 st_vbuk-fkstk TO st_final-fkstk.
        ENDIF.
    End of changes DRFK904686
    *reading i_vbak and moving sales doc,sales org,dist chanel,
    *sales group,and sold to party into the final internal table
        CLEAR st_vbak.
        READ TABLE i_vbak
              INTO st_vbak
          WITH KEY vbeln = st_vbap-vbeln
          BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE: st_vbak-vbeln  TO st_final-vbeln ,
                st_vbak-vkorg  TO st_final-vkorg ,
                st_vbak-vtweg  TO st_final-vtweg ,
                st_vbak-vkgrp  TO st_final-vkgrp ,
                st_vbak-auart  TO st_final-auart ,
                st_vbak-bstnk  TO st_final-bstnk , "DRFK904686(+)
                st_vbak-kunrsl TO st_final-kunrsl.
        ENDIF.
    *reading i_vbpa and moving ship to party to the final internal table
        CLEAR st_vbpa.
        READ TABLE i_vbpa
              INTO st_vbpa
          WITH KEY vbeln = st_vbap-vbeln
          BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_vbpa-kunrsh TO st_final-kunrsh.
        ENDIF.
    *reading i_makt and moving material description to the final table
        CLEAR st_makt.
        READ TABLE i_makt
                  INTO st_makt
              WITH KEY matnr = st_vbap-matnr
              BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_makt-maktx TO st_final-maktx.
        ENDIF.
    *reading i_t023t
        CLEAR st_t023t.
        READ TABLE i_t023t
                  INTO st_t023t
              WITH KEY matkl = st_vbap-matkl
              BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_t023t-wgbez TO st_final-wgbez.
        ENDIF.
    *READINGI_KNASL
        CLEAR st_knasl.
        READ TABLE i_knasl
                  INTO st_knasl
              WITH KEY kunnr = st_final-kunrsl
              BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_knasl-name1 TO st_final-name1.
        ENDIF.
    *READINGI_KNASH
        CLEAR st_knash.
        READ TABLE i_knash
                  INTO st_knash
              WITH KEY kunnr = st_final-kunrsh
              BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_knash-name1 TO st_final-name2.
        ENDIF.
        APPEND st_final TO i_final.
        CLEAR st_final.
      ENDLOOP.
    ENDFORM.                    " f_move_final
    *&      Form  f_build_fieldcat
    form for building the field catalog
    FORM f_build_fieldcat .
      m_fieldcat 'VKORG'   'VBAK'   'Sales Organisation'(004)   'Sales Organisation'(004)                     ' '.
      m_fieldcat 'VTWEG'   'VBAK'   'Distribution Channel'(005) 'Distribution Channel'(005)                   ' '.
      m_fieldcat 'VKGRP'   'VBAK'   'Sales Group'(008)          'Sales Group'(008)                            ' '.
      m_fieldcat 'VBELN'   'VBAK'   'Sales Document'(009)       'Sales Document'(009)                         ' '.
      m_fieldcat 'AUART'   'VBAK'   'Order Type'(026)           'Order Type'(026)                             ' '.
      m_fieldcat 'BSTNK'   'VBAK'   'PO number'(031)            'PO number'(031)                              ' '.
      m_fieldcat 'KUNRSL'  'VBAK'   'Sold to Party'(010)        'Sold to Party'(010)                          ' '.
      m_fieldcat 'NAME1'   'KNA1'   'Name Sold to'(020)         'Name Sold to'(020)                           ' '.
      m_fieldcat 'KUNRSH'  'VBPA'   'Ship to Party'(011)        'Ship to Party'(011)                          ' '.
      m_fieldcat 'NAME2'   'KNA1'   'Name Ship to'(022)         'Name Ship to'(022)                           ' '.
      m_fieldcat 'KWMENG'  'VBAP'   'Order Quantity'(012)       'Order Quantity'(012)                 'QUAN '(014).
      m_fieldcat 'VRKME'   'VBAP'   'Order UOM'(017)            'Order UOM'(017)                               ' '.
      m_fieldcat 'ZMENGE'  'VBAP'   'Report Quantity'(013)      'Report Quantity'(013)                'QUAN '(014).
      m_fieldcat 'ZMEIN'   'VBAP'   'Report UOM'(018)           'Report UOM'(018)                              ' '.
      m_fieldcat 'NETWR'   'VBAP'   'Net value'(030)            'Net value'(030)                               ' '.
    m_fieldcat 'MATKL'   'VBAP'   'Material Group Description'(023)    'Material Group Description'(023)    ' '. "DRFK904686(-)
    m_fieldcat 'WGBEZ'   'T023T'  'Material Group'(015)       'Material Group'(015)                         ' '. "DRFK904686(-)
      m_fieldcat 'MATKL'   'VBAP'   'Material Group'(015)       'Material Group'(015)                          ' '. "DRFK904686(+)
      m_fieldcat 'WGBEZ'   'T023T'  'Material Group Description'(023)    'Material Group Description'(023)     ' '. "DRFK904686(+)
      m_fieldcat 'MATNR'   'VBAP'   'Material Number'(016)      'Material Number'(016)                         ' '.
      m_fieldcat 'MAKTX'   'MAKT'   'Materia Description'(024)  'Material Description'(025)                    ' '.
    Begin of addition DRFK904686
      m_fieldcat 'LFSTK'   'VBUK'   'Delivery status'(027)         'Delivery status'(027)  'DelStat'           .
      m_fieldcat 'LFGSK'   'VBUK'   'Overall delivery status'(028) 'Overall delivery status'(028)              ' '.
      m_fieldcat 'FKSTK'   'VBUK'   'Billing status'(029)          'Billing status'(029)                       ' '.
    End of addition DRFK904686
    ENDFORM.                    " f_build_fieldcat
    *&      Form  f_list_dispaly
    form for displaying the final output in the Alv grid
    FORM f_list_dispaly .
      st_layout-cell_merge        = 'X'.
      st_layout-colwidth_optimize = 'X'.
    To display the required data
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_buffer_active    = 'X'
          i_callback_program = w_repid
          is_layout          = st_layout
          it_fieldcat        = i_fieldcat[]
          i_save             = 'A'
          is_variant         = i_variant
          it_events          = w_events[]
        TABLES
          t_outtab           = i_final.
    ENDFORM.                    " f_list_dispaly
    " f_EVENTTAB_BUILD
          FORM F_DISPLAY_TOP_OF_PAGE                                    *
    *form for providing the report heading                                *
            event     TOP_OF_PAGE                                       *
    FORM f_display_top_of_page.                                 "#EC CALLED
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = w_list_top_of_page.
    ENDFORM.                    "DISPLAY_TOP_OF_PAGE
    *&      Form  f_EVENTTAB_BUILD
            Ereignistabelle Bilden
            EVENTS TABLE BUILD
         -->U_ER_EVENTS[]  text
    FORM f_eventtab_build USING p_u_er_events TYPE slis_t_event.
      FIELD-SYMBOLS: <fs_event> TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = p_u_er_events.
      READ TABLE p_u_er_events WITH KEY name = slis_ev_top_of_page
                             ASSIGNING <fs_event>.
      IF sy-subrc = 0.
        <fs_event>-form = c_formname_top_of_page.
      ENDIF.
    ENDFORM.                               " f_EVENTTAB_BUILD
    *&      Form  F_COMMENT_BUILD
           Bearbeitung des Listenkopfes
           Processing of listheader
         -->U_ER_LIST_TOP_OF_PAGE[]  text
    FORM f_comment_build USING u_er_list_top_of_page TYPE slis_t_listheader.
      DATA: lw_line TYPE slis_listheader.
    Type H
      CLEAR lw_line.
      lw_line-typ  = 'H'.
    Daily Historical Volume
      lw_line-info = text-003.
      APPEND lw_line TO u_er_list_top_of_page.
    Type S
      CLEAR lw_line.
      lw_line-typ  = 'S'.
    Run Date - Sy-datum
      WRITE sy-datum TO w_datum MM/DD/YY .
      CONCATENATE text-021 w_datum INTO w_text.
      lw_line-info = w_text.
      APPEND lw_line TO u_er_list_top_of_page.
    ENDFORM.                               " COMMENT_BUILD
    Reward the points for useful answers.

  • Copy Control between Sales Orders and Deliveries

    Hi Gurus,
    please can you tell me why copy control between Sales Order and Delivery doesn't work?
    At header level, into copy control, we can set 2 requirement routines, one as general requirement for copying (TVCPL-AUBED) and the other one as requirement for grouping orders into deliveries (TVCPL-AUZUS).
    At header level we can also set a routine for data transfer to define how data are passed from Sales Order header to Delivery header (TVCPL-GRUAK).
    Then we can set routines at item level, one as requirement (TVCPL-AUBED) and one as data transfer (TVCPL-GRUAP).
    When delivery is created with VL10A transaction, at header level only the first  general requirement routine is used (FV50B***). Grouping requirement is not used (we also set a break point and the program is not passing into this routine).
    Then it is used the requirement routine at item level (FV50B***).
    Please can you tel me how we camake working the routine for grouping requirement at header level?
    Thank you very much.
    Kind Regards
    Andrea

    Hi, we used standard routine even if to be sure we run also the generation report you mentioned.
    Please any other suggestions?
    Thank you very much.
    Kind Regards
    Andrea

  • Sub-Groups Not Appearing in Report

    Post Author: burhan.survery
    CA Forum: Crystal Reports
    I am using CR10.
    My report has two groups: Main group "Order Number" and the subgroup "Customer Number". Both groups are from the same table. There could be upto four Customers per order. When i print the report, I only get the first customer in the order. I should get every customer. I don't understand why this could be happening. Any help would be appreciated.
    Burhan

    This is in fact the main sql behind the search button of the Query Report Viewer Page
    SELECT A.REPORT_DEFN_ID,
    A.DESCR,
    A.DS_TYPE,
    A.DS_ID,
    A.OPRID,
    A.PSXPDSOWNER,
    A.PT_TEMPLATE_TYPE,
    A.REPORT_CATEGORY_ID,
    A.OBJECTOWNERID,
    A.PT_REPORT_STATUS,
    A.BURST_FIELDNAME
    FROM PSXPRPTSRCH_VW A
    WHERE A.OPRID IN (' ', %OperatorID)
    AND EXISTS
    (SELECT 'X'
    FROM PSXPRPTCATAUTH X
    WHERE A.REPORT_CATEGORY_ID = X.REPORT_CATEGORY_ID
    AND ((X.AUTHORIDTYPE = '2'
    AND X.AUTHORID =%OperatorID)
    OR (X.AUTHORIDTYPE = '3'
    AND X.AUTHORID IN
    (SELECT RL.ROLENAME FROM PSROLEUSER RL WHERE RL.ROLEUSER = %OperatorID
    After this main sql it is checked if user has access to the query behind the datasource that i used for the report.
    This means:
    You need to have access to one of the roles defined in the ReportCategory or defined as user here and you need to have access to the query.
    Assuming you comply the first criteria, see if your user can access the query, again query can be private or query tree security.
    Hakan

Maybe you are looking for

  • HP Officejet 4620 Won't Scan on Printer Itself

    My computer runs on Windows 8, and updated itself last night. Somehow my printer was disconnected from the computer, so I couldn't do anything. I reinstalled the printer, but now I cannot scan using the "scan" button on the printer itself; I now have

  • Filesystem mounts as read only after boot

    Hi! I have checked the wiki, the forum posts and poked around on the web but haven't found anything helpful. I have just installed arch on my laptop, and after boot the file system is read only. Where do I change it so that it is mounted as read writ

  • Windows Services not working, nmbd stopping

    Hi all, I encounter a strange problem. I'm currently trying to install a Mac OS X Server System on a Xserve and XRaid. This to remove a Win2K Server with AD on and Exchange working on it. I set my server in OD master, import accounts from the AD, rep

  • More localization woes - upside down question marks.

    With some effort, I am able to load variable values from the database based on the language the user has selected, and display those variable values in my column headings and the like (see thread How are session variables used for localization? for t

  • How To View An Item When Publish Date Is Set Greater Than Current Date

    Using Oracle Portal Version: 10.1.2.0.2 (Build: 139). The customer(content manager) uploads a document into the portal on 28-JUL-2006 07:08 AM. The publish date is change to 1-AUG-2006 00:01 AM. There is a portal user group needing to review the docu