Checkbox in sapscript
Hi all,
I need to print a checkbox in my sapscript.
The line in sapscript I would have is:
5 blalba yes <- here my checkbox
Hi have uploaded a bmp file with a checkbox, but with this command:
/: BITMAP 'SQUARE3' OBJECT GRAPHICS ID BMAP TYPE BMON
insert the checkbox at the begin of the line, what is the code for insert at soma point of line?
By all,
rewards for all
Hi Fabrizio,
Try using [ ] in text symbol. it will look like checkbox.
refer these links as well... though its for Smartforms.
Re: Quick Question on Smartforms
Re: putting tick mark into check box in smartform
Another approach:
Go to the corresponding windows text editor in the change mode.
Go to INSERT in the menu bar
Choose Characters
Choose SAP Icons.In that list you will be able see an Icon for Check box with name ICON_CHECKBOX.
Once you choose that you will get <2039> in the text editor.save and activate it.
You will be able to see the check box only when you print it but not in the print preview.
<b>Reward points if this helps.
Manish</b>
Similar Messages
-
Truble with smartforms with word
Hello All.
i have a trouble with smartforms when I creat text , the smartforms open word page and the paragraph i was created within style did'nt show.
Note.
I have Office 2007
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Sep 1, 2008 4:54 PMHi
If you dont want MS word in your smartform text deactivate it in tcode:i18N
i18n customizing -->click on MS word as editor uncheck the checkbox of sapscripts and smartforms.
Then come back to your smartforms and then include your smartstyles in smartforms.
or
Incase if you want to include smartstyle in the smartforms.
Then output options tab include your smartstyle.
Regards,
sravanthi -
SAPscript - to print a checkbox
HI ALL,
I need to print a check box and a tick mark in the check box in SAPSCRIPT.Kindly send a sample code
Thanks
Points will be rewardedHi,
In window>textelements>insert>charecters>SAP SYMBOLS.
There you click on the symbol what ever you want by placing the courser in text elements.
I think it will not reflect in print preview but will come in raw copy.
Thanks.
If this helps you reward with points and close the thread.
Message was edited by: KDeepak -
For SAPscript INCLUDE TEXT, how to align as Paragraph format
Hi experts and ABAP colleagues!
Need your help on this sapscript problem:
How to align texts taken from "INCLUDE TEXT" in SAPscript, according to tab defined in Paragraph Format?
For example, I defined BG to have tabstop at the 2nd column (or equivalent to 1st tab position) where I need to print the text, and then declared it in SE71 like below:
However the text prints at the leftmost instead of at the 2nd col position - (8th char tab defined in par. format BG). Hence it is not aligned to its proper heading. Line Number instead of Description - which is not okay for client view that needs these Thai texts.
The technical details I included below. Kindly examine:
1.) Window >Main > Text Element > Include Text command
/E ITEM_TEXT
BG ,,&TTXIT-TDTEXT&
/: INCLUDE &T166P-TXNAM& OBJECT &T166P-TDOBJECT& ID &T166P-TDID&
/: NEW-PARAGRAPH BG
Note: I used command "NEW-PARAGRAPH" and had exactly the above code in se71. Anything missed here? Pls. help. Thanks.
#2.) Paragraph Format > Tab
No. -
Tab Position -
Alignment
1 8,00 CH LEFT
2 28,00 CH CENTER
etc.
Note: and then i put in ",,&TTXIT-TDTEXT&" (see above) with the 2 comma's beforehand to say that its on the 1st tab or at the 8th character where it should be printed, but does not give intended result... pls help.
#3.) Paragraph Formats > Standard Attributes
Left Margin - 0 cm
Alignment - Left
no blank lines checkbox - ticked
Note: Is there any more attribute i can manipulate from here to force display at the right position?
Thank you so much in advance for all your help. Our project team will really appreciate it. May the Lord bless you as we go through our SAP work!
Sincerely,
CelesteHere's a thought, instead of using tabs, try writing a method that takes a string that is the starting string, a pad character, and a length and returns a string padded to that length with the specified character.
public String padR(String src, String padChar, int len)
// ... You get to fill in the rest suggestion try to do it without a loop
}Have fun,
PS. -
In this a sapscript driving program .this is use for printing data when I click print preview one line have different text .i want to correct that text in script form. But I m not able to identify form name can u tell me how to get form name or how to solve the problem.
REPORT zj_1i57fp MESSAGE-ID 8i.
TABLES: t001w,
j_1iwrkcus,
j_1iregset,
j_1iindcus,
j_1iexcdtl,
j_1iexchdr,
lfa1,
adrc,
t001.
Begin 11.05.99
DATA : BEGIN OF listtab OCCURS 30,
procdoc(1) TYPE c,
exnum LIKE j_1iexchdr-exnum,
exdat LIKE j_1iexchdr-exdat,
srgrp LIKE j_1iexchdr-srgrp,
preprn LIKE j_1iexchdr-preprn,
exbed LIKE j_1iexchdr-exbed,
exsed LIKE j_1iexchdr-exsed,
exaed LIKE j_1iexchdr-exaed,
list_line LIKE sy-linno,
END OF listtab.
End 11.05.99
DATA : BEGIN OF options.
INCLUDE STRUCTURE itcpo.
DATA : END OF options.
DATA : BEGIN OF result.
INCLUDE STRUCTURE itcpp.
DATA : END OF result.
DATA : BEGIN OF thead OCCURS 10.
INCLUDE STRUCTURE thead.
DATA : END OF thead.
DATA : BEGIN OF tlines OCCURS 10.
INCLUDE STRUCTURE tline.
DATA : END OF tlines.
DATA : text_id(4) TYPE c.
DATA : doc_num LIKE j_1iexchdr-exnum, " pai 17/09/98
m_length TYPE i. " pai
Begin 11.05.99
DATA : doc_no LIKE j_1iexchdr-exnum,
doc_dt LIKE j_1iexchdr-exdat,
series LIKE j_1iexchdr-srgrp,
preprn LIKE j_1iexchdr-preprn,
m_selected,
m_date(10) TYPE c,
tabix LIKE sy-tabix.
DATA : it_pcrdtl LIKE TABLE OF zeou_pcrdtl WITH HEADER LINE,
it_pcrhdr LIKE TABLE OF zeou_pcrhdr WITH HEADER LINE .
DATA : wa_mara TYPE mara,
wa_t032t TYPE t023t.
DATA : gv_tot_duty TYPE konv-kwert,
gv_tot_amt TYPE konv-kwert,
gv_tot_val TYPE konv-kwert.
SELECT-OPTIONS: se_exnum FOR j_1iexchdr-exnum,
se_exdat FOR j_1iexchdr-exdat.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK 4 WITH FRAME TITLE text-005.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 01.
PARAMETERS: p_print RADIOBUTTON GROUP grp1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT (15) text-006.
SELECTION-SCREEN POSITION 20.
PARAMETERS: p_reprn RADIOBUTTON GROUP grp1.
SELECTION-SCREEN COMMENT (20) text-007.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK 4.
End 11.05.99
doc_num = doc_no. " pai
m_length = STRLEN( doc_num ).
WHILE m_length < 10.
CONCATENATE '0' doc_num INTO doc_num.
m_length = m_length + 1.
ENDWHILE.
doc_no = doc_num. " pai
Begin 11.05.99
TOP-OF-PAGE.
WRITE :/3 text-001,
text-002,
text-003,
text-004.
START-OF-SELECTION.
IF p_print = 'X'.
SELECT * INTO CORRESPONDING FIELDS OF TABLE listtab FROM j_1iexchdr
WHERE trntyp = '57FC' AND status = 'P' AND
exnum IN se_exnum AND exdat IN se_exdat AND preprn = ''.
ELSEIF p_reprn = 'X'.
SELECT * INTO CORRESPONDING FIELDS OF TABLE listtab FROM j_1iexchdr
WHERE trntyp = '57FC' AND status = 'P' AND
exnum IN se_exnum AND exdat IN se_exdat.
ENDIF.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH
'No data available or Document already printed'.
ENDIF.
END-OF-SELECTION.
SET PF-STATUS '100'.
SORT listtab BY exnum exdat.
LOOP AT listtab.
WRITE :/ listtab-procdoc AS CHECKBOX.
WRITE : listtab-exnum UNDER text-001,
listtab-exdat UNDER text-002.
WRITE AT 30 listtab-srgrp.
WRITE AT 45 listtab-preprn.
listtab-list_line = sy-linno.
MODIFY listtab.
ENDLOOP.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'EPRN'.
DO.
tabix = sy-index.
READ LINE sy-index FIELD VALUE listtab-procdoc.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF listtab-procdoc = 'X'.
READ TABLE listtab WITH KEY list_line = tabix.
doc_no = listtab-exnum.
doc_dt = listtab-exdat.
series = listtab-srgrp.
m_selected = 'y'.
EXIT.
ENDIF.
ENDDO.
ENDCASE.
Call fn. module to capture pre-printed excise no.
IF m_selected = 'y'.
CALL FUNCTION 'J_1I_ACCEPT_VALUE'
EXPORTING
i_preprn = preprn
IMPORTING
o_preprn = preprn.
ELSE.
MESSAGE e000(8i) WITH 'Select a Document'.
ENDIF.
Check whether entered pre-printed excise no. already exists
SELECT SINGLE * FROM j_1iexchdr WHERE preprn = preprn AND
status <> 'D' AND
NOT ( exnum = doc_no
AND exdat = doc_dt
AND srgrp = series ).
IF sy-subrc = 0.
SET CURSOR FIELD 'PREPRN'.
MESSAGE e000(8i) WITH 'Pre-printed excise no.' preprn 'already used'.
ENDIF.
End 11.05.99
SELECT SINGLE * FROM j_1iexchdr
WHERE exnum = doc_no
AND exdat = doc_dt
AND srgrp = series.
IF SY-SUBRC <> 0.
MESSAGE E000(8I) WITH 'Invalid Challan number entered'.
"10.05.99
ELSEIF J_1IEXCHDR-PREPRN <> PREPRN AND J_1IEXCHDR-PREPRN <> ''.
MESSAGE E000(8I) WITH
'57F4' DOC_NO 'already printed with pre-printed excise no.'
J_1IEXCHDR-PREPRN.
ENDIF.
IF J_1IEXCHDR-STATUS NE 'P'.
MESSAGE E000(8I) WITH 'Challan status is not posted..cannot print'.
ENDIF.
Begin 10.05.99
j_1iexchdr-exbed = j_1iexchdr-exbed + j_1iexchdr-exsed +
j_1iexchdr-exaed.
Begin 10.05.99
Print totals of BED, SED, AED
j_1iexchdr-exbed = listtab-exbed + listtab-exsed + listtab-exaed.
listtab-procdoc = ''.
listtab-preprn = preprn.
MODIFY LINE listtab-list_line FIELD VALUE listtab-procdoc
listtab-preprn LINE FORMAT COLOR 6 INPUT OFF.
End 10.05.99
Printing options
options-tdcopies = 1 .
options-tdnewid = 'X' .
options-tddataset = 'LIST1' .
options-tddelete = 'X' .
options-tdprogram = sy-repid.
options-tdpreview = 'X' .
PERFORM open_form.
PERFORM get_header_data.
PERFORM write_form USING 'TITLE' 'DOC_TITLE_T' 'SET'.
PERFORM write_form USING 'INFO' 'HEADER_DATA' 'SET'.
Print Line items
PERFORM write_form USING 'MAIN' 'DASH_LINE' 'SET'.
PERFORM write_form USING 'MAIN' 'ITEM_HEADER' 'SET'.
PERFORM write_form USING 'MAIN' 'DASH_LINE' 'SET'.
****Start of Changes***********************************
DATA: gs_mseg TYPE mseg.
CLEAR: gs_mseg.
SELECT * FROM zeou_pcrdtl INTO TABLE it_pcrdtl
WHERE exnum = doc_no " j_1iexcdtl-exnum
AND exdat = doc_dt. " j_1iexcdtl-exdat.
****End of Changes*************************************
SELECT * FROM j_1iexcdtl WHERE exnum = doc_no AND
exdat = doc_dt.
SELECT SINGLE * FROM zeou_pcidtl INTO it_pcidtl
WHERE ebeln = j_1iexcdtl-rdoc1
AND matnr = j_1iexcdtl-matnr.
****Start of Changes***********************************
SELECT SINGLE * FROM zeou_pcrdtl INTO it_pcrdtl
WHERE exnum = j_1iexcdtl-exnum
AND exdat = j_1iexcdtl-exdat.
SELECT SINGLE * FROM mseg
INTO gs_mseg
WHERE mblnr = j_1iexcdtl-rdoc2
AND mjahr = j_1iexcdtl-ryear2
AND parent_id = j_1iexcdtl-ritem2.
CLEAR it_pcrdtl.
READ TABLE it_pcrdtl WITH KEY mblnr = gs_mseg-mblnr
mjahr = gs_mseg-mjahr
zeile = gs_mseg-zeile.
****End of Changes*************************************
SELECT SINGLE * FROM mara INTO wa_mara
WHERE matnr = j_1iexcdtl-matnr.
SELECT SINGLE * FROM t023t INTO wa_t032t
WHERE matkl = wa_mara-matkl
AND spras = 'EN'.
PERFORM write_form USING 'MAIN' 'ITEM_VALUES' 'SET'.
gv_tot_duty = gv_tot_duty + it_pcrdtl-boedr.
gv_tot_val = gv_tot_val + it_pcrdtl-pcram.
gv_tot_amt = gv_tot_amt + j_1iexcdtl-exbas.
ENDSELECT.
PERFORM write_form USING 'MAIN' 'DASH_LINE' 'SET'.
PERFORM write_form USING 'MAIN' 'TOTAL' 'SET'.
SELECT SINGLE * FROM zeou_pcrhdr INTO it_pcrhdr
WHERE pcrnr = it_pcrdtl-pcrnr
AND pcrdt = it_pcrdtl-pcrdt.
PERFORM write_form USING 'MAIN' 'JOB_WORKER_ADDRESS' 'SET'.
PERFORM write_form USING 'HEADER' ' ' ' '.
text_id = 'PROC'.
*concatenate j_1iexchdr-rdoc j_1iexchdr-ryear into thead-tdname.
thead-tdname = '57FC'.
PERFORM read_text.
LOOP AT tlines.
IF tlines-tdline NE space.
j_1iregset-j_1irgdesc = tlines-tdline.
ENDIF.
ENDLOOP.
PERFORM write_form USING 'FOOTER' ' ' 'SET'.
PERFORM endform.
Update table with entered preprn excise no. "10.05.99
UPDATE j_1iexchdr SET preprn = preprn
WHERE exnum = doc_no
AND exdat = doc_dt
AND srgrp = series.
*& Form OPEN_FORM
text *
--> p1 text
<-- p2 text
FORM open_form.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
application = ''
device = 'PRINTER'
dialog = 'X'
form = 'ZJ_1I_57F4'
IMPORTING
RESULT = RESULT
exceptions
canceled = 1
device = 2
form = 3
OPTIONS = 4
unclosed = 5
OTHERS = 6.
IF sy-subrc NE 0.
MESSAGE e888.
ENDIF.
ENDFORM. " OPEN_FORM
*& Form WRITE_FORM
text *
--> p1 text
<-- p2 text
FORM write_form USING window element fnction.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = element
function = fnction
window = window
IMPORTING
PENDING_LINES =
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
OTHERS = 7.
ENDFORM. " WRITE_FORM
*& Form ENDFORM
text *
--> p1 text
<-- p2 text
FORM endform.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = RESULT
TABLES
OTFDATA =
exceptions
unopened = 1
OTHERS = 2.
ENDFORM. " ENDFORM
*& Form GET_HEADER_DATA
text *
--> p1 text
<-- p2 text
FORM get_header_data.
CLEAR: t001w,j_1iwrkcus,j_1iregset,j_1iindcus.
SELECT SINGLE * FROM t001w
WHERE werks = j_1iexchdr-werks.
SELECT SINGLE * FROM j_1iwrkcus
WHERE j_1iwerks = j_1iexchdr-werks.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'plant customisation not found'.
ENDIF.
SELECT SINGLE * FROM j_1iregset
WHERE j_1iregid = j_1iwrkcus-j_1iregid.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'register id customisation not found'.
ENDIF.
SELECT SINGLE * FROM j_1iindcus WHERE
j_1ibukrs = j_1iexchdr-bukrs.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Customisation missing .. indcus'.
ENDIF.
SELECT SINGLE * FROM lfa1 WHERE
lifnr = j_1iexchdr-lifnr.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Vendor record missing ....'.
**Vendor full address
ELSE.
SELECT SINGLE * FROM t001
WHERE bukrs EQ j_1iexchdr-bukrs.
SELECT SINGLE * FROM adrc
WHERE addrnumber EQ lfa1-adrnr.
ENDIF.
ENDFORM. " GET_HEADER_DATA
*& Form READ_TEXT
text *
--> p1 text
<-- p2 text
FORM read_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = text_id
language = sy-langu
name = thead-tdname
object = 'J1IF'
archive_handle = 0
IMPORTING
header = thead
TABLES
lines = tlines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
ENDFORM. " READ_TEXTHi ,
The form name is passed as a parameter to the FM OPEN_FORM , in your case look at the code
CALL FUNCTION 'OPEN_FORM'
EXPORTING
application = ''
device = 'PRINTER'
dialog = 'X'
form = 'ZJ_1I_57F4' " Form Name
IMPORTING
RESULT = RESULT
exceptions
canceled = 1
device = 2
form = 3
OPTIONS = 4
unclosed = 5
OTHERS = 6.
, Now use se71 to see the from and check the text .
Please do revert back in case you want more information.
Regards
Arun -
I have a customized sapscript available in EN language. I want to change some of the texts and headings to Spanish language. How do you do that? Please give the procedure.
Thanks,
Krishenhi,
once you do the translations to the script texts using SE63,you can assign them to a transport request by using
so the way how you transport the request for an ABAP program the similar way you can release this request also (by using SE09).
when ever the user logged in that specific language,he can see the output in that language.
here is the brief help for how to assign translation to a Transportable request.
USE The program to create request for your translations :
RS_LXE_RECORD_TORDER.
further information for that program input values
1.target language : say your language (translations language)
2. create request automatically --check this checkbox
3. transport of copies (select this radio button)
4. OBJECT type FORM
5. processing date : date in which you last changed the translations
(if you are not very sure when you last changed that,go now to SE63, & do some small change & revert it & then save it again, now your last change would be todays date)
6. Object processor : SAP USER (which USER id changed the translations)
Regards
Srikanth -
Hi All
I have the SAPscript form name. I need to find out the name of the print program.
The table TNAPR gives the standard program name attached to the SAPscript.
But, I need to find out the Z* program name associated with the SAPscript.
Pls do help on this.
Thanks,
Zahabia.hI
Sapscripts are client dependend and smartforms are client independet.
SAPscript are CLient Dependent, SmartForms are Client Independent. The reason why SmartForms are client independent is because when you activate a SMartForm, SAP actually generates a Function Module (which as you know is client independent). The Print Program (or as SAP likes to refer to them these days - Application Program) calls your generated FM.
In the "smartforms" transaction, when you are viewing a smartform, you can go to the Environment->Function Module Name menu path to see the FM name.
Look at the "Application Program" for the Invoice SmartForm (RLB_INVOICE):
determine smartform function module for invoice
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING formname = lf_formname
variant = ' '
direct_call = ' '
IMPORTING fm_name = lf_fm_name
EXCEPTIONS no_form = 1
no_function_module = 2
OTHERS = 3.
call smartform invoice
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_appl_obj =
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = space
is_bil_invoice = ls_bil_invoice
is_nast = nast
is_repeat = repeat
importing document_output_info =
job_output_info =
job_output_options =
EXCEPTIONS formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Difference with SMARTFORMS vs. SapScript (SE71)
The Following are the differences :-
a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
b) It is possible to have a smartform without a main window .
c) Labels cannot be created in smartforms.
d) Routines can be written in smartforms tool.
e) Smartforms generates a function module when activated.
Contributed by : SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips
f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
i) The main difference is that SAP script is client-dependant, while smartform is independent. Also there are some advanced and intreractive features available in smartforms.
You can use an External subroutine-call in sapscript editor like:
/: perform <form_name> in program <program_name>
/: using <var1>
/: using <var2>
/: changing <return1>
/: changing <return2>
/:endperform -
SAPScript: how tu adjust heigh and width of standard text (logo)?
Hi!
how to adjust heigh and width of standard text (logo)?
I do not want to edit the logo, because it is used elsewhere, so I need to adjust heigh and width when using it in a form.
For now stadard text comes over the window. Here is how I use it:
INCLUDE ZHEX-LOGO OBJECT TEXT ID ST
Will reward,
MindaugasHi Mindaugas,
While uploading using RSTXLDMC. You have to maintain your size of the logo.
Go through below mentioned document.
Upload TIFF files to SAPscript texts
Description
The report RSTXLDMC allows a TIFF graphics file to be uploaded from the file system of the R/3 GUI to a standard text in the R/3 word processor SAPscript. (TIFF is a registered trademark of the Aldus Corporation.)
When uploading, the TIFF graphic is converted either into a black and white raster image (parameter type=BMON ) or as a color raster image with a maximum of 256 colors (parameter type=BCOL).
The black and white raster images ( BMON) can be printed using the following printer types:
PCL-5 printer
PostScript printer
Kyocera PRESCRIBE printer
Device type SAPWIN (with SAPlpd 32-bit as of Version 2.41 for Windows NT or Windows 95)
The color raster images (BCOL) can be printed using the following printer types:
PCL-5 printer with color capability (e.g. HP Color LaserJet). Color graphics are not printed properly on monochrome PCL-5 printers (e.g. HP LaserJet 5), because the printer cannot set the color palette as required and does not perform any gray-level conversion.
PostScript printer (color graphics are automatically converted to gray levels on black and white printers using PostScript) Device type SAPWIN (with SAPlpd 32-bit as of Version 2.41 for Windows NT or Windows 95) During TIFF graphic import, the basic set " Baseline TIFF 6.0 " of the TIFF specification 6.0 is supported.
To maintain compatibility with earlier versions of the report RSTXLDMC, it is also possible to convert the TIFF graphic directly into a black and white raster image for a particular printer type when uploading. These are the three printer types PCL-5 (parameter type=PCL ), PostScript (parameter type=POST) and Kyocera PRESCRIBE (parameter type=PRES ). A raster image uploaded in this manner can only be printed using the appropriate printer type.
Besides TIFF raster graphics, direct printer commands in the respective printer language (PCL-5, PostScript or Prescribe) can also be contained in the file which is to be uploaded (printer macros). They are then transferred to the standard text unmodified.
The graphics are output by inserting the standard text into the document which is to be printed, directly or using an INCLUDE command. The printer commands, which for example draw a company logo on the page, are only output if the print request is processed by the printer driver corresponding to the macro type, otherwise they are ignored. Example: A macro of type PCL is contained in a print request. If the request is output to a printer with type HPLJIIID (to which the driver HPL2 is assigned), the macro data is sent to the printer. If the request is printed on a printer of type POSTSCPT (to which the driver POST is assigned), the output of the macro data is suppressed.
In the standard text, the printer commands are inserted between the HEX ... ENDHEX command lines in hex notation. Various report parameters allow the graphic or printer macro to be placed on the page or at the current text position. Note: When the /:HEX command line which precedes the macro appears in the text, a line break is generally made before the graphic is output. The output of the macro therefore begins in the next text line at the left window border of the current page window, as long as a shift to the right is not specified (see below).
If your own printer macros are uploaded and not TIFF files, you must ensure yourself that the normal (text) output of the driver is not impaired when the printer commands are inserted in the output from the uploaded file. The printer drivers pass the data contained in the file to the printer unmodified, therefore without control over the individual actions this triggers on the printer. For example, syntax errors should not be generated by the PostScript commands (type POST), or form feeds should not be contained in the file (unless this was intended) for PCL-5 (type PCL).
Restrictions:
In general, the output of graphics generated via RSTXLDMC from R/3 is not suitable for mass printing (that is, unless you are using the "Graphic resident on printer" feature): the R/3 spooler has to hold significantly more data in its output files. If the graphics occur several times in a spool request, the data also reoccurs. Apart from this, the network is more heavily loaded in sending the increased volume of data to the printer and the printer output is slowed significantly (varies according to printer model) if raster graphics are output as well as the text.
If your graphics reside on your printer during a printing job, the degree of 'correctness' with which they are printed depends on the amount of memory available in your printer. R/3 print drivers are unable to determine whether the amount of memory available is enough! If one of the graphics that you have marked as resident is not displayed, try reloading the graphic and switching off the parameter "Graphic resident on printer".
When printing black and white graphics on PCL-5 printers, image data is compressed in order to greatly reduce the file size.
The output of graphics and macros on PCL-5 printers, PostScript printers and device type SAPWIN (type BMON, BCOL, PCL, POST) is adapted to the page orientation used, that is if landscape is used instead of portrait, the graphic is also turned when output. This is not the case for the PRESCRIBE printers (type BMON, PRES)! With these printers, the graphic is not automatically turned when landscape is used, but appears on the page in the identical position as for portrait. You are therefore recommended not to output raster images when printing in landscape on PRESCRIBE printers.
PRESCRIBE printers do not support the resolutions 200 and 600 dots per inch when printing raster images.
Not all PCL-5 compatible printers support the resolutions 200 and 600 dots per inch when printing raster images.
TIFF graphics with compression type 2 ("CCITT Group 3 1-Dimensional Modified Huffman run length encoding ") can currently not be imported although this is a component of the Baseline TIFF 6.0 specification for monochrome images.
Color TIFF graphics with full color representation (ie. a lot more than 256 colors) are automatically converted into 256 gray levels when uploading with type BCOL.
When TIFF graphics are converted to black and white raster images (type BMON, PCL, POST, PRES) there is no default simulation of gray levels or colors of the original image on the printer (for example, by using different tones of gray). Each pixel of the original image is converted to a white or black pixel on the printer according to its intensity value.
The parameter "Number of TIFF gray levels" does, however, allow a simulation of gray/colour tones of the original image through levels of gray on the printer, when using type PCL, POST or PRES. This parameter is ignored for type BMON.
The conversion of TIFF graphics can be so time-consuming that it is recommendable to execute the report RSTXLDMC in batch processing. Note: in batch, the file is always read from the file system of the application server (ie. not from the file system of the GUI).
The length of an individual text in the text file is limited. When importing TIFF graphics with very large dimensions, especially if more than 2 gray levels are used, a termination can therefore occur when saving the standard text ("EXPORT_TOO_MUCH_DATA"). This restriction can only be avoided by reducing the TIFF graphics. Note: The display of a raster image in Postscript or PRESCRIBE format needs from two to three times as much space as displaying in PCL-5.
When processing very large TIFF images on PostScript printers, a print termination can occur with PS error message "limitcheck". In this case the internal memory of the printer is insufficient to scale the required raster image. This implementation limit cannot be influenced by changing the report parameters when importing.
Requirement
The file which is to be uploaded can contain the following formats/ commands:
Baseline TIFF 6.0 raster image files. The image information of the TIFF file is converted into black and white/color raster images when uploading. Note: As the TIFF format allows a variety of variants, only a basic set of TIFF 6.0 formats is supported here described in the TIFF 6.0 specification as Baseline TIFF 6.0.
PCL : PCL-5, Hewlett Packard Printer Control Language 5 for HP LaserJet 3, 4, 5 series and compatible printers. The data is output by the printer driver HPL2 only.
PRES: Kyocera PRESCRIBE for Kyocera laser printers. The data is output by the printer driver PRES only.
POST: Adobe PostScript or EPS format (encapsulated PostScript ) for PostScript printers. The data is output by the printer driver POST only. In the upload, one of the end-of-file markers (CTRL-D, hex $04) which may be contained in the PostScript file is not transferred.
For PostScript files which contain a bounding box entry (for example, all EPS files) the macro/graphic can be scaled to a size specified by the user. In this case, a small lead text and trailer are generated by the report for the macro data and inserted in the standard text.
Parameters of RSTXLDMC
File name
Path and file name of the file to be uploaded in the file system of the R/3 frontend (dialog processing) or in the file system of the application server (batch processing)
Type
Way which the data contained in the file is to be converted. Possible values are BMON, BCOL, PCL, POST and PRES. With parameter values BMON and BCOL, a TIFF 6.0 file is expected. This is converted into either a black and white raster image (BMON) or a color raster image (BCOL). These raster images are printer-independent and can be printed using various printer types (see above).
With parameter values PCL, POST and PRES, either a TIFF 6.0 file or a file with printer commands in the appropriate printer langauge is expected. If the file is a TIFF file, it is converted into a black and white raster image for the printer type specified in the parameter. The presence of a TIFF file is recognized automatically. If the file is not a TIFF file, the file contents are regarded as the printer macro of the respective type. Data loaded with type PCL, POST or PRES can only be printed on the respective printer type.
Resolution for TIFF raster images
Resolution which should be used when importing a TIFF raster image, in dots per inch (dpi). If an allowed value is entered here, this overrides the resolution information in the TIFF file. The allowed values are:
75 dpi
100 dpi
150 dpi
200 dpi (not for type PRES, for PCL only HP LaserJet 4,5 series)
300 dpi
600 dpi (not for type PRES, for PCL only HP LaserJet 4,5 series)
Changing the resolution affects the size of the graphic on the printer. If a resolution of 300 dpi is stated in the TIFF file and this parameter is set to 75 dpi, the graphic is four times as big when printed as at the outset.
Note: Kyocera PRESCRIBE printers do not support 200 and 600 dpi resolutions.
Note: Not all PCL-5 printers support resolutions 200 and 600 dpi, for example HP LaserJet 3 series does not, but LaserJet 4 and 5 series do.
Graphic Resident on Printer
Normally, graphics that occur more than once in a printing job (a company logo that appears on each page, for example) are sent to the printer repeatedly each time they are needed. In order to avoid this kind of redundancy, you can select this checkbox on the selection screen. The R/3 print driver then stores the graphic in the printer's memory and the printer retrieves the 'resident' graphic memory every time that re-occurs in your job.
Caution: Whether or not the printer correctly reproduces the graphic depends on the amount of memory available in the printer during the printing job! You should avoid using this feature with color graphics since they take up a lot more memory than monochrome graphics.
This parameter can only be used with types "BMON" and "BCOL".
Absolute positioning
Determines whether the macro/graphic is positioned absolutely or is to be output at the current text position. If this checkbox is selected, the graphic is positioned absolutely (parameters "X-position" and "Y-position" are used), if this checkbox is not selected, the graphic is positioned at the current text position (parameters "Reserved height" and "Shift to right" are used)
Absolute X-position
Horizontal position (space from left border) of the macro/graphic, if absolute positioning is required. This is the parameter XPOS of the HEX command.
Absolute Y-position
Vertical position (space from upper border) of the macro/graphic, if absolute positioning is required. This is the parameter YPOS of the HEX command.
Reserve height automatically
If this checkbox is selected, the system automatically inserts the actual height of the graphic during printing into the subsequent "Reserved height" parameter.
Reserved height
If positioned at the current text position, this parameter specifies the horizontal spacing to be reserved for the macro/graphic, which must not be printed with text from the paragraph. This is the parameter HEIGHT of the HEX command.
Shift to right
If positioned at the current text position, this parameter specifies the space between the left border of the macro/graphic and the left border of the page window. If this value is increased, the macro/graphic is shifted to the right. This is the parameter LEFT of the HEX command.
Unit of measurement for positioning
The unit of measurement in which the position values (X,Y, height, shift) are specified. Possible values are CM (centimeters), MM (millimeters), IN (inches), PT (typographic point = 1/72 inch), TW (1/20 point = 1/1440 inch)
Text title
Comment used for the attribute "Title" of the standard text generated as well as as a comment line in the text itself
Line width
Number of columns to be used in the standard text when generating the HEX...ENDHEX command lines. The default value is 132
Text name
Name of the standard text to be generated. If an * character occurs in the name, it is replaced by the value of the parameter "Printer type". For example, if the entry is ZHEX-IMAGE1-* and the printer type = PCL, the text name ZHEX-IMAGE1-PCL is generated. The default value for the name is ZHEX-MACRO-<printer type>, but the standard text can be named as required (take into account customer reserve). Standard texts are client-dependent!
Note: The name of a standard text can be up to 32 characters long !
Text ID
ID of the standard text to be generated. The default value is ST (general standard texts)
Text language
Language key of the standard text to be generated. The default value is the logon language
PostScript scaling
Flag which determines how the macros/graphics of type POST are handled. If set to 'X', the report expects a PostScript comment line in the file
%%BoundingBox llx lly urx ury (e.g. %%BoundingBox -1.5 0 21.4 14.1)
as present, for example, in all EPS files, in which the dimensions and the position of the macro/graphic are specified (if a bounding box comment is not included, 0 0 1 1 is assumed as the default value). This information is then used by the report to insert PostScript commands which scale the macro/graphic to the size specified in the parameters "Width" and "Height" (listed below).
If the flag is set to ' ' (blank), the PostScript file is transferred to the standard text without any additions (any transformations to the coordinate system used by the printer driver must already be contained in the file).
The flag must be set to 'X' for the import of TIFF files for type POST.
Width according to PS scaling
Required width of the macro/graphic if the flag PostScript scaling is set. Can remain at zero for the import of TIFF files, the size is then determined by the resolution of the graphic.
Height according to PS scaling
Required height of the macro/graphic if the flag PostScript scaling is set. Can remain at zero for the import of TIFF files, the size is then determined by the resolution of the graphic.
If you want to scale the PostScript graphic with these parameters, one of the two values, width or height, can be specified with zero. The graphic is then scaled so that the width-to-height ratio remains unchanged and the original graphic is not distorted.
Unit of measurement for PS scaling
Unit of measurement in which the parameters "Width" and "Height" are specified. Possible values are CM (centimeters), MM (millimeters), IN (inches), PT (typographic point = 1/72 inch), TW (1/20 point = 1/1440 inch)
Number of TIFF gray levels
Number of gray tones which are to be used on the printer for displaying the original image. Note: This parameter is only evaluated when using types PCL, POST or PRES!
Possible values are 2,4,9. With the default value 2, each pixel of the original image is converted either to a white or a black pixel on the printer. With the value 4, each pixel of the original image is converted on the printer with 4 pixels, which simulate 4 different gray levels. With the value 9, each pixel of the original image is converted on the printer with 9 pixels which simulate 9 different gray levels.
Note: With values 4 or 9 the resolution of the image is doubled or tripled. The restrictions on the possible resolutions (see previous parameter) then apply for the resulting resolution.
Output
Individual steps of the upload procedure are logged in the report list generated and, if necessary, errors reported. The uploading of TIFF graphics, in particular, is cancelled if there is a variant which is not supported. A message to this effect is then issued. If execution is successful, the report generates a standard text with the key specified in the parameters. If the standard text already exists, a window appears with a warning before the text is overwritten.
Regards,
Ameer Baba. -
How Sapscript form can be send by mail
Hello all,
I want to send a Sapscript form by mail.
I think it should first be converted to PDF form and than need to be send by mail.
I have created a z form which is a copy of standard for medruck and also have changed the standard program SAPFM06P. So I need to add functionality in z program so that i can send the sapscript form by mail.
Can any body let me know the complete process how can i do it?
ThanksHi,
Just follow the below code . I am giving the code which starts from OPEN_FORM. After that one submit program is there u can see the code.
*& Form display_layout
text
--> p1 text
<-- p2 text
FORM display_layout.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
device = 'PRINTER'
DIALOG = 'X'
form = 'YFIL_DUNN_01'
LANGUAGE = SY-LANGU
options = itcpo
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
canceled = 1
device = 2
form = 3
options = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 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.
ENDIF.
LOOP AT i_tab INTO wa_tab.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = '531'
FUNCTION = 'SET'
TYPE = 'BODY'
window = 'MAIN'
IMPORTING
pending_lines = wa_tab.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
result = itcpp
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
OTHERS = 5.
IF sy-subrc = 0.
IF ( itcpp-userexit IS INITIAL AND
NOT itcpp-tdspoolid IS INITIAL ).
p_spool = itcpp-tdspoolid.
SUBMIT yfir_mailsend_pdf_attachment WITH p_spool = p_spool
WITH p_kunnr = p_kunnr.
ENDIF.
ENDIF.
ENDFORM. " display_layout
*& Form modify_duedate
text
--> p1 text
<-- p2 text
FORM modify_duedate.
SELECT SINGLE mat_rec_no
mat_rec_date FROM yfi_matno
INTO (v_mat_rec_no, v_mat_rec_date)
WHERE vbeln = wa_tab-vbeln.
CHECK sy-subrc EQ 0.
SELECT SINGLE zterm
FROM vbrk INTO v_zterm
WHERE vbeln EQ wa_tab-vbeln.
CHECK sy-subrc EQ 0.
SELECT SINGLE zdays
FROM yfi_payment INTO v_zdays
WHERE zterm EQ v_zterm.
IF sy-subrc EQ 0.
wa_tab-zfbdt_due = ( v_mat_rec_date + v_zdays ).
wa_tab-due_days = ( sy-datum - wa_tab-zfbdt_due ).
IF wa_tab-due_days LE 0.
wa_tab-due_days = 'N/A'.
ENDIF.
IF ( wa_tab-umskz = 'A' AND wa_tab-shkzg = 'H' ).
wa_tab-zfbdt = ' '.
wa_tab-zfbdt_due = ''.
wa_tab-due_days = ''.
ENDIF.
MODIFY i_tab FROM wa_tab INDEX sy-tabix.
CLEAR: v_mat_rec_no, v_mat_rec_date, v_zterm, v_zdays.
ENDIF.
ENDFORM. " modify_duedate
SUBMIT PROGRAM :
REPORT yfir_mailsend_pdf_attachment MESSAGE-ID yf.
*& Program Name : *
& Author :
*& Creation Date : *
*& Program Type : *
*& SAP Release : *
*& Description : *
*& Transport No : *
*& Transaction : *
*& Send document with OTF/ALI attachment from spool to externalreci-
*& pient. OTF/ALI document is converted to PDF/HTML format duringthe
*& SAPconnect send process.
*& This report serves as example documentation for the function
*& modules SO_NEW_DOCUMENT_ATT_SEND_API1 and SO_DOCUMENT_SEND_API1.
*& Following this example you should be able to develop your own
*& report to send documents with all kinds of attachments.
Creation of the entry for the compressed document
*& TABLES:
TABLES : kna1,
adr6.
*& INTERNAL TABLES:
***********PDF Declaration*******
DATA: BEGIN OF i_spool OCCURS 0,
rqident LIKE tsp01-rqident,
rqo1name LIKE tsp01-rqo1name,
rqclient LIKE tsp01-rqclient,
END OF i_spool.
*& VARIABLES :
DATA: client LIKE tst01-dclient,
name LIKE tst01-dname,
objtype LIKE rststype-type,
type LIKE rststype-type.
DATA: spoolno LIKE tsp01-rqident,
download TYPE c VALUE 'X', "AS CHECKBOX DEFAULT 'X',
p_file LIKE rlgrap-filename
VALUE 'C:\Invoice.pdf', "#EC NOTEXT
otf LIKE itcoo OCCURS 100 WITH HEADER LINE,
cancel,
pdf LIKE tline OCCURS 100 WITH HEADER LINE,
doctab LIKE docs OCCURS 1 WITH HEADER LINE,
numbytes TYPE i,
arc_idx LIKE toa_dara,
pdfspoolid LIKE tsp01-rqident,
jobname LIKE tbtcjob-jobname,
jobcount LIKE tbtcjob-jobcount,
is_otf.
Data Declaration
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
*objpack-head_start = 1.
*objbin = ' | '. APPEND objbin.
*DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
objpack-head_start = 1.
*& PARAMETERS:
PARAMETERS : p_spool LIKE tsp01-rqident NO-DISPLAY,
p_kunnr LIKE kna1-kunnr NO-DISPLAY.
*& M A I N P R O C E S S
*& START OF SELECTION.
START-OF-SELECTION.
SELECT SINGLE
adr6~addrnumber
adr6~smtp_addr
FROM adr6
INNER JOIN kna1
ON kna1~adrnr = adr6~addrnumber
INTO CORRESPONDING FIELDS OF adr6
WHERE kna1~kunnr = p_kunnr.
IF sy-subrc = 0.
Create receiver list
reclist-receiver = adr6-smtp_addr. "<-- customer address
reclist-rec_type = 'U'.
APPEND reclist.
ENDIF.
***Convert Spool request to PDF
PERFORM pdf_convert.
docdata-obj_name = 'MAIL_AEIW'.
docdata-obj_descr = 'Dunning'.
Main Text
objtxt = 'Hi,'.
APPEND objtxt.
objtxt = 'Dunning'.
APPEND objtxt.
objtxt = 'Regards'.
APPEND objtxt.
Write Packing List (Main)
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
Create Message Attachment
Write Packing List (Attachment)
att_type = 'PDF'.
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
*objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-doc_size = tab_lines * 255.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = 'Attached Document'.
APPEND objpack.
*check for not maintaining customer address
IF reclist IS INITIAL.
MESSAGE e000 WITH 'Please Maintain Customer e-Mail ID'.
LEAVE LIST-PROCESSING.
ELSE.
Send Message
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel.6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
OBJECT_PARB =
receivers = reclist
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ELSE.
WRITE 'Mail sent successfully'.
ENDIF.
ENDIF.
WRITE: / 'End of Program'.
*& Form pdf_convert
text
--> p1 text
<-- p2 text
FORM pdf_convert.
DATA: date1 LIKE sy-datum,
time1 LIKE sy-uzeit,
period1 LIKE tsp01-rqcretime.
date1 = sy-datum.
time1 = sy-uzeit.
date1 = date1 - 1.
CONCATENATE date1 time1 INTO period1.
SELECT rqident
rqo1name
rqclient FROM tsp01 INTO TABLE i_spool
WHERE rqowner = sy-uname AND
rqclient = sy-mandt AND
rqident = p_spool.
IF sy-subrc <> 0.
WRITE: / 'No Spool Request created today'(003)
COLOR COL_NEGATIVE.
EXIT.
ENDIF.
SORT i_spool DESCENDING BY rqident.
READ TABLE i_spool INDEX 1.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = i_spool-rqclient
name = i_spool-rqo1name
part = 1
IMPORTING
CHARCO =
CREATER =
CREDATE =
DELDATE =
MAX_CREDATE =
MAX_DELDATE =
NON_UNIQ =
NOOF_PARTS =
RECTYP =
SIZE =
STOTYP =
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = i_spool-rqident
no_dialog = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
OTF_PAGECOUNT =
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.
CASE sy-subrc.
WHEN 0.
WHEN 1.
WRITE: / 'Error On Spool Job'(002)
COLOR COL_NEGATIVE.
EXIT.
WHEN 2.
WRITE: / 'No Permission'(003)
COLOR COL_NEGATIVE.
EXIT.
WHEN 3.
WRITE: / 'Conversion Not Possible'(004)
COLOR COL_NEGATIVE.
EXIT.
WHEN OTHERS.
WRITE: / 'Incorrect Destination Device'(005)
COLOR COL_NEGATIVE.
EXIT.
ENDCASE.
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src = 134
line_width_dst = 255
TABLES
content_in = pdf
content_out = objbin
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
ENDFORM. " pdf_convert -
Creating checkbox in SMARTFORMS
hi experts,
Is there anyway to create checkboxes in smartforms? Even if we do create them, would it appear in the print preview?Hi Vijay,
I need to print empty check box in SAPScript, but the menu path Insert ->character->SAP symbol is disabled in the script, how to insert this symbol otherwise.
Thanks
Senthil -
Hello All
Iam having a sapscript in original language Japanese. This form is available in different languages.
Now i have developed the same sapscript in new language chinese.
How to transport the Chinese sapscrpt form alone not the other forms with the same form.
When i imported the sapscript all the languages got imported so i do not want to transport the other only the Chinese language alone
Thanks
AjayHi ajay ,
In the form settingss there is one option like checkbox convert to all languages
try that u can solve ur issue
Let me know if u have any concernss...
Regards,
Lokesh. -
Hi ,
Can anyone please provide me a code to mail the sapscript as an pdf attachment . We can convert the sapscript in the spool into pdf using RSTXPDFT4 . How do I mail this as an attachment. Also I want to schedule this program in background . I made a search in this forum but none of them confirm to my requirement .
Regards,
Ben.
Message was edited by: Daniel BenHi Daniel,
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
screen *
report zxxx_alvmail_pdf .
parameter: p_email1 like somlreci1-receiver
default '[email protected]',
p_sender like somlreci1-receiver
default '[email protected]',
p_delspl as checkbox.
*DATA DECLARATION
data: gd_recsize type i.
Spool IDs
types: begin of t_tbtcp.
include structure tbtcp.
types: end of t_tbtcp.
data: it_tbtcp type standard table of t_tbtcp initial size 0,
wa_tbtcp type t_tbtcp.
Job Runtime Parameters
data: gd_eventid like tbtcm-eventid,
gd_eventparm like tbtcm-eventparm,
gd_external_program_active like tbtcm-xpgactive,
gd_jobcount like tbtcm-jobcount,
gd_jobname like tbtcm-jobname,
gd_stepcount like tbtcm-stepcount,
gd_error type sy-subrc,
gd_reciever type sy-subrc.
data: w_recsize type i.
data: gd_subject like sodocchgi1-obj_descr,
it_mess_bod like solisti1 occurs 0 with header line,
it_mess_att like solisti1 occurs 0 with header line,
gd_sender_type like soextreci1-adr_typ,
gd_attachment_desc type so_obj_nam,
gd_attachment_name type so_obj_des.
Spool to PDF conversions
data: gd_spool_nr like tsp01-rqident,
gd_destination like rlgrap-filename,
gd_bytecount like tst01-dsize,
gd_buffer type string.
Binary store for PDF
data: begin of it_pdf_output occurs 0.
include structure tline.
data: end of it_pdf_output.
constants: c_dev like sy-sysid value 'DEV',
c_no(1) type c value ' ',
c_device(4) type c value 'LOCL'.
*START-OF-SELECTION.
start-of-selection.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
write 'Hello World'.
new-page.
commit work.
new-page print off.
if sy-batch eq 'X'.
perform get_job_details.
perform obtain_spool_id.
Alternative way could be to submit another program and store spool
id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
perform convert_spool_to_pdf.
perform process_email.
if p_delspl eq 'X'.
perform delete_spool.
endif.
if sy-sysid = c_dev.
wait up to 5 seconds.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
else.
skip.
write:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
endif.
FORM obtain_spool_id *
form obtain_spool_id.
check not ( gd_jobname is initial ).
check not ( gd_jobcount is initial ).
select * from tbtcp
into table it_tbtcp
where jobname = gd_jobname
and jobcount = gd_jobcount
and stepcount = gd_stepcount
and listident <> '0000000000'
order by jobname
jobcount
stepcount.
read table it_tbtcp into wa_tbtcp index 1.
if sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
message s004(zdd) with gd_spool_nr.
else.
message s005(zdd).
endif.
endform.
FORM get_job_details *
form get_job_details.
Get current job details
call function 'GET_JOB_RUNTIME_INFO'
importing
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
exceptions
no_runtime_info = 1
others = 2.
endform.
FORM convert_spool_to_pdf *
form convert_spool_to_pdf.
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
importing
pdf_bytecount = gd_bytecount
tables
pdf = it_pdf_output
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.
check sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
loop at it_pdf_output.
translate it_pdf_output using ' ~'.
concatenate gd_buffer it_pdf_output into gd_buffer.
endloop.
translate gd_buffer using '~ '.
do.
it_mess_att = gd_buffer.
append it_mess_att.
shift gd_buffer left by 255 places.
if gd_buffer is initial.
exit.
endif.
enddo.
endform.
FORM process_email *
form process_email.
describe table it_mess_att lines gd_recsize.
check gd_recsize > 0.
perform send_email using p_email1.
perform send_email using p_email2.
endform.
FORM send_email *
--> p_email *
form send_email using p_email.
check not ( p_email is initial ).
refresh it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
append it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
append it_mess_bod.
If no sender specified - default blank
if p_sender eq space.
gd_sender_type = space.
else.
gd_sender_type = 'INT'.
endif.
Send file by email as .xls speadsheet
perform send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
endform.
FORM delete_spool *
form delete_spool.
data: ld_spool_nr type tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
check p_delspl <> c_no.
call function 'RSPO_R_RDELETE_SPOOLREQ'
exporting
spoolid = ld_spool_nr.
endform.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
form send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
data: ld_error type sy-subrc,
ld_reciever type sy-subrc,
ld_mtitle like sodocchgi1-obj_descr,
ld_email like somlreci1-receiver,
ld_format type so_obj_tp ,
ld_attdescription type so_obj_nam ,
ld_attfilename type so_obj_des ,
ld_sender_address like soextreci1-receiver,
ld_sender_address_type like soextreci1-adr_typ,
ld_receiver like sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
clear w_doc_data.
read table it_attach index w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + strlen( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
clear t_attachment.
refresh t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
clear t_packing_list.
refresh t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
describe table it_message lines t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
append t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
describe table t_attachment lines t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
append t_packing_list.
Add the recipients email address
clear t_receivers.
refresh t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'B'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
append t_receivers.
call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
importing
sent_to_all = w_sent_all
tables
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
loop at t_receivers.
ld_receiver = t_receivers-retrn_code.
endloop.
endform.
Regards,
Laxmi -
What does this code do (in SAPScript)
I am having trouble converting a SAPScript to SmartForm. Part of the reason is that I don't understand the SAPScript.
include &vblkp-zztdnameh& object vbbk id 0001 paragraph HT
if &sapscript-subrc& = ' 0'
Also is anybody willing to export a preconfigured (standard) SmartForm for me? I am looking for the PickList (SDPIK). We do not have the Best Practices update so I am not able to import the SAP Preconfigured SmartForms. I am on ECC 5.0
Regards,
DavisIt will print 1 object with the Object of 'VBBK' (delivery header I believe), ID of '0001', and name of 'zztdnameh' .
Have a look at structure THEAD and/or FM READ_TEXT. This should help clarify things for you.
In your smartform create a Text Node and make the Text Type 'Include Text'.
Name = &vblkp-tdnameh&
Object = VBBK
ID = 0001
Check the 'No error if no text exists' checkbox.
Message was edited by:
Matt Nagel -
Change the transport package of a SAPScript, Smartform
Hi!
There are several SAPScripts and Smartforms in our system, which is assigned to a transport package Z1, which points to nowhere, so it's just a technical, local package.
Now the basis team set up a new system, and there is a new package Z2, which points to this new system.
So I would like to assign the object from Z1 to Z2 package.
Within a program it could be easily changed.
How can I change it in a SAPScript or within a Smartform?
Thank you
Tamá> How can I change it in a SAPScript or within a Smartform?
>
for smartforms
in the smartforms transaction
enter the formname which you want to change , and from menu Goto->Object Directory Entry , now you can edit the package , using the change mode option.
For script.
go to Transaction SE03
Now you can see Object Directory entry option, press the change button.
(change object Directory entries)
Enter FORM in the input for object type, it comes in this way, now check the checkbox.
check RETR FORM <formname>
press F8,
Now you will see the option to change the Directory entry in the result screen. -
Diffrence b/w sapscript & smart forms?
hi
wat is the diffrence b/w sapscript & smart forms?
deepakHi Deepak,
Difference with SMARTFORMS vs. SapScript(SE71)
The Following are the differences :-
a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
b) It is possible to have a smartform without a main window .
c) Labels cannot be created in smartforms.
d) Routines can be written in smartforms tool.
e) Smartforms generates a function module when activated.
f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
check out this link:
http://www.sap-img.com/smartforms/sap-smart-forms.htm
Reward points if helpful.
Thanks,
Maybe you are looking for
-
Update a site column dynamically to Approval Status
Hello all this is what I have; InfoPath form with Form Status field (Form Status promoted to SP form library as site column) form switches to read only view when Form Status = Approved SharePoint form library set to require content approval Copied an
-
Why isn't the "Find My iPad", "Find My Mac", etc. feature not automatically enabled in the iCloud Settings on every device? My iPad was stolen a couple days ago and it's been showing Offline under "Find My iPhone" feature so I started doing some rese
-
Will this usb/firewire card work under OSX jaguar?
here is the link to it. I know it says windows but could it possibly work on mac? http://www.jr.com/JRProductPage.process?Product=3995178
-
Earlier today I was going through the routine of upgrading my phone and switching is Edge. I got to the point of the process where you view the Verizon Edge agreement. I did not accept because I was debating on a different phone. I backed out and
-
Has anyone tried calling a rule from inside an email template? It seems like everything has to be passed in from the workflow to the template. I'm wondering if I can call a rule from inside the template itself to get the data. Thanks!!