on 01-18-2008 7:36 AM
Hi All,
I tried to convert smartform into PDF format . But i am not getting. Could you please tell anyone where excatly i did mistake?
waiting your reply asap.
award will be for correct ans.
Thanks
Edited by: sasmita parida on Jan 19, 2008 6:01 AM
pl send me u r mail_id i have some docu and example.hope that will be use for u .ok bye
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
This is the program to convert smartform output into pdf . Inputs to the prog are Purchase order number.It is for a specific requirement. Convert it to suit ur requirement.
&----
*& Report : ZPDF_FORMAT
*& Description : Conversion of Purchase Order into PDF format
*& used in the workflow (Do Not Change or Delete).
&----
REPORT zpdf .
&----
*& Tables used
&----
TABLES: nast, tsp01, t024, spop, lfa1, tnapr.
&----
*& Data declaration
&----
DATA: spoolno LIKE tsp01-rqident.
DATA: rcode LIKE sy-subrc.
*data: doc_auth like zoutput-ztag.
DATA: cancel.
DATA: pdf LIKE tline OCCURS 0 WITH HEADER LINE.
DATA: numbytes TYPE i,
pdfspoolid LIKE tsp01-rqident,
jobname LIKE tbtcjob-jobname,
jobcount LIKE tbtcjob-jobcount,
is_otf.
DATA: client LIKE tst01-dclient,
name LIKE tst01-dname,
objtype LIKE rststype-type,
type LIKE rststype-type.
DATA: dir_loc(3).
DATA: t_docno LIKE vbak-vbeln..
DATA: spoolreq1 LIKE tsp01sys.
DATA: spoolreq LIKE rsporq OCCURS 0 WITH HEADER LINE.
DATA: t_frgke LIKE ekko-frgke.
DATA: okcode(10),
flag,
t_ekgrp LIKE ekko-ekgrp,
t_lifnr LIKE ekko-lifnr,
s_mail.
Data Declartion for mailing system - Start.
DATA: objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
DATA: objhead LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: reclist1 LIKE somlreci1 OCCURS 500 WITH HEADER LINE.
DATA: reclist LIKE somlreci1 OCCURS 500 WITH HEADER LINE.
DATA: itab LIKE somlreci1 OCCURS 50 WITH HEADER LINE."RKU 220802
DATA: doc_chng LIKE sodocchgi1.
DATA: BEGIN OF bdcdata OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdcdata.
DATA: tab_lines LIKE sy-tabix.
DATA: verkf LIKE ekko-verkf.
DATA: bemail(250), vemail(250).
&----
Data acceptance
&----
SELECTION-SCREEN BEGIN OF BLOCK blk0_input WITH FRAME .
PARAMETERS: docno LIKE ekko-ebeln OBLIGATORY LOWER CASE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK blk0_input.
&----
Initialisation
&----
*initialization.
&----
Screen Parameters Validation
&----
*at selection-screen.
AT SELECTION-SCREEN.
SELECT SINGLE frgke INTO t_frgke FROM ekko
WHERE ebeln = docno
AND frgke = 'R'.
IF sy-subrc 0.
MESSAGE 'DOCUMENT NOT RELEASED' TYPE 'E'.
ENDIF.
&----
Execution Part
&----
START-OF-SELECTION.
For PO related operation
Dislay Buyer Group, Name and Email id
SELECT SINGLE
ekgrp
lifnr
verkf
INTO (t_ekgrp, t_lifnr, verkf)
FROM ekko
WHERE ekko~mandt = sy-mandt
AND ebeln = docno.
IF sy-subrc = 0.
SELECT SINGLE * FROM lfa1
WHERE lfa1~mandt = sy-mandt
AND lifnr = t_lifnr.
ENDIF.
Get message status from NAST or assign msg status NAST stru
Pass the message status and get spool data
PERFORM check_output_create_spool.
IF rcode NE 0.
IF rcode = 9.
message s185 with text-e04.
ELSE.
message s185 with text-e01.
ENDIF.
EXIT.
ENDIF.
find the spool
PERFORM find_spool_request_id.
IF sy-subrc 0.
message s185 with text-003.
EXIT.
ENDIF.
READ TABLE spoolreq
WITH KEY rq0name = nast-dsnam
rq1name = 'LP01'
rqclient = '800'
rq2name = sy-uname
rqowner = sy-uname.
IF sy-subrc 0.
CASE sy-subrc.
WHEN 1.
message s185 with text-e03.
WHEN OTHERS.
message s185 with text-e02.
ENDCASE.
EXIT.
ENDIF.
spoolno = spoolreq-rqident.
Convert SPOOL job to PDF
PERFORM convert_spool_to_pdf.
Send through mail
PERFORM assign_data_4_mail.
PERFORM send_mail_with_attachment.
Delete created spool request
spoolreq1-rqident = spoolno.
PERFORM delete_spool_job.
&----
*& Form check_output_create_spool
&----
text
-
--> p1 text
<-- p2 text
-
FORM check_output_create_spool.
SELECT SINGLE * FROM nast WHERE objky = docno
AND kappl = 'EF'
AND kschl = 'NEU'
AND aktiv = space
AND nacha = '1'.
IF sy-subrc EQ 0.
COUNT = COUNT + 1.
PERFORM mssage_status_field_value.
nast-vsztp = '4'.
PERFORM einzelnachricht_dialog(rsnast00) USING rcode.
ELSE.
CLEAR nast-uhrvr.
CLEAR nast-cmfpnr.
CLEAR nast-datvr.
PERFORM mssage_status_field_value.
nast-vsztp = '4'.
PERFORM einzelnachricht_dialog(rsnast00) USING rcode.
else.
rcode = 9.
ENDIF.
ENDFORM. " check_output_create_spool
&----
*& Form mssage_status_field_value
&----
text
-
--> p1 text
<-- p2 text
-
FORM mssage_status_field_value .
nast-mandt = '800'.
nast-kappl = 'EF'.
nast-kschl = 'NEU'.
nast-objky = docno.
nast-ldest = 'LP01'.
nast-anzal = 1.
nast-dimme = 'X'.
nast-delet = 'X'.
nast-nacha = '1'.
nast-vsztp = '2'.
nast-spras = 'E'.
nast-vstat = '0'.
nast-manue = 'X'.
nast-erdat = sy-datum.
nast-eruhr = sy-uzeit.
nast-usnam = sy-uname.
nast-tdreceiver = sy-uname.
concatenate sy-uzeit+2(4) 'PDF' into nast-dsnam.
ENDFORM. " mssage_status_field_value
&----
*& Form find_spool_request_id
&----
text
-
--> p1 text
<-- p2 text
-
FORM find_spool_request_id.
CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
EXPORTING
allclients = '800'
authority = ' '
datatype = '*'
has_output_requests = '*'
rq0name = nast-dsnam "'*'
rq1name = '*'
rq2name = '*'
rqdest = 'LP01'
rqident = 0
rqowner = sy-uname
TABLES
spoolrequests = spoolreq
EXCEPTIONS
no_permission = 1
OTHERS = 2.
ENDFORM. " find_spool_request_id
&----
*& Form convert_spool_to_pdf
&----
text
-
--> p1 text
<-- p2 text
-
FORM convert_spool_to_pdf.
SELECT SINGLE * FROM tsp01 WHERE rqident = spoolno.
IF sy-subrc <> 0.
WRITE: / 'Spool order does not exist'
COLOR COL_NEGATIVE.
EXIT.
ENDIF.
client = tsp01-rqclient.
name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = client
name = name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4.
IF objtype(3) = 'OTF'.
is_otf = 'X'.
ELSE.
is_otf = space.
ENDIF.
IF is_otf = 'X'.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spoolno
no_dialog = ' '
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
btc_jobname = jobname
btc_jobcount = jobcount
TABLES
pdf = 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.
if sy-subrc 0.
case sy-subrc.
when 1.
write: / text-001 color col_positive.
when 2.
write: / text-002 color col_negative.
exit.
when 3.
write: / text-003 color col_negative.
exit.
when 4.
write: / text-004 color col_negative.
exit.
when others.
write: / text-005 color col_negative.
exit.
endcase.
endif.
ELSE.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spoolno
no_dialog = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
LIST_PAGECOUNT =
btc_jobname = jobname
btc_jobcount = jobcount
TABLES
pdf = pdf
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 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.
case sy-subrc.
when 0.
*write: / 'Funktion CONVERT_ABAPSPOOLJOB_2_PDF erfolgreich
*(successful)'.
color col_positive.
when 1.
write: / text-001 color col_positive.
when 2.
write: / text-002 color col_negative.
exit.
when 3.
write: / text-003 color col_negative.
exit.
when 4.
write: / text-004 color col_negative.
exit.
when others.
write: / text-005 color col_negative.
exit.
endcase.
ENDIF.
ENDFORM. " convert_spool_to_pdf
&----
*& Form delete_spool_job
&----
text
-
--> p1 text
<-- p2 text
-
FORM delete_spool_job .
CALL FUNCTION 'RSPO_IDELETE_SPOOLREQ'
EXPORTING
spoolreq = spoolreq1
IMPORTING
RC =
STATUS =
EXCEPTIONS
error = 1
OTHERS = 2
.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " delete_spool_job
*
&----
*& Form ASSIGN_DATA_4_MAIL
&----
text
-
--> p1 text
<-- p2 text
-
FORM assign_data_4_mail .
Text content of the mail
move 'Purchase order: ' to objtxt.
append objtxt.
move verkf to objtxt.
append objtxt.
move lfa1-name1 to objtxt.
append objtxt.
concatenate lfa1-ort01 lfa1-pstlz
into objtxt separated by space.
append objtxt.
clear: objtxt.
append objtxt.
append objtxt.
*
CLEAR objtxt.
CONCATENATE 'Purchase Order - ' docno
' has been released.'
INTO objtxt SEPARATED BY space.
APPEND objtxt.
clear: objtxt.
append objtxt.
append objtxt.
*
MOVE ' ' TO objtxt.
APPEND objtxt.
clear: objtxt.
append objtxt.
append objtxt.
concatenate 'Note:- This is an automatic mail sender.'
' Please do not reply to this mail ID.'
into objtxt.
append objtxt.
concatenate
' Any query, please send the mail to the respective buyer'''
's mail id.' into objtxt.
append objtxt.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = docno
IMPORTING
output = docno.
TLINE format will be coverted as 255 char foramt
CALL FUNCTION 'QCE1_CONVERT'
TABLES
t_source_tab = pdf
t_target_tab = objbin
EXCEPTIONS
convert_not_possible = 1
OTHERS = 2.
DESCRIBE TABLE objtxt LINES tab_lines.
creation of the entry for the compressed document
CLEAR objpack.
objpack-transf_bin = ''.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
APPEND objpack.
creation of the entry for the Attachemnt
DESCRIBE TABLE objbin LINES tab_lines.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'PDF'.
CONCATENATE docno '.PDF' INTO objpack-obj_name.
objpack-obj_descr = objpack-obj_name.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
APPEND objpack.
For Object Header
CONCATENATE docno '.PDF' INTO objhead.
APPEND objhead.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
CONCATENATE 'Purchase Order - ' docno ' has been released'
INTO doc_chng-obj_descr.
doc_chng-obj_prio = 1.
recipient Details
CLEAR reclist1.
CLEAR reclist.
REFRESH reclist1.
REFRESH reclist.
SELECT SINGLE * FROM t024
WHERE t024~mandt = sy-mandt
AND ekgrp = t_ekgrp.
reclist1-receiver = t024-smtp_addr.
reclist1-rec_type = 'U'.
reclist1-com_type = 'INT'.
reclist1-receiver = 'mukundhan.kn@lntinfotech.com'.
modify table reclist transporting rec_type receiver COM_TYPE .
where rec_type is initial.
APPEND reclist1 TO reclist.
ENDFORM. " ASSIGN_DATA_4_MAIL
&----
*& Form send_mail_with_attachment
&----
text
-
--> p1 text
<-- p2 text
-
FORM send_mail_with_attachment.
sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
CASE sy-subrc.
WHEN 0.
PERFORM flush_mail.
message 'Mail sent successfully' type 'I'.
when 1.
message 'No authorization for sending to the specified number'
*type 'E'.
when 2.
message 'Document could not be sent to any recipient' type 'E'.
when 4.
message 'No send authorization' type 'E'.
when others.
message 'Error occurred while sending' type 'E'.
ENDCASE.
ENDFORM. " send_mail_with_attachment
-
Start new screen *
-
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "bdc_dynpro
-
Insert field *
-
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "bdc_field
&----
*& Form AUTOMATE
&----
text
-
--> p1 text
<-- p2 text
-
FORM flush_mail .
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PDIA'.
PERFORM bdc_dynpro USING 'SAPLSPO4' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FURT'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SVALD-VALUE(01)'.
PERFORM bdc_field USING 'SVALD-VALUE(01)'
'int'.
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
CALL TRANSACTION 'SCOT' USING bdcdata
MODE 'N'
UPDATE 'S'.
ENDFORM. " AUTOMATE
Plzz reward if it is useful...
for any further quiries contact me on sunilmutyala@aol.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sasmita,
You need to pass few parameters in the structure OUTPUT_OPTIONS.
And also try executing this code,hope it should give you the required output.
REPORT ZSMARTFORM_TYCO.
TABLES: equi , SSFCTRLOP.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i.
DATA: BEGIN OF I_equi OCCURS 0.
INCLUDE STRUCTURE equi.
DATA: END OF I_equi.
CONSTANTS: c_true TYPE c VALUE 'X'.
DATA: ds_jobout TYPE ssfcrescl.
Selection screen
SELECT-OPTIONS S_equnr FOR equi-equnr.
SELECT * FROM equi
WHERE equnr IN S_equnr.
MOVE-CORRESPONDING equi TO I_equi.
APPEND I_equi.
ENDSELECT.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTEST_TYCO'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = v_form_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF sy-subrc ne 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_ctrlop-preview = space.
w_compop-tdnoprev = c_true.
w_compop-tdnewid = c_true.
w_compop-tdimmed = space.
w_compop-tdnoprint = c_true.
CALL FUNCTION v_form_name
EXPORTING
CONTROL_PARAMETERS = w_ctrlop
OUTPUT_OPTIONS = w_compop
IMPORTING
JOB_OUTPUT_INFO = w_return
TABLES
i_equi = i_equi
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.
CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
EXPORTING
i_otf = w_return-otfdata
EXCEPTIONS
CONVERT_OTF_TO_PDF_ERROR = 1
CNTL_ERROR = 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.
Reward all helpful answers
Regards
Zarina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi sasmita,
what you did is ok, it has some updatons. do refer the below code to get those updates
data: FM_NAME TYPE RS38L_FNAM.
DATA:
W_BIN_FILESIZE TYPE I,
T_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
T_PDF_TAB TYPE TLINE OCCURS 0 WITH HEADER LINE,
W_FILESIZE TYPE I,
WA_CTRLOP TYPE SSFCTRLOP,
WA_OUTOPT TYPE SSFCOMPOP,
T_OTFDATA TYPE SSFCRESCL.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = ur form name
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_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.
WA_CTRLOP-GETOTF = 'X'.
WA_CTRLOP-NO_DIALOG = 'X'.
WA_OUTOPT-TDNOPREV = 'X'.
call function "the function module resulted for ur form"
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = WA_CTRLOP
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = WA_OUTOPT
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = T_OTFDATA
JOB_OUTPUT_OPTIONS =
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.
T_OTF[] = T_OTFDATA-OTFDATA[].
call function 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
IMPORTING
BIN_FILESIZE = W_BIN_FILESIZE
BIN_FILE =
tables
OTF = T_OTF
LINES = T_PDF_TAB
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 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.
call function 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_BIN_FILESIZE
CODEPAGE = ' '
FILENAME = 'D:\TEST11.PDF'
FILETYPE = 'BIN'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH = W_FILESIZE
tables
data_tab = T_PDF_TAB
FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
.
if sy-subrc = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
WRITE: / 'SUCCESSFULLY CONVERTED'.
endif.
hope this can help you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can do it by using either of the function modules:
1. CONVERT_OTF
2. CONVERT_OTFSPOOLJOB_2_PDF
3. CONVERT_OTF_2_PDF
Regards,
Renjith Michael.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
Add one new parameter:
1. PARAMETERS F_FILE TYPE RLGRAP-FILENAME.
give file name here which will store ur PDF data.
then after ur FM "CONVERT_OTF"
use another FM
F_FILE1 = F_FILE.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = lbin_fsiz
filename = F_FILE1
FILETYPE = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = LI_LINES
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
reward if helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.