cancel
Showing results for 
Search instead for 
Did you mean: 

Print Button in webdynpro abap?

suman_kumar16
Participant
0 Kudos

Hi Gurus,

             I have created a custom button on my webdynpro screen . When I click that button I want to take print out of the particular screen and at the same time I need to hide the buttons (buttons are displaying on print screen option). Can anybody please help me out .

Thanks & Regards

Suman Kumar

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Suman,

To print WDA application, please refer the below document

Printing Web Dynpro ABAP Applications - Web Dynpro for ABAP - SAP Library

I don't think there is a standard method to hide the button from being included in snap shot of print.

Work around solution1:

  • Create a button BTN_PRINT and on click of button write the below code before call print_page( )

          i.e. hide the button,
         


  DATA lo_view TYPE REF TO if_wd_view.
  DATA lo_btn TYPE REF TO cl_wd_button.

  lo_view ?= wd_this->wd_get_api( ).

  lo_btn ?= lo_view->get_element( 'BTN_PRINT' ).

  lo_btn->set_visible( value = cl_wd_button=>e_visible-none ).

          " Print page

data:

l_api_componentcontroller type ref to if_wd_component,

l_appl type ref to if_wd_application.

  l_api_componentcontroller = wd_comp_controller->wd_get_api( ).

l_appl = l_api_componentcontroller->get_application( ).

l_appl->print_page( ).

Note: this hide the button PRINT and on subsequent action, you can make it visible again

    

Work around solution2 :

you can just create a button with access key ( CTRL + P ), without button text... So that it will not be visible in printing. Users can print by using short cut keys CTRL+P

Hope this helps you.

Regards,

Rama

Message was edited by: Ramakrishnappa Gangappa

Former Member
0 Kudos

Hi

I fill up this code about TimerTrigger action. When triger finish then display BTN_PRINT again.

Best regards

Answers (0)