• ABAP Online Training @ $50

    Now you can learn ABAP by watching and listening video classes by experienced consultant.

  • ABAP Tutorials N Materials

    Read, Surf and Download useful ABAP tips, tutorials, code and download many eBooks and documents free

  • Latest ABAP Job in India

    Get all latest opening for SAP ABAP and related jobs, vaccancies across India and apply for the same.

    Friday, October 26, 2012

    Example of a Print

    Taking print of any document or a list of data is a very common factor in business. We can achieve this functionality in Report easily. In case of Webdynpro ABAP, SAP provided a very easy solution to achieve such requirement. You can see the picture taken from SAP source and also the solution below.

    First create a complete Webdynpro Application. Now create a button on the screen where you want to apply the print functionality. 

    And for that button an onaction_print method. Write the code below to that method :

    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( ).

    Also write the below piece of code in WDDOINIT method

    DATA: lo_api_controller TYPE REF TO if_wd_view_controller,
      lo_action         TYPE REF TO if_wd_action.
      lo_api_controller = wd_this->wd_get_api( ).
      lo_action = lo_api_controller->get_action( name = 'ON_PRINT' ).
      IF lo_action IS BOUND.
        lo_action->set( keep_messages = abap_true ).
      ENDIF.

    Yu can find out the original tutorial in SAP website.
    Easy2learnabap.co.in @ 2012 All product names on this web site are trademarks of the companies that own them .

    Easy2learnabap.co.in is not affiliated with SAP AG in any way. SAP AG is the registered trademark holder of SAP, SAP R/3, mySAP, ABAP, xApps, NetWeaver, and other proprietary terms.

    The technical information on this site is verified to the greatest extent possible, however, any information found on this site is used at the site visitor's own risk. All the tutorials are collected from various sources, if anyone is having problem with the content, report this to us. We will take action accordingly.

    Easy2learnabap.co.in reserves the right to correct any errors or omissions in any portion of this site at any time without obligation.

    This website is created to teach people about ABAP technology. The Video contents provided in Premium service are completely owned by us and copyrighted.