2017 Mar 23 12:10 PM
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,
2017 Mar 23 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?
2017 Mar 23 1: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,
2017 Mar 24 7:52 PM
FYI - people answering questions are not notified when you post another answer. If you want Raymond to be notified of your response then post it as a comment to his answer. New SCN does not work like the old SCN, unfortunately (at least not yet).
2017 Mar 25 8: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.
2017 Mar 29 11: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,
2020 May 22 5:30 PM
Hi,
I'm facing similar issue. Any solution to this?
Regards,
Ben