cancel
Showing results for 
Search instead for 
Did you mean: 

Printing Smartform

Former Member
0 Kudos

Hi Friends,

I have an immediate requirement to print the smartform.My output page has a link ,clicking that link will take me to a smartform.Now by pressing a button, the link displaying smartform should get printed.What are options available for printing the smartform?

With Regards,

SHARMILA BRINDHA.M

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member205763
Active Contributor
0 Kudos

just call the smartform fm

Former Member
0 Kudos

I need the name of the FM to print PDF.I.m having Smartform.Clicking the print button should print the PDF converted Smartform.

With Regards,

SHARMILA BRINDHA.M

Former Member
0 Kudos

Hi,

1. get the OTF table data from SF function module.

2. once u get the OTF table data just pass it to below FM

FORM convert_to_pdf.

CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'

EXPORTING

i_otf = otf_data1[]

EXCEPTIONS

acrobat_not_registered = 1

convert_otf_to_pdf_error = 2

download_error = 3

acrobat_not_started = 4

cntl_error = 5

OTHERS = 6.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM.

Regards,

Pavan

former_member205763
Active Contributor
0 Kudos

if u just need print why do u need it in pdf the output's gonna be same anyways but if u still wanna pdf follow the steps given by vishnu . It would give u pd3 preview with print button

Former Member
0 Kudos

Hi Friends,

Thanks a lot for your responses.But in my case smartform has generated(Standard).It is similar to that of a background process.I have designed a button named Print below a table which is having link in one of its columns.Clicking that link will take me to a smartform.Those things are now ok.Now clicking the print button in the front should print all the smartforms of the link in the table without displaying them.

So here PDF is genereted and I need to print it.

  CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
      i_language                   = ls_control_parameters-langu
*     i_application                = 'SAPDEFAULT'
    IMPORTING
      e_devtype                    = l_devtype
    EXCEPTIONS
      no_language                  = 1
      language_not_installed       = 2
      no_devtype_found             = 3
      system_error                 = 4
      OTHERS                       = 5.

    ls_output_options-tdimmed       = 'X'.
    ls_output_options-xsfcmode      = 'X'.
    ls_output_options-xsfoutmode    = 'S'.
    ls_output_options-xsfformat     = 'X'.
    ls_output_options-tdnewid       = 'X'.
    ls_output_options-tdsuffix1     = 'LOCL'.
    ls_output_options-tddest        = 'LOCL'.
    ls_control_parameters-preview   = space.
    ls_control_parameters-no_dialog = 'X'.
    ls_output_options-tdprinter = l_devtype.

      CALL FUNCTION me->sf_fm_name
        EXPORTING
          control_parameters = ls_control_parameters
          output_options     = ls_output_options
          user_settings      = space
          personaldata       = me->pers_data
          addressdata        = me->addr_data
          telephondata       = me->tele_data
          maildata           = me->mail_data
          desiredjob         = me->job_data
          desiredjobloc      = me->jobloc_data
          workexperience     = me->workexp_data
          education          = me->educ_data
          qualifications     = me->qual_data
          attachments        = me->attch_data
          applications       = me->appl_data
          cdcy_activities    = me->cdcy_activities_data
          cand_preview       = me->cand_preview
          cand_documents     = me->cand_docs
          cand_talent_group  = me->cand_tg
              IMPORTING
          job_output_info       = ls_job_output_info

In the otf part of ls_job_output_info-otf I'm getting the needed values

With Regards,

SHARMILA BRINDHA.M

Former Member
0 Kudos

Hi

When print button is clicked , call the dynamic function module for the smartform again passing the print parameters