SAP SCRIPT ALIGNMENT

All,
I am developing a form with SAP Script. In the header window  (it is a single window using the almost entire width of page format DINA4)i am using three character formats for printing heder lines ofr ex: helve 8, helve 10 Bold and Helve 14 bold. When i see the print preview the alignment is perfect. But when i print the page alignment of header window is distorted. Why is it so? There is some other form using different character formats developed in smart forms. Here print out is coming properly. is this the problem with SAP script. If so what is the work around for this?
Rakesh

Hi
Certain FONTS were not supported by certain printers, hence you may be getting such problem
see the following OSS notes
OSSNote:960341
Symptom
In some device types (e.g HPLJ4, HPLJ5) you experience non-uniform character spacing in the PDF document after the PDF conversion of SAPscript or Smart Forms documents, using HELVE or TIMES fonts. You want to know the reason.
Other terms
CONVERT_OTF, SAPscript, Smart Forms
Reason and Prerequisites
The problem is not due to an error in the PDF converter but due to the fact, that the printer font, underlying the device type (e.g. Univers or CG Times in PCL-5 device types), is not available for the PDF converter and is either not available in Adobe Reader. The PDF converter has to try to simulate the layout of the printer font by means of a font which is predefined in Adobe Reader. This is done by assigning the letter widths of the printer font to the font used in Adobe Reader.
The PDF file contains a table with letter widths, used by Adobe Reader in the output of text, for each used printer font (except PostScript fonts).
Example:
%Charwidth values from HP4300 HELVE 060 normal
/Widths
[ 278 333 500 633 633 1000 758 333 333 333 633...
Adobe reader converts this width table, by modifying the space between each character, so that the specified letter width (= space between the current and the next letter) is kept.
This 'Simulation' of printer fonts results in the sometimes visible irregular spaces in PDF.
The PDF converter always uses the Helvetica Adobe PostScript font for the display of HELVE and the Times Roman Adobe PostScript font for the display of TIMES. However, for these Adobe PostScript fonts, Adobe Reader often uses a Windows TrueType font, which differs slightly from the original PostScript font.
Solution
Workaround: Use the POST2 PostScript device type or the PDF1 PDF device type for the PDF conversion of documents in the Latin-1 character set. They both use the Adobe PostScript fonts Helvetica or Times Roman for the HELVE/TIMES printer fonts.
Header Data
Release Status: Released for Customer
Released on: 30.06.2006  12:44:06
Priority: Recommendations/additional info
Category: Consulting
Primary Component: BC-CCM-PRN Print and Output Management
Secondary Components: BC-SRV-SCR SAPscript
OSS Note: 776507
Symptom
Documents printed via SAPscript or SmartForms do not print with correct special characters, e.g. ### prints instead of Japanese or Russian characters. What to do?
Other terms
SAPscript, SmartForms, printing, device types, OTF
Reason and Prerequisites
Help required to choose proper fonts in a SAPscript or SmartForm
Solution
When using SAPscript or SmartForms to print (or email or fax) a form from a business application, many factors influence the outcome of the actual text within the form. All these factors must be checked in order to ensure a correct printout:
1) The language version of the form used to produce the printout.
Example: If you want to print a French invoice, you need to have a FR version of your SAPscript or SmartForms invoice form RVINVOICE01. And the application program must specify the corresponding language key (FR) when calling the SAPscript or SmartForms API.
2) The font selections specified in the form (possibly also in a SAPscript style or SmartStyle used in a form).
Example: In a SAPscript form or a SmartStyle you need to specify HELVE if you want to print German text in Helvetica (or similar) font. If you want to print Japanese text, HELVE is not a valid choice but you need to specify a Japanese font like JPMINCHO in your Japanese form.
3) The output character set of the device type
Every printer in transaction SPAD has a "device type" assigned. Device types used by the spooler for printing support only one single specific output character set. All text from the form has to be converted (using SAP's built-in character conversion mechanism) to this output character set.
A character set can typically support either a single language (e.g. Shift-JIS which supports only Japanese) or a set of languages (e.g. ISO 8859-1, which supports Western-European languages). It is possible that a given language (such as German) can be supported by several output character sets, e.g. you may use either ISO 8895-1 (Latin-1) or ISO 8859-2 (Latin-2) to represent German text. This is so because both character sets contain the special characters used in German.
Example: HPLJ4000 is a HP LaserJet device type supporting the ISO 8859-1 (Latin-1) character set. ISO 8859-1 can be used to represent e.g. Dutch, English, French, German, Spanish, Swedish but NOT Russian or Japanese.
As a consequence, it is ok to use HPLJ4000 to print English, German French etc. but not for Japanese or Russian.
4) The set of available printer fonts for a given device type
When formatting a document, SAPscript and SmartForms perform an automatic mapping of the font definitions in the form (e.g. "HELVE 14 point bold") and the available printer fonts of the device type. A replacement printer font is chosen, should the specified font selection not be available in the device type. Now this replacement can be problematic if a language-specific font, such as Chinese CNSONG, is specified in a form and it gets replaced by a font which does not support this language, e.g. COURIER.
To solve this problem, font families in SE73 have language attribute assigned, e.g. some fonts are characterized as being suitable only for certain languages. And when a replacement has to be chosen because the original font from the form is not available in the device type, a replacement font is chosen which has the same language attributes.
If no fonts for the language in question exist in the device type, the resulting font will not be able to print the special characters and you will see "wrong" output characters in the printout.
Note on SAPscript/SmartForms Print Preview:
The OTF Print Preview available in Windows GUI (e.g. from transaction SP01) will sometimes not show the "wrong" characters which appear on the final printout. Here is the reason: since the Print Preview runs in Windows environment, it will use Windows fonts to represent the actual printer fonts. A Windows font typically has more available characters (i.e. covers more character sets) than are actually available in a printer's resident font.
A typical example where the Print Preview will differ from the printout is here: if you have a Chinese PCL5 printer such as CNHPLJ4 and use the Western Latin font COURIER in your document, the print preview will show you Chinese characters if you (by accident) tried to format Chinese characters in COURIER font. This is because Windows will automatically choose a font that can output Chinese characters (which is actually not Courier). But when you print the job on an actual PCL5 printer with resident Western and Chinese fonts, the Courier font will not print any Chinese characters but Western special characters instead, because the printer's resident Courier font does not include Chinese characters.
Rule of thumb: all Asian device types (e.g. CNHPLJ4, JPHPLJ4, JPPOST, KPHPLJ4) support not only Asian fonts but also COURIER, HELVE and TIMES fonts. But these Latin fonts can only be used to print English text, not Chinese/Japanese/Korean characters.
Which fonts are suitable for a given language?
Language(s):            Font family to use in a form:
Latin-1 (Western Europe/Americas) *******
DE,EN,FR,ES,NL,SV       COURIER, HELVE, TIMES
                        (LETGOTH, LNPRINT)
