Smartforms and webforms.

hi All,
I am a R/3 programmer and i am assigned a query of ESS which is developed in BSP and HTMLB. There is a smartform and that is not picking up the values properly so i m asked to sort that problem out. Basically they have designed the form such a way that once i go to that page and that i push the 'Print' button, the output of the form comes straight in the pdf format. Now generally there is a call 'SSF_FUNCTION_MODULE_NAME' to call the form in abap, is it the same in BSP??
also if it is so i did not see the call in my forms. So is it possible to conver the OTF straight to PDF without calling the smartform . I knw its confusing but i have tried to put it as clear as i can.
please ask me further questions if u feel the need.
thanks in advance,
Reena..

Reena,
  Yes calling smart form in BSP is same like in ABPA. Yes you can convert the smartform output into PDF from SPOOL output into OTF. But you need to call the FM to generate the OTF data.
To call smartforms: you can use FM 'SSF_FUNCTION_MODULE_NAME' " or you can generate the FM from smartforms then you can use that. Here is the sample code to call the smartforms & covert into PDF.
<b>OnInputprocessing or Oninitialization.</b>
* event handler for checking and processing user input and
* for defining navigation
  data: output_options      type ssfcompop,
        control_parameters  type ssfctrlop,
        output_data         type ssfcrescl,
        devtype             type rspoptype.
DATA: cached_response TYPE REF TO if_http_response.
DATA: guid TYPE guid_32.
* generated result: PDF format
  data: l_pdf_xstring  type xstring,
        lt_lines       type table of tline,
        ls_line        type tline,
        l_pdf_len      type i.
case event_id.
when others.
    call function 'SSF_GET_DEVICE_TYPE'
    EXPORTING
      i_language             = sy-langu
    IMPORTING
      e_devtype              = devtype
    EXCEPTIONS
      no_language            = 1
      language_not_installed = 2
      no_devtype_found       = 3
      system_error           = 4
      others                 = 5.
* set device type in output options
  output_options-tdprinter = devtype.
*control_parameters-DEVICE = 'LOCL'.
  control_parameters-langu = sy-langu.
  control_parameters-no_dialog = 'X'.
  control_parameters-getotf    = 'X'.
CALL FUNCTION '/1BCDWB/SF00000063'
  EXPORTING
   CONTROL_PARAMETERS         = control_parameters
   OUTPUT_OPTIONS             = output_options
   NAME                       = 'First name'
    PHONE                      = '264-466-4657'
IMPORTING
   JOB_OUTPUT_INFO            = output_data
  call function 'CONVERT_OTF'
    EXPORTING
      format                = 'PDF'
    IMPORTING
      bin_filesize          = l_pdf_len
      bin_file              = l_pdf_xstring
    TABLES
      OTF                   = OUTPUT_DATA-OTFDATA
      LINES                 = LT_LINES
    EXCEPTIONS
      err_max_linewidth     = 1
      err_format            = 2
      err_conv_not_possible = 3
      err_bad_otf           = 4
      others                = 5.
  if sy-subrc EQ 0.
    CREATE OBJECT cached_response TYPE CL_HTTP_RESPONSE EXPORTING add_c_msg = 1.
    l_pdf_len = xstrlen( l_pdf_xstring ).
    cached_response->set_data( data   = l_pdf_xstring
                        length = l_pdf_len ).
    cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                       value = 'application/pdf' ).
    cached_response->set_status( code = 200 reason = 'OK' ).
    cached_response->server_cache_expire_rel( expires_rel = 180 ).
    CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        ev_guid_32 = guid.
    CONCATENATE runtime->application_url '/' guid '.pdf' INTO display_url.
    cl_http_server=>server_cache_upload( url      = display_url
                                         response = cached_response ).
  ENDIF.
  RETURN.
endcase.
<b>In BSP Layput</b>
<%  IF display_url IS NOT INITIAL.
      %>
      <script language="Javascript">
        window.open("<%= display_url%>").focus();
      </script>
      <%
  ENDIF.
