ALV Group and Sort

Hi,
I am sorting the ALV Display on the basis of Assignment Field. It is getting sorted, but it is displaying the value in all the lines/rows. I want to display it only once(the first row) if the value is same.
Also, the first line of the ALV Output is a checkbox.
At present the check-box is displayed in all the rows.
My requirement is to display the check-box once for every new Assignment. So, if there are 5 rows with the same Assignment Value then only one check-box should appear, either in the first or fifth row.
Your help will be definitely appreciated.
Thanks,
~ Payel

There is no Direct solution in this case....
1. Hade one extra field of type lenght 4 chars.
2. populate the ICON value for unselected checkbox.
3. Change the Fieldcatalog for the field which is added in step1.
4. Populate the sort information.
5. Handle the usercommand to check or uncheck based on action.
Check the sample code..
REPORT  zalv_total_sub.
TYPE-POOLS: slis.
INCLUDE <icon>.
DATA: BEGIN OF it_flight OCCURS 0,
       carrid  LIKE sflight-carrid,
       connid   LIKE sflight-connid,
       fldate   LIKE sflight-fldate,
       seatsmax LIKE sflight-seatsmax,
       seatsocc LIKE sflight-seatsocc,
              check(4),             "Step1
      END OF it_flight.
DATA: it_fieldcat TYPE  slis_t_fieldcat_alv,
      wa_fcat LIKE LINE OF it_fieldcat,
      layout TYPE  slis_layout_alv.
DATA: it_sort TYPE  slis_t_sortinfo_alv,
       wa_sort LIKE LINE OF it_sort.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    i_program_name         = sy-repid
    i_internal_tabname     = 'IT_FLIGHT'
    i_inclname             = sy-repid
  CHANGING
    ct_fieldcat            = it_fieldcat
  EXCEPTIONS
    inconsistent_interface = 1
    program_error          = 2.
SELECT  carrid
       connid
       fldate
       seatsmax
       seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
SORT it_flight BY carrid.
"Step 2....
LOOP AT it_flight.
  it_flight-check = icon_wd_iframe.
  MODIFY it_flight.
ENDLOOP.
wa_fcat-do_sum = 'X'.
MODIFY it_fieldcat FROM wa_fcat TRANSPORTING do_sum
WHERE fieldname = 'SEATSOCC' .
CLEAR wa_fcat.
"Step3...
wa_fcat-hotspot = 'X'.
wa_fcat-icon = 'X'.
wa_fcat-col_pos = 1.
MODIFY it_fieldcat FROM wa_fcat TRANSPORTING col_pos icon hotspot
WHERE fieldname = 'CHECK' .
wa_sort-fieldname = 'CARRID'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO it_sort.
" Step 4.
CLEAR wa_sort.
wa_sort-fieldname = 'CHECK'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_callback_program      = sy-repid
    i_callback_user_command = 'USER_COMMAND'  "Step5
    is_layout               = layout
    it_fieldcat             = it_fieldcat
    it_sort                 = it_sort
  TABLES
    t_outtab                = it_flight
  EXCEPTIONS
    program_error           = 1.
"Step 5 implementation.
FORM user_command USING ucomm TYPE sy-ucomm
selfield TYPE slis_selfield.
  CASE ucomm.
    WHEN '&IC1'.
      CASE selfield-fieldname.
        WHEN 'CHECK'.
          READ TABLE it_flight INDEX selfield-tabindex.
          IF sy-subrc EQ 0.
            IF it_flight-check = icon_checkbox.
              it_flight-check = icon_wd_iframe.
            ELSE.
              it_flight-check = icon_checkbox.
            ENDIF.
            MODIFY it_flight  TRANSPORTING check
             WHERE carrid = it_flight-carrid.
          ENDIF.
      ENDCASE.
  ENDCASE.
  selfield-refresh = 'X'.
ENDFORM.                    "user_command
Check it and let me know if any issues with the code.

