Smartforms in wda...

Hi Techies,
I have created a smartform and converted to pdf format in driver program .. My actual requirement is m displaying a popup window having select-options(vbeln used in driver program) and after entering the values in it i need the pdf format of the smartform to be displayed after i click the button...
can u please guide me how to display select-options in wb dynpro.. i have used labels n input fields and binded these values to the low and high values of a structure..is dis is the way or should v use the other way?? 
Thanks in advance..
Moderator message: wrong forum, please have a look in "Web Dynpro ABAP" forum.
Edited by: Thomas Zloch on Nov 11, 2010 10:45 AM

Hi Techies,
I have created a smartform and converted to pdf format in driver program .. My actual requirement is m displaying a popup window having select-options(vbeln used in driver program) and after entering the values in it i need the pdf format of the smartform to be displayed after i click the button...
can u please guide me how to display select-options in wb dynpro.. i have used labels n input fields and binded these values to the low and high values of a structure..is dis is the way or should v use the other way?? 
Thanks in advance..
Moderator message: wrong forum, please have a look in "Web Dynpro ABAP" forum.
Edited by: Thomas Zloch on Nov 11, 2010 10:45 AM

Similar Messages

  • Displaying Smartforms in Webdynpro ABAP

    Hi All,
    I have to display smartforms in WDA. For that I'm using following link.
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785?quicklink=index&overridelayout=true]
    Now, in my case --
    Form Name - 'ZFORM'
    Importing Field - 'VBELN'
    But, my problem is I'm unable to understand some of the fields, used in Tutorial in the link above, which are --
    element_zinput
    pernr = stru_input1-zpernr
    reinr = stru_input1-zreinr
    pdvrs = stru_input1-zpdvrs
    I can understand that these must be user-defined. But, it has not defined in tutorial and hence, I'm confused.
    Can anyone tell me what are these fields and from where are these coming?
    Thakns.
    Kumar Saurav.

    hi:Thomas
         I have a requirement which smartform convert to pdf in web dynpro for abap ,But garbled for the Chinese.why is this?
        my code:
    method ONACTIONPDF2 .
    DATA FM_NAME TYPE RS38L_FNAM.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME                 = 'ZTEST_WDA'
    IMPORTING
    FM_NAME                  = FM_NAME
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    DATA: JOB_OUPUT TYPE SSFCRESCL,
    LT_OTFDATA TYPE TABLE OF ITCOO.
    DATA: LA_CTRL_FORM TYPE SSFCTRLOP,
    LA_OUTPUT_OPT TYPE SSFCOMPOP.
    ** Spool Parameters
    *LA_OUTPUT_OPT-TDIMMED = 'X'.
    *LA_OUTPUT_OPT-TDDELETE = 'X'.
    *LA_OUTPUT_OPT-TDLIFETIME = 'X'.
    *LA_OUTPUT_OPT-TDDEST = 'LOCL'.
    * Parameters passes to get the output in PDF format
    LA_CTRL_FORM-NO_DIALOG = 'X'.
    *LA_CTRL_FORM-PREVIEW = 'X'.
    LA_CTRL_FORM-GETOTF = 'X'.
    LA_CTRL_FORM-LANGU = '1'.
    *LA_CTRL_FORM-DEVICE = 'PRINTER'.
      LA_OUTPUT_OPT-tdprinter = 'PDF1'.
    CALL FUNCTION FM_NAME
    EXPORTING
    CONTROL_PARAMETERS         =  LA_CTRL_FORM
    OUTPUT_OPTIONS             = LA_OUTPUT_OPT
    IMPORTING
    JOB_OUTPUT_INFO            = JOB_OUPUT
    EXCEPTIONS
    FORMATTING_ERROR           = 1
    INTERNAL_ERROR             = 2
    SEND_ERROR                 = 3
    USER_CANCELED              = 4
    OTHERS                     = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    REFRESH LT_OTFDATA.
    LT_OTFDATA[] = JOB_OUPUT-OTFDATA[].
    CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
    EXPORTING
    I_OTF                    = LT_OTFDATA
    EXCEPTIONS
    CONVERT_OTF_TO_PDF_ERROR = 1
    CNTL_ERROR               = 2
    OTHERS                   = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    DATA: L_DUMMY TYPE STANDARD TABLE OF TLINE,
    PDF_DATA TYPE XSTRING,
    PDF_SIZE TYPE I.
    CLEAR: PDF_DATA, PDF_SIZE.
    * convert otf to pdf
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT                = 'PDF'
    MAX_LINEWIDTH         = 255
    IMPORTING
    BIN_FILESIZE          = PDF_SIZE
    BIN_FILE              = PDF_DATA
    TABLES
    OTF                   = LT_OTFDATA[]
    LINES                 = L_DUMMY
    EXCEPTIONS
    ERR_MAX_LINEWIDTH     = 1
    ERR_FORMAT            = 2
    ERR_CONV_NOT_POSSIBLE = 3
    OTHERS                = 4.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(
    *    *path to the word file
    I_FILENAME = 'WDA_SMARTFORMS.pdf'
    *     String Variable
    I_CONTENT =  PDF_DATA
    *     File Type
    I_MIME_TYPE = 'PDF' ).
    endmethod.
    image1 for smartforms
    image2 for pdf

  • How to View Smartforms or SAP Script Forms in Web Dynpro ABAP

    Do anyone have idea of how to View Smartforms or SAP Script Forms in Web Dynpro ABAP?
    Please let me know. Thanks

    Hi Sameeksha,
    You can display an smartform in WDA as an pdf file. Try go through this [article |https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785]where Nanda does explain about the same.
    Regards,
    Uday

  • Smart form in Web dynpro ABAP

    Hi experts,
                   In my scenario i have to display smartform from WDA. The smartform will show the employee records when i pass PERNR as the input parameter. i have used the following FM's SSF_FUNCTION_MODULE_NAME and CONVERT_OTF. and converted it into PDF and binded the source file to interactive form. Now the form is getting displayed.
    My problem is when i pass single pernr its fetching the record of particular pernr and when i pass multiple pernr its not fetching the records of multiple pernr.
    when i set the value for below control parameter its getting values for single pernr:-
    cparam-no_dialog  = 'X'.
    cparam-preview = 'X'.
    cparam-getotf = 'X'.
    when i set values for these parameters cparam-no_open = 'X' and cparam-no_close = 'X'  to fetch multiple PERNR nothing is getting displayed in the form.
    What should i have to do to show multiple records. Is any other control parameters is to be passed.
    Please help me out of this issue.
    Regards,
    Susil.

    Susil,
    It has something to do the logic inside the smartforms,nothing with the control parameters
    Thanks
    Bala Duvvuri

  • Exception condition "CNTL_ERROR" raised.  in WDA :  smartform to pdf

    Hii, 
    I am using a webdynpro - abap application. I am showing  a smartform as a pdf in one on the windows.
    When the link in the main window is clicked, a secondary window. Instead of the pdf, I get following exception.Kindly help me understand, where would I be going wrong. Let me know if more details required.
    *Exception condition "CNTL_ERROR" raised. *
    Form: PBO_HTML_CONTROL of program SAPLSTXBC
    Module: HTML_CONTROL of program SAPLSTXBC
    Function: SSFCOMP_PDF_PREVIEW of program SAPLSTXBC
    Method: DISPLAYPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: IF_COMPONENTCONTROLLER~DISPLAYPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: ONACTIONPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
    Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP
    Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP
    The code in the DISPLAYPDF method is as follows:
    method DISPLAYPDF .
    DATA: I_RS38L_FNAM TYPE  RS38L_FNAM.
    DATA: CTRL TYPE SSFCTRLOP.
    DATA: OUT TYPE  SSFCOMPOP.
    DATA: I_SSFCRESCL TYPE SSFCRESCL.
    DATA: LT_OTFDATA TYPE TABLE OF ITCOO.
    CTRL-GETOTF = 'X'.
    CTRL-NO_DIALOG = 'X'.
    CTRL-PREVIEW = 'X'.
    OUT-TDNEWID = 'X'.
    OUT-TDDELETE = ' '.
    data: i_tsp03 type tsp03.
    clear i_tsp03.
    select single * from tsp03 into i_tsp03.
    *OUT-TDDEST = i_tsp03-PADEST.
    OUT-TDDEST = 'TEP1'.
    ********get context data
      DATA lo_nd_zwebquestionaire TYPE REF TO if_wd_context_node.
      DATA lo_el_zwebquestionaire TYPE REF TO if_wd_context_element.
      DATA ls_zwebquestionaire TYPE wd_this->element_zwebquestionaire.
    * navigate from <CONTEXT> to <ZWEBQUESTIONAIRE> via lead selection
      lo_nd_zwebquestionaire = wd_context->get_child_node( name = wd_this->wdctx_zwebquestionaire ).
    * get element via lead selection
      lo_el_zwebquestionaire = lo_nd_zwebquestionaire->get_element(  ).
    * get all declared attributes
      lo_el_zwebquestionaire->get_static_attributes(
        IMPORTING
          static_attributes = ls_zwebquestionaire ).
    ********get context data ends
    data: itab1 type TCHAR255.
    data: itab2 type TCHAR255.
    data: itab type zprint. "addition by chandani
    data fm_name type rs38l_fnam..
    clear fm_name.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME             = 'ZCPESMARTFORM'
      IMPORTING
        FM_NAME              = fm_name
      EXCEPTIONS
        NO_FORM              = 1
        NO_FUNCTION_MODULE   = 2
        OTHERS               = 3.
    CALL FUNCTION fm_name
    EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = CTRL
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
       OUTPUT_OPTIONS             = OUT
       USER_SETTINGS              = ' '
       NAME                       = 'test'
       ZWEBQUESTIONAIRE           = ls_ZWEBQUESTIONAIRE
    IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = I_SSFCRESCL
    *   JOB_OUTPUT_OPTIONS         =
    TABLES                                  "addition by chandani
      itab                         = itab   "addition by chandani
    * EXCEPTIONS
    *   FORMATTING_ERROR           = 1
    *   INTERNAL_ERROR             = 2
    *   SEND_ERROR                 = 3
    *   USER_CANCELED              = 4
    *   OTHERS                     = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    REFRESH LT_OTFDATA.
    LT_OTFDATA[] = I_SSFCRESCL-OTFDATA[].
    CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
      EXPORTING
        I_OTF                          = LT_OTFDATA
    * EXCEPTIONS
    *   CONVERT_OTF_TO_PDF_ERROR       = 1
    *   CNTL_ERROR                     = 2
    *   OTHERS                         = 3
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    DATA: PDF_DATA TYPE XSTRING,
          PDF_SIZE TYPE I.
    DATA: L_DUMMY TYPE STANDARD TABLE OF TLINE.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
       FORMAT                      = 'PDF'
    *   MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
    *   COPYNUMBER                  = 0
    *   ASCII_BIDI_VIS2LOG          = ' '
    *   PDF_DELETE_OTFTAB           = ' '
    IMPORTING
       BIN_FILESIZE                = PDF_SIZE
       BIN_FILE                    = PDF_DATA
      TABLES
        OTF                         = LT_OTFDATA
        LINES                       = L_DUMMY
    * EXCEPTIONS
    *   ERR_MAX_LINEWIDTH           = 1
    *   ERR_FORMAT                  = 2
    *   ERR_CONV_NOT_POSSIBLE       = 3
    *   ERR_BAD_OTF                 = 4
    *   OTHERS                      = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      DATA lo_nd_pdf TYPE REF TO if_wd_context_node.
      DATA lo_el_pdf TYPE REF TO if_wd_context_element.
      DATA ls_pdf TYPE wd_this->element_pdf.
      DATA lv_sources LIKE ls_pdf-sources.
    * navigate from <CONTEXT> to <PDF> via lead selection
      lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
    * get element via lead selection
      lo_el_pdf = lo_nd_pdf->get_element(  ).
    * get single attribute
      lo_el_pdf->Set_attribute(
        EXPORTING
          name =  `SOURCES`
          value = PDF_DATA ).
    endmethod.

    Hi,
    1) This error generally comes ,when your GUI version is old.Check this point & try to upgrade.
    2) Otherwise if you are running report in background,then check madhu kumar's reply in this link & try like this.
    Dump Error Raise_Exception CNTL_ERROR
    Also search OSS notes.
    Thanks
    Gourav.

  • Displaying a Smartform as PDF in WDA

    Dear All,
    I am trying to display a smartform as PDf in the web dynpro application. I am getting the below error while trying to display the smartform.
    Note
    The following error text was processed in the system DE5 : Function module does not exist
    The error occurred on the application server MTW02SDEC01_DE5_00 and in the work process 0 .
    The termination type was: ERROR_MESSAGE_STATE
    The ABAP call stack was:
    Function: FUNCTION_IMPORT_INTERFACE of program SAPLSUNI
    Method: DATASOURCE_2_FM_PARAMS of program CL_WD_ADOBE_SERVICES==========CP
    Method: CREATE_PDF_DDIC of program CL_WD_ADOBE_SERVICES==========CP
    Method: CREATE_PDF of program CL_WD_ADOBE_SERVICES==========CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LADOBE==================CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LADOBE==================CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
    Please let me know does any services needs to be activated in SICF or any other problem?
    Thanks,
    Mugundhan

    Hi Thomas,
    Pleasure in receving the reply from you. I had created a node called pdf_data of cardinality 1..1, under which i had created a attribute called SOURCE of type XSTRING. i had used the below code to display the  smart form.
    DATA:  node_pdf_data TYPE REF TO if_wd_context_node,
             fm_name       TYPE  rs38l_fnam,
             outop         TYPE ssfcompop,
             cparam        TYPE ssfctrlop,
             tab_otf_data  TYPE ssfcrescl,
             tab_otf_final TYPE TABLE OF itcoo,
             bin_filesize  TYPE i,
             bin_file      TYPE xstring,
             pdf_tab       TYPE TABLE OF tline.
      " Get function module name for smart form
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZMG_SF_TEST'
        IMPORTING
          fm_name            = fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      " Get Report Format With Data From Smart Form
      outop-tdprinter   = 'LP01'.
      outop-tddest      = 'LP01'.
      cparam-no_dialog  = 'X' .
      cparam-preview    = 'X'.
      cparam-getotf     = 'X'.
      CALL FUNCTION fm_name
        EXPORTING
          control_parameters = cparam
          output_options     = outop
          user_settings      = space
        IMPORTING
          job_output_info    = tab_otf_data
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
      " Get all data of Smartform
      tab_otf_final[] = tab_otf_data-otfdata[].
      " Convert OTF data into PDF data
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = bin_filesize
          bin_file              = bin_file
        TABLES
          otf                   = tab_otf_final
          lines                 = pdf_tab
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          err_bad_otf           = 4
          OTHERS                = 5.
      " Set PDF Data to context attribute
      node_pdf_data = wd_context->get_child_node( name = 'PDF_DATA' ).
      CALL METHOD node_pdf_data->set_attribute
        EXPORTING
          value = bin_file
          name  = 'SOURCE'.
      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( ).
      lo_window         = lo_window_manager->create_window(
                         window_name            = 'W_PDF'
    *                    title                  =
    *                    close_in_any_case      = abap_true
                         message_display_mode   = if_wd_window=>co_msg_display_mode_selected
    *                    close_button           = abap_true
                         button_kind            = if_wd_window=>co_buttons_ok
                         message_type           = if_wd_window=>co_msg_type_none
                         default_button         = if_wd_window=>co_button_ok
      lo_window->open( ).
    The above code works fine.  Finally in the bin_file i am getting the raw data. After that i am getting the below error.
    The following error text was processed in the system DE5 : Function module does not exist
    The error occurred on the application server MTW02SDEC01_DE5_00 and in the work process 0 .
    The termination type was: ERROR_MESSAGE_STATE
    The ABAP call stack was:
    Function: FUNCTION_IMPORT_INTERFACE of program SAPLSUNI
    Method: DATASOURCE_2_FM_PARAMS of program CL_WD_ADOBE_SERVICES==========CP
    Method: CREATE_PDF_DDIC of program CL_WD_ADOBE_SERVICES==========CP
    Method: CREATE_PDF of program CL_WD_ADOBE_SERVICES==========CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LADOBE==================CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LADOBE==================CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP

  • How to include formating options present in "FormatTextEdit" UI element in Smartform

    Hi All,
    I need your help in below requirement
    We need to use FormatTextEdit UI element in our WDA, so that text entered in UI element along with formatting options needs to be printed in PDF form through smartform.
    We are using Smartform to get PDF not adobe form. So we are facing issue in converting HTML tags which we get as a result of "FormatTextEdit" UI element in smartform.
    In PDF ( which is generated using Smartform inside our component), HTML tags are getting printing like
    We tried using "cl_wd_formatted_text", but could not find solution in integrating those HTML tags inside our smartform.
    Is there is any FM or Utility to convert HTML tags to smartform or any other approach to fulfil our requirement?
    Please help.
    Thank you
    Sangeetha

    Hi,
    You can convert smart form or RTF text to HTML tags but not the other way. There is no such provision.  You can check the class CL_WD_FORMATTED_TEXT which has method to convert smartform/sap script to /formatted text . May be you can check that and try to do the reverse way.
    But SAP doesn't have any such provision to convert HTML to other formats.
    Hope this helps,
    Regards,
    Kiran

  • Calling smartform and displaying ALV grid in ABAP WEBDYNPRO

    Hi all,
    I am new to ABAP web dynpro.I ahve few custom reports which are simple ALV list reports which I now need to convert to ABAP web dynpro application .
    For one particular report,based on the selection screen input,I need to display the ALV list and when I select the records from the ALV list,I need to call a smartform on clik of a push button.
    My questions:
    1. Im using 'REUSE_ALV_GRID_DISPLAY' FM  to display the o/p in my report.Is there any similar FM in webdynpro ABAP which will display my list in ALV GRID in my web dynpro application??/
    2. How to call a smartfrm in ALV grid in web dynpro??
    Edited by: abap_1000 on Jan 9, 2011 6:09 PM

    Hi,
    You can search SDN, there are several posts available. Just to get some idea, you can check --
    [Beginneru00B4s questions on WDA ALV;
    [Reg ALV Display;
    For clicking event on ALV --
    [Reg Row Data fetching on click in ALV;
    For ALV display on WDA --
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/101df93f-4b5c-2910-14aa-9eb0338c2110?quicklink=index&overridelayout=true]
    Thanks.
    Kumar Saurav.

  • Display Smartform Pdf output in ABAP Webdynpro application

    Hello,
    there is a solution for displaying Smartform output in Java Webdynpro application in this forum. Since i want to start an project in ABAP Webdynpro i need a solution for this technology since i don't want to recreate all the paperwork again using Adobe. Is there any solution available?
    Thanks
    Udo Ahle

    Hello,
    this is the solution which i was able to implement using the hints given by Heidi and Thomas. Thank you for the support. With this solution it is possible to reuse oldstyle sapscripts and smartforms in todays environment.  Here is the sample code which solves the problem:
    In WDA you define for example a pushbutton to start the display of the PDF.
    In the onaction method you implement:
    method ONACTIONSHOW_PDF .
      data LX_pdf type xstring.
    * get PDF from existing sapscript or smatform
      call function 'Y_PDF_GET' destination '46c'
        IMPORTING
          ex_PDF = LX_PDF.
    * append the pdf to the response
      cl_wd_runtime_services=>attach_file_to_response(
        i_filename  = 'Hello.PDF'
        i_content   = lx_pdf
        i_mime_type = 'application/pdf'
        i_in_new_window = 'X'
        i_inplace       = 'X' ).
    endmethod.
    The function 'Y_PDF_GET' is implemented as follows:
    FUNCTION Y_PDF_GET .
    *"*"Local interface:
    *"  EXPORTING
    *"     VALUE(EX_PDF) TYPE  XSTRING
    *"  TABLES
    *"      ET_OTF STRUCTURE  ITCOO OPTIONAL
      data: lf_filesize type i,
            lt_otf type table of ITCOO,
            lt_lines type table of tline,
            tline type tline.
    * start sapscript or smatforms and return
      perform make_otf.
      CALL FUNCTION 'READ_OTF_FROM_MEMORY'
        TABLES
          OTF                = lt_otf
       EXCEPTIONS
         MEMORY_EMPTY       = 1
         OTHERS             = 2
      et_otf[] = lt_otf.
      CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
         FORMAT                      = 'PDF'
    *   MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
       IMPORTING
         BIN_FILESIZE                = lf_filesize
        TABLES
          OTF                         = lt_otf
          LINES                       = lt_lines
       EXCEPTIONS
         ERR_MAX_LINEWIDTH           = 1
         ERR_FORMAT                  = 2
         ERR_CONV_NOT_POSSIBLE       = 3
         OTHERS                      = 4
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * convert tline to xstring as needed in
    * in web dynpro            
      field-symbols <X>.
      data: st(268) type c.
      data l1 type i.
      data len type i.
      data maxline type i value 134.
      l1 = 0.
      loop AT lt_lines INTO tline.
        clear st.
        st+l1(maxline) = tline.
        len = maxline + l1.
        l1 = maxline - strlen( tline ).
        ASSIGN st TO <x> TYPE 'X'.
        CONCATENATE ex_pdf <x>(len) INTO ex_pdf.
      endloop.
    ENDFUNCTION.
    The make_otf for sapscript is the following:
    * the next attribute enables the otf output.
    * no other output will be generated
    <b>options-TDGETOTF = 'X'</b>
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
    *         APPLICATION        = 'TX'
    *         ARCHIVE_INDEX      = ARCHIVE_INDEX
             ARCHIVE_PARAMS     = ARCHIVE_PARAMS
                DEVICE             = DEVICE
                DIALOG             = ' '
                FORM               = FORM
                LANGUAGE           = language
               OPTIONS            = OPTIONS
    *     IMPORTING
    *          LANGUAGE           =
    *          NEW_ARCHIVE_PARAMS =
    *          RESULT             =
           EXCEPTIONS
                CANCELED           = 1
                DEVICE             = 2
                FORM               = 3
                OPTIONS            = 4
                UNCLOSED           = 5
                OTHERS             = 6.
    *... make some write forms
      data lT_OTF     type table of     ITCOO.
    * get the otf data
      CALL FUNCTION 'CLOSE_FORM'
    *     IMPORTING
    *          RESULT   = result
           TABLES
               OTFDATA  = lt_otf
           EXCEPTIONS
                UNOPENED = 1
                OTHERS   = 2.
    * put otf into memory for later usage
      if not lt_otf is initial.
        CALL FUNCTION 'SAVE_OTF_TO_MEMORY'
    * EXPORTING
    *   MEMORY_KEY       = 'DEF_OTF_MEMORY_KEY'
          TABLES
            OTF              = lt_otf.
      endif.
    For Smartforms technology it is possible to implement the same concept.

  • Smartforms in Webdynpro Abap

    Hi Experts,
    I am having smartform using this smartform i need to use in Webdynpro Abap.Can any one tell how to use is there any example component using smartform in webdynpro Abap.

    Hello Durga,
    you want to display the smart form in WDA or do you want to just get the output of the smartform and display it in PDF.
    for the first case you need to use Interactive forms and for the second case you need to simply call the FM generated for the smart form and display th output in PDF
    check this thread
    smart forms in web dynpro abap
    BR, Saravanan

  • Reg ALV Hyperlink event handling in WDA

    Hi,
    I am using one ALV for Invoice in WDA. There in that ALV, column containing VBELN has been defined as Hyperlink. On clicking of VBELN, detail about that should be opened up as PDF.
    So far, this is working. But, my problem is, if once VBELN has been selected, next clicking does not pass diff VBELN.
    I need to know how can I handle  clicking on diff VBELN in my Invoice ALV?
    If there is anything like clear or refresh, that need to be invoked in Afteraction or Beforeaction or WdModifyView...?
    Or is there a syntax like
    wdContext.currentContextElement().setSpace(" ");
    for getElement( ) also...?
    Thanks.
    Kumar Saurav.
    Edited by: Kumar Saurav on Feb 5, 2010 8:55 AM

    Hi Arjun,
    I followed and implemented this line --
    In the DISPLAYPDF method, create a parameter ln_vbeln ref to vbeln.
    Now,
    Now when you call this method in the ON_CLICK event handler (use the help of code wizard to call the method),
    So, why should I call this method in ON_CLICK Event Handler?
    In ON_CLICK Method, this is my code that is being generated using Wizard --
    LO_EL_VBRKTAB_2->GET_ATTRIBUTE(
          EXPORTING
            NAME =  `VBELN`
          IMPORTING
            VALUE = LV_VBELN ).
    In addition, I am just firing the Plug to call View that has PDF Container - InteractiveForm Element.
    And, DISPLAYPDF is a Method defined in ComponentController Method Tab. There, I am employing the logic to fetch the data using Wizard from diff nodes and processing those to give the output from Smartforms as PDF.
    There, I've defined ln_vbeln, but, an error comes stating - ln_vbeln cannot be a table, a reference, a string, or contain any of these objects
    Here, my question is I've defined my steps. Let me do it in numbers--
    1) View for Input defined
    2) View to contain output ALV defined
    3) View to contain PDF defined
    4) Method ON_CLICK defined in second View
    5) Method DISPLAYPDF defined in COMPONENTCONTROLLER's Method Tab
    Now, suggest me what to do and where?
    Thanks.
    Kumar Saurav.

  • WDA set up Print Pages

    Hi All,
    I need to customize the print page in my WDA program.
    Ex :
    Page 1.
    Selection Screen
    Page 2.
    result screen
    Can you plz advice on this?

    Hi Tharu,
    Are you referring to the print_page( ) options as below
    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( ).
    I dont think its possible to customize the print page as per our requirement. It just prints the visible area of window.
    Instead, you need to go for adobeforms/smartforms development, where you can controll the output.
    Regards,
    Rama

  • WDA ALV Total shows too many decimals

    When an aggregate rule(total field) is defined for a WDA ALV column
    defined as a DEC with 0 decimals field in the dictionary, the total is
    shown with 9 decimal places, when it should be shown with no decimals
    at all.
    If we define the column field on the dictionary as a DEC with 2
    decimals, the total is correct(with 2 decimals).
    With don´t get this error when we export alv to smartform.
    Can anyone advise me to solve it?
    we are running ECC 6 with SP  SAP_ABA SAPKA70020 and SAP_BASIS SAPKB70020
    I have sent a msg to SAP with no luck (Please, Thomas msg 935005 / 2009 )
    Thanks in advance.
    Silvana.

    Hi, Lekha
    only  total line shows 9 dec places.  other cells of the column work ok.
    ex, Detail  displays:    123,456,789
          total    displays:    123,456,789.000000000
    data type int4 works fine in all cells but the number of characters are not enough.
    regards.
    Silvana.

  • How to convert Sapscript into PDF in WDA

    Hi All,
    I have a requirement in Webdynpro in which I need to convert the Sap Script into PDF.
    Can you please tell me how to proceed ?
    Thanks in advance.
    Regards,
    Swapnil

    Hi,
    Check this document: Convert SAPScript to PDF file and instead of using gui_download/cl_gui* as mentioned in that doc, use CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE to open the PDF in WDA. You can refer that in this doc: Opening a Smartform in Web Dynpro ABAP
    Regards,
    Kiran

  • Filename in Webdynpro for a PDF created with Smartform

    Hi,
    I created a PDF with Smartform in my Webdynpro-Application.
    When I click the save button there is a default filename f.pdf .
    How can I change the filename?
    Regards
    Marcus Schug

    Hi Experts,
    any update on this?
    I am facing the same problem with ESS payslip (smartform/Hrform): my customer wants to have custom file name for download salery statements from the portal. Do you know how to change the default form name unknown.pdf to e.g.. "payslip_month_year"?
    I spent a lot of time to find any possibility to get and change the file name but without success till now.
    Please respond.
    Regards,
    Zdzislaw Kaczmarczyk
    Edited by: Zdzislaw Kaczmarczyk on Jun 14, 2010 4:41 PM

