cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Print event in Custom Button

mani_sekar
Explorer
0 Kudos

Hi,

I have requirement to call ALV print event in Custom Button after some condition. Can anyone give me the solution or link to achieve this requirement.

Thank in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Mani,

On that ALV button event, write the following code.

  DATA lo_component TYPE REF TO if_wd_component.

  DATA lo_appl      TYPE REF TO if_wd_application.



  lo_component = wd_comp_controller->wd_get_api( ).

  lo_appl      = lo_component->get_application( ).

  lo_appl->print_page( ).



  DATA lo_app_info TYPE REF TO if_wd_rr_application .

  lo_app_info = lo_appl->get_application_info( ).



  DATA lv_app_name TYPE string .

  lv_app_name = lo_app_info->get_name( ).

It helps you to print the table contents. Hope this helps you.

Thanks

KH

mani_sekar
Explorer
0 Kudos

Hi Katrice,

Thanks,

This code is to print the Web page, But my requirement is to call the ALV print event in Custom button.

I have a dashboard which is to display Vendor and Customer details in two ALV tables and one Custom button to Save. By default ALV have Print button in the table toolbar, ALV print button will print only the corresponding table details.

On Click of Save button, Print button event should trigger for both ALV tables and it should print both ALV table details.

Thanks

Mani

Former Member
0 Kudos

Hi Mani.

Refer this thread . Hope it might help you.

Thanks

KH

Former Member
0 Kudos

Hi Mani,

Also refer this link which will help you ABAP code to Print abap web dynpro table

Thanks

KH

mani_sekar
Explorer
0 Kudos

Hi Katrice,

Above one is helpful but it didn't met my requirement