cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Form printing witout dialog box

Former Member
0 Kudos

Hi Experts,

I want to print the smart form when i execute the print program witout any dialogbox asking for printer name or other details.

I am using the following code. By using this i am not getting any dialog box, but its not printing anything.

DATA wa_outputoption TYPE ssfcompop.

DATA wa_controlparameters TYPE ssfctrlop.

wa_outputoption-tddest = 'INFO' .

wa_outputoption-tdnoprev = 'x'.

wa_outputoption-tdimmed = 'X' .

wa_controlparameters-no_dialog = 'X' .

wa_controlparameters-no_open = 'X'.

wa_controlparameters-no_close = 'X'.

wa_controlparameters-device = 'PRINTER'.

CALL FUNCTION '/1BCDWB/SF00000116'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = wa_controlparameters

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • output_options = wa_outputoption

  • USER_SETTINGS = 'X'

v_whno = 'WN1'

v_sttyp = 'ND1'

v_plant = 'WN01'

v_invrec = '1068'

v_page = '3'

v_invdt = sy-datlo

  • 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

Please suggest a solution.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try changing these two values.


wa_outputoption-tdnoprev = space.
wa_controlparameters-no_dialog = space .

thx

pavan

Former Member
0 Kudos

Hi Pavan,

I tried with this but it's not working

Regards,

Pankaj

Answers (3)

Answers (3)

Former Member
0 Kudos

The following worked for me:

ls_control_param-device = 'PRINTER'.

ls_control_param-no_dialog = 'X'.

ls_control_param-preview = p_prevw. " 'X' or space

ls_control_param-langu = sy-langu.

ls_output_options-tddest = p_prntr. " 'LOCL'

ls_output_options-tdarmod = 1.

ls_output_options-tdreceiver = sy-uname.

Former Member
0 Kudos

hi pankaj,

it looks fine, u r passing correct parameters only but just try..

just pass these parameters:

DATA:  ST_CONTROL_PARAMETERS      TYPE SSFCTRLOP
  st_control_parameters-device     = 'PRINTER'. "Output device
 st_control_parameters-no_dialog  = 'X'.       "SAP Smart Forms: General Indicator

I am using the same, it is working fine,

can u plese tell wht exactly happening.. is the dialogue is displaying or smethig else. r u calling this from only once or many time base on any conditions check once..r u passing right values..

call this FM before calling samrtform because u will face problems in PRD and Quality.. if u r already then ignore this.

c_formname = 'xxxx ut form name'.
 v_fm_name is type rs38l_fnam.

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
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
control_parameters = wa_controlparameters
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* output_options = wa_outputoption
* USER_SETTINGS = 'X'
v_whno = 'WN1'
v_sttyp = 'ND1'
v_plant = 'WN01'
v_invrec = '1068'
v_page = '3'
v_invdt = sy-datlo
* 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

Former Member
0 Kudos

Hi,

You need to fill these options

control-preview = 'X'.
control-no_open = 'X'.
control-no_close = 'X'.
control-no_dialog = 'X'.
control-device = 'PRINTER'.
control_parameters-no_dialog = 'X'.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
OUTPUT_OPTIONS-TDDEST = 'PRINTER NAME'.
OUTPUT_OPTIONS-TDNOPRINT = 'X'.

Regards

Sudheer

Former Member
0 Kudos

Hi Sudheer,

You have mentioned theree work areas,

Control

Control_parameters

and OUTPUT_OPTIONS

but in the import parameters there is no structure by name control.

please tell me what is that.

Regards,

Pankaj