Print Button in Web Dynpro ABAP

Hi Everybody,
i hope that someone know or have a code sample how i can set a print button to the Web Dynpro for ABAP. On click on this it should open the print window from the Internet Explorer.
Please let me know if there is any information about this.
Thanks
Best regards
Markus

Hi,
If you are using the Internet Explorer 7, you can use CTRL + P to invoke print directly on any WebDynpro ABAP view.  This is IE 7.0 browser featute & always has print preview & print options available from File Menu's. So you dont require any additional buttons on view :).
For table data if you use ALV you get options to export data to excel or fire print directly
Greetings
Prashant

Similar Messages

  • How to open print dialog from web dynpro abap application

    Hi experts,
            I have a web dynpro application with several views and onone of the view there is a button that should open print dialog with printers list and all other options (standard print dialog we see in windows). I did reserach on SDN and came to now that this is a limitation of web dynpro abap. I did find some code also but unfortunately our current version of ABAP(7.0) do not support the code I found. I am not able to find any proper solution for this. Could someone please let me know how I can open a print dialog by clicking on a button in web dynpro abap? Any sample code or any information would be greatky appreciated.
    Thanks.
    Mithun

    Hi Mithun,
    Have you check this?
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/f8/872806981d4411b5ce51a00207ed31/content.htm
    and also go through..
    How to print in a web dynpro application
    Print button
    Cheers,
    Kris.

  • Calling a smart form on click of a button in web dynpro abap

    Hi experts,
    I have a requirement like if I click a button in a view i need ti generate a PDF through smart form.
    Is this possible. If so please tell me the way..
    Thanks & Regards

    Hi Sharma,
    Create Interactive form in your view, create one node say PDF_SOURCE under this one attribute PDF_SOURCE of type XSTRING.
    Bind this to IF form Datasource and pdfsource.
    in your button action write code to call your smartform
    using SSF_FUNCTION_MODULE_NAME
    using FM  CONVERT_OTF and attach_file_to_response
    *convert to pdf
      call function 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
        IMPORTING
          bin_filesize          = lv_bytecount
        TABLES
          otf                   = ls_job_output_info-otfdata
          lines                 = lt_lines
        EXCEPTIONS
          err_conv_not_possible = 1
          err_bad_otf           = 2.
      loop at lt_lines into ls_line.
        lv_string = ls_line.
        export mydata = lv_string to data buffer lv_buffer.
        import mydata to l_xline from data buffer lv_buffer in char-to-hex
        mode.
        concatenate l_pdfstring l_xline into l_pdfstring in byte mode.
      endloop.
      call method cl_wd_runtime_services=>attach_file_to_response
        EXPORTING
          i_filename      = 'ZWTY_PACKINGSLIP'
          i_content       = l_pdfstring
          i_mime_type     = 'BIN'
          i_in_new_window = abap_false
          i_inplace       = abap_false.
    also check this..
    http://abapcodexperiments.wordpress.com/2011/03/20/smartform-pdf-webdynpro-abap/
    Call smartform in web dynpro abap
    Cheers,
    Kris.

  • Calling URL when click on buttons using web dynpro - ABAP

    Hi All,
    I am new to web dynpro application development and i am facing issue when i try to test my application.
    simple require when i click on button i should direct the to one of url say 'http://www.google.co.in/' my application is activate with no error but when i test the application i am getting below error , can someone please provide me the solution or way out.
    The URL http://ides47:8062/sap/bc/webdynpro/sap/zwa_calling_url/ was not called due to an error.
    Note
    The following error text was processed in the system N6Q : Access via 'NULL' object reference not possible.
    The error occurred on the application server IDES47_N6Q_62 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WDR_CONTEXT_MENU_HANDLER~CONTEXT_MENU_CALLED of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
    Method: IF_WDR_CONTEXT_MENU_HANDLER~CONTEXT_MENU_CALLED of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
    Method: IF_WDR_ADAPTER_EVENT_HANDLER~HANDLE_EVENT of program CL_WDR_CONTEXT_MENU_HANDLER===CP
    Method: IF_WDR_CLIENT~GET_CLIENT_UPDATES of program CL_WDR_CLIENT_SSR=============CP
    Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP
    Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
    Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
    Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
    Module: %_HTTP_START of program SAPMHTTP
    HTTP 500 - Internal Server Error
    Thanks,
    Parab

    Hi ,
    It seesms something you are missing. It would be easy for us if you could paste your code which you have written in the Action of Button.
    Sample code for your reference :
    METHOD onactionget_url .
    data lo_window_manager type ref to if_wd_window_manager.
    data lo_api_component  type ref to if_wd_component.
    data lo_window         type ref to if_wd_window.
    lo_api_component  = wd_comp_controller->wd_get_api( ).
    lo_window_manager = lo_api_component->get_window_manager( ).
    CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
      EXPORTING
        URL            = 'http://www.google.co.in/'
        MODAL          = ABAP_FALSE
        HAS_MENUBAR    = ABAP_TRUE
        IS_RESIZABLE   = ABAP_TRUE
        HAS_SCROLLBARS = ABAP_TRUE
        HAS_STATUSBAR  = ABAP_TRUE
        HAS_TOOLBAR    = ABAP_TRUE
        HAS_LOCATION   = ABAP_TRUE
      RECEIVING
        WINDOW         = lo_window.lo_window->open( ).
    ENDMETHOD.

  • Print Functionality for Web Dynpro ABAP Application

    Hi All,
    I am using the standard print button provided by FPM in my application.
    The application has a date navigator control as well as a dynamic ALV with fixed and on fixed columns.
    I would like to know if the application has to do any implementation to provide print functionality. If yes, how do we do it?
    Will it consider all the ALV columns as the ALV could have horizontal scroll bar.
    How do we test it?
    Defining output device in our user as LOCL is enough to test it? Are there any limitations?
    Findings until now:
    I just happened to see that gc_event_print FPM event is raised and the application uses interactive PDF form to implement printing.
    I am not sure if this satisfies my requirement.
    Could you help me in providing more information regarding this? You could also provide me some web dynpro examples for reference.
    Regards,
    Rekha

    >I just happened to see that gc_event_print FPM event is raised and the application uses interactive PDF form to implement printing.
    I am not sure if this satisfies my requirement.
    As you are already suspecting, the FPM doesn't provide the print functionality itself.  It only raises the event and the specific application is then responsible for how it wants to produce the output.  Therefore it is your job to design the output (generally using PDF forum).

  • Problem in calling abap editor with the program name in Web Dynpro ABAP

    Hi,
    I have to caal ABAP Editor screen with the display of program after clicking a button from web dynpro abap application.
    I am able to call the ABAP Editor initial screen, but i want the editor display screen with a program.
    How to do that?
    Please find my code below:
      DATA : FINAL_URL TYPE STRING,
             URL TYPE STRING.
      DATA: LV_HOST TYPE STRING,
            LV_PORT TYPE STRING.
    DATA V_TCODE TYPE TCODE.
      DATA:  LO_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.
      DATA:  LO_API_COMPONENT  TYPE REF TO IF_WD_COMPONENT.
      DATA:  LO_WINDOW         TYPE REF TO IF_WD_WINDOW.
      DATA:  LD_URL TYPE STRING.
    V_TCODE = 'SE38'.
    *Call below method to get host and port
      CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
         IMPORTING
           HOST = LV_HOST
           PORT = LV_PORT ).
      CONCATENATE 'http'
      '://' LV_HOST ':' LV_PORT '/sap/bc/gui/sap/its/webgui/?sap-client=&transaction=' V_TCODE '&OKCODE=SHOW'
      INTO URL.
      LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LD_URL = URL.
      CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL    = LD_URL
        RECEIVING
          WINDOW = LO_WINDOW.
      LO_WINDOW->OPEN( ).
    Now, how to pass my Zprogram name into the URL.
    I need to get the editor screen with the display of the program.
    Thanks,
    Radhika

    Hi Kiran,
    Please find my code below:
    DATA :   URL TYPE STRING.
      DATA: LV_HOST TYPE STRING,
            LV_PORT TYPE STRING.
      DATA:  LO_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.
      DATA:  LO_API_COMPONENT  TYPE REF TO IF_WD_COMPONENT.
      DATA:  LO_WINDOW         TYPE REF TO IF_WD_WINDOW.
      DATA:  LD_URL TYPE STRING.
    *Call below method to get host and port
      CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
         IMPORTING
           HOST = LV_HOST
           PORT = LV_PORT ).
      CONCATENATE 'http'
    '://' LV_HOST ':' LV_PORT '/sap/bc/gui/sap/its/webgui/?&transaction=se38&RS38M-PROGRAMM=Y2PSOLTREE&~okcode=shop'
      INTO URL.
      LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LD_URL = URL.
      CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL    = LD_URL
        RECEIVING
          WINDOW = LO_WINDOW.
      LO_WINDOW->OPEN( ).
    Here,, Y2PSOLTREE is the program, that should show in SE38 screen.
    I used the above code, but still it is showing the SE38 initial screen.
    Thanks,
    Radhika

  • Pixel tracking in web dynpro abap

    Hi,
    I have a scenario where in we are tracking job applicant source. Lets say a job seeker goes to careerbuilder.com and searches for job. At that point, careerbuilder.com sets a cookie in the job seek's computer. when Job seeker clicks to appy for job that takes him to our company sap e-recruiting job application page. when job seeker finally clicks send application button from web dynpro abap,  we are rendering external https url as image using rfc destination from web dynpro abap. The external https url which basically reads the cookie ithat is set by careerbuilder.com site in the client computer. 
    External url as rfc destination is not reading the cookie even though I have enabled cookie read option and used http1.1 in rfc destination.
    does anyone have any idea how sap wda handles client cookie? how can we make a external url which renders as image can be set to no caching? any help is highly appreciated.
    thanks
    Vijay

    Hi,
    Please refer these links for cookies -
    Re: Get a cookie from web dynpro application
    Regards,
    Lekha.

  • Reg: Workflow in Web Dynpro ABAP

    Dear Experts,
    Im new to Workflow. I need some guidance in sending a smartform for approval to next level approver's workflow inbox, im using web dynpro abap when i click on approve button in web dynpro abap the smartform should move to next level approver inbox.
    Regards
    Arun.P

    Hi Arun,
    Here rather than using smart form, make use of INteractive adobe form.
    This will disaply the required fileds of your amartform as well as buttons to approve o reject.
    Do a little search on SDN and you will get plenty of examples to use adobe forms in web dynpro.
    Once you have designed the adobe form, you can make use of SAP_WAPI* function modules to transfer data to workflow.
    Hope this helps.
    Regards,
    Sangvir Singh

  • Dynamic radio button in web dynpro abao

    Hi expert,
    I want to dynamic radio button by  web dynpro abap .
    Kindly give me a soulation ASAP.
    Thanks and regard's
    Vikash

    hi,
    method wddomodifyview .
    if first_time eq abap_true.
    data: LR_CONTAINER         type ref to CL_WD_UIELEMENT_CONTAINER,
          LR_RADIOBUTTON1            type ref to CL_WD_RADIOBUTTON,
          LR_RADIOBUTTON2            type ref to CL_WD_RADIOBUTTON,     
          LR_FLOW_DATA         type ref to CL_WD_FLOW_DATA.
    " bind text property will give TEXT that appears next to Radio Button
    CALL METHOD cl_wd_radiobutton=>new_radiobutton
      EXPORTING
       bind_selected_key   =  '01' 
       BIND_TEXT           =  'saurav'
      receiving
        control             = LR_RADIOBUTTON1.
    " bind text property will give TEXT that appears next to Radio Button
    CALL METHOD cl_wd_radiobutton=>new_radiobutton
      EXPORTING
        bind_selected_key   = '02'
       BIND_TEXT           = 'mago'
      receiving
        control             = LR_RADIOBUTTON2.
    LR_FLOW_DATA        =  CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_RADIOBUTTON1  ).
    LR_FLOW_DATA        =  CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_RADIOBUTTON2  ).
    LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).
    LR_CONTAINER->ADD_CHILD( LR_RADIOBUTTON1  ).
    LR_CONTAINER->ADD_CHILD( LR_RADIOBUTTON2  ).
    endif.
    endmethod.
    Thanx.

  • Closing web browser from a Web Dynpro (ABAP) component in it

    Hi,
    I am opening a Web Dynpro component in IE.
    I have a requirement to close the Internet Explorer window on click of a "Close" Button in Web Dynpro (ABAP) component. I am using EXIT Outbound plug of the Main Window to perform the same.
    In the EXIT plug I am setting "CLOSE_WINDOW" parameter to ABAP_TRUE.
    On click of the "Close" button a pop-up dialog box (with "Yes" and "No" buttons) appears asking me whether I really want to close the IE window.
    If I click on "Yes" button of the dialog box, the IE window gets closed without any issues.
    But when I click on "No" button, the IE window shows up a blank screen. I want the control to come back to the calling Web Dynpro component's screen.
    Appreciate any help/guidance in the above issue.
    Thanks,
    Prasanna

    create an action 'YES','NO', 'CANCEL' in required view.
    copy and paste below code in YES action
    method ONACTIONYES .
      data : l_view_cntr type ref to if_wd_view_controller,
    l_win_cntr type ref to if_wd_window_controller,
    l_window type ref to if_wd_window,
    l_parameter_list type wdr_event_parameter_list,
    l_parameter type wdr_event_parameter,
    l_val type ref to data.
    field-symbols <fs> type any.
    l_view_cntr = wd_this->wd_get_api( ).
    l_win_cntr = l_view_cntr->get_embedding_window_ctlr( ).
    l_parameter-name = 'CLOSE_WINDOW'."'CLOSE_WINDOW'.
    create data l_val type c.
    assign l_val->* to <fs>.
    <fs> = 'X'.
    l_parameter-value = l_val.
    insert l_parameter into table l_parameter_list.
    l_win_cntr->if_wd_view_controller~fire_plug(
    exporting plug_name = 'EXIT_PLUG'
    parameters = l_parameter_list ).
    endmethod.
    goto your window
    create plug EXIT in Window of type EXIT and chect interface checkbox
    create a button - for example - "PUSH BUTTON"
    in pushbutton action
    copy and paste this code
    method ONACTIONEXIT_PLG .
    DATA: API TYPE REF TO IF_WD_COMPONENT,
          WINMAN TYPE REF TO IF_WD_WINDOW_MANAGER,
          WIN TYPE REF TO IF_WD_WINDOW,
          TEXT1 TYPE STRING_TABLE,
          ls_text type string,
          V_API TYPE REF TO IF_WD_VIEW_CONTROLLER.
    API = WD_COMP_CONTROLLER->WD_GET_API( ).
    WINMAN = API->GET_WINDOW_MANAGER( ).
    LS_TEXT = 'Do You Want To Close the Window'.
    INSERT LS_tEXT into table text1.
    win = winman->create_popup_to_confirm(
                                           window_title = 'CONFIRM'
                                           text = text1
                                           button_kind = if_wd_window=>co_buttons_yesnocancel
                                           message_type = if_wd_window=>co_msg_type_question
                                           window_position = if_wd_window=>co_center ).
    V_API = WD_THIS->WD_GET_API( ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_YES
            ACTION_NAME = 'YES'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_TRUE ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_NO
            ACTION_NAME = 'NO'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_FALSE ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_CANCEL
            ACTION_NAME = 'CANCEL'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_FALSE ).
    WIN->OPEN( ).
    endmethod.

  • Issue While printing / Previewing a Adobe form in Web Dynpro ABAP application

    Dear All,
    We have designed 4 different adobe forms using SFP transaction for 4 different countries in SAP system.
    Every country have different terms and conditions and therefore we have placed static texts (Hardcoded text) with text in different styles. Some text is in bold, some in different font (Bold, Italic). Font and Paragraph settings of the text was done as per expected. All the forms have same font and paragraph settings.
    When we Launch Web Dynpro ABAP application to open the form in Print preview or to take print, form is not getting displayed / printed as it is designed in SFP. But if you open the form in SFP, everything looks fine.
    It is working fine for 3 different forms but problem with only 1 form.
    Kindly guide what is the reason for this strange issue when previewed or taken print. It is very urgent.
    Thanks,
    Bharath.K

    Dear All,
    Thanks for your responses.
    We had identified the reason.
    Customer has provided terms and conditions for all 4 countries in PDF document. Along with PDF, for 3 out of 4 countries customer has shared pre-prepared word document with pre aligned and justified terms and conditions as per expected outcome. We copied this text from word to Adobe form layout. It worked fine. For 1 country, customer have not shared terms and conditions in word document. Therefore we had copied text directly from adobe PDF document in to Form layout. Then this issue happened.
    Solution for this issue is to, prepared a word document with expected alignment and justification of terms and conditions text . Then copied from word to adobe livecycle designer form layout. It worked fine.
    Thanks,
    Bharath.

  • Submit button  from Interactive adobe form in Web Dynpro ABAP

    Hi all,
    We seem to be having a problem with the 'submit' button on the Interactive Form for the Web Dynpro ABAP.  The submit button is from the Web Dynpro active X or web Dynpro Native in the form designer. The submit button doesn't trigger the action in Web Dynpro. we are currently running on support pack 9 for the ABAP stack. We have Internet Explorer browser version 6.  Could someone tell me if there are requirements for the IE version that will work in conjunction with a particular ABAP stack version.  And, are there specific IE security settings or administrative privilages required with this version of the ABAP stack.  Or, any other ideas as to why this does not seem to work. 
    Thanks in advance,
    Michelle Hong

    Hi Michelle,
    Could you tell me how you resolved the problem - as I'm facing exactly the same issue!
    Many Thanks
    Christine

  • Web Dynpro ABAP ALV menu button icon image

    Hi
    Does anybody know how to add or link an image or an icon to a menu button in a
    Web Dynpro ABAP ALV view?
    I know how to do it in the alv table column but can't find a method for a menu button.
    Best regards
    Lars

    Hi
    Found the answer:
      DATA: lr_febutton TYPE REF TO cl_salv_wd_fe_button.
      lr_febutton->set_image_source( '@4B@' ).
    Just used a wrong class.
    Best regards
    Lars

  • How to add button ui element in alv table data in web Dynpro ABAP

    Hi Experts,
    I have one requirement,
    Actually I was devloped normal table in web Dynpro ABAP
    in that i have one column Display as a button .
    when i select that button need to display some data.
    same requirement i need to devlope in alv table.
    i am going to attach file please check.
    Thanks in advance.
    Regards,
    Subba Reddy.

    Hi,
    You can create Button in your ALV table column with below code
    DATA lo_button              TYPE REF TO cl_salv_wd_uie_button.
    CREATE OBJECT lo_button.
        CALL METHOD lv_value->if_salv_wd_column_settings~get_column
          EXPORTING
            id    = <your column name>
          RECEIVING
            value = lo_system_select_hdr.
        lo_button->set_enabled( value = abap_true ).
       lo_button->set_text( value = 'Avaliable List'  ).
        lo_button->set_tooltip( value = 'Avaliable List' ).
        lo_system_select_hdr->set_cell_editor( value = lo_button ).
    And for button click action,
    Create a method (say SHOW_DATA( ) ) with on_click event handler.And when you click button on your ALV table, SHOW_DATA( ) method will trigger.
    Thanks
    KH

  • How to add screen elements at run time on button click in Web Dynpro abap?

    Hello All,
    I have a requirement wherein the user wants to add the textbox dynamically at runtime on button click action. My questions is, Is it feasible to dynamically add screen elements at runtime? If yes, how?
    Please help.
    Thanks

    Hi Ajinkya,
    This is absolutely possible! Adding view elements at runtime is called "dynamic programming". There are a lot of good resources and tutorials on SCN if you do a search. To start you off, here is an excellent series by Thomas Szücs:
    Dynamic Programming in Web Dynpro ABAP - Introduction and Part I: Understanding UI Elements
    Dynamic Programming in Web Dynpro ABAP - Part II: Handling ViewElements
    Dynamic Programming in Web Dynpro ABAP - Part III: Aggregations and DDIC-Binding of ViewElements
    Another option that avoids dynamic programming is to create the view element at design time but bind its visible property to a context attribute of type WDUI_VISIBILITY. You could initially set its visibility to "none" until the user clicks the button, then you could change its visibility to "visible".
    Cheers,
    Amy

