Print form in PDF
Hi experts. I have a task with prd form. I need to display data in the pdf form. But I don't know the number of columns, it will be depend on the data. It can be 10 or 20, I don't know. Each page have to have header and footer with number of page. Do you know how to realize this task.
You can output your report into a spool then capture the spool and convert it to a pdf file which you can download. Please see code below.
*-- Setup the Print Parmaters
call function 'GET_PRINT_PARAMETERS'
exporting
authority = space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
in_archive_parameters = space
in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog = 'X'
user = sy-uname
importing
out_parameters = mstr_print_parms
valid = mc_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
*-- Find out the spool number
perform get_spool_number using sy-repid
sy-uname
changing mi_rqident.
*-- Convert Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = mi_rqident
no_dialog = space
dst_device = mstr_print_parms-pdest
importing
pdf_bytecount = mi_bytecount
tables
pdf = mtab_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
others = 12.
*-- Download the file
call function 'DOWNLOAD'
exporting
bin_filesize = mi_bytecount
filename = mc_filename
filetype = 'BIN'
importing
act_filename = mc_filename
tables
data_tab = mtab_pdf.
Similar Messages
-
How to print form into pdf format using smart forms in abap
please let me know how to print form into pdf format using smart forms in abap.
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on Mar 25, 2011 2:04 PMHi ,
refer this link
<removed by moderator>
Regards,
Dhina..
Moderator message: please do not reply to questions that violate forum rules.
Edited by: Thomas Zloch on Mar 25, 2011 2:04 PM -
hi,
i want to print the form i created in sapscript. how to do that? need to save the form into pdf format and then print it.
please advise.
thanks.Hi
This is my routine used to generate a pdf file from print, u need only to get the OTF data from CLOSE_FORM fm:
CALL FUNCTION 'CLOSE_FORM'
TABLES
OTFDATA = T_OTF
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE I208(00) WITH 'Errore chiusura stampa'(A02).
ELSE.
PERFORM DOWNLOAD_PDF.
ENDIF.
FORM DOWNLOAD_PDF.
DATA: BIN_FILESIZE TYPE I.
DATA: T_FILE_PDF TYPE STANDARD TABLE OF TLINE,
DOCTAB_ARCHIVE TYPE STANDARD TABLE OF DOCS.
DATA: FILE_TABLE TYPE FILETABLE WITH HEADER LINE.
DATA: RC TYPE I,
USER_ACTION TYPE I.
DATA: TITLE TYPE STRING,
FILENAME TYPE STRING.
CHECK P_PDF = 'X'.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
BIN_FILESIZE = BIN_FILESIZE
TABLES
OTF = T_OTF
DOCTAB_ARCHIVE = DOCTAB_ARCHIVE
LINES = T_FILE_PDF
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE I208(00) WITH 'Errore conversione PDF'(A03).
EXIT.
ENDIF.
TITLE = 'Creare File'(T02).
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = TITLE
DEFAULT_EXTENSION = '*.pdf'
CHANGING
FILE_TABLE = FILE_TABLE[]
RC = RC
USER_ACTION = USER_ACTION
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE I208(00) WITH 'Errore creazione PDF'(A04).
EXIT.
ELSE.
IF USER_ACTION = 9. EXIT. ENDIF.
IF RC = 1.
READ TABLE FILE_TABLE INDEX 1.
ENDIF.
ENDIF.
MOVE FILE_TABLE-FILENAME TO FILENAME.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
EXPORTING
BIN_FILESIZE = BIN_FILESIZE
FILENAME = FILENAME
FILETYPE = 'BIN'
CHANGING
DATA_TAB = T_FILE_PDF
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 I208(00) WITH 'Errore creazione PDF'(A04).
EXIT.
ELSE.
MESSAGE S208(00) WITH 'File creato con successo'(S01).
ENDIF.
CHECK P_OPEN = 'X'.
CALL FUNCTION 'CALL_BROWSER'
EXPORTING
URL = FILE_TABLE-FILENAME
EXCEPTIONS
FRONTEND_NOT_SUPPORTED = 1
FRONTEND_ERROR = 2
PROG_NOT_FOUND = 3
NO_BATCH = 4
UNSPECIFIED_ERROR = 5
OTHERS = 6.
IF SY-SUBRC <> 0.
MESSAGE S208(00) WITH 'Impossibile aprire file'(A05).
ENDIF.
ENDFORM. " DOWNLOAD_PDF
Max -
Printing from APEX onto pre printed forms - not PDF
Hi
What is the best solution within APEX for printing. I am looking to print out data within an interactive report record onto a piece of pre printed stationary. So fields from the database will need to be positioned on certain positions on the print out
How can this be achieved? I have seen examples generating a PDF but I do not want a PDF to be generated or stored when the page has been printed.Or Oracle Reports as a cheaper option, if your infrastructure is suitable.
Done that for pre-printed forms before - pixel perfect, just not for APEX. But it's easy to call Oracle Reports from APEX. -
Smartforms: How 2 fire print & download 2 PDF simultaniously 4 my forms
Dear Murugesh, Cristian
The following is my piece of code which directly downloads my forms into PDF but not creating any spool 4 firing print ,
1) I need the both to happen simultaniously .
2) I need to include the o/p(either SAPScript/report o/p) as the Smartform pages with o/p of my Driver prog ,by calling another TCODE from my driver prog .
Please throw some light on this .
have a look into my code
*Printing of Export Invoice, Packing List,Enclosure to Packing List & *
*Case Marking in one SMART FORMS Layout *
REPORT ZSD_REP_MULTI_PRINT.
TABLES :
vbak,
vbap,
vbpa,
vbfa,
VBRK,
VBRP,
LIKP,
LIPS,
KONV,
objk,
tvko,
ser01,
sadr,
equi,
makt,
mast,
t005t,
kna1,
t001w,
T001,
ADRC,
sscrfields,
zpp_plcmi, "Packing list history For Conf: Item data
zplh, "PACKING LIST HISTORY : HEADER DATA
zpli. "PACKING LIST HISTORY : ITEM DATA
DATA: FM_NAME1 TYPE RS38L_FNAM,
FM_NAME2 TYPE RS38L_FNAM,
FM_NAME3 TYPE RS38L_FNAM,
FM_NAME4 TYPE RS38L_FNAM,
P_E_DEVTYPE TYPE RSPOPTYPE,
P_JOB_OUTPUT_INFO TYPE SSFCRESCL OCCURS 2000 WITH HEADER LINE,
T_OTF LIKE ITCOO OCCURS 0 WITH HEADER LINE,
P_OUTPUT_OPTIONS TYPE SSFCOMPOP OCCURS 0 WITH HEADER LINE,
P_CONTROL_PARAMETERS TYPE SSFCTRLOP OCCURS 0 WITH HEADER LINE ,
P_DOC LIKE DOCS OCCURS 2000 WITH HEADER LINE,
P_LINES LIKE TLINE OCCURS 200,
P_BIN_FILESIZE TYPE I,
P_LANGUAGE TYPE SFLANGU,
P_BIN_FILE TYPE XSTRING,
OK_CODE LIKE SY-UCOMM.
DATA: T_ITEM TYPE ZSD_TABL_LITEM,
WA_ITEM TYPE ZSD_STRUCT_LITEM,
T_ADRS LIKE ZSD_STRUCT_ADRS OCCURS 0 WITH HEADER LINE,
MSLINES LIKE TLINE OCCURS 1 WITH HEADER LINE,
TIDNO LIKE STXL-TDID,
TNAME LIKE STXL-TDNAME,
TOBJT LIKE STXL-TDOBJECT,
SSORD LIKE VBAK-VBELN,
TOT LIKE VBAK-NETWR,
WORD LIKE SPELL.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: P_DELNO LIKE LIKP-VBELN OBLIGATORY,
P_INVNO LIKE VBRK-VBELN OBLIGATORY,
P_DATE LIKE SY-DATUM.
SELECTION-SCREEN END OF BLOCK blk1.
AT SELECTION-SCREEN.
CLEAR T_ADRS.
REFRESH T_ITEM.
T_ADRS-INVNO = P_INVNO.
T_ADRS-INVDAT = P_DATE.
SELECT SINGLE VBELV INTO VBFA-VBELV
FROM VBFA
WHERE VBELN = P_DELNO
AND VBTYP_N = 'J' .
SSORD = VBFA-VBELV.
*Exporter's Address
SELECT SINGLE BUKRS_VF INTO VBAK-BUKRS_VF
FROM VBAK
WHERE VBELN = VBFA-VBELV.
SELECT SINGLE ADRNR
INTO T001-ADRNR
FROM T001
WHERE BUKRS = VBAK-BUKRS_VF.
SELECT SINGLE NAME1 STREET CITY1 POST_CODE1 COUNTRY
INTO (T_ADRS-NAME1,T_ADRS-STREET,T_ADRS-CITY1,
T_ADRS-POST_CODE1, ADRC-COUNTRY)
FROM ADRC
WHERE ADDRNUMBER EQ T001-ADRNR.
SELECT SINGLE LANDX
INTO T_ADRS-COUNTRY
FROM T005T
WHERE SPRAS = 'EN'
AND LAND1 = ADRC-COUNTRY.
*Consignee Address & Buyer Other Than Consignee
SELECT SINGLE KUNNR KUNAG INTO (LIKP-KUNNR, LIKP-KUNAG)
FROM LIKP WHERE VBELN = P_DELNO.
IF LIKP-KUNNR = LIKP-KUNAG.
SELECT SINGLE NAME1 NAME2 STRAS ORT01 PSTLZ REGIO TELF1 ADRNR
INTO (T_ADRS-CNAME1, T_ADRS-CNAME2, T_ADRS-CSTREET,
T_ADRS-CCITY, T_ADRS-CPCODE, T_ADRS-CREGIO,
T_ADRS-CTELF1, KNA1-ADRNR)
FROM KNA1
WHERE KUNNR = LIKP-KUNNR.
SELECT SINGLE COUNTRY INTO ADRC-COUNTRY
FROM ADRC
WHERE ADDRNUMBER EQ KNA1-ADRNR.
SELECT SINGLE LANDX
INTO T_ADRS-CCOUNTRY
FROM T005T
WHERE SPRAS = 'EN'
AND LAND1 = ADRC-COUNTRY.
T_ADRS-ONAME1 = T_ADRS-CNAME1 .
T_ADRS-ONAME2 = T_ADRS-CNAME2 .
T_ADRS-OSTREET = T_ADRS-CSTREET .
T_ADRS-OCITY = T_ADRS-CCITY.
T_ADRS-OPCODE = T_ADRS-CPCODE .
T_ADRS-OREGIO = T_ADRS-CREGIO.
T_ADRS-OTELF1 = T_ADRS-CTELF1 .
T_ADRS-OCOUNTRY = T_ADRS-CCOUNTRY.
ELSE.
SELECT SINGLE NAME1 NAME2 STRAS ORT01 PSTLZ REGIO TELF1 ADRNR
INTO (T_ADRS-CNAME1, T_ADRS-CNAME2, T_ADRS-CSTREET,
T_ADRS-CCITY, T_ADRS-CPCODE, T_ADRS-CREGIO,
T_ADRS-CTELF1, KNA1-ADRNR)
FROM KNA1
WHERE KUNNR = LIKP-KUNNR.
SELECT SINGLE COUNTRY INTO ADRC-COUNTRY
FROM ADRC
WHERE ADDRNUMBER EQ KNA1-ADRNR.
SELECT SINGLE LANDX
INTO T_ADRS-CCOUNTRY
FROM T005T
WHERE SPRAS = 'EN'
AND LAND1 = ADRC-COUNTRY.
*Buyer Other than Consignee
SELECT SINGLE NAME1 NAME2 STRAS ORT01 PSTLZ REGIO TELF1 ADRNR
INTO (T_ADRS-ONAME1, T_ADRS-ONAME2, T_ADRS-OSTREET,
T_ADRS-OCITY, T_ADRS-OPCODE, T_ADRS-OREGIO,
T_ADRS-OTELF1, KNA1-ADRNR)
FROM KNA1
WHERE KUNNR = LIKP-KUNAG.
SELECT SINGLE COUNTRY INTO ADRC-COUNTRY
FROM ADRC
WHERE ADDRNUMBER EQ KNA1-ADRNR.
SELECT SINGLE LANDX
INTO T_ADRS-OCOUNTRY
FROM T005T
WHERE SPRAS = 'EN'
AND LAND1 = ADRC-COUNTRY.
ENDIF.
*Other's Ref
TIDNO = 'Z071'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-OREF = mslines-tdline(25).
EXIT.
ENDLOOP.
*Buyer's Order No Ref
TIDNO = 'Z023'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-BUYER = mslines-tdline(25).
EXIT.
ENDLOOP.
*Exporter Ref
TIDNO = 'Z072'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-XPREF = mslines-tdline(25).
EXIT.
ENDLOOP.
*Pre-Carraige By
TIDNO = 'Z074'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-PCRG = mslines-tdline(25).
EXIT.
ENDLOOP.
*Place Of reciept by Pre-Carraige
TIDNO = 'Z073'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-PLPCRG = mslines-tdline(25).
EXIT.
ENDLOOP.
*Vessel/Flight No
TIDNO = 'Z075'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-VFNO = mslines-tdline(25).
EXIT.
ENDLOOP.
*Port Of Loading
TIDNO = 'Z077'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-PLOAD = mslines-tdline(25).
EXIT.
ENDLOOP.
*Port Of Discharge
TIDNO = 'Z076'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-PDISG = mslines-tdline(25).
EXIT.
ENDLOOP.
*Final Destination
TIDNO = 'Z070'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-FDEST = mslines-tdline(25).
EXIT.
ENDLOOP.
*Terms Of Delivery & Payment
TIDNO = 'Z080'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-TERMS = mslines-tdline(50).
EXIT.
ENDLOOP.
APPEND T_ADRS.
*BODY SECTION FOR LINE ITEMS
SELECT POSNR KWMENG VRKME WAERK
INTO (VBAP-POSNR, VBAP-KWMENG, VBAP-VRKME, VBAP-WAERK)
FROM VBAP
WHERE VBELN = SSORD.
*Mark/Case No
TIDNO = '0002'.
CONCATENATE SSORD
VBAP-POSNR
INTO TNAME.
TOBJT = 'VBBP'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
WA_ITEM-MARKNO = mslines-tdline(40).
EXIT.
ENDLOOP.
*Packing Type
TIDNO = '0003'.
CONCATENATE SSORD
VBAP-POSNR
INTO TNAME.
TOBJT = 'VBBP'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
WA_ITEM-PACKTYP = mslines-tdline(40).
EXIT.
ENDLOOP.
*Goods Description
TIDNO = '0001'.
CONCATENATE SSORD
VBAP-POSNR
INTO TNAME.
TOBJT = 'VBBP'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
WA_ITEM-GDESC = mslines-tdline(40).
EXIT.
ENDLOOP.
*Goods Quantity
WA_ITEM-QTY = VBAP-KWMENG.
WA_ITEM-VRKME = VBAP-VRKME.
*Goods Rate
SELECT SINGLE KNUMV INTO VBAK-KNUMV FROM VBAK WHERE VBELN = SSORD.
SELECT SINGLE KBETR WAERS
INTO (WA_ITEM-RATE, WA_ITEM-WAERS)
FROM KONV
WHERE KNUMV = VBAK-KNUMV
AND KPOSN = VBAP-POSNR
AND KSCHL = 'PR00'.
*Item Remarks
TIDNO = 'ZREM'.
CONCATENATE SSORD
VBAP-POSNR
INTO TNAME.
TOBJT = 'VBBP'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
WA_ITEM-REMARK = mslines-tdline(40).
EXIT.
ENDLOOP.
*Goods Amount
WA_ITEM-AMOUNT = WA_ITEM-QTY * WA_ITEM-RATE.
WA_ITEM-WAERK = VBAP-WAERK.
TOT = TOT + WA_ITEM-AMOUNT.
APPEND WA_ITEM TO T_ITEM.
ENDSELECT.
T_ADRS-TOT = TOT.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = TOT
CURRENCY = VBAP-WAERK
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = WORD
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 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.
*Gross Wieght
TIDNO = 'Z078'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-GWT = mslines-tdline(15).
EXIT.
ENDLOOP.
*Net Wieght
TIDNO = 'Z079'.
TNAME = SSORD.
TOBJT = 'VBBK'.
PERFORM FINDTEXT.
LOOP AT MSLINES.
T_ADRS-NWT = mslines-tdline(15).
EXIT.
ENDLOOP.
T_ADRS-TOT_WORDS = WORD-WORD.
APPEND T_ADRS.
START-OF-SELECTION.
P_LANGUAGE = 'EN'.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
I_LANGUAGE = P_LANGUAGE
I_APPLICATION = 'SAPDEFAULT'
IMPORTING
E_DEVTYPE = P_E_DEVTYPE.
P_OUTPUT_OPTIONS-XSFCMODE = 'X'.
P_OUTPUT_OPTIONS-XSF = SPACE.
P_OUTPUT_OPTIONS-XDFCMODE = 'X'.
P_OUTPUT_OPTIONS-XDF = SPACE.
P_OUTPUT_OPTIONS-TDPRINTER = P_E_DEVTYPE.
P_OUTPUT_OPTIONS-TDDEST = 'LOHP'.
APPEND P_OUTPUT_OPTIONS.
P_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
P_CONTROL_PARAMETERS-GETOTF = 'X'.
P_CONTROL_PARAMETERS-NO_CLOSE = SPACE.
APPEND P_CONTROL_PARAMETERS.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSD_REP_MULTI_PRINT1'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME1
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.
CALL FUNCTION FM_NAME1
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = P_CONTROL_PARAMETERS
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = P_OUTPUT_OPTIONS
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = P_JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS =
TABLES
T_ADRS = T_ADRS
T_ITEM = T_ITEM
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.
LOOP AT P_JOB_OUTPUT_INFO-OTFDATA INTO T_OTF.
APPEND T_OTF.
ENDLOOP.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSD_REP_MULTI_PRINT2'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME2
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.
CALL FUNCTION FM_NAME2
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = P_CONTROL_PARAMETERS
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = P_OUTPUT_OPTIONS
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = P_JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS =
TABLES
T_ADRS = T_ADRS
T_ITEM = T_ITEM
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.
LOOP AT P_JOB_OUTPUT_INFO-OTFDATA INTO T_OTF.
APPEND T_OTF.
ENDLOOP.
<b>SET PARAMETER ID: 'AUN' FIELD SSORD ,"VBAK-VBELN VALUE ,
'APO' FIELD ITNO."VBAP-POSNR.
CALL TRANSACTION 'ZPL3' AND SKIP FIRST SCREEN.
IF SY-SUBRC NE 0.
MESSAGE E001(ZQOTBANK).
ENDIF.
*SET PARAMETER ID: 'AUN' FIELD VBAK-VBELN,
'APO' FIELD VBAP-POSNR.
*CALL TRANSACTION 'ZA3C' AND SKIP FIRST SCREEN.
*IF SY-SUBRC NE 0.
MESSAGE E001(ZQOTBANK).
*ENDIF.
IMPORT (T_OTF2) FROM MEMORY ID 'MEMID'.
LOOP AT T_OTF2 INTO T_OTF2.
APPEND T_OTF2 TO T_OTF.
ENDLOOP.
</b>
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSD_REP_MULTI_PRINT4'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME4
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.
CALL FUNCTION FM_NAME4
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = P_CONTROL_PARAMETERS
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = P_OUTPUT_OPTIONS
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = P_JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS =
TABLES
T_ADRS = T_ADRS
T_ITEM = T_ITEM
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.
LOOP AT P_JOB_OUTPUT_INFO-OTFDATA INTO T_OTF.
APPEND T_OTF.
ENDLOOP.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
USE_OTF_MC_CMD = 'X'
ARCHIVE_INDEX =
IMPORTING
BIN_FILESIZE = P_BIN_FILESIZE
TABLES
OTF = T_OTF
DOCTAB_ARCHIVE = P_DOC
LINES = P_LINES
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 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.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = P_BIN_FILESIZE
FILENAME = 'C:\SD4.pdf'
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'
IMPORTING
FILELENGTH = P_BIN_FILESIZE
TABLES
DATA_TAB = P_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.
*& Form FINDTEXT
text
FORM FINDTEXT.
REFRESH mslines.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = tidno
language = sy-langu
name = tname
object = tobjt
TABLES
lines = mslines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
DELETE mslines WHERE tdline IS INITIAL.
ENDFORM. "FINDTEXT
Thnx
moni
Message was edited by: md monirujjaman
Message was edited by: md monirujjamanHello,
I had thought that your 4th output of the Transaction is an output of a list and NOT from a SCRIPT.
Now, if it is a SAP SCRIPT ourput, it is quite simple as you have to get the OTFDATA from the SCRIPT. But you may have to make the correction in your SAPSCRIPT driver program.
Sample:
CALL FUNCTION 'CLOSE_FORM'
TABLES
otfdata = te_otf_table
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
OTHERS = 3.
Next you may EXPORT this OTF Data Internal Table to ABAP Memory.
In your program where you are calling all the 3 forms + the transaction which outputs the SAPScript output, the exported data may be imported and appended into the MAIN Interal Table and single PDF could be generated.
Secondly, The PRINT prieview of the SSFs could be generated by passing Export options of the SSF FM
SAmple:
ssfctrlop-no_dialog = ' '.
CALL FUNCTION l_form
EXPORTING
control_parameters = ssfctrlop
output_options = ssfcompop
I hope this helps you.
Regards, Murugesh AS -
Text Object Error in Pdf based print forms
Hello Friends,
I am trying to include a text object in Adobe PDF-based print form.
In the context, I have created a node for the text. I chose the Text Type as Include Text. I am able to choose the required Text Object and Text ID from the respective search helps. When trying to activate the form, I am getting an error saying that I did not specify a text name. I tried to rectify this error but could not do so.
Please help me out on how to rectify this error.
Points will be rewarded for useful answers.
Thanks,
John.There is no need of activation for standard text... save will do...
Also note: standard text is client dependent... you need to attach to your transport request manually to move between clients...
Close the thread once your question is answered.
Regards,
Sairam -
How send a Print Form as attachment PDF?
Hi everybody,
I have created an Interactive Forms where I can input any new data.
When I click on the button for save the new data, I must also convert my Interactive Form in PDF for send it as attachment to email. When I have groped to convert the interactive form in a PDF file, I lost the data that I have inserted.
So I have created a Print Form through transaction SFP.
I recall the print form in background mode and gets the form of Interactive Data and requiring as import table OTF, but the OTF table is returned to me is different from that of a smartform and so I can not use the function module u2018CONVERT_OTFu2019.
Carryover in the code, you know give me directions?
With the code I'm used to create the PDF file and attach it to email, but the files that I receive by email can not I open it, probably because of an error in formatting during its creation.
I look forward to your advice,
Davide.Dear sirs, I can provide this program schema to send PDF print form as an email attachment. Hope it will help a bit.
FUNCTION ZPDF_MAIL_SEND.
""Lokální rozhraní:
*" IMPORTING
*" VALUE(PDF) TYPE FPCONTENT
*" VALUE(EMAIL) TYPE AD_SMTPADR
DATA lt_att_content_hex TYPE solix_tab.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = pdf
TABLES
binary_tab = lt_att_content_hex.
CLASS cl_bcs DEFINITION LOAD.
DATA:
lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
lo_send_request = cl_bcs=>create_persistent( ).
Message body and subject
DATA:
lt_message_body TYPE bcsy_text VALUE IS INITIAL,
lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
CALL FUNCTION 'ZREC_MAIL_GET_BODY'
IMPORTING
message_body = lt_message_body.
Message document
lo_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = lt_message_body
i_subject = 'Úloha: vyplňte prosím následující formulář' ).
Add attachment
DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.
TRY.
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'Formulář'
I_ATTACHMENT_SIZE =
I_ATTACHMENT_LANGUAGE = SPACE
I_ATT_CONTENT_TEXT =
I_ATTACHMENT_HEADER =
i_att_content_hex = lt_att_content_hex ).
CATCH cx_document_bcs INTO lx_document_bcs.
ENDTRY.
Pass the document to send request
lo_send_request->set_document( lo_document ).
Create sender
DATA: lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL.
lo_sender = cl_cam_address_bcs=>create_internet_address( email ).
Set sender
lo_send_request->set_sender(
EXPORTING
i_sender = lo_sender ).
Create recipient
DATA:
lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.
lo_recipient = cl_sapuser_bcs=>create( sy-uname ).
Set recipient
lo_send_request->add_recipient(
EXPORTING
i_recipient = lo_recipient
i_express = 'X' ).
lo_send_request->add_recipient(
EXPORTING
i_recipient = lo_recipient
i_express = 'X' ).
Send email
DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
TRY.
lo_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = lv_sent_to_all
EXCEPTIONS
OTHERS = 1 ).
CATCH cx_send_req_bcs. .
CLEANUP.
ENDTRY.
COMMIT WORK.
MESSAGE 'Formulář byl odeslán' TYPE 'I'.
ENDFUNCTION. -
Why doesn't Preview print out my pdf forms as edited anymore?
A week ago, I was able to print out a pdf form the way it was editted on the screen using Preview. As of Wednesday, it no longer prints what I have editted in Preview. It prints the naked, empty form only. No edits. I have Mountain Lion and am using an hp deskjet 6122.
Assuming that you're talking about printing from Adobe Reader for iPad or iPhone, you either (1) need an AirPrint-enabled printer, or (2) (for the iPad only), purchase a third party app like Printer Pro from Readdle.
Here's a list of AirPrint-enabled printers:
A List of Printers with AirPrint (updated March 2013)
If you're talking about printing from Reader on your laptop or desktop computer, you're in the wrong forum. -
How to disable Save & Print functionality in PDF form?
Hi,
This is the requrement, client need to disable Save & Print functionality in PDF form. (They not allow employee save & print the hrforms payslip)
May I know how to do it. Thank you.
What is the parameter value in structure SFPOUTPUTPARAMS that I need to set in order to disable Save & Print functionality ?
call function 'FP_JOB_OPEN'
changing
ie_outputparams = SFPOUTPUTPARAMS
exceptions
others = 1.Hi Nayan,
I'm the person who did the WD as well, using IFrame to contain the PDF binary. WD site didn't contro the binary source.
I pre-define the 'FP_JOB_OPEN' before calling the PDF generation.
Optional: Set output parameters
gs_outputparams-nodialog = ''.
gs_outputparams-preview = ''.
gs_outputparams-getpdf = 'X'.
gs_outputparams-nopreview = 'X'.
gs_outputparams-noprint = 'X'.
gs_outputparams-noarchive = 'X'.
gs_outputparams-nopributt = 'X'.
gs_outputparams-arcmode = '1'.
gs_outputparams-noarchive = 'X'.
Open print job
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = gs_outputparams
EXCEPTIONS
OTHERS = 1.
Regards,
Eric -
Hi Frnds,
This is my first time to work in PDF print forms.
I am using standard interface and program to print my PDF forms. The PDF form alone is customised.
I need to format my date as dd-mmm-yyyy. how can i do it?
can i call a subroutine from a Zprogram in the context or interface?
Can anyone help me to solve my issue? thanks a lot.
regards
Suganya.Hi Frnds,
I got the date format solution.
But I need to know whether we can use the subroutine of the program inside the interface or PDF forms as like script.
I am using the std prgm RFKORD10_PDF and my customised PDF form. but i am getting an error as "Contradiction in form".
Can anyone help me to solve the error?
thank in adv
Suganya -
How can print a file PDF from form
Hi to all,
I need to print a file PDF from form (developer 6i), Is IT POSSIBLE?
Thank you
Silvia"Print" probably won't work for a pdf file. As the HOST command try:
host('<path_to>/AcroRd32.exe /t pathname "printername" "drivername" "portname"');See "How do I use the Windows command line with Acrobat and Adobe Reader?" in:
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/Acrobat_SDK_developer_faq.pdf -
Problems printing a converted PDF which was converted to Word after completing the form
Problems printing a converted PDF which was converted to Word after completing the form. I have spent the last 3 hours trying to figure out what I am doing incorrectly. I can't get it to print in either the PDF or Word file. Please help, I need to complete this form and sent it NJ Department of Motor Vehicles Commission.
Hi, make sure you are using the latest release of PDF program.
Please mark the post that solves your issue as "Accept as Solution".
If my answer was helpful click the “Thumbs Up" on the left to say “Thanks”!
I am not a HP employee. -
Best Practice for PDF print forms based on SAP standard
Hi,
I have copied the SAP standard PDF form F_D_INT_SCALE_00 to a Z form, and am using it in conjunction with the standard print program RFDZIS01_PDF. However I need to output some additional fields that are not supplied by the print program / interface (for example Customer VAT number).
What is the best practice for achieving this? As far as I can see the only way is to take a copy of the standard print program and modify it to select the extra data, and modify the interface. I never like taking copies of standard programs though for obvious reasons.
If I had this requirement with a smartform it would be a simple case of embedding ABAP code into the Z smartform and leaving the print program alone, but unfortunately there is no provision for the non-PDF version of the Interest Letter to be sent by email.
Thanks in advance,
VindalooThanks for your reply Robert.
However I think you are referring to Smartforms when you mention Code Initialization and Global Data declarations. I need to know the best way to modify copies of standard Adobe Print Forms.
Regards,
Vindaloo -
Remote print form automatically to pdf files
Hi everyone,
The user want to implement a request like follows:
1. quotation will send to a webservice for approval.
2. when the quotation is approved, webservice will call a RFC to update the status of this quotation in SAP.
The problem start here.
3. inside the RFC call, SAP need to print the Quotation FORM automatically to a PDF file which will be named using Document No. date and time. Then a record need to be sent to another CRM with the PDF as an attachment.
Is there any way to solve this requirements?
The biggest question for me is how to tigger the form print and print it into pdf.
Thanks for prompt response
Regards
SeanHi Sean
It is possible like this:
Maintain two output types for the same program of form output.
1. Maintain output type as EDI i.e. Idoc from SAP to Webservice. Say Output type ZWEB.
2. Once approved by webservice, call RFC to update SAP. This RFC will responsible to trigger second output type, say ZPDF.
ZPDF will trigger in sales order with transmission medium as 5- external send having name using "Document No. date and time" (this can be achieve by ABAP program for smartform). This e-mail will sent to e-mail id provided with PDF attachment.
Please discuss with ABAP consultant having good command in Smartforms.
try and revert
Edited by: Yadav on Dec 3, 2009 9:29 AM -
Print a designer form as pdf using distiller
Is it possible to print a life cycle designer form as pdf?
We have test reports with diffrent form-fields and signature on it.
They are all made with life cycle designer 7.0 and filled in with Acrobat
Professional 7.05.
Is it possible to print the form as pdf with the distiller, so no one can change the fields with Acrobat Standard?
I know you can protect the fields with the security options but for reasons
I can't explain here we want to do it with the method mentioned above.
Thanks for all ideas and opinions
Alex WimmerThe problem is that Acrobat shows that the desingner document has a password for security.
when I try to print as pdf the procedure stops with the message:
"This PostScript file was created from an encrypted PDF file.
Redistilling encrypted PDF is not permitted."
The strange thing is that I told designer in the document options not to use a password for security but Acrobat shows me that the document is password protected. I can even change the security settings to "no security" without typing in a password.
After changing the security options in Acrobat I can print the form as pdf without a problem.
Is it possible to remove the "password" for the documents using the
"Stapelverarbeitung" I don't know if "batch processing" is the right
translation because I use the german version. :-)
Maybe you are looking for
-
Can ISE 1.2 Virtual Appliance assign VPN address pool like ACS does?
Dear friends, I have observed that Cisco ISE Virtual Appliance (VMware) can act as a RADIUS server in the same manner as ACS does, but I cannot find the way of assigning an IP address to a remote VPN client (only assigning a VLAN). At this point I do
-
MacBook wont boot up all the way!!
I recently updated my computer with Quiktime and itunes applications and it asked me to restart after updates were complete. It restarted but it gets stuck on the gray screen with the apple and the turning wheel and wont go any further. I read simila
-
[polkit-kde] strange 10 seconds of pause on boot
since the 0.99.0-4 version of polkit-kde package I notice a strange pause of 10 seconds during the boot of KDE 4.14.1 KDE displays the desktop ( icons, plasmoids ) but suddenly he stops his job for 10 seconds, I can't click on the "K" menu during the
-
Iphone 4 unable to update from 4.3.1 to 4.3.3 NOT JAILBROKEN
hello, I have searched these discussion rooms and am unable to find an answer that has worked for me. My current situtation: upgraded from 3gs to a WHITE IPHONE4 yesterday. I have not jailbroken it. I have updated itunes to 10.2.2 (current version)
-
Hi there, I'm hoping someone has a good fix for this..I'm on my second day of trying to fix it! Every time I open mail, it pauses as if loading, but soon changes into the "spinning wheel of doom" (that colored wheel). I end up having to force-quit ea