‎2010 Dec 22 9:29 AM
Hello,
Is there any way to convert OTF data into Spool Request.
Actual scenario is for the Order Acknowledgement form they have configured the output type for Print Medium and here the spool is generated through Close_Form . Based on the spool no they are converting the spool to PDF and then placing a copy in the Unix Directory.
They have also configured the form for Fax Medium , but here in the close_form they are getting the Fax number instead of spool number. As this way it just Fax the output to required destination , user require a copy of the output should be converted to PDF and then it has to be placed in Unix directory as it is happening for print medium.
The problem here in the close form for first case , i can see the spool id but in the second case that is not happening . So only OTF data is available with me. So is there any way where i can pass OTF data get spool id . So that if i have spool id rest will be taken care by my existing logic.
I Appreciate your valuable inputs.
Thanks,
Subash
‎2010 Dec 22 9:37 AM
Hi
Use FM CONVERT_OTF to convert the OTF format to PDF doc. To this FM pass format as PDF in the Export paramet.
Thanks
‎2010 Dec 22 10:10 AM
Hi Reddy,
I have idea about convert_pdf , but my requirement is to convert it into spool. i need one spool number for the OTF data so that i can make use of it.
Thanks
subash
‎2010 Dec 22 10:42 AM
Check this code snippet.
data : it_spool TYPE STANDARD TABLE OF rsporq ,
it_pdf TYPE STANDARD TABLE OF tline ,
v_objtype TYPE rststype-type ,
v_name TYPE rststype-name .
*&---------------------------------------------------------------------*
*& Form find_spool_request_id
*&---------------------------------------------------------------------*
FORM find_spool_request_id.
CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
EXPORTING
allclients = '320'
datatype = '*'
has_output_requests = '*'
rq0name = nast-dsnam
rq1name = '*'
rq2name = '*'
rqdest = 'LOCL'
rqowner = sy-uname
TABLES
spoolrequests = it_spool
EXCEPTIONS
no_permission = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE i000 DISPLAY LIKE 'E' WITH text-002.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " find_spool_request_id
*&---------------------------------------------------------------------*
*& Form convert_spool_to_pdf
*&---------------------------------------------------------------------*
FORM convert_spool_to_pdf .
READ TABLE it_spool INTO wa_spool INDEX 1.
v_spoolno = wa_spool-rqident.
*Get Spool request attributes
SELECT SINGLE *
FROM tsp01
INTO tsp01
WHERE rqident EQ v_spoolno.
IF sy-subrc <> 0.
MESSAGE i000 DISPLAY LIKE 'E'
WITH text-003 v_spoolno text-034.
LEAVE LIST-PROCESSING.
ENDIF.
v_client = tsp01-rqclient.
v_name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = v_client
name = v_name
part = 1
IMPORTING
objtype = v_objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE i000(zz) DISPLAY LIKE 'E'
WITH text-003 v_spoolno text-034.
LEAVE LIST-PROCESSING.
ENDIF.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = v_spoolno
no_dialog = ' '
TABLES
pdf = it_pdf
EXCEPTIONS
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12
‎2010 Dec 22 12:58 PM
Print the OTF data using FM PRINT_OTF. You will get the Spool Id from export parameters.
‎2010 Dec 22 2:06 PM