%>
<b>* Page Attibutes:</b>
display_url type string.
Let me know if you have any issues.
Raja T
Message was edited by:
        Raja T

Similar Messages

  • Smartform and webform PDF

    hi All,
    I am a R/3 programmer and i am assigned a query of ESS which is developed in BSP and HTMLB. There is a smartform and that is not picking up the values properly so i m asked to sort that problem out. Basically they have designed the form such a way that once i go to that page and that i push the 'Print' button, the output of the form comes straight in the pdf format. Now generally there is a call 'SSF_FUNCTION_MODULE_NAME' to call the form in abap, is it the same in BSP??
    also if it is so i did not see the call in my forms. So is it possible to conver the OTF straight to PDF without calling the smartform . I knw its confusing but i have tried to put it as clear as i can.
    please ask me further questions if u feel the need.
    thanks in advance,
    Reena..

    hi
    good
    did you debug the program properly?
    did you see how the data flow from abap to bsp?
    did you check wheather there is any javascript they are using as the inteface between ABAP and BSP page ?
    go through this links, hope this ll give you the idea about Smartforms implementation in BSP.
    /people/thomas.jung3/blog/2004/09/20/bsp-in-action-kimball-international
    If you have any further query feel free to  mail me.
    Thanks
    mrutyun^

  • How to?? show smartform and generate pdf at the same time

    hi experts,
    how can i show the smartform and generate  a pdf at the same time?? i have a control parameter gtotf in X and i generate the pdf but i want to show the smartform at the same time??
    thx in advance

    Hi...
    call fm <sf function name>
    exporting...
    importing..
    tables..
    now in the outputparam set the getotf as 'X'.
    call the same FM again and get the otf data.
    call fm <sf fm name>

  • How to change font size in smartform and set layout of smartform

    Dear abapers,
                           I want to change font size in smartform and also set the layout of smart form how can we do this.
                                                 Thank you sir.

    Hi,
    you can do it first you need to goto smartforms tcode there click on radiobutton 'Style'.
    Give any name and click on create. Right sideyou can find character format right click on it and create a node .A pop will raise gve a 2 characterlike z1 or a1 etc click on font tab gve size and font style and click on save and activate. Use this style in your smartform you can apply what ever styles created in styles you can use it in your smartform by that smartstyle name.
    When we create text in output options give your smart style name and click on general attributes . Select your text and apply the style what thse size it should be and what the font style it should be.
    Goto smartforms tcode and select formpainter in application bar set layout according to your requirement.
    Thanks,
    venkat

  • How can we download a smartform and sapscripts under a transport request.

    hi abaper's
                   my requirement is that i have to download the transport request objects smartforms and sapscripts to do this i have to make a report, so that a person can run this report and enter the request number , then the objects  smartform and sapscripts download automatically for him.
    or is thr any standard report progrma available in sap system.
    thanks & regards
    pardeep kumar

    hi gopi
    what is this i can read only 1 here.

  • Standrad smartform and standard print program not available in ECC 6.0

    Hi gurus,
    I have a requirement like, I need to change the logo of the standrad smartform based on the company code.
    The standard smartform name is '/SMBUSE/US_MMGR3'.
    I have searched for the above form in ECC 6.0 and could not find one.
    is the issue because of installation or configuration?
    Please let me know what need to be installed or configured. so that I can give directions to the respective basis / functional guys.
    please let me know the standard print program for the above smartform and how can I find the same.
    Thanks & Regards
    Kiran Kumar K

    Hi ,
    No standard smartform's were available because SAP Best Practises was not installed in the system.
    If standard smarforms are not installed then in this case we need to need to download the forms and upload them in our system.
    We need to copy paste the standard print program's as well.
    Thanks & Regards,
    Kiran Kumar K

  • Regarding Smartforms and Print Programs in MM

    HI
    ALL
    I need to customise the all  the standard smartforms  Purchase Requisition , Purchase Order,Goods receipt,Goods issue,Goods return in MM .For this I need the standard smartforms and driven programs(Print Programs) for these . send me the smartforms and printprograms for these.
    Regards
    Venkat

    Hi,
      You can goto 'NACE' transaction and select the Required Application then Click on OUTPUT TYPES and select the required Output type and click on PROCESSING ROUTINES.
      In this way you can get the standard Smartforms.
    Hope this may be helpful,
    Regards,
    Sravanthi

  • Attaching smartform and print prog to invoice

    hi
    ive developed a smartform and a print program.
    da program has a selection screen dat asks user for doc number(vbeln).
    it den displays data in da smartform.
    now ive to attach it to va02.
    wen i attach it using v/40 output type(RD000)  program name : zinvoice and pdf/smartform: zinv .and try to get print preview using vf03 da preview doesnt appear.also wen i click on print it shows message "output cannot be issued".
    can ny1 suggest wat da problem is and how to resolve it...
    points 'll b rewarded.
    rgds

    first call the function module name using ssf_function module _name
    and then inluce  ur fm.
    as below.
    Reading the NAST and DOC structures
      CALL FUNCTION 'ME_READ_PO_FOR_PRINTING'
        EXPORTING
          ix_nast        = nast
          ix_screen      = ent_screen
        IMPORTING
          ex_retco       = ent_retco
          ex_nast        = l_nast
          doc            = l_doc
        CHANGING
          cx_druvo       = l_druvo
          cx_from_memory = l_from_memory.
      CHECK ent_retco EQ 0.
    SmartForm from customizing table TNAPR
      gv_formname = tnapr-sform.
    Calling the layout set
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = gv_formname
        IMPORTING
          fm_name            = gv_fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        PERFORM protocol_update.
      ENDIF.
    For Print output:
      IF nast-nacha = '1'.                  " Print output
        ls_control_param-preview =   'X'.
        ls_control_param-no_dialog = 'X'.
      ENDIF.
    For fax output.
      IF nast-nacha = '2'.                  " Fax
    Create the Recipient Object
        CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
          EXPORTING
            ip_country        = gv_land1
            ip_faxno          = gv_telfx
            ip_type_id        = lv_fax_tp
          IMPORTING
            ep_recipient_id   = ls_recipient_id
          EXCEPTIONS
            invalid_recipient = 1
            OTHERS            = 2.
        IF sy-subrc NE 0.
       IF write_out = 'X'.
          FORMAT COLOR 6.
          WRITE AT /5 text-004.
       ENDIF.
          RAISE other.
        ENDIF.
    Create The Sender Object
        CALL FUNCTION 'CREATE_SENDER_OBJECT_PPF'
          EXPORTING
            ip_sender      = sy-uname
          IMPORTING
            ep_sender_id   = ls_sender_id
          EXCEPTIONS
            invalid_sender = 1
            OTHERS         = 2.
        IF sy-subrc NE 0.
       IF write_out = 'X'.
          FORMAT COLOR 6.
          WRITE AT /5 text-003.
       ENDIF.
          RAISE other.
        ENDIF.
    Output options
        ls_output_options-tdteleland = gv_land1.
        ls_output_options-tdtelenum  = gv_telfx.
        ls_output_options-tdfaxuser  = sy-uname.
    Control parameters
        ls_control_param-device = lc_fax.
       ls_control_param-no_dialog = 'X'.
       ls_control_param-langu  = nast-tdspras.
      ENDIF.
      IF gv_fm_name IS NOT INITIAL.
    Below function module is used to show the Smart form
        CALL FUNCTION gv_fm_name
          EXPORTING
            is_nast            = l_nast
            doc                = l_doc
            control_parameters = ls_control_param
            output_options     = ls_output_options
            user_settings      = ' '
          EXCEPTIONS
            formatting_error   = 1
            internal_error     = 2
            send_error         = 3
            user_canceled      = 4
            OTHERS             = 5.
        IF sy-subrc <> 0.
    Error handling
          cf_retcode = sy-subrc.
          PERFORM protocol_update.
        ELSE.
        ENDIF.
      ENDIF.

  • Attaching smartforms and print prog to invoice

    hi
    ive developed a smartform and a print program.
    da program has a selection screen dat asks user for doc number(vbeln).
    it den displays data in da smartform.
    now ive to attach it to va02.
    wen i attach it using v/40 output type(RD000) program name : zinvoice and pdf/smartform: zinv .and try to get print preview using vf03 da preview doesnt appear.also wen i click on print it shows message "output cannot be issued".
    can ny1 suggest wat da problem is and how to resolve it...
    points 'll b rewarded...
    rgds
    Message was edited by:
            abapuser

    1.
    How did u assigned the output type in NACE.
    2.
    did u go through the form routines of data/transfer copy controls in VOFM .
    if its VA02 and VF02 then VTFA has to be used for the same in setting the output type .
    if option 2 is not ur case then check with ur functional consultant as to which requirement this output is configured in the nace and in procedures.
    o/p cannot be issued is not able to pick the output type for the form and the print program.
    This output type has to be configured in NACE first of all.
    Then to test the invoice enable this output type for that vbeln number in GOTo-_header->output -> and enable the output type.
    regards,
    vijay

  • Insert URL link into SMARTFORMS and retrive the picture linked to the URL

    Hi Guys,
    I have the following problem:
    I have a URL link and I want to set this link into the smartforms and
    I want to retrieve the picture linked to the URL and display the picture in the print.
    Is it possible?
    Thanks for your support.
    Best regards,
    Giulio

    Hi
    Check the Tcodes
    OAOR and
    SMW0
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Difference between smartforms and adobeform

    hi all,
    can you tell me what are the differences between smartforms and adobeform?
    Thanks,

    Search with your Subject line.

  • Idoc generation and reprint for smartforms and sapscripts

    Dear Experts,
    Currently our scenario is as below.
    We are using XML for all outputs. once IDOC is generated it is passed to XML port and print is issued.
    To reprint IDOC we have a customised program where in we can enter idoc number and print output.
    Now we are converting all to smartforms and at some places sapscript. So how to setup reprint for idocs in smartforms and  sapscript as it is done for sapscripts. Do we need to make some config in WE19 to issue smart forms and sapscripts.
    If possible please give all steps right from preparing structures till reprint.
    Can anyone help with detailed solutions.

    Closed as no answer received

  • Copying smartforms and sapcript-forms

    Hello!
    How can I copy smartforms and sapcript-forms  from one system to the other ?
    Ragards
    sas

    Hi,
    A smartform is transported no differently than any other object. if it is assigned to a development class that is atteched to a transport layer, it will be transported. 
    The definition is transported, and when called, the function module is regenerated. 
    This leads to an interetsing situation. On the new machine, it is very likely the function module name will be different than the name on the source system. Make sure, before you call the function module, you resolve the external name to the internal name using the 'SSF_FUNCTION_MODULE_NAME' function module. 
    Typically, generate the SF, then use the pattern to being in the interface. Then change the call function to use the name you get back from the above function module. 
    Regards,
    Bhaskar

  • Disadvantage of Smartform and Advantages of SAP script

    Good day Gurus.,,
    Can anyone please tell me the Advantages of SAP Script over Smartforms and
    Disadvantages of Smartforms over SAP script.
    Also is there any special scenario where only sapscript could be used but not Smartforms.
    Please enlighten me....
    Many thanks

    hi,
    Smartforms are came into picture in 4.6 version to overcome the disadvantages of scripts.
    Disadvantages of Scripts
    1.scripts are client dependent.
    2.we can't add colors in scripts.
    3.It is paragraph dependent.
    4.In this  main window is compulsory.
    5.mutiple page formats are not availble.
    6.we can't add background pictures.
    Adavantages of smartforms
    smartforms are advanced versions of sap scripts,
    1.smartforms are client independent.
    2.we can add colors in smartforms.
    3.It is not a paragraph dependent.
    4.In this  main window is not compulsory.
    5.mutiple page formats are possible.
    6.we can add background pictures.
    7. it will generate one function module when activating it.
    8. total code can be written in smartforms itself.
    sap scripts used to use in previous versions if they dont upgrate current version of sap then they have to use sap scripts because smartforms are not available in the previous versions.

  • What are Smartforms and SAPscripts?

    Hey Everyone,
    Where do we use Smartforms and SAPscripts...how to we create these...if u have step step procedures that will be helpful...
    Thanks in Advance...
    Cheers:
    Jim

    Smartform is client indep.
    Scripts is client dependent.
    Smartform will generate function module.
    Script will not.
    Tcode for scripts is se71
    Tcode for smartforms is smartforms
    go to sap library ............ their u can find the step by step procedure............
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can configure forms with data from an SAP System for the relevant business processes.
    Execute transaction SMARTFORMS to start SAP Smart Forms.
    Key Benefits of SAP Smart Forms:
    SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time. You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
    To make changes, use Drag & Drop, Copy & Paste, and select different attributes. These actions do not include writing of coding lines or using a Script language.
    Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one. For Web publishing, the system provides a generated XML output of the processed form. Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
    Example Forms Available in Standard SAP R/3
    SF_EXAMPLE_01
    Simple example; invoice with table output of flight booking for one customer
    SF_EXAMPLE_02
    Similar to SF_EXAMPLE_01 but with subtotals
    SF_EXAMPLE_03
    Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request.
    Also check this step by step procedure to create SMARTFORMS:
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Look through for example these links for details about Smart Forms:
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://esnips.com/doc/7e67af5c-6188-4252-8613-41816756d560/from-sappres.pdf
    http://esnips.com/doc/58566115-54a4-4405-8872-8de952e245e5/smartform.pdf
    http://esnips.com/doc/13b7ae7a-b32c-4b96-b588-881859d4ac99/Template,Table,Loop,Command-in-Smartforms.doc
    http://esnips.com/doc/97acb00a-e513-4611-91f0-c626f460bfc5/Smart_Form_Overview.pdf
    http://esnips.com/doc/77a981b9-8fe3-4fbb-8101-67745c1fe60c/SMART-FORMS_shail.ppt
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sapgenie.com/abap/smartforms_described.htm
    http://www.sapgenie.com/abap/smartforms_detail.htm
    http://www.sapgenie.com/abap/smartforms_sapscript.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SMARTFORMS_tutorial.html

Maybe you are looking for

  • Recovery from HD failure - how do I resync apps?

    Long story short - suffered a hd drive failure (not total, but pretty bad). I've replaced the drive, reinstalled all my stuff, now I'm trying to get my iPhone back up and running to get ready for the impending OS update and will be replacing with the

  • Printing with OS 9

    Help! i had to reinstall my system and lost all the settings for printing and am trying to print out of Classic onto an Epson R320. I can print out of OSX 3.7 but the printer doesn't show up when I go to the printer utility in 9 ( and try to set up p

  • Importing images

    Hi everyone I want to import a large number of images into a web page (not worried about databases, photo galleries etc, just the same as importing one image but many times). Is there any way I can say import all images in a folder or have a macro do

  • ADE reader defeats the purpose

    Have been trying to send feedback to Adobe for ADE but apparently Adobe isn't interested: ADE isn't included in the list of software in the feedback form. Am hoping that perhaps someone is listening in here. Here's my beef: I am a firm supporter of D

  • Putting caps on numbers in cells

    I'm making a spreadsheet for doing my own payroll. (I have just 1-2 part time staff, so I hate having to pay for a service.) Almost done, but I have one remaining bugaboo: In one catagory a tax is levied only on the first $7000 of income per employee