Maybe you are looking for

  • Feedback for my site, please

    Dear Friends, Can you please give me some feedback about my site http://www.anonser.pl Let me know what you think about the design and give me some tips about making the site better for Google. Thanks Already. Kind Regards,

  • My laptop (GX70-3BE) keeping having blue screen recently PLEASE HELP~

    Recently my laptop keep having blue screen about "memory management" problem .However i got use Windows Memory Diagnostic to fix it but it give me notification about .After i fix this problem well not so long again..it will blue screen again.i guess

  • Serializing large objects

    Dear All, I am trying to serialize a HashMap containing Strings as keys and and ArrayLists as values. This works fine when the number of entries is small, but does not work when the number of entries are really large, in which case an java.lang.OutOf

  • BADI for Service Order Validations on Timesheets .

    Hi Experts, I am working on the Timesheets - Record working times (CAT2 transaction). The Client requirement is that certain validation should be put on the Service Orders / Rec. Orders before an employee can book his timesheet against that particula

  • Storage suddenly disappeared?

    I have an iPhone 6 (64GB), running iOS 8.1.13 (I updated just now in an attempt to resolve this issue). On Friday I had around 30GB of storage - my phone is now saying it has 5.1 - 3.8 GB, it is has dropped and gone back up and dropped again. This is