Skip to Content
author's profile photo Former Member
Former Member

reuse webdynpro ALV conversion to pdf in sapgui alv

Hi Experts,

I would like to know : if and how it's possible to reuse the functionality for

converting webdynpro ALV to pdf (using ADS server) :

purpose : quick generation of e-mail attachment from internal table

Reusing wanted in : SapGui OO ALV (CL_GUI_ALV_GRID) or CL_SALV_TABLE or new ALV for Hana CL_SALV_GUI_TABLE_IDA


i know obviously the way to print ALV to spool and convert_abapspool_to_pdf but the look is not

well enough for mail attachment...

i already reuse the AlvWDA .xls function conversion, but don't find the way with pdf conversion out of webdynpro application.

.xls conversion code sample :

data l_my_result_data type ref to cl_salv_ex_result_data_table.
data l_flavour type string.
data l_version type string.


l_my_result_data = cl_salv_ex_util=>factory_result_data_table( r_data = my_data "(type ref to data)
t_fieldcatalog = tfieldcatalog ). "(type lvc_t_fcat)

case cl_salv_bs_a_xml_base=>get_version( ).
when if_salv_bs_xml=>version_25.
l_version = if_salv_bs_xml=>version_25.
when if_salv_bs_xml=>version_26.
l_version = if_salv_bs_xml=>version_26.
endcase.
l_flavour = if_salv_bs_c_tt=>c_tt_xml_flavour_export.

cl_salv_bs_tt_util=>if_salv_bs_tt_util~transform( exporting xml_type = if_salv_bs_xml=>c_type_excel_xml
xml_version = l_version
r_result_data = l_my_result_data
xml_flavour = l_flavour
gui_type = if_salv_bs_xml=>c_gui_type_gui
importing xml = me->xstring
mimetype = me->type ).

Kind regards,

Fred

Message was edited by: Frédéric Voirol no idea, no solution ?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 18, 2016 at 10:26 AM

    Hi Frédéric,

    Did you find any solution for your post? As i too have a similar requirement working on.

    Thanks,

    Prema

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Prema,

      I tried differents ways but not able to get the solution.

      For example, this below... but no succes...

      ************************************

      data l_my_result_data type ref to cl_salv_ex_result_data_table.

      data l_my_wd_c_table type ref to cl_salv_wd_c_table.
      data l_my_exp_pdf type ref to cl_salv_wd_export_pdf_acc.
      data l_my_result_data_wd type ref to cl_salv_wd_result_data_table.
      data l_my_comp_factory type ref to cl_salv_wd_comp_factory.
      data l_my_node type ref to if_wd_context_node.


      data l_flavour type string.
      data l_version type string.

      l_my_comp_factory ?= cl_salv_wd_comp_factory=>get_instance( ).
      l_my_wd_c_table ?= l_my_comp_factory->if_salv_wd_comp_factory~get_component_table( ).
      l_my_wd_c_table->if_salv_wd_comp_table_if~set_data( changing r_data_source = my_data->my_data_table->my_data ).

      xstring = cl_salv_wd_pdf_util=>generate_pdf_xml( l_my_wd_c_table->r_result_data ).

      **********


      In conclusion, I'll use the classical (not pretty) solution :



      data l_tdata_lvc type lvc_t_data.
      data l_tinfo_lvc type lvc_t_info.
      data l_thtml type w3htmltab.
      data l_xstring type xstring.
      data l_my_tbi type ref to zcl_tbi.
      field-symbols <l_tdata> type standard table.
      data l_my_alv type ref to cl_gui_alv_grid.
      data l_sprint type lvc_s_prnt .

      l_sprint-print = 'X'.
      l_sprint-prnt_title = '0'.

      call function 'REUSE_ALV_GRID_DISPLAY_LVC'
      exporting
      * i_callback_program = l_repid
      it_fieldcat_lvc = my_alv->tfieldcatalog
      i_save = 'A'
      i_default = 'X'
      * it_sort = t_sort[]
      is_layout_lvc = my_alv->is_layout
      is_print_lvc = l_sprint
      tables
      t_outtab = <l_tdata>
      exceptions
      program_error = 1
      others = 2.
      * commit work.
      zcl_utilities=>convert_abapspooljob_2_pdf( exporting i_spoolid = sy-spono importing e_xstring = l_xstring ).

      If you find something, you are welcome...


      Kind regards,

      Fred

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.