Similar Messages

  • Group and sort in webi report

    I have a requirement to group and sort in a report. Group should be based on id, sort based on time. Time sort should be the priority. Meaning, first criteria to sort is time, but if the id is repeated, time should be sorted for that id.
    e.g, If I have ids A,B,C and values are such that A - 9:15 AM, B - 9:00 AM, A - 10:00 AM, C - 9:30 AM.
    Requirement is as below
    B - 9:00 AM
    A - 9:15 AM
    A - 10:00 AM
    C - 9:30 AM
    If I apply sort on time without group on id, I am getting data in the below manner which is not correct.
    B - 9:00 AM
    A - 9:15 AM
    C - 9:30 AM
    A - 10:00 AM
    If I apply group first, I am not able to apply sort. Since the requirement is to show the least time first.
    Please advice.

    use the variable
    =Min([Time]) In ([ID])
    to sort. Then hide the column by reducing the width and making the font and background color as white.

  • Use Parameter to choose Group and Sort options

    I've got a report that gets used for several different puposes, and needs to be grouped or sorted differently each time.  How can I use a parameter to let the user choose the group and sort options at runtime?
    I'm using CR2008, and SAP B1 2005.  The various grouping options I want to offer include SKU, Vendor and Description, and sorting within those Groups by SKU or Description.
    I'm a newbie with CR, so detailed instructions would be really helpful.

    You can create a report using parameter field. Follow these steps
    -- Create new parameter in the field explorer window
    -- The parameter shouls be static and enter all the field names on which you want to create in the values option
    -- Now create a formula like this
    if {?Parameter}="fieldname1" then
    else
    if {?Parameter}="fieldname2" then
    else
    -- Now insert new group and select this formula
    -- Now the group will change according to the parameter selected
    Please note that if you have different data types of fields you must need to convert totext()
    as If condition will allow only one data type output.
    Also when you insert any group by default the data is sorted on grouped field. If you want to sort on another field then you need to insert a summary field on that and go to report>group sort expert>select the field-->All based on the summary inserted.
    Hope this helps!
    Raghavendra

  • Grand Totals functionality under Group and Sort

    Hello community,
    Does anyone know if there is a solution for rolling up text fields in the summary line item (under the Show Grand Totals functionality under Group and Sort)? I can only find that date fields and formula fields summarize. I would like to be able to summarize all the data in one line items so I wont have a really long schedule and I can present to my end users accordingly.
    Thanks,
    P6GURUYOU

    Hope I understand,  if you have the groups setup, you should be able to (CRXI instructions) right click on the item in the Details line, insert a summary, you can select sum, add the sum to the group.  For the locations, insert a summary count, and add that to the groups.
    What I do sometimes, is select the option to add summary to all groups, Perhaps change the font to red, I can see the totals
    I want, and just suppress the other groups.  Just a quick and dirty way to do the totals.

  • Group and Sort

    Hi, I am a new PPM user I am trying to group my activities but the Group and Sort window does not respond.  Any ideas?

    I beg your pardon, but in your example in the insert statement you have 1, 1, Ship , whereas in your report you display 1, 0 , Ship.
    Why not avoid the problem at the source, byt letting T-sql do the work:
    with a ([Group], [FirstSort])
    AS (SELECT [GROUP], MIN(sort) As FirstSort from dbo.Table_1 group by [group])
    select  a.[GROUP], a.FirstSort, c.[Item] AS FirstItem , b.[sort], b.[item]
    from a
    inner join  dbo.table_1 as b on a.[Group] = b.[group]
    inner join dbo.Table_1 as c on a.[Group] = c.[group] and a.[FirstSort] = c.[Sort]
    order by a.[group], b.[sort] -- LEAVE OUT the order BY in the report dataset
    Gives this result (I took the insert statements from your example)
    GROUP FirstSort FirstItem sort item
    1 0 Bike       0 Bike     
    1 0 Bike       1 Car      
    1 0 Bike       1 Train    
    1 0 Bike       1 Ship     
    2 0 Lorry      0 Lorry    
    2 0 Lorry      1 Bus      
    Jan D'Hondt - SQL server BI development
    sorry for that .. will take care heare by
    ShanmugaRaj

  • Dashboards PowerShell Grid Widgets - Grouping and Sorting?

    First of all, to those who made Dashboard PowerShell Grid Widgets possible - Thank you, Thank you, Thank you.  Love it!  So much more power except for the output......
    Is there a way to group and sort my results or is it my system?  Clicking the column header doesn't seem to work, no personalize option, nor does sorting in the script seem to work. 
    Thank you. 
    BTW, it looks like the dashboard is sorting by ID no matter what one does.

    Tried it, doesn't work. Moreover, the example in the link uses CreateInstance
    whereas I'm using CreateFromObject.  Below is my code.  If I run the first two lines from the SCOM PS command prompt, I receive a nicely sorted results.  Not so in the PowerShell Grid Widget (PsGW).  If I change
    my sort property to Id, then the output order matches the PsGW.  So is this a result of using
    CreateFromObject?
    Editorial Feedback for the SCOM Team:  From all the examples I've seen on the web, and most seem to be derivative of two or three MS examples, the trend appears to be that CreateInstance
    is used for the PowerShell Web Browser Widget and everyone seems to be enamored by its capabilities.  It sure is pretty, but for my environment doesn't offer a great deal.  I feel the real meat and potatoes is PsGW - being
    able to create one's own output.  I'd love to see more examples of the methods in ScritpContextObject (who's link I'm unable to add) that have nothing to do with the web. 
    $class = Get-SCOMClass -Name Microsoft.Windows.Cluster.Group
    $clstrGrpRes = Get-SCOMClassInstance -Class $class | ? { $_.HealthState -ne "Uninitialized" } | sort-object -property Name -Descending
    foreach ($gRes in $clstrGrpRes)
    $dataObject = $ScriptContext.CreateFromObject($gRes,"Id=Id,Health=HealthState", $null)
    $dataObject["Cluster"] = $gRes.Name.Split(".")[0]
    $dataObject["Group Resource"] = $gRes.Name.Split(".")[1]
    $dataObject["Hosting Node"] = ($gRes | % { $_.values } | ? { $_.Type.ToString() -eq 'GroupActiveOnNodeDuringDiscovery' } ).value
      $ScriptContext.ReturnCollection.Add($dataObject)
    

  • Grouping and sorting the data based on the parameter

    Hi,
    I need to display the total of item Cost i.e sub total based on parameter in Excel format
    if value = 1 then (Subtotal by Manufacture) and sorting by Manufacture, Receipt Date, Organization, Item Code
    if value = 2 then (Subtotal by Organization ) and sorting by Organization, Item, Serial Number
    and at the end of report need to display full total
    is it possible in excel output using the below xml , please guide me if i need to change the way of getting XML ouput or can be acheived using this.
    Please find the xml , thanks in advance
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.27.0 -->
    <ASWRECDTREP>
    <LIST_G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>90699100802262</SERIAL_NUMBER>
    <ITEM_CODE>OM906LA.007</ITEM_CODE>
    <DESCRIPTION>MERCEDES SERIES 900 OFF HWY ENGINE 205 KW 0852</DESCRIPTION>
    <MANUFACTURER>MER</MANUFACTURER>
    <APPLICATION>INDL</APPLICATION>
    <ITEM_COST>15009.09</ITEM_COST>
    <MATERIAL_COST>685.25</MATERIAL_COST>
    <PO_NUMBER>1001395</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>22-MAY-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>EUR</CURRENCY_CODE>
    <PO_UNIT_PRICE>7431.3</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>90699100802285</SERIAL_NUMBER>
    <ITEM_CODE>OM906LA.007</ITEM_CODE>
    <DESCRIPTION>MERCEDES SERIES 900 OFF HWY ENGINE 205 KW 0852</DESCRIPTION>
    <MANUFACTURER>MER</MANUFACTURER>
    <APPLICATION>INDL</APPLICATION>
    <ITEM_COST>15009.09</ITEM_COST>
    <MATERIAL_COST>685.25</MATERIAL_COST>
    <PO_NUMBER>1001395</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>22-MAY-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>EUR</CURRENCY_CODE>
    <PO_UNIT_PRICE>7431.3</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>30</ORGANIZATION_CODE>
    <ORGANISATION_NAME>Melbourne</ORGANISATION_NAME>
    <SERIAL_NUMBER>6520107896</SERIAL_NUMBER>
    <ITEM_CODE>3500.010</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E018179</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>11126.11</ITEM_COST>
    <MATERIAL_COST>664.23</MATERIAL_COST>
    <PO_NUMBER>971515</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>14-APR-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>8063.3</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>30</ORGANIZATION_CODE>
    <ORGANISATION_NAME>Melbourne</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510869062</SERIAL_NUMBER>
    <ITEM_CODE>3200.010</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E017944</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>11853.57</ITEM_COST>
    <MATERIAL_COST>707.66</MATERIAL_COST>
    <PO_NUMBER>982120</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>12-MAY-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>8251.6</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>40</ORGANIZATION_CODE>
    <ORGANISATION_NAME>Brisbane</ORGANISATION_NAME>
    <SERIAL_NUMBER>D6002 G6003</SERIAL_NUMBER>
    <ITEM_CODE>520 SERIES.002</ITEM_CODE>
    <DESCRIPTION>KONRAD 520 SERIES MARINE STERN DRIVE</DESCRIPTION>
    <MANUFACTURER>OTH</MANUFACTURER>
    <APPLICATION>MARI</APPLICATION>
    <ITEM_COST>9296.95</ITEM_COST>
    <MATERIAL_COST>482.91</MATERIAL_COST>
    <PO_NUMBER>1009062</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>24-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>6939.29</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>40</ORGANIZATION_CODE>
    <ORGANISATION_NAME>Brisbane</ORGANISATION_NAME>
    <SERIAL_NUMBER>ABC123</SERIAL_NUMBER>
    <ITEM_CODE>GM20541-KP1.001</ITEM_CODE>
    <DESCRIPTION>KOHLER GENSET</DESCRIPTION>
    <MANUFACTURER>KOH</MANUFACTURER>
    <APPLICATION>PGEN</APPLICATION>
    <ITEM_COST>756.83</ITEM_COST>
    <MATERIAL_COST>.78</MATERIAL_COST>
    <PO_NUMBER>1015156</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>14-OCT-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE>20</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>40</ORGANIZATION_CODE>
    <ORGANISATION_NAME>Brisbane</ORGANISATION_NAME>
    <SERIAL_NUMBER>ABC124</SERIAL_NUMBER>
    <ITEM_CODE>GM20541-KP1.001</ITEM_CODE>
    <DESCRIPTION>KOHLER GENSET</DESCRIPTION>
    <MANUFACTURER>KOH</MANUFACTURER>
    <APPLICATION>PGEN</APPLICATION>
    <ITEM_COST>756.83</ITEM_COST>
    <MATERIAL_COST>.78</MATERIAL_COST>
    <PO_NUMBER>1015156</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>14-OCT-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE>20</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>06R1017763</SERIAL_NUMBER>
    <ITEM_CODE>6062HK30.005</ITEM_CODE>
    <DESCRIPTION>DETROIT SERIES 60 MARINE ENGINE 615 KW 2949322</DESCRIPTION>
    <MANUFACTURER>MDD</MANUFACTURER>
    <APPLICATION>MARI</APPLICATION>
    <ITEM_COST>99125.34</ITEM_COST>
    <MATERIAL_COST>2028.31</MATERIAL_COST>
    <PO_NUMBER>883339</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>05-MAR-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>63768</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6310935001</SERIAL_NUMBER>
    <ITEM_CODE>2500.003</ITEM_CODE>
    <DESCRIPTION>ALLISON 2000 SERIES ON HWY TRANSMISSION E016189</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>4855.33</ITEM_COST>
    <MATERIAL_COST>306.39</MATERIAL_COST>
    <PO_NUMBER>1000221</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>01-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>3574.9</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6310935002</SERIAL_NUMBER>
    <ITEM_CODE>2500.003</ITEM_CODE>
    <DESCRIPTION>ALLISON 2000 SERIES ON HWY TRANSMISSION E016189</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>4855.33</ITEM_COST>
    <MATERIAL_COST>306.39</MATERIAL_COST>
    <PO_NUMBER>1000221</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>01-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>3574.9</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6310935003</SERIAL_NUMBER>
    <ITEM_CODE>2500.003</ITEM_CODE>
    <DESCRIPTION>ALLISON 2000 SERIES ON HWY TRANSMISSION E016189</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>4855.33</ITEM_COST>
    <MATERIAL_COST>306.39</MATERIAL_COST>
    <PO_NUMBER>1000221</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>01-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>3574.9</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510876301</SERIAL_NUMBER>
    <ITEM_CODE>T350R.004</ITEM_CODE>
    <DESCRIPTION>ALLISON TORQMATIC ON HWY TRANSMISSION</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>9465.69</ITEM_COST>
    <MATERIAL_COST>597.33</MATERIAL_COST>
    <PO_NUMBER>1005777</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>23-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>6936.3</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510876302</SERIAL_NUMBER>
    <ITEM_CODE>T350R.004</ITEM_CODE>
    <DESCRIPTION>ALLISON TORQMATIC ON HWY TRANSMISSION</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>9465.69</ITEM_COST>
    <MATERIAL_COST>597.33</MATERIAL_COST>
    <PO_NUMBER>1005777</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>23-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>6936.3</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510876303</SERIAL_NUMBER>
    <ITEM_CODE>T375R.002</ITEM_CODE>
    <DESCRIPTION>ALLISON TORQMATIC ON HWY TRANSMISSION</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>10224.19</ITEM_COST>
    <MATERIAL_COST>645.19</MATERIAL_COST>
    <PO_NUMBER>1005777</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>23-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>7433.3</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6310940354</SERIAL_NUMBER>
    <ITEM_CODE>2500.003</ITEM_CODE>
    <DESCRIPTION>ALLISON 2000 SERIES ON HWY TRANSMISSION E016189</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>4855.33</ITEM_COST>
    <MATERIAL_COST>306.39</MATERIAL_COST>
    <PO_NUMBER>1005777</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>23-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>3574.9</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6310940355</SERIAL_NUMBER>
    <ITEM_CODE>2500.003</ITEM_CODE>
    <DESCRIPTION>ALLISON 2000 SERIES ON HWY TRANSMISSION E016189</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>4855.33</ITEM_COST>
    <MATERIAL_COST>306.39</MATERIAL_COST>
    <PO_NUMBER>1005777</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>23-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>3574.9</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6310940356</SERIAL_NUMBER>
    <ITEM_CODE>2500.003</ITEM_CODE>
    <DESCRIPTION>ALLISON 2000 SERIES ON HWY TRANSMISSION E016189</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>4855.33</ITEM_COST>
    <MATERIAL_COST>306.39</MATERIAL_COST>
    <PO_NUMBER>1005777</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>23-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>3574.9</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>6310940357</SERIAL_NUMBER>
    <ITEM_CODE>2500.003</ITEM_CODE>
    <DESCRIPTION>ALLISON 2000 SERIES ON HWY TRANSMISSION E016189</DESCRIPTION>
    <MANUFACTURER>ATD</MANUFACTURER>
    <APPLICATION>ONHY</APPLICATION>
    <ITEM_COST>4855.33</ITEM_COST>
    <MATERIAL_COST>306.39</MATERIAL_COST>
    <PO_NUMBER>1005777</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>23-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>3574.9</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <ORGANIZATION_CODE>70</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PRODUCT</ORGANISATION_NAME>
    <SERIAL_NUMBER>5272003543</SERIAL_NUMBER>
    <ITEM_CODE>T1637K33.002</ITEM_CODE>
    <DESCRIPTION>DETROIT SERIES 4000 INDUSTRIAL ENGINE 1865 KW 2456291</DESCRIPTION>
    <MANUFACTURER>MDD</MANUFACTURER>
    <APPLICATION>MNIG</APPLICATION>
    <ITEM_COST>420083.16</ITEM_COST>
    <MATERIAL_COST>3785.85</MATERIAL_COST>
    <PO_NUMBER>921170</PO_NUMBER>
    <TRANSACTION_RECEIPT_DATE>30-JUN-09</TRANSACTION_RECEIPT_DATE>
    <VENDOR_LOT_NUM></VENDOR_LOT_NUM>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <PO_UNIT_PRICE>301549</PO_UNIT_PRICE>
    </G_ASW_REC_DATE>
    </LIST_G_ASW_REC_DATE>
    </ASWRECDTREP>
    Best Regards,
    Mahi

    Hi Vetri,
    I tried to implement the solution you have given and i am getting error,
    I tried to see the output by loading the xml to the template given in BIP Blog in the following Link,
    http://blogs.oracle.com/xmlpublisher/2007/05/left_up_down_right_group.html
    I am getting the same error,Please help me how to overcome this.If possible send me the template that was working for you.
    The error log is as follows:
    ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    Template: C:\Users\MAHESH\Desktop\Grouping.rtf
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Users\MAHESH\Desktop\EmployeeListing.xml
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at RTF2PDF.runRTFto(RTF2PDF.java:629)
         at RTF2PDF.runXDO(RTF2PDF.java:439)
         at RTF2PDF.main(RTF2PDF.java:289)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
         at oracle.xdo.parser.v2.XSLTContext.peekExprValue4Grouping(XSLTContext.java:871)
         at oracle.xdo.parser.v2.XPathFunctionCall.evaluate(XPathFunctionCall.java:536)
         at oracle.xdo.parser.v2.XPathFunctionCall.evaluate(XPathFunctionCall.java:583)
         at oracle.xdo.parser.v2.XSLVariable.getValue(XSLVariable.java:205)
         at oracle.xdo.parser.v2.XSLVariable.processAction(XSLVariable.java:117)
         at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
         at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
         at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
         at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
         at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
         at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
         at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
         at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
         at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
         at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
         at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
         at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
         at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
         at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
         at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
         at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
         at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
         at oracle.xdo.parser.v2.XSLTemplate.processAction(XSLTemplate.java:191)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:512)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
         ... 15 more
    Best Regards,
    Mahi

  • Group and sort in group2

    CREATE TABLE [dbo].[Table_1](
    [group] [int] NULL,
    [sort] [int] NULL,
    [Item] [nchar](10) NULL
    ) ON [PRIMARY]
    GO
    INSERT [dbo].[Table_1] ([group], [sort], [Item]) VALUES (1, 1, N'Car ')
    INSERT [dbo].[Table_1] ([group], [sort], [Item]) VALUES (2, 1, N'Bus ')
    INSERT [dbo].[Table_1] ([group], [sort], [Item]) VALUES (1, 0, N'Bike ')
    INSERT [dbo].[Table_1] ([group], [sort], [Item]) VALUES (2, 0, N'Lorry ')
    INSERT [dbo].[Table_1] ([group], [sort], [Item]) VALUES (1, 1, N'Train ')
    INSERT [dbo].[Table_1] ([group], [sort], [Item]) VALUES (1, 1, N'Ship ')
    Data
    My Dataset Query in ssrs table
    Group2 expression
    Group on Group
    Sort on Sort
    Group 1 expression
    Sort on Sort
    First(Item.value ) is not working..  i need to fix in ssrs since this is an an sample data of sp with more columns
      my problem is once group2 is grouped, it is not taking the sort and just dispalying the First item in the sort of the item.
    ShanmugaRaj

    I beg your pardon, but in your example in the insert statement you have 1, 1, Ship , whereas in your report you display 1, 0 , Ship.
    Why not avoid the problem at the source, byt letting T-sql do the work:
    with a ([Group], [FirstSort])
    AS (SELECT [GROUP], MIN(sort) As FirstSort from dbo.Table_1 group by [group])
    select  a.[GROUP], a.FirstSort, c.[Item] AS FirstItem , b.[sort], b.[item]
    from a
    inner join  dbo.table_1 as b on a.[Group] = b.[group]
    inner join dbo.Table_1 as c on a.[Group] = c.[group] and a.[FirstSort] = c.[Sort]
    order by a.[group], b.[sort] -- LEAVE OUT the order BY in the report dataset
    Gives this result (I took the insert statements from your example)
    GROUP FirstSort FirstItem sort item
    1 0 Bike       0 Bike     
    1 0 Bike       1 Car      
    1 0 Bike       1 Train    
    1 0 Bike       1 Ship     
    2 0 Lorry      0 Lorry    
    2 0 Lorry      1 Bus      
    Jan D'Hondt - SQL server BI development
    sorry for that .. will take care heare by
    ShanmugaRaj

  • Grouping and sorting multiple cells

    Is there a way to group multiple contiguous cells so that they act as one large "super" cell, then have Numbers sort the groups according to a value in one of the individual cells in the group?
    I have created a document that has several columns and rows that are added together to arrive at a value that is put into a cell in the bottom right corner of the group. I need to sort these groups according to the value in that last cell in each group.
    I hope that makes sense.

    Seth,
    Consider putting the group value in each row so that when you sort, rows with the same group value will stay together. The column with this value can be hidden and you can repeat it in another column on the last row of each group. This will probably require another auxiliary column to keep the rows in the proper order within a group, and a two-level sort.
    Jerry

  • What are events in ALV report and explain how sorting is done  alv report

    events in alv report and sorting in alv report
    Moderator Message: Search before posting.
    Edited by: kishan P on Dec 21, 2011 11:13 AM

    Hi Raja,
    <<content and links removed by moderator>>
    PavanKumar.G
    Edited by: kishan P on Dec 21, 2011 11:12 AM

  • Is it possible to have sorting by group and checkboxes in the same ALV

    Hi there,
    Does anyone know whether it is possible to have sorting and group on one field in ALV and checkboxes set on another field in ALV?
    eg.
    Fieldname
    ===========
    Name----
    Text
    Allowance----
    Numeric -> Sort & Group
    Verified----
    Checkbox
    How do I code it if it is possible to have grouping and check box all in one ALV.  Meaning I want some data that are the same to merge using sort, while still having the checkbox available for my other field (Verified).
    Thanks in advance.
    Lawrence

    hi,
    GROUP BY clause is used on database tables with select statement.
    sort is used on internal tables.
    can u clearly explain y u need group by and sort on the same field.
    if u are extracting from dbtable using grou by clause on a field, then no need to sort it again.
    if u want sort u can do it by giveing "sort itab by field". thats not a problem.
    now coming to check box.instead of using SLIS type field catalog, u use LVC type.
    in LVC_S_LAYO, u can fine box_fname.
    while defining layout, u declare a variable of type LVC_S_LAYO
    AND GIVE BOX_FNAME = internal table field name

  • "Custom" grouping and / or colored lines in ALV

    Hi!
    Two questions:
    1. Is it possible to use colors in the ALV for a given set of rows? I'd like to mark rows with a color, which are logically belongs together.
    2. Other approach would be to sort the ALV and via that the "similar" rows (i.e. some column values in the rows have the same value ) would be grouped.
    The normal ALV grouping feature is too general. E.g if the ALV contains a lot of empty cells, then those cells will be grouped as well, nevertheless they are logically don't belong together -> looks quite weird.
    If the custom grouping cannot be realized, then my approach would be the following:
    1. Sorting the table. -> rows where the content partially equal are in succession.
    2. Manually clear the cells in the second (in my business case only two lines can be partially equal, others are unique) row, which are the same as in the previous row.
    3. Use coloring to indicate that these two lines are belonging together.
    Best regards,
    Peter

    Hi Peter,
    It is possible to assign colors to a specific row. But you need to have some work around.
    You have to create an extra attribute for each column that you have in your table. The type of that attribute should be of WDUI_TABLE_CELL_DESIGN.
    After Instatiating your ALV Component you have to use the following statement for the column that you have to apply the color.
    ls_column-r_column->set_cell_design_fieldname( COLUMN1_DESIGN ). Assuming ls_column-r_column will have COLUMN1 as filed name.
    There are 16 colors that are defined and each combination from '00' to '15' will define one color.
    Look at the structure below.  Its a table with 4 columns(2nd and 4th represents colors for first and third columns)
    value11          00            value12          00
    value21          00            value22          00
    value31          02            value32          02.
    If you consider the above struture as your output table 3 rows and 4 columns  then your third row will be highlighted in green color because 02 represents green. You can hide your second column and fourth column in above example because they represents colors. Use the following statement to hide those columns.
    ls_column-r_column->set_visible(
                     cl_wd_uielement=>e_visible-none ). "ls_column-r_column will have 'COLUMN1_DESIGN'
    Let me know if you know more code.
    Thank You,
    Gajendra.

  • How to subtotal and sort in ABAL webdynrp ALV?

    Hi Experts,
       In my ALV table I have CARRID and PRICE.
       I want to sort the data by CARRID and then group the data based on CARRID and get price subtotal of it.
       I also want a grand total of the price.
       How to programatically subtotal and sort in ABAL webdynrp ALV?
       Please provide sample code snippet if possible.
    Thanks
    Gopal
    Edited by: gopalkrishna baliga on Oct 26, 2010 1:30 PM

    Hi Gopal,
    Didn't you get solution with your earlier post?
    How to show Subtotal in webdynpro ALV(ABAP)? Kindly help!
    Regards,
    Vikram

  • Grouping and input columns ALV

    HI ,
    my requirement is to group  the  columns   that have same value  in my ALV (  like fonction sort/subtotal in standard ALV) and have other input  coloums in my ALV .
    I observe that groupement don't work if  have one of columns as input  .
    have you any idea to have on the same time  grouping fonction and  other  iput columns , on my ALV grid
    thanks

    There is a layout property cell_merge in ALV layout. You can try with that. But not sure whether it works with a editable column.
    Kesav

  • Call tcode from alv report and passing  group of values

    hi all .
    i want to call tcode from alv report and passing an internal table or group of values to a selection option of that t code ? how
    ex. passing group of GL to fbl3n and display the detials of all .
    thank you

    Dear,
    You have done a small mistake
    --> rspar_line-option = 'EQ'.
         rspar_line-HIGH = PDATE-HIGH.
    u r passing "high" value and in "option u r passing "EQ" so how it will work!!!
    So if u r passing only 1 date or more dates like 01.01.2010 , 15.02.2010 , 10.03.2010 then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'EQ'.
    rspar_line-LOW = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    or if u r passing low & high date means in range like 01.01.2010 to 30.01.2010, then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'BT''.
    rspar_line-LOW = PDATE-LOW.
    rspar_line-HIGH = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    try above code , hope it helps...
    i think u cannot use "call transaction using bdcdata" in ur case bcoz as u said in ur 1st post u want to display the details of all but still if u want to use then u should pass all parameters in  loop.
    PROGRAM
    DYNPRO
    DYNBEGIN
    FNAM
    FVAL
    ex:-
    LOOP AT GT_TEMP INTO GS_TEMP.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = 'SAPXXXX'.
    bdcdata_DYNPRO = '1000'.
    bdcdata_DYNBEGIN = 'X'.
    bdcdata_wa-fnam = '''.
    bdcdata_wa-fval = ''.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'SD_SAKNR'.
    bdcdata_wa-fval = GS_TEMP-GLACCOUNT.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = 'XXX'.
    APPEND bdcdata_wa TO bdcdata_tab.
    ENDLOOP.
    try above code if u r using call transaction...
    Edited by: mihir6666 on Jul 9, 2011 3:10 PM
    Edited by: mihir6666 on Jul 9, 2011 3:11 PM
    Edited by: mihir6666 on Jul 9, 2011 3:13 PM

Maybe you are looking for