on 02-06-2008 6:39 AM
Hi everybody
I need to send an smartform to spool and I have to indicate the spool name. On the other hand the smartforms shouldn't print immediately in an specifict printer and it shouldn't show any dialog
The calling to smartform . it made for each possition in a internal table and for that reason I work with control_parameters-no_open control_parameters-no_close.
Currently The printer's settings is:
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = gs_prm_prt
list_text = 'Contrato Equi'
immediately = ' '
line_size = 255 "I-@01JH
line_count = 58 "I-@11
layout = 'X_65_255' "I-@01JH
no_dialog = 'X'
IMPORTING out_archive_parameters = arc_params
out_parameters = params
valid = valid.
IF valid <> space.
NEW-PAGE PRINT ON
PARAMETERS params
ARCHIVE PARAMETERS arc_params NO DIALOG.
Endif.
On the other hand I don't wanna show any window and I work with : control_parameters-no_dialog = 'X'.
For each possition in the internal table I call to smanrtform like that :
CALL FUNCTION fm_name
EXPORTING
control_parameters = control_parameters
user_settings = ' '
gs_zkunnr = gs_zkunnr
gs_zsd_ndocum = gwa_esclidex-zsd_ndocum
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
When The process is out I work with the sentence NEW-PAGE PRINT OFF.
Each time I run the program It adds new information to spool but It doesn't show any name that It should appear
How can I do for each time that the program runs. It creates a new spool and it put the spool name ?
Hi,
The user which send the smartform to the spool (probably wf-batch) needs an output device. You can maintain this in SU01.
Just look at sample code:
1.Send Smart Form output to spool using the FM <ws_formname> (FM name derived from the export parameters of SSF_FUNCTION_MODULE_NAME).
//Start of Code Sample
DATA : ws_formname TYPE rs38l_fnam.
TYPES: BEGIN OF ty_script,
trans_ref LIKE eanl-anlage,
cont_ref TYPE e_edmideservprovcontractid,
trans_code TYPE char05,
trans_reason TYPE char05,
market_sect LIKE eanl-zzmktscode,
efffrm_date LIKE sy-datum,
mprn LIKE iflot-zzmprn,
mlc TYPE char01,
subbuild_no(40) TYPE c,
build_no LIKE adrc-str_suppl1,
dep_fare LIKE adrc-str_suppl3,
post_town LIKE adrc-city1,
post_code LIKE adrc-post_code1,
asset_code LIKE egerh-kombinat,
paymnt_code(2) TYPE c,
model_code LIKE equi-typbz,
manuf_code LIKE equi-herst,
year_manuf LIKE equi-baujj,
serial_no LIKE equi-sernr,
meter_code TYPE char01,
meter_mech(2) TYPE c,
meas_cap TYPE zmeasur_cap,
role_code TYPE char03,
market_name LIKE eservice-serviceid,
status TYPE char01,
END OF ty_script.
DATA: i_scriptdata TYPE STANDARD TABLE OF ty_script
WITH HEADER LINE.
DATA: wa_output_options TYPE ssfcompop,
wa_control_params TYPE ssfctrlop,
wa_spoolnum TYPE rspoid,
wa_printdata TYPE efg_strn_printdata.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Your Form Name'
IMPORTING
fm_name = ws_formname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION ws_formname
EXPORTING
control_parameters = wa_control_params
c = wa_printdata
IMPORTING
job_output_info = wa_job_output_info
TABLES
i_scriptdata_input = i_scriptdata(Your Script Data)
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
MOVE wa_job_output_info-spoolids[] TO wa_spoolids[].
READ TABLE wa_spoolids INTO wa_spoolnum INDEX 1.
IF sy-subrc = 0.
DATA :id LIKE tsp01-rqident.
MOVE wa_spoolnum TO id.
ENDIF. .
Comments-Id Contains the Spool Request for the given smart form
//End of Code Sample
Convert Smart Form Output to Raw
Format
2.Convert the Spool Output to OTF using the FM RSPO_RETURN_SPOOLJOB.
//Start of Code Sample
data i_soli LIKE soli occurs 0 with header line.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = id
desired_type = 'OTF'
TABLES
buffer = i_soli
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
Comments- i_soli contains the OTF data
//End of Code Sample
3.Convert the OTF using FM
SX_OBJECT_CONVERT_OTF_RAW.
DATA content_bin TYPE solix_tab.
DATA objhead TYPE soli_tab.
DATA i_soli_tab TYPE soli_tab.
DATA boolean TYPE sx_boolean.
DATA length TYPE so_obj_len.
LOOP AT i_soli.
APPEND i_soli TO i_soli_tab[].
ENDLOOP.
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_RAW'
EXPORTING
format_src = 'OTF'
format_dst = 'RAW'
CHANGING
transfer_bin = boolean
content_txt = i_soli_tab
content_bin = content_bin
objhead = objhead
len = length
Convert Smart Form Output to Raw
Format
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
THANKS
and please give points if useful
Edited by: Abhishek Ojha on Feb 6, 2008 8:07 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.