Reuse ALV - Only subtotals on first view...how

Hello
This is how my current report looks like.
[http://www.filedump.net/dumped/200809021357031220356701.png]
Want I want is the first column to be collapsed on first view. The help file had this to say:
subtot
'X' = Subtotals for control level changes
o comp (INTERNAL USE ONLY)
o expa
Prequisite:
IT_SORT-SUBTOT = 'X', that is, the sort criterion is also the
subtotals criterion.
If no complete breakdown but only a breakdown to totals level n that
can be further expanded by the user should be displayed when the
list is output for the first time, you must set the indicator for
the totals level criterion of level n.
I do not understand that part, and haven't found any threads that cover this. I'd de thankful if somebody could help me out.
bye
Here is my current code:
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
DATA: T_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA: S_SORT LIKE LINE OF T_SORT.
S_SORT-SPOS = '0'.
S_SORT-FIELDNAME = 'EBELN'. "VENDOR field name.
S_SORT-UP = 'X'.
S_SORT-SUBTOT = 'X'.
APPEND S_SORT TO T_SORT.
*S_SORT-SPOS = '1'.
*S_SORT-FIELDNAME = 'GL ACCOUNT FIELD NAME'.
*S_SORT-UP = 'X'.
*S_SORT-SUBTOT = 'X'.
*APPEND S_SORT TO T_SORT.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
"    * Build Fieldcatalog for ALV Report
form build_fieldcatalog.
"    * There are a number of ways to create a fieldcat.
"    * For the purpose of this example i will build the fieldcatalog
"manualy
"    * by populating the internal table fields individually and then
"    * appending the rows. This method can be the most time consuming
"but can
"    * also allow you more control of the final product."
"    * Beware though, you need to ensure that all fields required are
"    * populated. When using some of functionality available via ALV,
"such as
"    * total. You may need to provide more information than if you were
"    * simply displaying the result
"    * I.e. Field type may be required in-order for
"    * the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
"    * fieldcatalog-do_sum = 'X'.
"    * fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
*fieldcatalog-key = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
"    * Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
*gd_layout-totals_only = 'X'.
"    * gd_layout-f2code = 'DISP'. "Sets fcode for when double
"    * "click(press f2)
"    * gd_layout-zebra = 'X'.
"    * gd_layout-group_change_edit = 'X'.
"    * gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
"    * Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
"    * i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
"    * i_callback_user_command = 'USER_COMMAND'
"    * i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_sort = T_SORT
"    * it_special_groups = gd_tabgroup
"    * IT_EVENTS = GT_XEVENTS
i_save = 'X'
"    * is_variant = z_template
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
if sy-subrc = 0.
"    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
"    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
"    * Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL

Hello
The layout is defined in gd_layout.
I'm not sure if I understand.
The program does show the subtotals already. But I want a collapsed view like this.
http://www.filedump.net/dumped/200809021450331220359886.png

Similar Messages

  • I bought the second season of arrow on i tunes and it only downloaded the first episode how do i download the rest?

    Please help i have spent forty dollars on this season of arrow and it only downloaded the first episode how do i download the rest?

    Hi handpg2,
    It looks like there are several options for downloading episodes of a TV show.
    iTunes Store download options
    Season Passes and completed TV seasons
    When you buy a TV season or Season Pass, you'll see these options:
    Later: Don't download any episodes now. You can download your episodes later from iTunes in the Cloud.
    Download All: Download all available episodes.
    Download: Download the earliest unseen episode of the season. For example:
    If you haven't downloaded any episodes from a season, episode 1 of that season will download.
    If you've previously bought or downloaded episode 3 of a season, episode 4 of that season will download.
    Thank you for using Apple Support Communities.
    Nubz

  • I am trying to get a footnote repeated on each page of a report- it only appears on first page - how do I make it appear on each page please?

    How do I get the same footnote to appear on each page of a report - it only shows on  the first page?? I went in through View and Layout per instructions. Thanks.

    Hard to tell w/out knowing exactly which application and version you are drafting this report in.  Often the footer on the first page is distinct from the footers of the second page through end - quick fix: add the footer to the second page and you should then be able to format it to continue on through the end of the report.

  • ALV: how to display only subtotals and total rows in the output

    ALV: how to display only subtotals and total rows in the output
    i am getting output
    i am getting subtotals for respective fields
    but i want to display only subtotals and totals rows in the output
    i have tried the
    totals_only   parameter in slis_layout_alv
    but it is not working.

    hi,
    For TOTAL
    For the amount field / quantity field in the field catalog give DO_SUM = 'X'    for WHOLE total
    For SUBTOTAL
    For subtotal you will have to create an internal table sort..Let's say you want to do subtotal for each customer..
    DATA: lt_sort type SLIS_T_SORTINFO_ALV,
    ls_sort type slis_sortinfo_alv.
    CLEAR ls_sort.
    ls_sort-spos = 1.
    ls_sort-fieldname = 'Give the field name that you do the sum'.
    ls_sort-up = 'X'.
    ls_sort-subtot = 'X'.
    APPEND ls_sort TO lt_sort.
    fieldcatalog-do_dum = 'X'.
    for subtotals
    WA_SORT-FIELDNAME = 'ERSDA'.
    WA_SORT-SPOS = '2'.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOTAL = 'X'.
    APPEND WA_SORT TO IT_SORT.
    Refer
    http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/content.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/doesnt-function-event-subtotal_text-in-alv-713787
    regards,
    Prabhu
    reward if it is helpful

  • How can I view a PDF file on my IPad? I only get the first page.

    How can I view a PDF file from my Ipad, both in email and Internet links? I only get the first page.

    Support for viewing PDFs in emails and web-pages is built in to the iPad. You need not have bought an app for that.
    There are PDF apps that provide more features than the built-in functionality, but for basic viewing of multi-page PDFs no app is required.

  • Hide "more" button in a list view, only works for first item in the list

    I have the following code in a list view that outputs several dozen items in a web app.  The code only works for the first item, how can I make it loop through and execute the test for each item in the list view?  The {tag_hide more button} is a checkmark field that yields a numeric 1" if checked otherwise yields a numeric "0".
    <div id="more-option">
            <p class="right"><a href="{tag_itemurl_nolink}" class="btn btn-small btn-very-subtle">More &rarr;</a></p>
          </div>
          <div class="more-selection" style="display: none;">{tag_hide more button}</div>
          <script>
    if ($(".more-selection").text() == "1") {
        $("#more-option").hide();
    </script>

    What's the URL for the site where you are using this?  Offhand, it looks like it should work with your first example so you are either placing the script before those elements are loaded or you might try wrapping your current javascript inside the:
    $(document).ready(function() {
    --- your existing javascript here
    This make sure the code runs once all the html is loaded on the page.  Without seeing a URL and debugging with the js console in Chrome I can't give you a solid answer.
    But, I do know that you can probably do this with a lot less markup.  Once we figure out what the actual problem is I have a better solution mocked up for you on jsfiddle.
    When looking at my HTML code on jsfiddle, please realize I setup some dummy HTML and removed your tags and added actual values which would be output by your tags.  The main thing I did was remove the whole div.more-selection and instead, added a "data-is-selected" attribute on your div.more-option element.  Then, in my javascript for each div.my-option element on the page, we loop through them, find the value of that data attribute and hide that div if it's less than 1 (or 0).
    Here's the fiddle for you to look at:  http://jsfiddle.net/thetrickster/Mfmdu/
    You'll see in the end result that only two divs show up, both of those divs have data-is-selected="1".
    You can try pasting the javascript code near the closing </body> tag on your page and make sure to wrap my js inside a <script> tag, obviously.  My way is neater on the markup side.  If you can't get it to work it's likely a jquery conflict issue.  My version is using the $(document).ready() method to make sure all the code is loaded before it runs.
    Best,
    Chris

  • I purchased a season of downtown abbey and it only downloaded the first 30 seconds of every episode.  How do,I co

    I Purchased a season of downton abbey from iTunes on my iPad and it only downloaded the first 30 seconds of every episode..how do I correct this?

    You are trying to watch them in the Videos app and not the previews in the iTunes store app ? If you are then depending upon what country that you are in (TV programmes can't be re-downloaded in all countries) then try deleting those episodes from the Videos app on your iPad and then redownload them via the Purchased tab in the iTunes store app.
    If you aren't in a country where you can re-download TV programmes or if they re-download in the same state then try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via the Store > View Account menu option and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that series and use the 'Report a Problem' link and fill in details about the problem (iTunes support should reply within, I think, about 24 hours).
    If the 'report a problem' link doesn't work (it's been taking some people to this site on a browser instead of showing a form in iTunes) then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page.

  • Programatically changing a portlets theme on first view only

    I have a need to highlight a portlet when it is displayed on a page for a user
    when the user first views the page. After this first page access i need to remove
    the hightlight so it the portlet is the same as the exisiting ones.
    I think i can do this by creating a highlight theme (like the Alert theme in the
    samples app) and applying in the admin tool when the portlet is added to the page.
    I can set the ThemeDefinitionId on the portlet instance using the PortletInstance
    object but will this only be effective during this session ? I need somehow to
    set the users personalization so that it knows the user has viewed the portlet
    and then change the theme back to the default one for all other accesses.
    Is it possible to do this or is there another solution that i can use. This will
    have to be done on all portlets on all pages so performance is a big consideration.
    TIA
    Martin

    Hello
    The layout is defined in gd_layout.
    I'm not sure if I understand.
    The program does show the subtotals already. But I want a collapsed view like this.
    http://www.filedump.net/dumped/200809021450331220359886.png

  • I purchased a song of iTunes last night. It says it has successfully downloaded but only plays the first second of a 2.43min song. How do I fix this or get a refund?

    I purchased a song of iTunes last night. It says it has successfully downloaded but only plays the first second of a 2.43min song. How do I fix this or get a refund?

    If the store in your country does allow it, try to download the song again, see this support article:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise report a problem with your purchase. Sign into the iTunes Store and view your purchase history  in your account section. Beside the recently bought song should be a link "Report a problem".
    Regards
    Léonie

  • How do I display text only in the first page inXML Publisher

    Hi everybody,
    I've been reading so much, on the last two days, on this issue at this forum but I didn't get an answer. My problem is: In an invoices report some text and fields from the invoice header, (such as payment terms, bank details etc.), should be printed only in the first page of the invoice, (If the invoice has more than one page). These elements are not in the document header/footer but in the document body. That's why I think the different fist page of MS Word will not work. I tried also <? start@first-page:body ?>, with no success. Any idea, someone?
    Thanks,
    Shimon

    Hi,
    Did you find solution to your problem? I am facing same issue and I want to know how you solved it? It would be great help.
    Thank you.
    Regards,
    Rahul

  • I bought a new album off of iTunes the wifi wasn't strong so I left my computer on as it was downloading and went to sleep. This morning I went to listen to the songs and some of the songs will only play the first 50 sec or the first minute? How do i fix?

    I bought a new album off of iTunes the wifi wasn't strong so I left my computer on as it was downloading and went to sleep. This morning I went to listen to the songs and some of the songs will only play the first 50 sec or the first minute? How do i fix it or refresh them so i can listen to them fully?
    How do I get the songs to fully play? Or can i refresh the songs and redownload them?

    See Repair security permissions for iTunes for Windows.
    tt2

  • How can I prevent a PDF file from being copied, printed or downloaded? Students should only be able to view the text and and not distribute it in any way.

    How can I prevent a PDF file from being copied, printed or downloaded? Students should only be able to view the text and and not distribute it in any way.

    You can prevent it from being printed by applying a security policy to it
    in Acrobat. The rest can't be prevented, unless you spend  a LOT of money
    on DRM protection.

  • How can I view the complete score with all tracks? I seem to only be able to view one track at a time. Thanks

    How can I view the complete score with all tracks? I seem to only be able to view one track at a time. Thanks

    JoBrooke wrote:
    I seem to only be able to view one track at a time.
    unfortunately, that is how GB works, it only offers a score for a single track at a time

  • TS1717 I just downloaded a song and it only plays the first 50 seconds and then moves to the next song in the list. How can I get it to play the rest of the song?

    I just downloaded a song and it only plays the first 50 seconds and then moves to the next song in the list. How can I get it to play the rest of the song?

    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copy of the track and try redownloading a fresh one. See the following document for instructions:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the item, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.

  • HOw to start the project for first view in webdynpro application

    Hi,I am having  a problem regarding scenario for customer feedback for portal end user i.e..wen user login to a application for feedback there it check the Id of the user wether it had given the feedback or not by comparing the Id with the database Idu2019s from SQLserver.If the feedback is thr of that Id then a view shud say u hav already given feedback otherwise feedback form shud open ,the user will giv feedback and closes by thanking with other view.My problem is how to openthe  view were it will compare the userlogin Id with the database Id to move further.How shud I handle this scenario for first view.I am creating this application in webdynpro.In this project how shud I manage the viewsu2026

    Hanif,
    you can create a webdynpro application and create an iview and set the height and width to 0 .inside that webdynpro application open a popup that provides the feedback form .and you invoke this popup window in the WDDOINIT() or WDDOMODIFYVIEW() of the webdynpro main view.
    apart from this you need to get the logged user id in main view and get the output from database whether you want to open the feedback form
    check this forum on developing webdynpro application
    Web Dynpro Java
    Thanks
    Bala Duvvuri

Maybe you are looking for

  • Null Pointer Exception

    Hi , We are using SO_DOCUMENT_SEND_API1 this BAPI to send mails in our application.Here we are passing values to the input parameters  SENDER_ADDRESS,SENDER_ADDRESS_TYPE,COMMIT_WORK . and we need to pass values to the tables also.one table name in th

  • Bounced messages are returned to all people in an email list

    I have a distribution list called "members", with about 40 people, that include contacts that are mostly external to our company.  External senders can send to this list. I sent out a message from an account that i have at gmail.  this was sent to th

  • Can anyone recommend how to get Microsoft word ??

    Hi There, I need help with downloading some type of word program, I am unsure as to what is the best microsoft word download and how to do it thanks

  • Can i transport PO Release strategy in a request

    Hi Gurus,                  I have done po release starategy in dev can i transport the release strategy in a request to quality client or should i do the same setting again in quality server. Regards, Dheepak

  • MS sql server  2005 and encryption

    I've got a Microsoft SQL Server 2005 database server set up with encryption forced on. I managed to get the MS 1.1 jdbc driver from Microsoft, I then tried to configure it into Coldfusion v 7.0.2 as an Other data source. The problem I've got now is t