How to publish Smart form of PDF in r/3 through WD

Hi,
We have a PDF smart form in the r/3.we want to call the PDF from WD View without using PDF interactive form.
Could any one give me soln for this??
Thanks

Hi ,
  Insert IFrame UI Element and bind the Resource property to the value attribute  PdfUrl of  type String .
Define a Output parameter of type Binary in RFC .
Insert the following code to dispaly the smart form.
          byte[] pdfContent = wdContext.currentOutput<node>().get<Binary>();
          IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF);
          try
               wdContext.currentContextElement().setPdfUrl(pdfResource.getURL());
          catch(Exception e)
               wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);     
Regards,
Sunitha Hari

Similar Messages

  • How to convert Smart Form into PDF format and return the result in BAPI?

    I want to convert a Smart Form into PDF format and return the result in BAPI.
    can anyone tell me how it can be done with related example
    regards
    pranay

    hi,
    smart form to pdf--
    All you have to do is call your SF to get OTF and then concert it to PDF. Works like charm:
    DATA: p_output_options TYPE ssfcompop,
    p_control_parameters TYPE ssfctrlop.
    p_control_parameters-no_dialog = 'X'.
    p_control_parameters-getotf = 'X'.
    CALL FUNCTION v_func_name "call your smartform
    EXPORTING
    output_options = p_output_options
    control_parameters = p_control_parameters
    IMPORTING
    job_output_info = s_job_output_info.
    call function 'CONVERT_OTF_2_PDF'
    tables
    otf = s_job_output_info-otfdata
    lines = t_pdf
    and if u need more u can check below links also
    Check the below links..
    Re: Smartforms to PDF
    Re: smartform (otf) as pdf and sending as email-attachment
    VISIT THIS LINK
    Re: Smartforms to PDF
    PLZ REWARD POINTS IF IT HELPS YOU
    rgds
    anver

  • How to show Smart form in PDF format

    Hi Experts,
    I  have a requirement in which I have to show a smart form in
    PDF Format coming from the RFC .
    Please give your helpful suggestion.
    Thanks and Regards
    Upendra Agrawal

    Hi ,
    Just look this pdf
    see this link
    http://www.****************/Tutorials/Smartforms/SFinEPasPDF/Page1.htm
    Thanks
    Edited by: Anup Bharti on Nov 7, 2008 7:00 AM

  • Creation of Smart Forms for PDF

    Hi All,
    I am new to SFP. So, please tell me how to create Smart Forms for PDF.
    I already have an SAP standard form of Customer Invoice in this format (SFP) and I need to change the layout and add some additional fields in it as well.
    Please guide me through the process. Earliest reponse will be highly appreciated.
    Regards,
    Shabbar

    Hi,
    I take that you meant PDF Forms in SAP.
    Refer the following help links.
    http://help.sap.com/saphelp_nw04s/helpdata/en/dc/f1783fe3263042e10000000a114084/content.htm
    This PDF link (Has got many Pdf files)
    https://www.sdn.sap.com/irj/sdn/interactiveforms?rid=/webcontent/uuid/d1088b7e-0c01-0010-c78e-984c0537e3ec [original link is broken]
    Also check this Tech-ed 06 session at Amsterdam.
    http://www.sapteched.com/emea/edu_sessions/session.htm?sid=317
    Check this download from SDN.
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/2dd3dbcd-0401-0010-55b8-b10808ff688e
    Is this you are looking for?
    Feel free to revert back.
    --Ragu

  • Display smart form in PDF

    Hi all,
    I have created a smart form , and I can down load it to the local drive in PDF format.
    But  I want to display my smart form in PDF first , then if the user want to save , he should be able to do so. How can i do thtat.
    Many thanks ,
    Sandeep.

    hi friend,
    pls go through the code
    rewards are expecting .
    vivek
    *& Report  Y_SD_PRE_SHIPMENT
    REPORT  y_sd_pre_shipment.
    **************DATA DECLARATION****************************************
    DATA : BEGIN OF i_vbrk OCCURS 0,
           vbeln TYPE vbrp-vbeln,
           END OF i_vbrk.
    DATA:  prog TYPE sy-repid,
           dynnr TYPE sy-dynnr,
           FNAM  TYPE RS38L_FNAM,
           v_vbeln type ZSDTANNXINV-vbeln,
           idx type i,
           cnt type i.
    DATA: I_FINAL TYPE TABLE OF YPSHIP,
          W_FINAL TYPE YPSHIP.
    DATA: I_HEAD TYPE TABLE OF YPSHIP1,
          W_HEAD TYPE YPSHIP1.
    DATA: it_otf   TYPE STANDARD  TABLE OF itcoo,
          it_docs  TYPE STANDARD  TABLE OF docs,
          it_lines TYPE STANDARD  TABLE OF tline,
          st_job_output_info      TYPE ssfcrescl,
          st_document_output_info TYPE ssfcrespd,
          st_job_output_options   TYPE ssfcresop,
          st_output_options       TYPE ssfcompop,
          st_control_parameters   TYPE ssfctrlop,
          v_len_in                TYPE so_obj_len,
          v_language              TYPE sflangu VALUE 'E',
          v_e_devtype             TYPE rspoptype,
          v_bin_filesize          TYPE i,
          v_name                  TYPE string,
          v_path                  TYPE string,
          v_fullpath              TYPE string,
          v_filter                TYPE string,
          v_uact                  TYPE i,
          v_guiobj                TYPE REF TO cl_gui_frontend_services,
          v_filename              TYPE string.
    ******USER INTERACTION OPTION FOR THE INVOICE NO
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE r.
    PARAMETERS:  invoice LIKE ZSDTANNXINV-vbeln obligatory .
    SELECTION-SCREEN : END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR invoice.
      REFRESH i_vbrk.
      SELECT vbeln FROM vbrk INTO TABLE i_vbrk.
      IF sy-subrc IS INITIAL.
        prog = sy-repid.
        dynnr = sy-dynnr.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
    DDIC_STRUCTURE         = ' '
           retfield               = 'VBELN'
           dynpprog               = prog
           dynpnr                 = dynnr
           dynprofield            = 'INVOICE'
           value_org              = 'S'
           TABLES
           value_tab              = i_vbrk.
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
       exceptions
      parameter_error        = 1
      no_values_found        = 2
       others                 = 3
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    at selection-screen on invoice.
    if invoice is not initial.
    clear v_vbeln.
    select single vbeln from ZSDTANNXINV into v_vbeln where vbeln = invoice.
    if sy-subrc is not initial.
    message 'Enter Valid Document No' type 'E'.
    endif.
    endif.
    START-OF-SELECTION.
    perform get_data.
    perform process_data.
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    form get_data .
    IF INVOICE IS NOT INITIAL.
    SELECT  VBELN
            VTEXT
            NETWT
            GROSSWT
            vsslname
            kindofpack
            INCO1
            INCO2
            REMDATE
            DESTINATION
            SHPNGLIN1
            CNTRNO
            TRAILERNO1
            ETDDATE
            ETADATE
            baanr
            FROM ZSDTANNXINV
            INTO  TABLE I_HEAD
            WHERE VBELN = INVOICE.
    ENDIF.
    IF I_HEAD[] IS NOT INITIAL.
    select  vbeln
            POSNR
            MATNR
            MAKTX
            meins
            RATE
            VALUE
            WAERK
            PRPOSNR
            from zsafii
            into corresponding fields of table i_final
            for all entries in i_head
            where vbeln = i_head-vbeln.
    ENDIF.
    describe table i_final lines cnt.
    idx = 1.
    loop at i_final into w_final.
    if idx le cnt.
    read table i_head into w_head with key vbeln = w_final-vbeln.
    if sy-subrc is initial.
    move-corresponding w_head to w_final.
    modify i_final from w_final index idx.
    idx = idx + 1.
    endif.
    endif.
    endloop.
    endform.                    " get_data
    *&      Form  process_data
          text
    -->  p1        text
    <--  p2        text
    form process_data .
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
      EXPORTING
        i_language    = v_language
        i_application = 'SAPDEFAULT'
      IMPORTING
        e_devtype     = v_e_devtype.
    st_output_options-tdprinter = v_e_devtype.
    *st_output_options-tdprinter = 'locl'.
    st_control_parameters-no_dialog = 'X'.
    st_control_parameters-getotf = 'X'.
    sort i_final by vbeln.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 = 'Y_SSF_PRESHIPMENT'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    IMPORTING
        FM_NAME                  = FNAM
    EXCEPTIONS
      NO_FORM                  = 1
      NO_FUNCTION_MODULE       = 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.
    if fnam is not initial.
    CALL FUNCTION FNAM
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = st_control_parameters
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS             = st_output_options
      USER_SETTINGS              = 'X'
    IMPORTING
       DOCUMENT_OUTPUT_INFO       = st_document_output_info
       JOB_OUTPUT_INFO            = st_job_output_info
       JOB_OUTPUT_OPTIONS         = st_job_output_options
      TABLES
        itab                       = I_FINAL
        i_head                     = I_HEAD
    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.
    .........................CONVERT TO OTF TO PDF.......................
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
        IMPORTING
          bin_filesize           = v_bin_filesize
        TABLES
          otf                    = st_job_output_info-otfdata
          doctab_archive         = it_docs
          lines                  = it_lines
        EXCEPTIONS
          err_conv_not_possible  = 1
          err_otf_mc_noendmarker = 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.
    ........................GET THE FILE NAME TO STORE....................
      CONCATENATE 'smrt' '.pdf' INTO v_name.
      CREATE OBJECT v_guiobj.
      CALL METHOD v_guiobj->file_save_dialog
        EXPORTING
          default_extension = 'pdf'
          default_file_name = v_name
          file_filter       = v_filter
        CHANGING
          filename          = v_name
          path              = v_path
          fullpath          = v_fullpath
          user_action       = v_uact.
      IF v_uact = v_guiobj->action_cancel.
        EXIT.
      ENDIF.
    ..................................DOWNLOAD AS FILE....................
      MOVE v_fullpath TO v_filename.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          bin_filesize            = v_bin_filesize
          filename                = v_filename
          filetype                = 'BIN'
        TABLES
          data_tab                = it_lines
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDIF.
    ********************************************************************8
    endform.                    " process_data

  • Conversion of Smart form to PDF in Webdypro UI

    Hi Gurus,
                 I want to display a smart form as PDF by converting OTF to PDF and thereby passing the PDF format data to Interactive Form UI element in a Webdynpro application (via portal iview). Do I need ADS server for publishing the OTF converted PDF data in the Interactive Form UI element of the WDA framework.
    Is there a better way to display a smartform in Webdynpro application by avoiding ADS?
    Regards,
    Subhadip

    Hi Thomas,
                    Great to see reply from you. I still cherish the memories of your TechEd sessions that  I have attended in 2007.
    Well back to the topic I'm able to publish a Smartform as PDF via OTF conversion and passing the binary PDF string to pdfsource. While I'm testing the webdynpro application in the WebAS backend I can see the PDF screen with data but when I'm trying to run it from prortal as an iview I can only see a blank screen even without the PDF container. Can you please suggest me whether ADS is a requirement in this kind of scenario (ie portal integration via iview) or this different issue altogether. In case if you feel it's not due to ADS can you please give me a clue on the issue.
    Regards,
    Subhadip

  • Display SMART form as PDF in WD ABAP

    Hi ,
    To display smart form as PDF  , I am following  the SDN article :
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785?quicklink=index&overridelayout=true
    In my component  , I have created the view VIEW_PDF, for this . I have created Adobe interactive UI element, and bind the property source to the attribute (XSTRING) where I will  get PDF (after OTF conversion).
    First of all I am using the FM SSF_FUNCTION_MODULE_NAME and usingf the import parameter fm_name .
    Then using this FM
    CALL FUNCTION lv_fm_name
      EXPORTING
       OUTPUT_OPTIONS             = lwa_output_options
        GW_VENREQDAT               = lwa_venreqdat
        GW_REQHEADER               = lwa_venreqhdr
    IMPORTING
       JOB_OUTPUT_INFO            = lv_ssf_output.
    from smart form ZVM_SFM_SUMMARY,I want to get  the data in OTF format using the importing parameter JOB_OUTPUT_INFO of the above FM.
    But I am not able to retrieve the data .Please direct me , where am I missing?
    For converting it to PDF , I am using the FM CONVERT_OTF .
    regards,
    amit

    You may continue like this there after...
    call function w_fmodule
        exporting
          control_parameters = w_cparam
          output_options     = w_outoptions   ":lv_output_options
          user_settings      = ' '
        importing
          job_output_info    = t_otf_from_fm
        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.
      t_otf[] = t_otf_from_fm-otfdata[].
      call function 'SSFCOMP_PDF_PREVIEW'
        exporting
          i_otf                    = t_otf
        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.
      call function 'CONVERT_OTF'
        exporting
          format                = 'PDF'
    *      max_linewidth         = 132
        importing
          bin_filesize          = pdf_size
          bin_file              = pdf_data
        tables
          otf                   = t_otf[]
          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 lv_source like ls_pdf-source.
    * 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 =  `SOURCE`
          value = pdf_data ).
    Regards
    Gopi

  • Problem in converting smart form into PDF

    HI Experts,
                      I am using a Function Module CONVERT_OTF for converting smart form into pdf file for send it to with attachment.
    But i got a error when i am using that FM.
    Runtime Errors         CONVT_NO_NUMBER
    unable to interpret *292 as a no.
    Is that because my file size too large about 13 pages of PDF?
    and when i run it for other smart forms which have 2 or 3 pages of PDF, its working perfectly.
    can anyone tell what is problem with that FM?
    Thanks
    Shakun

    Hi,
    I had the similar issue and after analysis I have that this is the issue by not passing the IMPORTING parameter of the Function Module "BIN_FILESIZE". Please try to pass some variable to this paramter and then this will be completely rectified.
    DATA ; v_filesize     TYPE i.
    *--Convert OTF data to PDF data
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = v_filesize
        TABLES
          otf                   = it_otfdata
          lines                 = it_pdfdata
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          err_bad_otf           = 4
          OTHERS                = 5.
    Please verify whether this reolves the problem for you.
    Regards,
    SRinivas

  • Publish XML Form to PDF

    Hi all,
    Do you know a way of publishing XML forms to PDF ?
    Is it possible using XSL-FO transformation within the portal ? Has someone already done it ?
    I can not find any information regarding this.
    Thanks a lot
    Nicolas

    HI
    the basics involve using
    1>an XSLT filter already available
    2>using an  custom dev oped xsl which brings the transformation and configuring the xsl in XSLT filter
    3>keeping the xml doccuments in a repository in KM Content and configuring the xslt filter to point to the repository/doccument .
    4>restarting the server.
    u will find help if u navigate to KMconfiguration under system configuration and then
    <b>Configuration
    Content Management
      Repository Filters</b> 
    Please do give points if this helps you atleast gives u a guideline
    With Regards
    subrato kundu
    IBM
    SAP Enterprise Portal  technology Consultant

  • How to publish infopath forms to open new and old form templates in sharepoint2007

    Hi All,
    My requirement is , we are having a form library with the Infopath form templated(V1) published.
    Then we have added about 300 items using template(v1) into the sharepoint library.
     Then client asked for the changes in form and we deveploped infopath template (V2) and published, able to create the items using the new template(v2).
    But ,the issue is when we open item from the 300 items which are created with template(v1), its is opening using template(v2) and we are loosing the functionality of template(v1).
    Can i know ,how to publish the form template to use both template versions and it should open the form with  wahatever the  template it used for creation.
    Thanks in Advance.
    Anil Kumar K

    Hi,
    If you want the InfoPath forms for displaying the items in the list, then I recommend to click Customize Form button in the ribbon of the list to edit the form in InfoPath and then publish the form back to SharePoint.
    After that, you will see there are three new forms(displayifs.aspx, editifs.aspx, newifs.aspx) when you view the list in SharePoint Designer.
    Then you can create the custom action to navigate to the custom InfoPath form:
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Form smart forms vs pdf

    dear experts,
    do you have any experience with the forms in GTS. we have to print LTVD (long term vendor declarations) and have to decide wether to go for smart forms or pdf (adobe, incl this java stacks and ads configuration)
    appreciate any experience feedback.
    many thanks for you time
    peter

    Hi,
    No, there is no technical restriction on using particular layout. u can use whatever u wanna to use. For know more about smartforms go thru,
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    Smartform have following advantages:
    1. Creating and maintaining forms in less time than SAPScript.
    2. Adapting forms without any programming knowledge due to entirely graphical user interface. ( ofcourse you need to write driver program for smartforms, but you can write most of your code in smartform itself.. see the above given link for more detail)
    3. Integrating input elements into the HTML output, which enables you to use a form in Internet applications as well.
    I hope this will help you.
    Pratik

  • How to populate smart form with new values

    Hi!
    I am new to smart form . Can anybody help me in how to populate smart form with some new fileds. Actually i have to populate credit memo form with some customized values..

    Hello,
    Please elaborate your query more in order to be comprehendable.
    Regards,
    Shehryar

  • Convertion of Smart form to pdf and sending mail to vendor for PO

    Hello all,
    I have modified a standard PO Smartform and running it through ME23N.
    In this i have to convert it to a pdf file and then send it through mail to the vendor.
    I have found out FMs'CONVERT_OTF'and
    'SO_NEW_DOCUMENT_ATT_SEND_API1'
    to convert it and send mail. But can u tell me how to go about using it.
    As i am using a standard program do i have to copy this prog to zprog and then call the fm out there. I am not sure.
    Thanks
    Salil

    Hi,
    Here is the sample code.If you find this as useful,kindly reward points by clicking the star on the left of reply.
    Internal Table declarations
    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
          i_tline TYPE TABLE OF tline WITH HEADER LINE,
          i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
          i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
          i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
          i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
          w_objhead TYPE soli_tab,
          w_ctrlop TYPE ssfctrlop,
          w_compop TYPE ssfcompop,
          w_return TYPE ssfcrescl,
          w_doc_chng typE sodocchgi1,
          w_data TYPE sodocchgi1,
          w_buffer TYPE string,"To convert from 132 to 255
    Variables declarations
          v_form_name TYPE rs38l_fnam,
          v_len_in LIKE sood-objlen,
          v_len_out LIKE sood-objlen,
          v_len_outn TYPE i,
          v_lines_txt TYPE i,
          v_lines_bin TYPE i.
    call function 'SSF_FUNCTION_MODULE_NAME'
         exporting
              formname           = 'ZZZ_TEST2'
         importing
              fm_name            = v_form_name
         exceptions
              no_form            = 1
              no_function_module = 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.
    w_ctrlop-getotf = 'X'.
    w_ctrlop-no_dialog = 'X'.
    w_compop-tdnoprev = 'X'.
    CALL FUNCTION v_form_name
         EXPORTING
              control_parameters = w_ctrlop
              output_options     = w_compop
              user_settings      = 'X'
         IMPORTING
              job_output_info    = w_return
         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.
    i_otf[] = w_return-otfdata[].
    CALL FUNCTION 'CONVERT_OTF'
         EXPORTING
              format                = 'PDF'
              max_linewidth         = 132
         IMPORTING
              bin_filesize          = v_len_in
         TABLES
              otf                   = i_otf
              lines                 = i_tline
         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 PDF from 132 to 255.
    LOOP AT i_tline.
    Replacing space by ~
      TRANSLATE i_tline USING ' ~'.
      CONCATENATE w_buffer i_tline INTO w_buffer.
    ENDLOOP.
    Replacing ~ by space
    TRANSLATE w_buffer USING '~ '.
    DO.
      i_record = w_buffer.
    Appending 255 characters as a record
      APPEND i_record.
      SHIFT w_buffer LEFT BY 255 PLACES.
      IF w_buffer IS INITIAL.
        EXIT.
      ENDIF.
    ENDDO.
    Refresh: i_reclist,
             i_objtxt,
             i_objbin,
             i_objpack.
    clear    w_objhead.
    Object with PDF.
    i_objbin[] = i_record[].
    DESCRIBE TABLE i_objbin LINES v_lines_bin.
    Object with main text of the mail.
    i_objtxt = 'Find attached the output of the smart form.'.
    APPEND i_objtxt.
    i_objtxt = 'Regards,'.
    APPEND i_objtxt.
    i_objtxt = 'J.Jayanthi'.
    APPEND i_objtxt.
    DESCRIBE TABLE i_objtxt LINES v_lines_txt.
    Document information.
    w_doc_chng-obj_name = 'Smartform'.
    w_doc_chng-expiry_dat = sy-datum + 10.
    w_doc_chng-obj_descr = 'Smart form output'.
    w_doc_chng-sensitivty = 'F'. "Functional object
    w_doc_chng-doc_size = v_lines_txt * 255.
    Pack to main body as RAW.
    Obj. to be transported not in binary form
    CLEAR i_objpack-transf_bin.
    Start line of object header in transport packet
    i_objpack-head_start = 1.
    Number of lines of an object header in object packet
    i_objpack-head_num = 0.
    Start line of object contents in an object packet
    i_objpack-body_start = 1.
    Number of lines of the object contents in an object packet
    i_objpack-body_num = v_lines_txt.
    Code for document class
    i_objpack-doc_type = 'RAW'.
    APPEND i_objpack.
    Packing as PDF.
    i_objpack-transf_bin = 'X'.
    i_objpack-head_start = 1.
    i_objpack-head_num = 1.
    i_objpack-body_start = 1.
    i_objpack-body_num = v_lines_bin.
    i_objpack-doc_type = 'PDF'.
    i_objpack-obj_name = 'Smartform'.
    CONCATENATE 'Smartform_output' '.pdf'
    INTO i_objpack-obj_descr.
    i_objpack-doc_size = v_lines_bin * 255.
    APPEND i_objpack.
    Document information.
    CLEAR i_reclist.
    e-mail receivers.
    i_reclist-receiver = '[email protected]'.
    i_reclist-express = 'X'.
    i_reclist-rec_type = 'U'. "Internet address
    APPEND i_reclist.
    Sending mail.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
              document_data              = w_doc_chng
              put_in_outbox              = 'X'
         TABLES
              packing_list               = i_objpack
              object_header              = w_objhead
              contents_hex               = i_objbin
              contents_txt               = i_objtxt
              receivers                  = i_reclist
         EXCEPTIONS
              too_many_receivers         = 1
              document_not_sent          = 2
              document_type_not_exist    = 3
              operation_no_authorization = 4
              parameter_error            = 5
              x_error                    = 6
              enqueue_error              = 7
              OTHERS                     = 8.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How to display smart form stored in SAP in Webdynpro java( TLINE table)

    Hi
    I have a requirement where I have to display the smart form from WD Java end.
    The BAPI is producing output in TLINE(TDLINE(132),TDFORMAT(2)). I am trying to concat both(TDLINE+TDFORMAT) and put in the interactive form but I am not able to get the output from BAPI.
    Is it because the TLINE  format is not supported in the WD java. How can I solve the issue.
    Looking forward for the reply.
    Regards,
    Pawan

    Hi..
    Try this PDF URL.... u might get useful things...
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    Web Dynpro Java
    yours GS

  • How to user Smart form for the BID in SRM 4.0

    Hello,
    We have SRM 4.0 and we need to send the BID information to the vendor. This is because we have vendors that are not able to get in to our system and we have to send them a print out of the bid information so that they give us back the information. Then our users will insert it in the system.
    It could be as an attach to the email or it could be printable in the program SPPS - Selecting and Processing Outputs.
    SAP says that there is a smart form BBP_BIDINV_BID and BBP_BID_NOTIFICATION but I am not managing to make them work.
    I found some messages to help solving specific problems so I assume it is possible to do this...
    Is there someone that can help me?
    Thanks very much.
    My best regards,
    Catarina Campos

    Hi
    <u><b>Here is the standard solution to use your own forms:-></b></u>
    <u>- copy the smartform BBP_BIDINV_BID to ZBBP_BIDINV_BID (transaction SMARTFORMS) and apply your changes
    - use BADI to call your custom form ZBBP_BIDINV_BID</u>
    <b>For PDF output form change use BADI BBP_OUTPUT_CHANGE_SF.</b>
    <b>For email notification change use BADI BBP_CHANGE_SF_BID instead.</b>
    <u>You will find all relevant documentation in SPRO --> Supplier Relationship Management --></u>
    SRM Server --> Business Add-Ins (BAdIs) --> Document Output -->
    - Change Forms for Document Output
    - Change Smart Form for E-Mails Relating to Bids
    <u><b>Please go through the links below for more details -></b></u>
    Re: how to use cutom smartform instead standard?
    Re: Email message customization ?
    Re: Bid Invitation Email Subject
    Re: Email notification to bidder should reflect start/end date and time
    Re: RFQ Smartform in SRM
    Re: Standard Text
    Do let me know.
    Regards
    - Atul

