Application Development and Automation 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: 
Read only

ALV export issue in MHTML format

amrendra_tiwari
Explorer
0 Likes
615

Hi Experts,

I have an ALV report with multiple currency columns and one currency keys.We are getting total of each currency column using Fieldcat-do_sum = 'X'. Everything is fine with report.Issue comes with when we export using List->Export->Spreadsheet->Excel(in MHTMT format) to export from ALV.

ALV Output:

In my report there are 24 currency fields and one currency key field.

MHTML export Output replicates grand total rows like 24 * (Number of different currencies)

in above case MHTML output will have 24 * 4 = 96 grand total rows.

Field Catalog in program is as below

   PERFORM FIELD_CAT USING 'I_DATA' '' 'L' '' '05' 'WAERS' 'Currency' ''.
   PERFORM FIELD_CAT USING 'I_DATA' '' 'L' '' '04' 'WERKS' 'Plant' ''.
   PERFORM GET_MONTH.
   IF W_MONTH = 1. " and so for 12 months
    PERFORM FIELD_CAT USING 'I_DATA' '' 'R' 'WAERS' '18' 'JAN_C' 'Jan(Contract)' 'X'.

   FORM FIELD_CAT  USING    P_TABNAME
                         P_KEY
                         P_JUST
                         P_CFLD
                         P_OLEN
                         VALUE(P_3798)
                         VALUE(P_3799)
                         P_SUM.
  ADD 1 TO COL_POS.
  FIELDCAT_IN-TABNAME   = P_TABNAME.
  FIELDCAT_IN-FIELDNAME = P_3798.
  FIELDCAT_IN-SELTEXT_L = P_3799.
  FIELDCAT_IN-COL_POS   = COL_POS.
  FIELDCAT_IN-NO_ZERO   = 'X'.
  FIELDCAT_IN-OUTPUTLEN = P_OLEN.
  FIELDCAT_IN-KEY       = P_KEY.
  FIELDCAT_IN-JUST      = P_JUST.
  FIELDCAT_IN-CTABNAME  = P_TABNAME.
  FIELDCAT_IN-CFIELDNAME = P_CFLD.
  FIELDCAT_IN-DO_SUM     = P_SUM.
  FIELDCAT_IN-CURRENCY = 'WAERS'.         

APPEND FIELDCAT_IN TO FIELDCAT.

ENDFORM.

Could you please let me know how can we solve this problem?Client is sticking with this issue.

Thanks in advance!

Hi Experts,

I have an ALV report with multiple currency columns and one currency keys.We are getting total of each currency column using Fieldcat-do_sum = 'X'. Everything is fine with report.Issue comes with when we export using List->Export->Spreadsheet->Excel(in MHTMT format) to export from ALV.

ALV Output:

In my report there are 24 currency fields and one currency key field.

MHTML export Output replicates grand total rows like 24 * (Number of different currencies)

in above case MHTML output will have 24 * 4 = 96 grand total rows.

Field Catalog in program is as below

   PERFORM FIELD_CAT USING 'I_DATA' '' 'L' '' '05' 'WAERS' 'Currency' ''.
   PERFORM FIELD_CAT USING 'I_DATA' '' 'L' '' '04' 'WERKS' 'Plant' ''.
   PERFORM GET_MONTH.
   IF W_MONTH = 1. " and so for 12 months
    PERFORM FIELD_CAT USING 'I_DATA' '' 'R' 'WAERS' '18' 'JAN_C' 'Jan(Contract)' 'X'.

   FORM FIELD_CAT  USING    P_TABNAME
                         P_KEY
                         P_JUST
                         P_CFLD
                         P_OLEN
                         VALUE(P_3798)
                         VALUE(P_3799)
                         P_SUM.
  ADD 1 TO COL_POS.
  FIELDCAT_IN-TABNAME   = P_TABNAME.
  FIELDCAT_IN-FIELDNAME = P_3798.
  FIELDCAT_IN-SELTEXT_L = P_3799.
  FIELDCAT_IN-COL_POS   = COL_POS.
  FIELDCAT_IN-NO_ZERO   = 'X'.
  FIELDCAT_IN-OUTPUTLEN = P_OLEN.
  FIELDCAT_IN-KEY       = P_KEY.
  FIELDCAT_IN-JUST      = P_JUST.
  FIELDCAT_IN-CTABNAME  = P_TABNAME.
  FIELDCAT_IN-CFIELDNAME = P_CFLD.
  FIELDCAT_IN-DO_SUM     = P_SUM.
  FIELDCAT_IN-CURRENCY = 'WAERS'.         

APPEND FIELDCAT_IN TO FIELDCAT.

ENDFORM.

Could you please let me know how can we solve this problem?Client is sticking with this issue.

Thanks in advance!

1 REPLY 1
Read only

Former Member
0 Likes
548

Same issue here also .