Skip to Content

Downloaded ALV in excel format has different subtotals value

Hi all,

I have an ALV in which I resort to use a subroutine to calculate a subtotal value because the standard way adding up all the values doesn't fit my requirements.

The ALV grid shows the correct value but when it's exported in any format the subtotal is wrong. It seems as if my subroutine is not executed when downloading.

Any ideas why it's working like that.

Regards,

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Posted on Mar 23, 2017 at 12:29 PM

    Most likely the tool used to transfer data to Excel doesn't export the subtotal, but the original itab data, which option did you use?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 23, 2017 at 01:38 PM

    Hi !

    I have several subtotal items and it's only wrong the one I modify with the subroutine so it seems to be a issue with that specific subtotal.

    The catalog for that specific field is:

    <NAME>KBETR20160530</NAME>
    <TYPE_NAME>BETRH_KK</TYPE_NAME>
    <REFERENCE_FIELD>WAERS</REFERENCE_FIELD>
    <REFERENCE_FIELD_TYPE>01</REFERENCE_FIELD_TYPE>
    <TABNAME>BETRH_KK</TABNAME>
    <LANGU>S</LANGU>
    <POSITION>0001</POSITION>
    <OFFSET>000000</OFFSET>
    <DOMNAME>WRTV7</DOMNAME>
    <ROLLNAME>BETRH_KK</ROLLNAME>
    <LENG>000013</LENG>
    <INTLEN>000007</INTLEN>
    <OUTPUTLEN>000018</OUTPUTLEN>
    <DECIMALS>000002</DECIMALS>
    <DATATYPE>CURR</DATATYPE>
    <INTTYPE>P</INTTYPE>
    <PRECFIELD>BETRH_KK</PRECFIELD>
    <LOGFLAG>X</LOGFLAG>
    <MASKLEN>0000</MASKLEN>
    <HEADLEN>18</HEADLEN>
    <SCRLEN1>10</SCRLEN1>
    <SCRLEN2>15</SCRLEN2>
    <SCRLEN3>20</SCRLEN3>
    <FIELDTEXT>Importe</FIELDTEXT>
    <REPTEXT>Impte</REPTEXT>
    <SCRTEXT_S>Importe</SCRTEXT_S>
    <SCRTEXT_M>Importe</SCRTEXT_M>
    <SCRTEXT_L>Importe</SCRTEXT_L>
    <SIGN>X</SIGN>
    <DYNPFLD>X</DYNPFLD>
    <IS_KEYF>X</IS_KEYF>
    <REFERENCE_FIELD>WAERS</REFERENCE_FIELD>
    <REFERENCE_FIELD_TYPE>01</REFERENCE_FIELD_TYPE>
    <PRESENTATION_MODE>01</PRESENTATION_MODE>
    <VALUE_SET_SOURCE>00</VALUE_SET_SOURCE>
    <VALUE_SET_FIELD_TYPE>00</VALUE_SET_FIELD_TYPE>

    And the subtotal is declared as:

    ls_sort-fieldname = 'KBETR20160530'.
    ls_sort-up = 'X'.
    CLEAR ls_sort-down.
    ls_sort-group = 'UL'.
    ls_sort-subtot = 'X'.

    APPEND ls_sort TO pe_sort

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 25, 2017 at 08:06 AM

    You "recalculate the subtotal via a custom subroutine". What did you do exactly (use of "SUBTOTAL_TEXT" event? provide code excerpts), and which kind of ALV technology did you use? (dynpro, webdynpro, reuse_alv_?, salv, cl_gui_alv_grid...)

    Possibly a limitation. Did you check SAP notes, there are many informative notes about ALV export limitations. If there's nothing about your issue, raise a ticket at SAP support.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 29, 2017 at 10:17 AM

    Hi Sandra,

    I am using REUSE_ALV_GRID_DISPLAY_LVC and the "SUBTOTAL_TEXT" event to change the subtotal value. What I also see, it's working fine changing the subtotal text when showing the ALV, but not when exporting. It seems it's refreshing when exporting and not executing any event code added to the ALV.

    Could it be just a REUSE_ALV_GRID_DISPLAY_LVC limitation and I should just use another ALV technology.

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 22 at 04:30 PM

    Hi,

    I'm facing similar issue. Any solution to this?

    Regards,

    Ben

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.