Maybe you are looking for

  • Using iWeb mobileme

    Since MobileMe is going away, is there a place I can upload my website from iWeb to?

  • Trouble formatting a 1TB external drive

    I am unable to format or partition a 1TB external drive, connected by fire wire 400. My computer is a Power Mac G5 (not intel), 1.6 Ghz, and 1.25 RAM. I am running OS 10.5.6. When I first plugged in the TB drive, its icon displayed on the desktop. Un

  • Error code 0x80020042 when burning DVD

    I recently updated my 2.16 GHz Intel Core Duo MacBook Pro with 2 GB 667 MHz DDR2 SDRAM and MATSHITA DVD-R UJ-857 Superdrive to Mac OS X (10.5.6) and installed the latest updates. Since updating I have not been able to use Burn to burn DVDs. I get the

  • Disable PartitionListeners on service prior to cluster shutdown

    We're running a Coherence cluster of 70 storage nodes and a further 10 storage-disabled tcp-extend nodes, all running DefaultCacheServer. I have a PartitionListener configured on a distributed cache service which sends an email to a distribution list

  • ASO member selection

    we have a hierarchy as below in account dim Z43100 68405 Rate Z43100 (Shared Member) when i am retreiving Z43100 in excel then name of member is changing to 68405 and when i try to look in member selction then i can see 68405 under Rate instead of Z4