Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue in SSF_OPEN

Former Member
0 Likes
1,544

Hello all,

I have a requirement for printing RANGE of documents which the user will put on selection screen.

I need to collect the OTF DATA and convert it in PDF format and send as email.

I am doing following steps.

CALL FUNCTION 'SSF_OPEN'

LOOP AT IT_DATA INTO WA_DATA.

CALL FUNCTION GV_FM_NAME

exporting

control_parameters = control

IMPORTING

job_output_info = p_job_output

ENDLOOP.

CALL FUNCTION 'SSF_CLOSE''

The issue is my OTFDATA table is blank.If i run these logic for a single document by removing SSF_OPEN and SSF_CLOSE and also not putting my logic in LOOP than it is working fine.

Kindly suggest how to proceed on the same.

Regards,

Arun Chaudhary

Hello all,

I have a requirement for printing RANGE of documents which the user will put on selection screen.

I need to collect the OTF DATA and convert it in PDF format and send as email.

I am doing following steps.

CALL FUNCTION 'SSF_OPEN'

LOOP AT IT_DATA INTO WA_DATA.

CALL FUNCTION GV_FM_NAME

exporting

control_parameters = control

IMPORTING

job_output_info = p_job_output

ENDLOOP.

CALL FUNCTION 'SSF_CLOSE''

The issue is my OTFDATA table is blank.If i run these logic for a single document by removing SSF_OPEN and SSF_CLOSE and also not putting my logic in LOOP than it is working fine.

Kindly suggest how to proceed on the same.

Regards,

Arun Chaudhary

4 REPLIES 4
Read only

former_member186491
Contributor
0 Likes
1,306

Hi Arun,

It seems that IT_DATA is not containing any data within it. You can check that using debugger.

Because, otherwise, you are stating it is running for one value and does not run when you put that in loop.

Just check that you may be flushing data from internal table before calling of the loop.

Thanks.

Kumar Saurav.

Read only

0 Likes
1,306

Hello Kumar,

The table has proper data.

The issue is when i use the FM SSF_OPEN only than the OTF DATA is coming as blank.

I am unable to understand the same.

Regards,

Arun

Read only

0 Likes
1,306

Why dont you try keeping the loop outside the SSF_OPEN instead of keeping after SSF_OPEN.

Like this:

LOOP.

SSF_OPEN

Call smartform.

SSF_CLOSE.

ENDLOOP.

Read only

Former Member
0 Likes
1,306

See the following example to store data into OTF


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname           = c_formname
  IMPORTING
    fm_name            = v_fm_name
  EXCEPTIONS
    no_form                    = 1
    no_function_module = 2
    OTHERS                    = 3.


CALL FUNCTION v_fm_name
  EXPORTING
    control_parameters       = st_control_parameters
    output_options              = st_output_options
  IMPORTING
    document_output_info  = st_document_output_info
    job_output_info            = st_job_output_info
    job_output_options      = st_job_output_options
  EXCEPTIONS
    formatting_error     = 1
    internal_error          = 2
    send_error              = 3
    user_canceled         = 4
    OTHERS                   = 5.


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.

*Convert into PDF
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.