<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: EXPORT PIVOT CHART TO EXCEL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/export-pivot-chart-to-excel/m-p/3349719#M803444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get your data into an ALV GRID (OO --NOT THE OLD SLIS FUNCTION MODULE VERSION)&lt;/P&gt;&lt;P&gt;and a Toolbar with Transfer to EXCEL button on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Click on the EXCEL button you created and the Popup prompt will give you  options of a Pivot table amongst others.*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*The EXCEL spreadsheet will be displayed in the Foreground with the pivot table options you want*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; *From here just use the Chart Wizard (built into EXCEL) to get your chart.*&lt;/P&gt;&lt;P&gt;*You can of course save etc. On exit from excel you are returned to the GRID where you can EXIT  or perform further functions.*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*You probably could use excel macros to generate a graph / chart automatically -- the EXCEL prompt also allows you to run macros --you need to see the popup to understand what I'm trying to post here --but I haven't tried that option yet.* &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


method on_toolbar .
type-pools icon.
 clear ls_toolbar.
     move  0 to ls_toolbar-butn_type.
     move 'EXCEL' to ls_toolbar-function.
     move  space to ls_toolbar-disabled.
     move  icon_xxl to ls_toolbar-icon.
     move 'Excel' to ls_toolbar-quickinfo.
     move  'EXCEL' to ls_toolbar-text.  
     append ls_toolbar to e_object-&amp;gt;mt_toolbar.
    perform   toolbar  in program (caller) if found
     using e_object.

* ...
endmethod.



case e_ucomm.


      when 'EXIT'.
        leave program.
      when 'EXCEL'.
       call method me-&amp;gt;download_to_excel.
      when 'SAVE'.
      when 'PROC'.
        call method me-&amp;gt;process.
      when 'REFR'.
        call method me-&amp;gt;refresh.
        when 'SWITCH'.
        call method me-&amp;gt;switch.
       when 'TEST'.
        call method me-&amp;gt;get_cell.

       endcase.

* ...
endmethod.



method download_to_excel.
field-symbols:
       &amp;lt;fs0&amp;gt; type standard table,
       &amp;lt;fs1&amp;gt; type standard table.
    assign g_outtab1-&amp;gt;* to &amp;lt;fs0&amp;gt;.
    assign g_fldcat1-&amp;gt;* to &amp;lt;fs1&amp;gt;.
       call function  'LVC_TRANSFER_TO_KKBLO'
      exporting
        it_fieldcat_lvc   = &amp;lt;fs1&amp;gt;
*     is_layout_lvc     = m_cl_variant-&amp;gt;ms_layout
         is_tech_complete  = ' '
      importing
        es_layout_kkblo   = ls_layout
        et_fieldcat_kkblo = lt_fieldcat.

    loop at lt_fieldcat into lt_fieldcat_wa.
      clear lt_fieldcat_wa-tech_complete.
      if lt_fieldcat_wa-tabname is initial.
        lt_fieldcat_wa-tabname = '1'.
        modify lt_fieldcat from lt_fieldcat_wa.
      endif.
      l_tabname = lt_fieldcat_wa-tabname.
    endloop.
    call function 'ALV_XXL_CALL'
         exporting
              i_tabname           = l_tabname
              is_layout           = ls_layout
              it_fieldcat         = lt_fieldcat
              i_title             = sy-title
         tables
              it_outtab           = &amp;lt;fs0&amp;gt;
         exceptions
              fatal_error         = 1
              no_display_possible = 2
              others              = 3.
    if  sy-subrc &amp;lt;&amp;gt; 0.
      message id sy-msgid type 'S' number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.

* ...
endmethod.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might be able to use FM 'ALV_XXL_CALL' directly but you need to be aware that the field catalog is slightly different  which is why you need FM  'LVC_TRANSFER_TO_KKBLO'  to convert your ALV GRID field catalog to the one required by the XXL call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Feb 2008 12:52:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-01T12:52:42Z</dc:date>
    <item>
      <title>EXPORT PIVOT CHART TO EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/export-pivot-chart-to-excel/m-p/3349718#M803443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to export the internal table data to the excel graph or chart . &lt;/P&gt;&lt;P&gt;using OLE .( or any other method which u can suggest.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my internal table in having three col&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name &lt;/P&gt;&lt;P&gt;val1 &lt;/P&gt;&lt;P&gt;val2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name should be Y Axis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest me the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;right now am just displaying the graph using Business Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the requirment is the EXCEL OUTPUT with GRAPH or chart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2008 08:41:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/export-pivot-chart-to-excel/m-p/3349718#M803443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-01T08:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: EXPORT PIVOT CHART TO EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/export-pivot-chart-to-excel/m-p/3349719#M803444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get your data into an ALV GRID (OO --NOT THE OLD SLIS FUNCTION MODULE VERSION)&lt;/P&gt;&lt;P&gt;and a Toolbar with Transfer to EXCEL button on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Click on the EXCEL button you created and the Popup prompt will give you  options of a Pivot table amongst others.*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*The EXCEL spreadsheet will be displayed in the Foreground with the pivot table options you want*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; *From here just use the Chart Wizard (built into EXCEL) to get your chart.*&lt;/P&gt;&lt;P&gt;*You can of course save etc. On exit from excel you are returned to the GRID where you can EXIT  or perform further functions.*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*You probably could use excel macros to generate a graph / chart automatically -- the EXCEL prompt also allows you to run macros --you need to see the popup to understand what I'm trying to post here --but I haven't tried that option yet.* &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


