Skip to Content
author's profile photo Former Member
Former Member

smartform and acrobat output

Hi ,

Could any body tell me how to display the smartform output in acrobat as well.

Thanks

Santosh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2006 at 05:03 AM

    Please do NOT post the question in multiple forums, you have already posted this in the FORM printing forum

    smartform and acrobat output

    Regards,

    Ravi

    Note Please close this thread

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2006 at 05:04 AM

    Hi Santosh,

    You can just just print a smart form & that will generate a spool no. You can use that spool no as an input to the report RSTXPDFT4 to display the from in acrobat format.

    Regards,

    Chetan.

    PS: Reward points if you find this helpful.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Santosh,

      The spool no would be visible to you when you print the form @ the bottom of your window like you get standard messages. You can use the same as input to the report RSTXPDFT4.

      Do let me know if you have any other doubts.

      Regards,

      Chetan.

      PS: Reward points if this is helpful.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2006 at 05:12 AM

    Hi,

    Call this function module immediately after you get the output from your smart form function module.

    Your smartform function module will have an output parameter <b>job_output_info </b>

    this field is a nested internal table and contain a internal table <b>OTF_DATA</b>

    CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'

    TABLES

    otf_table = lt_otf_data (This table is the output from your smartform function module).

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi ,

      My call for smartforms is like this .Please explain how to pass the fn mod.

      HR_IT_DISPLAY_WITH_PDF with parameters

      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

      EXPORTING

      formname = 'ZHR_INCOMETAX'

      • VARIANT = ' '

      • DIRECT_CALL = ' '

      IMPORTING

      fm_name = formname

      • 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.

      CALL FUNCTION formname

      • EXPORTING

      • ARCHIVE_INDEX =

      • ARCHIVE_INDEX_TAB =

      • ARCHIVE_PARAMETERS =

      • CONTROL_PARAMETERS =

      • MAIL_APPL_OBJ =

      • MAIL_RECIPIENT =

      • MAIL_SENDER =

      • OUTPUT_OPTIONS =

      • USER_SETTINGS = 'X'

      • IMPORTING

      • DOCUMENT_OUTPUT_INFO =

      • JOB_OUTPUT_INFO =

      • JOB_OUTPUT_OPTIONS =

      TABLES

      i_output = i_output

      i_output_all = i_output_all

      • 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.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2006 at 05:35 AM

    Hi Santosh,

    <b>1.</b> In the smartform form function module make use of <b>JOB_OUTPUT_INFO</b> which is of type ssfcrescl.

    CALL FUNCTION <SMARTFORM_FUNC_NAME>

    EXPORTING

    control_parameters = ws_ctrlpara

    output_options = ws_opoption

    user_settings = 'X'

    IMPORTING

    <b> job_output_info = ws_opinfo</b>

    EXCEPTIONS

    formatting_error = 1

    internal_error = 2

    send_error = 3.

    After this your WS_OPINFO table gets populated with OTF output for smartform.

    <b>2.</b> Now pass <b>WS_OPINFO-OTFDATA[]</b> to function module

    <b>CONVERT_OTF_2_PDF</b>.

    This will convert OTF output to PDF form.

    CALL FUNCTION 'CONVERT_OTF_2_PDF'

    EXPORTING

    use_otf_mc_cmd = 'X'

    IMPORTING

    bin_filesize = wl_filesize

    TABLES

    otf = wi_otfdata

    doctab_archive = wi_docs

    <b> lines = WI_MTAB_PDF</b>

    EXCEPTIONS

    err_conv_not_possible = 1

    err_otf_mc_noendmarker = 2

    OTHERS = 3.

    Here <b>WI_MTAB_PDF</b> will contain pdf output which can be downloaded.

    WI_MTAB_PDF is declared LIKE tline OCCURS 0 WITH HEADER LINE.

    <b>3.</b> This WI_MTAB_PDF can now be downloaded in pdf format using GUI_DOWNLOAD function module.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    bin_filesize = wl_mi_bytecount

    filename = wl_mc_filename "Path where pdf file is to be downloaded

    <b> filetype = 'BIN'</b>

    TABLES

    <b> data_tab = WI_MTAB_PDF</b>

    EXCEPTIONS

    file_write_error = 1

    no_batch = 2

    gui_refuse_filetransfer = 3

    invalid_type = 4

    Hope this helps you ....

    Let me know if you nedd more inputs on this...

    Enjoy SAP.

    Pankaj Singh.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello pankaj,

      I need help from you.

      Just seen how you expalined about the control parameters.

      CALL FUNCTION 'CONVERT_OTF'

      EXPORTING

      FORMAT = c_format

      MAX_LINEWIDTH = 132

      IMPORTING

      BIN_FILESIZE = v_len_in

      TABLES

      OTF = i_otf

      LINES = i_tline "contains the pdf output that need to be ttanslated into pdf format

      EXCEPTIONS

      ERR_MAX_LINEWIDTH = 1

      ERR_FORMAT = 2

      ERR_CONV_NOT_POSSIBLE = 3

      OTHERS = 4.

      *-- if sy-subrc eq 0, conversion a success else a failure

      <b>*--conveting i_tline into pdf format to build the pdf attachment

      LOOP AT i_tline INTO wa_tline.

      TRANSLATE wa_tline USING '~'.

      CONCATENATE wa_buffer wa_tline INTO wa_buffer.

      ENDLOOP.

      TRANSLATE wa_buffer USING '~'.

      DO.

      wa_record = wa_buffer.

      APPEND wa_record TO i_record.

      SHIFT wa_buffer LEFT BY 255 PLACES.

      IF wa_buffer IS INITIAL.

      EXIT.

      ENDIF.

      ENDDO.

      *-- parameter to contain the pdf attachment

      i_objbin[] = i_record[].

      *-- Create Message Body Title and Description

      wa_objtxt = c_text1.

      APPEND wa_objtxt to i_objtxt .

      CLEAR wa_objtxt.

      wa_objtxt = c_text2.

      APPEND wa_objtxt to i_objtxt .

      CLEAR wa_objtxt.

      wa_objtxt = c_text3.

      APPEND wa_objtxt to i_objtxt .

      CLEAR wa_objtxt.

      wa_objtxt = c_text4.

      APPEND wa_objtxt to i_objtxt.

      CLEAR wa_objtxt.

      DESCRIBE TABLE i_objtxt LINES v_lines_txt.

      READ TABLE i_objtxt INDEX v_lines_txt INTO wa_objtxt.

      wa_doc_chng-obj_name = c_form_name.

      wa_doc_chng-expiry_dat = SY-DATUM + 10.

      wa_doc_chng-obj_descr = c_mail_desc.

      wa_doc_chng-sensitivty = c_mail_sens.

      wa_doc_chng-doc_size = v_lines_txt * 255.

      *-- creating Main Text

      CLEAR wa_objpack-transf_bin.

      wa_objpack-head_start = 1.

      wa_objpack-head_num = 0.

      wa_objpack-body_start = 1.

      wa_objpack-body_num = v_lines_txt.

      wa_objpack-doc_type = c_doc_type.

      APPEND wa_objpack TO i_objpack.

      *-- Attachment (pdf-Attachment)

      wa_objpack-TRANSF_BIN = c_set.

      wa_objpack-HEAD_START = 1.

      wa_objpack-HEAD_NUM = 0.

      wa_objpack-BODY_START = 1.

      DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.

      READ TABLE I_OBJBIN INDEX V_LINES_BIN INTO wa_objbin.

      *--filling in email addresses (list of receivers)

      wa_objpack-DOC_SIZE = v_lines_bin * 255 .

      wa_objpack-BODY_NUM = v_lines_bin.

      wa_objpack-doc_TYPE = c_format.

      wa_objpack-obj_name = c_form_name.

      wa_objpack-obj_descr = c_mail_desc.

      APPEND wa_objpack TO i_objpack.

      *--retrieving email addresses of the customer, so as to send the mail on each of the customer's eamil addr

      SELECT SINGLE smtp_addr

      INTO v_mail_addr

      FROM adr6

      WHERE addrnumber EQ wa_header_details-c_adrnr.

      *--if addr exists

      IF sy-subrc EQ 0.

      *--extract each address and put in in internal table i_reclist

      SPLIT v_mail_addr AT c_comma INTO TABLE i_reclist.

      *--set the parameter of recipient type for each email address of the customer

      LOOP AT i_reclist INTO wa_reclist.

      v_index = sy-tabix.

      wa_reclist-rec_type = c_recipient_type.

      MODIFY i_reclist INDEX v_index FROM wa_reclist.

      CLEAR wa_reclist.

      ENDLOOP.

      ENDIF.</b>*--sending document as attachment

      *--if any email addr exists

      IF i_reclist IS NOT INITIAL.

      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

      EXPORTING

      DOCUMENT_DATA = wa_doc_chng

      PUT_IN_OUTBOX = c_set

      COMMIT_WORK = c_set

      TABLES

      PACKING_LIST = i_objpack

      OBJECT_HEADER = wa_objhead

      CONTENTS_BIN = 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 EQ 0.

      *--if email is successfully sent, error message

      MESSAGE i001.

      ELSE.

      *--if email could not be sent, error message

      MESSAGE e002.

      ENDIF.

      ELSE.

      *-- if no email is present address , error message

      MESSAGE e004.

      ENDIF.

      ELSE.

      *--if no data is present to be in smartform.

      MESSAGE e003.

      ENDIF.

      Can you please try to explain to me what is actually happening in the code above (piece of code in bold characters.)?

      Thank you.

      In hope of getting a reply..

      Regards,

      Lina.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.