cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms

Former Member
0 Kudos

Hi,

I am trying to show personels information on smartform. So I have created smartforms and followed these steps.

-Created Copy window to paste personel's photo.

-Created text on main window to put personel's information.

The problem is how i can loop photos with different personels information.I mean each page should show me different personel's information.I hope i will find the answer here.

Regards.

Moderator message: please use a more descriptive subject line next time.

Edited by: Thomas Zloch on Sep 5, 2010 8:44 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mas,

I think you should use technique 'SSF_OPEN' and 'SSF_CLOSE' for this request, I will describe below:

1/ You need 2 tables: 1 table for personnel ID, picture.. we assume it's header. 1 table for item as your personnel information.

2/ You write code in your driver program before getting display in form:


data: fm_name type rs38l_fnam,
      control type ssfctrlop,
      errtab  type tsferror.

* get the name of the generated function module using the logical
* Smart Forms name
  call function 'SSF_FUNCTION_MODULE_NAME'
       exporting  formname           = p_form
*                 variant            = ' '
*                 direct_call        = ' '
       importing  fm_name            = fm_name
       exceptions no_form            = 1
                  no_function_module = 2
                  others             = 3.

  if sy-subrc <> 0.
*   error handling
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
  endif.
  call function 'SSF_OPEN'
    exporting
*     ARCHIVE_PARAMETERS       =
*     USER_SETTINGS            = 'X'
*     MAIL_SENDER              =
*     MAIL_RECIPIENT           =
*     MAIL_APPL_OBJ            =
*     OUTPUT_OPTIONS           =
      control_parameters       = control
*   IMPORTING
*     JOB_OUTPUT_OPTIONS       =
    exceptions
      formatting_error         = 1
      internal_error           = 2
      send_error               = 3
      user_canceled            = 4
      others                   = 5.

  if sy-subrc <> 0.
*   error handling
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
  endif.

* Loop through header and item table

LOOP t_header into wa_header.
* Fill table parameter you decide to pass to smartforms
* after that call your form

    call function fm_name
         exporting
*                   archive_index        =
*                   archive_parameters   =
                    control_parameters   = control
*                   mail_appl_obj        =
*                   mail_recipient       =
*                   mail_sender          =
*                   output_options       =
*                   user_settings        = 'X'
*        importing  document_output_info =
*                   job_output_info      =
*                   job_output_options   =
         exceptions formatting_error     = 1
                    internal_error       = 2
                    send_error           = 3
                    user_canceled        = 4
                    others               = 5.

    if sy-subrc <> 0.
*     error handling
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
ENDLOOP.

  call function 'SSF_CLOSE'
*   IMPORTING
*     JOB_OUTPUT_INFO        =
    exceptions
      formatting_error       = 1
      internal_error         = 2
      send_error             = 3
      others                 = 4.

  if sy-subrc <> 0.
*   error handling
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

* analyse internal error table of Smart Forms
  call function 'SSF_READ_ERRORS'
       importing
            errortab = errtab.
  if not errtab is initial.
*   add your handling
  endif.

You can get more by refer example report SF_EXAMPLE_03.

Please check.

good luck

Answers (0)