cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid popup dialog in smartforms

Former Member
0 Kudos

hi all,

i'm facing a problem, i want to avoid popup dialog in smartforms.

i have set structure SSFCTRLOP-no_dialog = 'X'. but it still show popup dialog. did i miss something?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

I had the same issue, no need to set device to PRINTER since the underlying function module will default that if blank.

On debugging the SMARTFORM function module.

It turns out that the parameter USER_SETTINGS defaults to 'X', which will display the printer dialog popup.

Changing this setting (USER_SETTING) to ' ' (SPACE) when calling the generated SMARTFORM function module as below then stopped the pop up appearing.

(The actual issue is that the destination specified was being overwritten with *, so it was looking to the users settings for a printer. Normally LOCAL PRINTER, changing the user_setting to ' ' keeps the printer specified and no need for the printer dialog popup)

* Get function module name
   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
     EXPORTING
       formname           = i_formname
     IMPORTING
       fm_name            = l_fm_name
     EXCEPTIONS
       no_form            = 1
       no_function_module = 2
       OTHERS             = 3.
   IF sy-subrc <> 0.
     CASE sy-subrc.
       WHEN 1.
         RAISE no_form.
       WHEN 2.
         RAISE no_function_module.
       WHEN OTHERS.
     ENDCASE.

   ENDIF.

  CALL FUNCTION l_fm_name
     EXPORTING
       control_parameters   = i_ctrl_params
       output_options       = i_output_opts
      user_settings        = ' '                                        <--- *** Set this to SPACE ***
       t_line_items         = it_trolley_items
     IMPORTING
       job_output_options   = l_job_output_options
     EXCEPTIONS
       formatting_error     = 1
       internal_error       = 2
       send_error           = 3
       user_canceled        = 4
       OTHERS               = 5.

This fixed the issue in my case, every case is different.

Hope this helps someone, even though this is posted long after the original question.

Thanks

Jodh Atwal

former_member569226
Participant
0 Kudos

Use the below code

REPORT ZK_SALESFORM.

TABLES:VBAP.

data: form_name type rs38l_fnam.

DATA: out_opt TYPE ssfcompop,

i_device TYPE ssfctrlop.

i_device-preview = 'X'.

i_device-no_dialog = 'X'.

i_device-device = 'PRINTER'.

out_opt-tdimmed = 'X'.

out_opt-tddelete = 'X'.

out_opt-tdimmed = ' '.

out_opt-tddest = 'LP01'.

parameter:l_vbeln like vbap-vbeln.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZK_SALES'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FORM_NAME

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

EXPORTING

control_parameters = i_device

output_options = out_opt

user_settings = space

Best Regards

Suresh

Former Member
0 Kudos

set no_dialogue as 'X'

and USER_SETTINGS = ' '.

Then it will directly show you the output.

Former Member
0 Kudos

Hi,

try this

CALL FUNCTION lf_fm_name

EXPORTING

user__settings = space_

EXCEPTIONS formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

IF sy-subrc <> 0.

pass user setting as sapce if u don't want dialog

Former Member
0 Kudos

Hi,

DATA : device TYPE ssfctrlop.

device-no_dialog = 'X'.

CALL FUNCTION ws_form_fname

EXPORTING

control_parameters = device

IMPORTING

job_output_info = ls_output_info

TABLES

i_final_ap = i_final_ap.

Pls. reward if useful.....

Former Member
0 Kudos

yeah that's what i'm trying to ask, i have done this, but still, popup dialog will appear

Former Member
0 Kudos

Hi,

But in your query you are assigned to directly structure.

Like SSFCTRLOP-no_dialog = 'X'.Any how paste that part of code here.

Former Member
0 Kudos

Thanks for the reply,

this is the code

DATA :

out_opt TYPE ssfcompop,

ctr_param TYPE ssfctrlop.

ctr_param-no_dialog = 'X'.

ctr_param-preview = space.

ctr_param-getotf = 'X'.

out_opt-tdnoprev = 'X'.

out_opt-tddest = 'LOCL'.

out_opt-tdprinter = 'PDF1'.

is there something that i miss?

Former Member
0 Kudos

Hi,

I have just tried this out and it works fine ON CONDITION that I have set the default device in my Username std. params (I have set "LOCL" logical device, and have checked the 2 checkboxes below it)

Then in ABAP, I used it like this.

DATA is_device TYPE ssfctrlop.

is_device-preview   = 'X'.
is_device-no_dialog = 'X'.

Later in Smartform call:

CALL FUNCTION fm_name
 EXPORTING
     control_parameters = is_device
     nalog            = nalog  "program specific data
   TABLES
      ztaboperacije    = ztaboperacije "program specific data
      zheader          = zheader "program specific data

Like this, I get the preview, without being asked in the std. dialog.

Regards,

SD

Former Member
0 Kudos

Hi,

You also need to set ctr_param-device to 'PRINTER'.

Regards,

Nick