ALV: How do I suppress repeating values and page breaks on printed output?

Good day, everyone!
First, I've done a LOT of searching trying to find the answer to my question, but I'm not finding an answer.  If this has already been answered and you can point me to a URL, I would appreciate it.
Here's my issue:  I have a rather simple ALV report.  It has the columns of Person ID, Personnel Number, For Period, In Period, and Amount.  I sort by Person ID and Personnel Number, and if the value repeats on the next line of the report, I want to suppress it (make it blank).
I thought the answer was in the following code, where I set the GROUP attribute to asterisk:
  CLEAR sortcat_ln.
  sortcat_ln-spos      = '1'.
  sortcat_ln-fieldname = 'PERSONID_EXT'.
  sortcat_ln-up        = c_true.
  sortcat_ln-group     = '*'.
  APPEND sortcat_ln TO sortcat.
  CLEAR sortcat_ln.
  sortcat_ln-spos      = '2'.
  sortcat_ln-fieldname = 'PERNR'.
  sortcat_ln-up        = c_true.
  sortcat_ln-group     = '*'.
  APPEND sortcat_ln TO sortcat.
It looks PERFECT on the screen -- the values are suppressed if they repeat, and everything appears together on one screen.  However, when I print the report, two things happen:  1) The values repeat on each row, even if they are the same, and 2) I get a page break after each Person ID / Personnel Number combination.
I now realize that I can't use the GROUP attribute.  Is there some other way in ALV to blank these repeating values and keep all the rows together on one page, rather than page breaking after each value change?
Thanks!
Dave

Hi
Same requirement i had before, when i try to print preview. the output of the grid display is in grouping is ok, but when i print preview or print it doesnt cater the grouping and page breaks, so what i did i modify the internal table use in alv , after hitting the print preview/print with the format desired by the user. you can do that in user-command. see code below
FORM user_command USING r_ucomm TYPE syucomm
                        rs_selfield TYPE slis_selfield.
  DATA lt_sort TYPE lvc_t_sort.
  CASE r_ucomm.
    WHEN '&RNT_PREV' OR '&RNT'.
      t_final_x[] = t_final[].
      PERFORM clear_redundant.
      PERFORM set_sort_criteria USING lt_sort.
    WHEN '&F03' OR '&PRINT_BACK_PREVIEW'.
      t_final[] = t_final_x[].
    WHEN OTHERS.
  ENDCASE.
ENDFORM.                    "user_command
hope it helps

