Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Downloaded ALV in excel format has different subtotals value

danielgonzalez
Explorer

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,

6 REPLIES 6

raymond_giuseppi
Active Contributor
0 Kudos

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?

danielgonzalez
Explorer
0 Kudos

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,

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).

Sandra_Rossi
Active Contributor
0 Kudos

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.

danielgonzalez
Explorer
0 Kudos

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,

benlim
Contributor
0 Kudos

Hi,

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

Regards,

Ben