Smartforms : How to include Printer commands in smartforms
I want to include printer command <esc>&l1T at the end of the smartform so that the printer can staple the form after printing.
Can any one please let me know how to include this in smart form ..?
Is there any way ..?
You should use the following way:
- Copy the device type into the Customer name space.
- Go via transaction SPAD - Device types into the device type and
here to tab strip 'Print controls'. Here add a print control
with the following contents: \e&l1T
(without flag 'Hexadecimal'; the \e is the escape character)
- Now go to your Smartform and add a command node (right-click
on the tree, Create - Flow logic - Command) and enter the print
control name into the field 'Include Printer Control'.
This adds the print control at this point. You only have to
select the right position of the command node in the tree
(and therefore the point of time, when the sequence shall be sent).
- If you want to check the print data, which the SAP sends to the
printer (and therefore whether the escape sequence was included
correctly), you can use note 5799, method 2.
Similar Messages
-
How to write print program for smartforms
Hi all
I need to develop new smartform and its print program.
But Im not experience in writing print program for smartform.
Ive gone through the simple print program sample that use only one table as input and one table for output.
But my smartforms require few tables for input and output.
How should I define the Data?
Can anyone guide me on how to write it.
Thanks & Regards
azTransaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
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.
Reward points... -
How can i print data in smartforms from ABAP program.
Dear gurus:
in my abap program i process require data, and saved in a internal table.
how can l print the data in smartforms.?
who can give me a code sample is better:)
reward all helpful advise.Try this....
1) Tcode --> SmartForms
2) Form name --> Z_SF_TEST Create
3) Under Global settings
a) Form Interface
Table Tab
ITAB LIKE EKPO
b) GLOBAL Definitions
WA_NETPR LIKE EKPO-NETPR
In smart forms if we want to display quantity and currency fields. We can't directly display currency field and quantity fields
For that we have to create an extra variable in global definitions
Ex: netpr FIELD of EKPO
CREATE program lines and specify WA_NETWR = itab-netpr.
4) RT CLick on main Window
CREATE --> TABLE
Click Table painter
DEFAULT %LTYPE will be Created
a) If you want more like Header footer etc add by rt click on %LTYPE1
Table (Tab)
%LTYPE Radio(SELECT) 5 CM 5 CM 6 CM
CLICK on DATA (Tab)
INTERNAL TABLE ITAB LIKE ITAB
5)RT click on table control and create --> program lines
General attribute (Tab)
INPUT PARAMETER OUTPUT PARAMETER
itab WA_NETPR
Code Area
WA_NETWR = ITAB-NETPR.
6) RT CLcick on table ctl and create 3 text to display the fields
a) % text1 +button(insert field)
FIELD name &itab-ebeln&
Output options (tab)
Check New line LINETYPE %Ltype1
check new cell
b) % text2
& itab-ebelp&
output options
check new cell
c) % text2
& wa_netpr&
output options
check new cell
<b>Report ac
Tables ekpo.
Data: itab1 like ekpo occurs 0 with header line.
select * into table itab1 from ekpo.
Call function module --> smart form function module and pass your internal table</b>
Regards,
SaiRam -
How to issue print command from report/form server to client printer on web
1) We have a client server application which is to be deployed on the web environment. The reports generated in our application are having a destination type as File. These reports are printed after applying some print format (escape sequences) which are passed on to the printer programmatically at runtime while printing.
Now when this application is shifted on to the Application server (Forms server & Reports Server )in web environment ,the report outputs would be generated in the application server as against the client in client server environment as the report server is on the application server.
Now while printing/accessing the report the output file will not be available to the client unless it is pushed on to the client side from the server . I am able to see reports in pdf/html output but in this case layout of my reports gets changed and I dont want to change my layouts or reformat my report layouts.
How do I redirect the report output from the application server on to the client within the D2k context and then execute print commands?
Note: In this case we want to use both DMT and Laser printing. Also note that we use escape sequences to adjust reports in desired printing papers.
2) We have second set of reports which we call as document because these are printed after capturing data from 'Form' using text_io utility (please note that for these documents we are not using any Report 6i functionality)and we print it from file using printing mechanism as mentioned above. These are working well in client server application. We adopted this methodology for getting better performance (in terms of speed as database server and network traffic is not involved) of printing. But now we are converting our application for web, we are finding it difficult how to capture Form's data from browser to client's machine and then executing printing commands which are stored in our application liabrary.
If you help me out by giving some suggestions, I shall be grateful to you.
nullHello
I wonder if you ever solved this problem.
I have a very similar problem with Photoshop CS5 on Mac OSX 10.6 + HP Photosmart C7180.
If I choose "Photoshop Manages Colors" the results are lousy.
If I choose "Printer Manages Colors" the results are OK. not necessarily great.
I believe I have all the correct settings after going through books and web advice (and wasted a lot of paper and ink).
As far as I can see, "ColorSync" is the internal Mac management which is the only option available with "Photoshop Manages Colors" and "Vendor Matching" appears to mean the printer vendor (ie HP) will provide the matching. Either can be selected if "Printer Manages Colors" is used. It seems the type of paper can be set in three different places. if That's all a bit academic as the results are poor regardless.
My wife suggests I buy a new printer - Epson's looking good.
Any words of wisdom would be appreciated. -
How to include Print & Export Buttons in VC
Hi
I developed 1 Dashboard with Tables(4) & Graphs(4).
My requirement is to include PRINT & EXPORT TO PDF BUTTONS so that users can Print or export the all the items in dashboard or particular item to a PDF
Please advise how can i achieve this
ThanksHi
Refer the link below. Detail procedure of exporting the data to clipboard,excel & PDF isgiven -
http://sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/805709cb-ec97-2910-04b8-f3d6303d8d3b
(Check the appendix at the end of this document, that is also important)
Also if you want to print the dashboard follow th steps below -
1. Include one form & right click on it & go to 'Toolbars'
2. Create Button in it & assign the system action 'Print'
3. You will get various options for it (Print Table, Print Whole page etc.)
4. Select Print Whole page.
5. When you execute thei model in run time you will get one button in that. When user clicks this button, he will get normal print popup window which we get before printing anything.
Regards
Sandeep -
How to include print date with time on SkillBuilders Schedule Plug In?
Hi,
Do you have an idea how to include and get the print date with time on the SkillBuilders Plug In? It shows me the date only, time not included. Have tried to put "HH24:MI", "HH24MI" or Tochar(HH24:MI)? No result??
select p.fullname, sbip_schedule.start_date(e.event_schedule) start_date
, sbip_schedule.end_date(e.event_schedule) end_date
, sbip_schedule.duration_seconds(e.event_schedule) duration_seconds
, sbip_schedule.calendar_summary(e.event_schedule) calendar_summary
from app_events e
Thanks!I forget to clarify I am looking for the answer is how to get the print of date with time, Start date with time and End Date with time.
-
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 -
How to configure print settings in smartforms
Hello friends,
I was given a task to develop smart forms..everythign is working fine but i am left with following queires,
so far i ddint maintain any print related parameters,
i understand i need to work on three parameters now
1)CONTROL_PARAMETERS
2) OUTPUT_OPTIONS
3) USER_SETTINGS
now i have seen other forms at our place and seen
in control parameters they pass
p_control-langu = 'EN'.
p_control-no_dialog = 'X'.
in output
p_output-tddest = 'LP05'.
p_output-tdnewid = 'X'.
and for user_settings
user_settings = ' '
but
the same changes are giving me error....
can any one tell me why?
next if i remove them and give them at runtime i get no sort of problem..
so how i do give them with in program?
next what si the role of user_settings...
why is it ' '...
shud it be 'X'..
next when i give print parameters in DEVELOPMENT..
when i move it to QUALITY...(settings will remain same as DEV) will it cause problmes?(like may be in QUA p_output-tddest = 'LP05'. needs to be modified?)..
any links,material to help me know more abt this issue wil be rewarded..
thnaksHi kumar,
Please find the below thread.....
convert smartform output into pdf
Re: Euro symbol in PO Layout output preview
data: C_FORMNAME TYPE TDSFNAME.
DATA: G_FM_NAME TYPE RS38L_FNAM.
c_formname = 'ZKAR_SF2PDF_EXMPL'.
To get output device type
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
I_LANGUAGE = V_LANGUAGE
I_APPLICATION = 'SAPDEFAULT'
IMPORTING
E_DEVTYPE = V_E_DEVTYPE.
ST_OUTPUT_OPTIONS-TDPRINTER = V_E_DEVTYPE.
ST_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
ST_CONTROL_PARAMETERS-GETOTF = 'X'.
Call Function to get the Function Module name for the smart form
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = C_FORMNAME
IMPORTING
FM_NAME = G_FM_NAME.
IF SY-SUBRC 0.
Check for Errors
ENDIF.
Call Smartform function module without hard coding
CALL FUNCTION G_FM_NAME
EXPORTING
CONTROL_PARAMETERS = ST_CONTROL_PARAMETERS
OUTPUT_OPTIONS = ST_OUTPUT_OPTIONS
USER_SETTINGS = 'X'
ADD YOUR DATA STRUCTURES HERE
IMPORTING
DOCUMENT_OUTPUT_INFO = ST_DOCUMENT_OUTPUT_INFO
JOB_OUTPUT_INFO = ST_JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS = ST_JOB_OUTPUT_OPTIONS
TABLES
ADD YOUR DATA TABLES
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC 0.
On Failure display standard Message
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Also see this related note:
Note 1072424 - Error from SSF_GET_DEVICE_TYPE when lang is not installed.
Reward points.....
Regards,
Sreenivasa Sarma K.
Edited by: sharmashree kashi on Apr 7, 2008 4:03 PM -
REQUIRE One spool request for n copies in one print command in smartform
Hii Friends,
I created a smartform..I require 5 copies of that form..There is a text which needs to be changed in evry copies...eg Original in first copy
Duplicate in second copy
Triplicate in third copy....n so on
So i used a loop n i am calling smartform 5 times....The problem is i need one spool request to be created..
Note: By default sometimes it create one spool request and sometimes 3 spool request...
Pls share your inputs ............
Thanks,
Regards,
Sujit.hi,
this is more complicated see below description from help
regards,darek
Printing Several Forms in One Print Request
Use
You want to bundle several forms into one print job.
Print Request vs. Spool Request
SAP Smart Forms allows you to bundle several forms to form one output unit. This output unit is called a print request. A print request is different from a spool request:
Whether a new spool job is created in the spool depends on the settings in the spool dialog.
Whether a new print request starts depends on the standard parameters of the generated function module you set in SAP Smart Forms. For each print request, the spool dialog is called only once. If you suppress the dialog, you can pass parameters for spool processing only at the beginning of the print request.
This means that a print request gathers several forms before submitting them to spool processing. Thus they cannot be spread over several spool requests. Vice versa however, you can include several print requests into one spool request.
Procedure
Use function module SSF_FUNCTION_MODULE_NAME to retrieve the name of the function module generated from the Smart Form (see also: Integrating the Smart Form Into the Application).
Call the Smart Form for the first time and set the NO_CLOSE parameter of the control structure. This prevents the print request from being closed after accepting the output of the Smart Form and allows you to include all other form output into this print request as well. Leave the NO_OPEN parameter empty.
Instead of calling the Smart Form for the first time you can also call function module SSF_OPEN .
If you want to start a new spool request for the print request, set the TDNEWID field of the Output Options in this first call.
For all other form output of the application program that you want to include into the print request, use a loop to set both the NO_OPEN field and the NO_CLOSE field of the control structure.
To close the print request, in the call of the last Smart Form set the NO_OPEN parameter and unmark the NO_CLOSE parameter.
Instead of calling the Smart Form for the last time, you can also call function module SSF_CLOSE .
Result
The forms you called in the steps described above are included into one print request. If in the first step you started a new spool request, you can now view its status in the spool request overview (transaction SP01 ). -
How to Get Print event in Smartforms on preview model.
Dear All,
I have a issue for Get the Print button value in Smartforms.
I can get the print button value on the popup window before show smartforms result.
But I donu2019t know how to get if the report preview .Because on preview model,user also can click toolbar print button to print.
Please give me some advice
Thanks
Sundone have okay
IF SY-MSGV1 <> '' OR SY-UCOMM = 'PRNT'.
MESSAGE 'PRINTED' TYPE 'S'.
ELSE.
MESSAGE 'NOT PRINTED' TYPE 'S'.
ENDIF. -
How find out print program for smartform?
i know smart form name but i want printprogram name for that.how to find?pls help me.
Hi
There's no method.
If you're speaking about a smartforms for logistics module (SD,MM), you can you the transaction NACE (or table TNAPR) in order to findout which program is assigned to that smartforms.
U can also try to find out all programs using the fm SSF_FUNCTION_MODULE_NAME and get only the program where the string containing the name of your smartform.
Max -
How to Sent Printer Configurations while Printing in SMARTFORMS for PO?
Hi,
I took PO Print Out on LIPI Dot Matrix Printer before 10 days. At that time our Basis Consultant kept Some Configurations for that Printer. After some one changed the Configuration Settings of that Printer. Now we took a print but it is printing differently.
Is it possible to send printer Configurations while calling PO smartforms in my driver Program so that while taking PO Print Out my Print Out Specific Configurations will set automatically if antbody can change the printer Configurations.
can anyone suggest how to pass printer configuration through smartform or driver program .Thank u
-
To find print program for smartforms.
pls tell me how to find print programs for smartforms.pls tell me with all steps.clearly.i tried with tanpr table but unable to find
hi,
Please take a look at the NACE transaction where all the output conditions will be configured. Drill down into you specific application and you should be able to find the print program as well as the smart form name.
Steps..
Use NACE and follow procedure as follows
1)Choose Application from list(eg PO)
2)Click OP type
3)Chose one OP type from Right pane.
4)Click on processing routines
and you got it
regards,
keerthi -
How to create a hyperlink in smartform
Hi All,
How to create a hyperlink in the smartform text editor so that when we click on that,we should be able to open the internet explorer.I have tried with the option insert URL.But still its not working.Do we need to do any further settings along with this?
Thanks in advance
Regards,
AkankshaHi,
check this:
http://help.sap.com/saphelp_47x200/helpdata/en/03/7560eccf0d11d3b565006094192fe3/frameset.htm
Create hyperlink in SMARTFORM
How to create a hyperlink in smartform
Create hyperlink in SMARTFORM
Re: URL in SmartForm sent as email body
Don't forget to reward if useful -
How to run Terminal commands in Xcode?
Anyone knows how to include Terminal commands ( like sudo) in Xcode? for example in a line of my program I need to run this:
sudo open/Library/Preferences/com.apple.sharing.firewall.plist
I searched the library but found no class or routine for that.Well, I am not a professional programmer, but one of the things I continue to learn is how to wade through all of the Cocoa documentation (and it does get deep in spots). Chances are though, no matter what you are trying to do, Apple or some third party has created a class to make it easier - you just have to find it. My Xcode documentation bookmarks continue to grow, but you might start with some of Apple's documentation, such as
Cocoa Fundamentals Guide
Foundation Framework Reference
Application Kit Framework Reference
Maybe you are looking for
-
Open movie crashes logic every time
Hi, I just wondered if anyone else has experienced this.. I am trying to open a movie which is 2.77gb (DVCPRO50) in size.. Upon selecting it within the file browser, (before even clicking OK), Logic crashes. This happens when video is set to either "
-
Hi All, Wanted to understand what would be the impact activating business function "FIN_TRAVEL_2" for Travel management. Presently we are on FIN_TRAVEL_1 and EHP6. Wanted to have both Travel request and Travel expense report output view though PR05.
-
How do I stop Logic Pro X from trying to load a 32 bit plug-in that's no longer installed
How do I stop Logic Pro X from trying to load a 32 bit plug-in that's no longer installed? I noticed it occurring on projects where I used Miroslav Philharmonik. I keep getting prompted when opening the projects. I uninstalled Miroslav thinking it w
-
ERTR status -- production order
Dear all we have found that all the materials were issued yet the production order status still says ERTR. How i can refreshe the ERTR stutus to be be removed from the production order status. If there are any prerequisites what are they? Rgds S Pat
-
Searching for movie data in file
Does anyone know how to fix the problem of the "Searching for movie data in file" interruption and annoyance? I can not access my movies to edit - or do anything for that matter - because this thing keeps popping up. Any help would be GREATLY appre