Similar Messages

  • No repeated values and in ascendant sort

    Hi all,
    I'm trying to put this:
    SELECT DISTINCT month FROM Concert ORDER BY month ASC;
    (no repeated values and in ascendant sort) into EJB-QL. This is what I've worked out:
    SELECT DISTINCT OBJECT(o)
    FROM Concert AS o
    ORDER BY o.month ASC
    (month is a field in the bean )
    But this (and several tries later) doesn't work.
    What's wrong with it??
    The query is for a findAll method -without- input parameters which returns a collection, is here the error??? If so, how can I solve it?
    I'm totally lost and frustrated, I'd really appreciate some light
    Thanks a lot in advance

    Your query is currect if table name and attribute name are currect.
    Can you write what type of error is comming?

  • How to create a matrix with constant values and multiply it with the output of adc

    How to create a matrix with constant values and multiply it with the output of adc 

    nitinkajay wrote:
    How to create a matrix with constant values and multiply it with the output of adc 
    Place array constant on diagram, drag a double to it, r-click "add dimension". There, a constant 2D double array, a matrix.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • How to retrieve the procedure value and pass the value to a form field

    How to retrieve the procedure value and pass the value to a form field?

    Set property for the field and the value is the actual procedure/function.
    Cheers

  • How to get the kerning value and set it to back use script?

    hi,guys
    I come back again.
    I encountered a kerning problem.
    how to get the kerning value and set it to back use script?
    Thanks very much!

    For both cases, the filename can be found on the FILE.ReceivedFileName Context Property.  You can access this Property in a Pipeline Component or Orchestration and take any action you want, such as apply to a database.
    The value is accessed by: MyReceivedMessage(FILE.ReceivedFileName)
    In the case of a duplicate EDI Interchange, you would use the Failed Message Routing feature to capture the error message with either an Orchestration or Send Port.

  • Prevent Occurence of list header and page breaks in spool file of ALV Grid

    Prevent Occurence of list header and page breaks in spool file of ALV Grid  Display.
    When we run the ALV in background and create spool request then:
    Spool file output is coming like this.
    Column1 Column2 Column3 Column4
    data        data        data       data
    data        data        data       data
    data        data        data       data
    Column1 Column2 Column3 Column4
    data        data        data       data
    data        data        data       data
    data        data        data       data
    But the required is like this
    Column1 Column2 Column3 Column4
    data        data        data       data
    data        data        data       data
    data        data        data       data
    data        data        data       data
    data        data        data       data
    data        data        data       data
    Please suggest a posible answer

    Hello all,
    if you have not yet solved this on your own, here is my solution: use a format type that has 60000 lines per page for your spool output device.
    It all depends on the format type that was used for creating the spool output.
    By default (in our system), we have 65 lines per page. And after each page the column headings of the ALV will appear.
    What i did:
    create a new format type via transaction SPAD->full administration->device types->format types (copy an existing one)
    change"Number of Rows" to 60000 or something applicable
    edit the device type of your output device (e.g. LOCL) to contain the newly created format type (via SPAD; Button "Formats" in device type maintenance).
    That's it! Be sure to use this format type for your output device in the "Background Print Parameters" window (-> Button "Properties").
    Regards
    Daniel Klein
    All other parameters you discussed before didn't do it. All ALV-Settings will be overwritten by the output device settings and its print properties.

  • OO ALV - How to highlight cell after value change

    Hi All,
    I have an OO ALV with an input enable column and would like to highlight a cell in a different color when the user changes it's value.
    I am using pr_data_changed->get_cell_value to check the cells value has changed and pr_data_changed->modify_cell to update the cell with the new value.
    The output table has a field called CELLCOLOR of type LVC_T_SCOL which I am using to highlight the cell in red:
             lw_cellcolor-fname = 'THISFIELD' .
             lw_cellcolor-color-col = '7'.
    The ALV layout is also correclty set using:   layout-ctab_fname = 'CELLCOLOR'
    All the above is working fine and the changed cell is highlighted HOWEVER it only works if I call METHOD g_grid->refresh_table_display
    Is there anyway to highlight the cell without calling method refresh_table_display??????
    I do not like to call method refresh_table_display in an ALV event. The main reason is if a user changes a cells value and at the same time selects the row for update then the method refresh_table_display wipes out the row selection marker.
    So Is there anyway to highlight the cell without calling method refresh_table_display??????
    All your help appreciated
    Che

    Try this way
    In the PAI use
    call method get_selected_rows
    This will get you the row index of the selected rows from the screen for example I_ROW
    In PBO
    call method g_grid->set_selected_rows
    exporting
      it_row_no = i_rows[].
    then call refresh_table_first_display
    So this one will keep row selection after the refresh_table_first_display method

  • How to Assign a default value and Increement in my Target table ........?

    Hi,
    In my target table I want to Increment a value and store it in the table ........
    the increement shud start frm ...........5001,5002,5003..................etc
    How can I achieve this...........?
    I created an numeric Variable and in assigned the default as 5000 nad action as Historize.........
    In the target Datastore ......I assigned VAR+1.......
    but in the Target column I got 5001 for all the columns........
    Which way is the best way to deal with the Variables.......
    Thanks
    AK
    Message was edited by:
    AK2008

    Hi Gurusank and Micropole,
    Thanks for reply and info.....
    I am trying out one of the solutions first........
    Gurusank,
    I have created a sequence........whether I need to mention the schema and table name ,column.........also ( I gave all the information) and Increement column =1 and saved it .......
    Then I follwed the procedure as u have mentioned .....
    And in the Target field also I gave the same the same.......for tat column I gave choose (target for execution).
    And I directly ran the interface ..........
    I got the folowing Error:
    287 : 42000 : java.sql.SQLException: ORA-02287: sequence number not allowed here
    java.sql.SQLException: ORA-02287: sequence number not allowed here
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:534)
    Could u plz let me know where I am doing the mistake
    Thanks
    AK

  • How to maintain space between value and base unit of measure in sapscript

    Hi Guys,
    I am working on an upgradtion project, i have problem like while upgrading from 4.6b to 5.0. i need to main a space between value and base unit of measure. can anyone letme know how to maintain in the form. I mean in sapscript.
    Thanks,
    Yogesh

    There are a couple of ways to handle this,  if you need a bigger space between, you can use tabs in the paragraph format.  Or you can just write the space in between the fields like so.
    ZA  &MSEG-MENGE& &MSEG-MEINS&
    Regards,
    RIch Heilman

  • Ff67 , How Interpretation algoritms 001 take VALUE and REFER

    Dear experts
    How to Interpretation algoritms 001 take VALUE AND REFERENCE (XBLNR).
    BOTH VALUE AND REFERENCE .
    When I use algorithm 001 without REFERENCE , It take value , but when I
    put REFERENCE it take REFERENCE only and NO TAKE VALUE .
    I need that this algorithm take both VALUE AND REFERENCE.
    How Can do this ?
    Our electronic account statement , have many equal values , but I can
    take reference value for clear item open automatic . In this moment is
    manual this process.
    Is necesary implement  user-exit or badi for this solution ? Or any ideas to implement algoritms 901 ??
    Thanks for your comments

    Hi phantom,
    Row 1 is a Header Row. Row 10 is a Footer Row.
    Formula in Footer Cell B10
    =SUMIF(C,TRUE,B).
    SUMIF will sum the values in B where there is a tick (TRUE) in C.
    Regards,
    Ian.

  • How to Store bollean selection values and retrieve them in runtime?

    I have an array of bolleans representing a channel of a device. Now , when the user turns on the channel the selected channel array are supposed to be stored. Now when the user selects device 2 (using a ring function) the list refreshes t5he channel names and resets the bollean array to their default values and the new selection values are to be stored. Now if the user wants, he should revert back to device 1 and can review what all channels he had selected for Device 1. How can this functionality be achieved?
    Labview Learner
    Attachments:
    1.PNG ‏14 KB
    2.PNG ‏14 KB

    You need to store the boolean array somewhere.  I would likely just use a shift register
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to get po delivered value and po invoived value?

    HI experts,
    i need to create bex query with PO total value,  PO NET VALUE Item wise, po delivered value,
    po still remaining value and po invoiced value.
    AFter extensive search i got 0net_po_val for PO net value item wise.
    Remaining 4. Fields am unable to search in bw targets. So how to proceed?? Any inputs?
    Thanx in advance.
    br,
    Ravi kiran

    Hi Ravi,
    Please find the logic for the same:
    PO Delivered Value
    EKBE (BEWTP = E and SHKZG) SHKZG = S   is positive  and
    SHKZG = H is negative.
    PO Still Remaining Value
    PO Value- PO  Delivered Value
    PO Invoiced Value
    EKBE(BEWTP = Q and SHKZG) SHKZG = S   is positive  and
    SHKZG = H is negative.

  • When we run query how it gets the characteristic values and attributes.

    Hi,
    When we load transaction data it chacks characteristic values then SIDs then DIM IDs then insert  DIM IDs into fact table but when we run the query how it checks and gets the characteristic values and attributes.
    Bye
    GK

    when we run the query how it checks and gets the characteristic values and attributes.
    Just the opposite way you have described. It gets from the corresponding masterdata tables, with the connected SID.

  • How to create a display value and a return value for an item

    Hi! I have an item on a form. I want the default value for my item to be :":APP_USER", but the return value, to be the id of my user. I tried to create a PL/SQL Expression for the default item, but it doesn't work. What do I miss?
    It should be something like this, but it's not.
    begin
    select first_name || ',' ||last_name as "Employee",
    id_employee -- display value,return value
    from employees
    where id_employee = :APP_USER;
    end;
    Does anyone know?
    Thanks!
    Vitaly

    Hi VItaly,
    Display value and return value concept applies very well in case of a Combo box if i am correct, I don't know what type of item is your's.
    But any way, you can have a workaround like,
    Create a hidden item such that it's default value should be ID of the user which can be get from db by using :APP_USER.
    Use the this item for your references.
    I think this will meet your requirement.
    Thanks
    Kumaraswamy.

  • Grouping and Page Break in ALV using Function Modules

    Hi all,
    I am trying to develop an ALV Report that will be grouped by vendor, some vendor information to be displayed on header. And, after each vendor;s records there should be a page break.
    It should be something like this:
    Vendor Number: 00012345454
    Vendor Name: ABC Technologies, Inc
    Vendor Country: USA
    Item....Price...... Descriptopm
    123....100,00......this is description
    124....120.00......this is another description
    PAGE BREAK
    Vendor Number: 000123456545
    Vendor Name: My Bank
    Vendor Country: USA
    Item....Price..... Descriptopm
    223....32,00......this is my description
    224....120.00......this is another description
    Can anybody give some sample code for it ? I have tried a few codes from web, but they are not working.
    Thanks.

    Hi,
    Try the following:
    1. Build your sorting criteria. Pass this to ALV FM.
      gs_sort-fieldname = 'VENDOR'.
      gs_sort-group = '*'. "new page
      gs_sort-up = 'X'.
      APPEND gs_sort TO gt_sort.
    2. Add event group level change. Pass this to ALV FM
      gs_event-name = 'GROUPLEVEL_CHANGE'.
      gs_event-form = 'GROUPLEVEL_CHANGE'.
      APPEND gs_event TO gt_event.
    Inside the form, retrieve your vendor details.
    FORM grouplevel_change USING gs_lineinfo
                                 gs_groups TYPE kkblo_grouplevels.
      DATA: l_index     TYPE i.
      IF gs_groups-level = 1.
        l_index = gs_groups-index_to + 1.
        READ TABLE gt_display INDEX l_index  INTO gw_display.   
      ENDIF.
    3. In the event top-of-page, display vendor details using write statements. For the first record, your structure (gw_display) will be blank, read from your data table first
    FORM top_of_page.
      IF gw_display IS INITIAL.
        READ TABLE gt_display INDEX 1 INTO l_display.
        IF sy-subrc = 0.
          WRITE: / l_display-vendor
        ENDIF.
      ELSE.
        WRITE: / gw_display-vendor.
        CLEAR: gw_display.
      ENDIF.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_pf_status_set = 'SET_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          is_layout                = gs_layout
          it_fieldcat              = gt_fcat[]
          it_sort                  = gt_sort[]
          i_save                   = 'A'
          it_events                = gt_event
        TABLES
          t_outtab                 = gt_display[]
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    Hope this helps.