Latin-2 (Central Europe) ****************
PL, CZ                  COURIER, HELVE, TIMES
ISO 8859-4 (Baltic) *********************
ET, LT, LV              COURIER, HELVE, TIMES
ISO 8859-5 (Cyrillic) *******************
BG, RU, SR, UK          COURCYR, HELVCYR, TIMECYR
ISO 8859-7 (Greek) **********************
EL                      COUR_I7, HELV_I7, TIME_I7
ISO 8859-8 (Hebrew) *********************
HE                      COURIER, HELVE, TIMES
ISO 8859-9 (Turkish) ********************
TR                      COURIER, HELVE, TIMES
Simplified Chinese **********************
ZH                      CNHEI, CNKAI, CNSONG
Japanese ********************************
JA                      JPMINCHO, DBMINCHO, DBGOTHIC
Korean **********************************
KP                      KPBATANG, KPDODUM, KPGULIM
                        KPGUNGSE, KPSAMMUL
Traditional Chinese *********************
ZF                      TWDPHEI, TWMING, TWSONG
Thai ************************************
TH                      THANGSAN, THDRAFT, THVIJIT
Arabic (Unicode systems only) ***********
AR                      ANDALE_J
Verify your output by examining the OTF data
When analysing printing problems of this type, be sure to check the OTF data which gets produced by SAPscript or SmartForms. OTF or "Output Text Format" is the intermediate page-description format generated from SAPscript or SmartForms. OTF will contain the final printer font names and character set/language identifiers which help to solve the problem. OTF will even name the form and the language of the form used to create the output.
The easiest way to do this is to create a spool request from your application, run transaction SP01, use menu
Goto->Display Requests->Settings
and choose
Display Mode: Raw
Now display your spool request. If this is a SAPscript or SmartForms spool request, you will see OTF data. Each line represents one OTF command, every command starts with a 2-character cmd identifier and possibly some cmd parameters follow.
Here is an excerpt from a sample OTF file where we highlight the most interesting commands:
//XHPLJ8000    0700 00000000001
IN04EALEXTEST_ZEBRA
IN05%PAGE1
OPDINA4  P 144  240 1683811906000010000100001
IN06%WINDOW2
MT0024401289
CP11000000E
FCHELVE  120  00109XSF100SF101110000067E X
UL +0000000000000
SW00067
CT00000000
ST0453037Dieses SF hat Stil ALEXTEST_ZEBRA mit
The 1st line with the // (Control) command reveals the device type usedto print: HPLJ8000
//XHPLJ8000    0700 00000000001
The 2nd line (IN = Info command) shows the name and (internal 1-char)language key of the form:
IN04EALEXTEST_ZEBRA
In this case it is the English (E = EN) SmartForm ALEXTEST_ZEBRA
The OP-line (OP = Open Page) gives the page format used in the form, it is DINA4 Portrait orientation:
OPDINA4  P 144  240 1683811906000010000100001
The CP (CodePage) cmd shows the SAP system codepage used to code the text and the active language. In our case it is codepage 1100 and language E = EN = English.
CP11000000E
Finally, the FC-cmd (Font Call) lists a printer font selected within SmartForms. Please note that every SmartForm has a designated default SmartStyle under "Form Attributes->Output Options". In addition, every text node can have a SmartStyle attached (which will override the definitions from the default style for the text). In our case the resulting printer font that was selected is HELVE 12.0 pt bold-off, italic-off.
FCHELVE   120  00109XSF100SF101110000067E X
Header Data
Release Status: Released for Customer
Released on: 22.08.2005  09:57:20
Priority: Recommendations/additional info
Category: Customizing
Primary Component: BC-CCM-PRN Print and Output Management
Secondary Components: BC-SRV-SCR SAPscript
BC-SRV-SSF Smart Forms
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • Problem in SAP-script alignment

    Hi Experts,
    Need your help in aligning script.
    in the script output , one field "BAPIESLL-QUANTITY" in not getting display properly.
    Problem is if it fetches 6 digit value e.g.100000, it displays proprly aligned but if it fetches 2 digit values its not coming in proper alignment.
    I have maintained its left margin as 0.40 CM and TAB as 1CH left alignment.
    output is like
    1st Output                                                                                2nd Output
    ACCOM ALLOW HYDRAULIC SERV                                        ACCOM ALLOW HYDRAULIC SERV
         60                                                                                100000
    I am not getting why its showing 2 different alignment format for same filed.
    Could you please help me in this issue.
    Thanks in advance.
    Regards,
    Rachna

    Rachna,
    Welcome to SDN.
    All quantity and currency fields should be provided with Right-justified.
    also in ur code in sapscript hope u used tab notations.
    &FIELD1& ,, &FIELD2&
    here '  ,,  ' will be tab of 0.40 CM
    other wise ur field 2 will be starting after the field1.
    Regards
    Syed A

  • Issue in alignment of PE51 data when printing it in SAP Script

    Hi Experts
    I have a SAP Script which is used to print Check at the top and Re-numeration Statement at the second half via RFFOUS_C program. The re-numeration statement is designed in PE51. The Check is designed in SAP Script and the PE51 form is printing inside the script using Main window/ Text Element : 525-HR.
    The FM RP_IMPORT_PAY_STATEMENT is used inside the RFFOUS_C program which returns the table PFORM and the contents of  the PFORM is exactly the re-numeration statement data and are getting  printed one by one in the script using the variable REGUD-TXTHR. My object is fine with all the above said things. Only issue is with the alignment which is weird in SAP Script for the re-numeration part. But when I look into PC00_M10_CEDT (TCODE to view re-numeration statement) the output of designed PE51 form is good with proper alignment.When it is printed via script the alignment is not good at all.
    There is some differences in the formats of printing between PE51 and SE71. Do not know what exactly it is. How I can resolve this issue?
    Thanks
    Siva
    Message:Siva

    Hi Madhu,
    Sorry for the delayed response.See the below screen shot.This is how it prints now.The amounts are not aligned.Increasing the line spacing will increase only the space between the lines and i am using same character format for the variable REGUD-TXTHR.I would like to align them.
    Thanks
    Siva

  • Drawing Table & Displaying Data in SAP Script : Data Alignment probelm

    Hi Experts,
    I am Developing An SAP Script in Which Had to Display Data in a Table with Three column & multiple rows, i had created the Table using BOX Command in SAP SCRIPT & assigned a TEXT Element to it & calling this text element while Looping in WRITE_FORM FM.but while displaying DATA in One column the data in another columns shift to the right & if the data in 1st column is less the data in the second column shift to the left. i know these issues had been covered in the past but i am not getting any concrete results from searching in the forum.
    Also On more problem when ever i am declaring a text element in some other window & also giving the Command BOX inside it to draw outline the BOX is not drawn.
    This seem to be an alignment issue . Experts Please provide me with some alternative.
    Thanks & Regards
    Priyesh Shah

    Hi ,
    To stop columns going left and right.Use number of position in the variable .Like fix the lenght &name(10)&.Here name can print 10 characters.
    For box not appearing in other window check the box command parameters .It will draw.Not a alignment problum.

  • Issue with the font and alignment in SAP Script PDF

    Hi Experts,
    I have a problem with the font in SAP Script PDF conversion.
    The output of the form is working fine but in the PDF the output is wrong.
    There is a dutch letter ' ï ' which is pinted in the form output correctly but in the PDF output the character
    has been changed to '#'.
    and also the alignment of some text has beed changed without line spacing in between.
    Please let me know what could be the problem and how to solve this issue.
    Thanks in advance,
    Regards,
    Sankara Chakradhar.

    Hi Prabhudas,
    I am using the FM 'CONVERT_OTF' to convert the data to pdf.
    The FM CLOSE_FORM is creating the IT_OTF internal table and the CONVERT_PDF uses that internal table to populate the         IT_PDF internal table and then using the FM 'SO_OBJECT_SEND' to send the PDF file to mail.
      CALL FUNCTION 'CONVERT_OTF'             
           EXPORTING                          
                format       = 'PDF'          
           IMPORTING                          
                bin_filesize = g_filesize     
           TABLES                             
                otf          = it_otf         
                lines        = it_pdf.        
    Regards,
    Sankara Chakradhar.

  • Aligning data in sap script

    hi guyz,
    how can i align data in sap script with spaces between..
    regards

    Hi,
    you have to create paragraph formats for this, in paragraph format you can define tab sapces.
    use that paragraph format in command box of ur window editor, where ever you want the space just use ',,'  which will apply tab space (the sapce you have declared).
    reward if useful,
    Thanks,
    Sreeram.

  • HI, Alignment Problem in SAP Script

    Hi Friends
    I am working on SAP Script, I have the problem alignment, in the first row I need to show 8 values,
    among them all the times length is not same, so my script is not displaying in proper alignment,
    I have tried with all the ways which I known, specifying the length, and using (*), but still it is not
    coming properly, is there any method to specify the position exactly like as in reposrting.
    Please help me in this, this is very urgent.
    Thanks and Regards
    Praveeb

    Hi Nagesh
    Thanks for your reply,
    I am displaying in the first row,  here I am mentioning the filed and lenght of the field
    1) Date(10)
    2) Reference No(16), .
    3) Fiscal Year(4),
    4) Internal Reference(3),
    5) Item Text (50)
    6) Due Date (10)
    7) Original Currency(3)
    8) Amount (18).
    In the field item text length is vary from each entry, it wont be static all the times, if one customer having having 10 records, all ten line items are not coming in the proper order, after displaying the item text, remaining fields are running out from the alignment. I am using tab space as 2 characters, I kept even so many conditions on the item text lenght, but still there are problems. I tried with specifying the length in
    the script for the symbols also no use and I passed (*), this is also not working properly. Here I am sending the code of my script. Please have a look and give me a suggestion please.
    bold Heading bold
    Date,,,,  ACR Ref No,,,,  UW-  Inst- Cedant,,,,,,,,,,
         ,,,,,,,,,,,,Due Date,,,, Original-,,,,Amount
         &wa_final-date(10)&,,&wa_final-xblnr(16)&,,&w_year(4)&,,
         &wa_final-xref1(3)&,,&wa_final-sgtxt(50)&
         ,,,,,,,,&wa_final-zfbdt(10)&,,,,&wa_final-waers(6)&,,,,&w_amt3(18)&
           &wa_final-date(*)&,,&wa_final-xblnr(*)&,,&w_year(4)&,,
         &wa_final-xref1(3)&,,&wa_final-sgtxt(*)&
         ,,,,,,,,&wa_final-zfbdt(*)&,,,,&wa_final-waers(*)&,,,,&w_amt3(*)&

  • SAP script printout alignment issue

    Hi Experts,
    I have facing one Script Printout Alignment issue.
    SAP Script Form printing some Values in Table format.
    While debugging( in debug mode ), I am getting the correct Alignment ( Proper table format with values ).
    But in printout the Alignment( The vertical and horizontal lines are not printed properly ) is not correct.
    Thanks in Advance.

    HI Glen Anthony,
    I am not using any printer details.
    from the Spol (SP01) I am checking the print priview.
    Success in debug mode but not in Print.
    Please suggest.
    Thanks

  • Alignment problem in SAp Script

    Hi All,
    I am quite new to ABAP. I was working in .net for two years. I am developing an
    SAP script which includes table layout. No my problem is that certain texts in certain columns is so longer that the alignment get distorted. Is there any way in sap script by which we can bring down the text to next line if the text length exceeds certain limit. In web development it is possible to display like that and i hope it is possible in sap script also. Could any one please help me?

    Hi,
    First you need to consider the of the maximum possible length of each program symbol you are giving in the table layout. Depending upon that you need to create Tab spaces in "Paragraph formats" option.
    Each tabspace will allocate certain length of space to each program symbol.
    Plz reward if helpful.
    Thanks,
    Nagendra

  • Table content alignment in SAP Scripts

    000010       MAG DX 17P           7,000                   PC     1.520,00       10.640,00
    000020       mag pa/dx  175             6,000             PX     1.599,00       9.594,00
    000030       MVC MULTI SYNC XV15      5,000      PC     2.301,00       10.155,00
    000040       MVC MULTI SYNC XV   17   1,000      PC     2.389,00        2.389,00       
    The above is the output i got...
    table i hv used is VBAP
    POSEX  -  6
    ARKTX  -  40
    KWMENG  - 15
    MEINS - 3
    NETPR - 11
    ZWERT - 13
    TABS i hv specified in paragraph format is 1,7,47,62,65,76,89....
    i hv compressed the kwmeng,netpr,zwert field as it has leading zeros....
    How to arrange the table contents in proper order?
    how to wrap the ARKTX field contents as it is too long for certain vbeln values...i think its the reason y im nt getin o/p in proper format......
    Is there any mapping need to be done for CURRENCY & QUANTITY fields as we do in smartforms....if so pls provide needful help...

    If i try these tab values am getting it as such.....
    000010 MAG DX 17P  7,000                                 PC                           1.520,00  
    10.640,00
    000020 mag pa/dx    175 6,000                            PX                           1.599,00
    9.594,00
    000030 MVC MULTI SYNC XV15     5,000           PC                            2.301,00
    10.155,00
    000040 MVC MULTI SYNC XV 17      1,000         PC                            2.389,00
    2.389,00
    i think the problem is with the field "item decription"- ARKTX.......
    In smartforms there is a tab to map with currency and quantity fields ,is there anything as such in sap scripts?

  • How to set the position in SAP Script

    Hi Professionals,
    Can anyone tell me that How can I set the position of an bitmap Image (after inserting) in SAP Script ?
    by default position is in Left, I need to align it in center or somewhere else.
    Anybody knows, kindly reply!
    Thanks
    Devinder

    Hi,
    But Can we assign a window under another window. Because I want to insert a bmp picture on particular position.
    example:- there is a digital signature and wanted to insert upon a name.
    So, there is a text (which is customer name) and digital signature (in bmp picture format) upon it.
    Thanks
    Devinder

  • Vertical line issue in SAP Script main window

    Hi All,
    I want to draw a vertical line in my main window in SAP Script output.
    But problem is in main window i am printing some texts at the beggining then i am printing line items.
    So this is not fixed line (box). It may increase/decrease based on text available before line items.
    How can i manage this prining vertival line as i don't know height, top of this line!
    Thanks in advance.
    Thanks,
    Deep.

    Hai Deep,
    Use Elements as suggested by Kodarapu.
    Now goto Paragraph Formats create a format for Item lines.
    ex.
    Name Paragraph Format as 'IL' Now click on the Push Button "Tabs" on bottom Right.
    now in "Tab Position" enter the spacing that you need for your item dispaly
    ex.
    Number     Tab position       Alignment
    1               6.00   CH          LEFT
    2               25.00  CH         LEFT
    3               54.00  CH         LEFT
    The above example is for 3 items
    Now in your Script Windows-> Main
    do the following.
    /E           ITEM_LINE_A
    IL           &EKPO-EBELP&,,&EKPO-EMATN&,,,,&EKPO-TXZ01&
    Hope it SOlves your Issue.
    Cheers,
    Suvendu

  • In SAP Script the form is not printing in required format

    hi
    in my sap script i am facing a issue. when i trigger the output on the screen, first page is coming correctly but second page has mixed up the alignment, i want to say the footer is coming up and main window box has gone sb total window shift to left while it should be right.
    regards
    atul

    Hey Mishra,
        Check in the page 2 Layout in your scrit form. The layout what you created for second page allighment is not correct. It seems you need to change the the footer and main in all the pages. Goto Page Windows -> Select the Seond page Name -> and check the layout ( Setting -> Form Painter).
    Regards,
    Saravanan M

  • Structure of SAP Script.....

    Hi,
           What is the structure of SAP SCRIPT..... If anybody knows help me....
    Thanx in adv,
    Regards,
    <b>SureshKumar.V</b>

    Hi,
    Check the links for info on SAPSCRIPT structures -
    BAPI Tutorial
    Re: Sapscript
    Re: Sapscript
    Re: sapscript: how to align empty fields?
    Re: Addition of new fields to SAP script
    Re: scripts
    Re: scripts
    Regards,
    Amit
    Reward all helpful replies.

  • Putting cross line under top left corner in a cheque through SAP SCRIPT.

    Hi,
    How to put cross line over top left corner in cheque   (cross cheque) while doing it through  SAP SCRIPT.
    Thanks.

    Hi,
    i can give you two solutions. try the thing which looks fine for you.
    1.  say this is line editor of the script.
    you have to design like this manually(its a bit time consuming for alignments and all - both should align side by side using '/')
    so try the second way.
    2.  make this 'corss' as an image and simply pass as a text on to the window on which you needs this.
    it will be simple and an easy way.
    Thanks & regards,
    Sasi Kanth.

Maybe you are looking for