Maybe you are looking for

  • Why won't my 5c connect to server

    whats wrong with my iphone 5c-whenever i try to open safari or check my email i get a message cannot connect to server, or cannot establish a secure connection. whats wrong?

  • Cost element report prob. with auxiliary account assignment

    Hi, WBS is statistical. Orders are auxiliary account assigned to WBS. When running cost element reports, cji3 ; settlement cost elements are not showing there for the order. Kindly suggest. Thanks, Harsh. Edited by: Harsh Saxena on Dec 8, 2010 2:12 P

  • How to create hundreds of  SHIP TO ADDRESS in SRM 7.0

    Hi Experts, We are configuring SRM7.0 with ECC6 ( Ehp4) having Classic Scenario . In ECC we are maintaing the Delivery Address  at Storage Location level  and we have such approx 4000 storage Location Address and so in SRM the Delivery Address in Sho

  • "Get Info" only displaying "more info" 1 time

    Strange problem here. When I select a file in the finder, and hit cmd-i to "get info" it displays as expected. The "More Info:" section is complete. If it's an image, it gives dimensions and color space etc. If its a pdf, I get page count, title, cre

  • Import Buissness Component and make view object

    Hi, How can i import an other Buissnes component in my project and make a view componnent with the component of my package and with this new imported component Thanks Philippe null