Maybe you are looking for

  • The problem about call dll from VB....

    Dear All. I have a device and  VB dll file.I want to use labview to call  dll.But Labview show "An Exception occurred within the external code ..." Below is  to call this dll details. 1.FindHardware: Call it at beginning when load program first, it c

  • FlexUnit Ant task freeze at Reciving Data...

    Hello, I'm trying to use flex unit task and when I run it, get this on console and stay there for ever. "*****" is just to privacy this is my ant task <target name="UNIT TEST">                     <echo>COMPILING TEST SWF..</echo>                    

  • Populate List Box

    Hi,           I am new to Weblogic 8.1 and was with .NET for last couple of years. I need to populate a list box in my jsp page. I have a database control method that returns a String array and this should be shown in the list box. I would like to kn

  • RICS0001:Internal Error

    Hi, I run RME 4.1.1, I have the following error when I try to inventory a MCS 7825 : RICS0001:Internal Error,unable to process the collected data from the device. I attached the IC_Server.log. regards, Julien

  • Anyone got a FP controller for sale?

    Has anyone got a FP-2000, FP-2010 or FP-2015 that they'd be happy to let got for a few bucks? I've got a buddy who's automating his home brewing operation, and I've got the DAQ modules and TBs, but no controller. Copyright © 2004-2015 Christopher G.