method on_toolbar .
type-pools icon.
 clear ls_toolbar.
     move  0 to ls_toolbar-butn_type.
     move 'EXCEL' to ls_toolbar-function.
     move  space to ls_toolbar-disabled.
     move  icon_xxl to ls_toolbar-icon.
     move 'Excel' to ls_toolbar-quickinfo.
     move  'EXCEL' to ls_toolbar-text.  
     append ls_toolbar to e_object-&amp;gt;mt_toolbar.
    perform   toolbar  in program (caller) if found
     using e_object.

* ...
endmethod.



case e_ucomm.


      when 'EXIT'.
        leave program.
      when 'EXCEL'.
       call method me-&amp;gt;download_to_excel.
      when 'SAVE'.
      when 'PROC'.
        call method me-&amp;gt;process.
      when 'REFR'.
        call method me-&amp;gt;refresh.
        when 'SWITCH'.
        call method me-&amp;gt;switch.
       when 'TEST'.
        call method me-&amp;gt;get_cell.

       endcase.

* ...
endmethod.



method download_to_excel.
field-symbols:
       &amp;lt;fs0&amp;gt; type standard table,
       &amp;lt;fs1&amp;gt; type standard table.
    assign g_outtab1-&amp;gt;* to &amp;lt;fs0&amp;gt;.
    assign g_fldcat1-&amp;gt;* to &amp;lt;fs1&amp;gt;.
       call function  'LVC_TRANSFER_TO_KKBLO'
      exporting
        it_fieldcat_lvc   = &amp;lt;fs1&amp;gt;
*     is_layout_lvc     = m_cl_variant-&amp;gt;ms_layout
         is_tech_complete  = ' '
      importing
        es_layout_kkblo   = ls_layout
        et_fieldcat_kkblo = lt_fieldcat.

    loop at lt_fieldcat into lt_fieldcat_wa.
      clear lt_fieldcat_wa-tech_complete.
      if lt_fieldcat_wa-tabname is initial.
        lt_fieldcat_wa-tabname = '1'.
        modify lt_fieldcat from lt_fieldcat_wa.
      endif.
      l_tabname = lt_fieldcat_wa-tabname.
    endloop.
    call function 'ALV_XXL_CALL'
         exporting
              i_tabname           = l_tabname
              is_layout           = ls_layout
              it_fieldcat         = lt_fieldcat
              i_title             = sy-title
         tables
              it_outtab           = &amp;lt;fs0&amp;gt;
         exceptions
              fatal_error         = 1
              no_display_possible = 2
              others              = 3.
    if  sy-subrc &amp;lt;&amp;gt; 0.
      message id sy-msgid type 'S' number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.

* ...
endmethod.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might be able to use FM 'ALV_XXL_CALL' directly but you need to be aware that the field catalog is slightly different  which is why you need FM  'LVC_TRANSFER_TO_KKBLO'  to convert your ALV GRID field catalog to the one required by the XXL call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2008 12:52:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/export-pivot-chart-to-excel/m-p/3349719#M803444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-01T12:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: EXPORT PIVOT CHART TO EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/export-pivot-chart-to-excel/m-p/3349720#M803445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The method you suggest works. but what the requirement I am having is that I can't change the SLIS to LVC so can you please sugest me any other method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Prashant Bonde on Feb 1, 2008 3:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2008 14:08:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/export-pivot-chart-to-excel/m-p/3349720#M803445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-01T14:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: EXPORT PIVOT CHART TO EXCEL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/export-pivot-chart-to-excel/m-p/3349721#M803446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't use SLIS anymore so I can't be of any help here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might find somewhere to add custom functions and then bolt in the Method I've shown. You could change the method to a FM call with parameters but this is really "going backwards".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Feb 2008 15:09:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/export-pivot-chart-to-excel/m-p/3349721#M803446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-02T15:09:05Z</dc:date>
    </item>
  </channel>
</rss>

