on 02-11-2008 6:01 AM
HI experts,
how to create the spool request for smartform. can anyone help me. give me the complete procedure.
thanks in advance for ur responce.
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.
REward points if useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello mytri,
Execute the smartform directly
at the OUTPUT Device : LP01.
Then print preview--> smartform displayed
Then Menu Goto---> PDF Preview(click)
It displays like PDF View
Then Menu Text--->print(click)
Spool number generated
Then goto se38 run the program : RSTXPDFT4
Give the spool number and execute.
thank you
sudhakar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank u very much for ur valuble answres.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the program gives an output, then you will have spool request generated when executed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
After getting the print preview of the smartfrom
goto TEXT ---> PRINT
Buttom of the page one spool request will be generated by system
You can use that spool no in RSTXPDFT4 program to generate the PDF file for your smartform.
Reward if it makes any sense to you
Thanks
Krushna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You have to use the function modules
JOB_OPEN , JOB_SUBMIT, JOB_CLOSE.
try this FM "RSPO_OPEN_SPOOLREQUEST".
or check if this can serve ur purpose ( Without using BDC )
SUBMIT rep ... TO SAP-SPOOL. ( See SAP help )
or u can see for full help see this link:
[http://help.sap.com/saphelp_nw04/helpdata/en/fa/096d4d543b11d1898e0000e8322d00/frameset.htm]
Thanks And please Reward points
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.