Columns in SApScripts
Hi All,
Please tell me how can i put columns & rows in SAPScripts?
Is there any way where i can hide the columns wherever they are not needed?
Please answer my question asap.
Thanks & Regards,
Bhavika
Hi
By drawing the peoper boxes you can put the rows and Colum,ns in a table like structure
see the commands for drawing them
SAPScripts
POSITION WINDOW
SIZE WIDTH '160' MM HEIGHT '140' MM
BOX FRAME 10 TW
Box
BOX HEIGHT '11' MM WIDTH '160' MM FRAME 10 TW INTENSITY 35
linessssssss
BOX XPOS '20' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
BOX XPOS '45' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
BOX XPOS '80' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
BOX XPOS '120' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
Boxes, Lines, Shading: BOX, POSITION, SIZE
Use the BOX, POSITION, and SIZE commands for drawing boxes, lines, and shading to print particular windows within a form or passages of text within a window in a frame or with shading.
The SAP printer drivers that are based on page-oriented printers (the HP LaserJet driver HPL2, the Postscript driver POST, the Kyocera Prescribe driver PRES) employ these commands when printing. Line printers and page-oriented printers not supported in the standard ignore these commands. You can view the resulting printer output in the SAPscript print preview.
Syntax:
/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
/: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
/: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
BOX Command
Syntax
/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
Effect: draws a box of the specified size at the specified position.
Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT, and FRAME, you must specify both a measurement and a unit of measurement. Specify the INTENSITY parameter as a percentage between 0 and 100.
XPOS, YPOS
Upper left corner of the box, relative to the values of the POSITION command.
Default: Values specified in the POSITION command.
The following calculation is performed internally to determine the absolute output position of a box on the page:
X(abs) = XORIGIN + XPOS
Y(abs) = YORIGIN + YPOS
WIDTH
Width of the box. Default: WIDTH value of the SIZE command.
HEIGHT
Height of the box. Default: HEIGHT value of the SIZE command.
FRAME
Thickness of frame.
Default: 0 (no frame).
INTENSITY
Grayscale of box contents as %.
Default: 100 (full black)
Measurements: You must specify decimal numbers as literal values (like ABAP numeric constants) by enclosing them in inverted commas. Use the period as the decimal point character. See also the examples listed below.
Units of measurement: The following units of measurement may be used:
TW (twip)
PT (point)
IN (inch)
MM (millimeter)
CM (centimeter)
LN (line)
CH (character).
The following conversion factors apply:
1 TW = 1/20 PT
1 PT = 1/72 IN
1 IN = 2.54 CM
1 CM = 10 MM
1 CH = height of a character relative to the CPI specification in the form header
1 LN = height of a line relative to the LPI specification in the form header
/: BOX FRAME 10 TW
Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
/: BOX INTENSITY 10
Fills the window background with shading having a gray scale of 10 %.
/: BOX HEIGHT 0 TW FRAME 10 TW
Draws a horizontal line across the complete top edge of the window.
/: BOX WIDTH 0 TW FRAME 10 TW
Draws a vertical line along the complete height of the left hand edge of the window.
/: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
/: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
POSITION Command
Syntax
/: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters of the BOX command. When a window is first started, the POSITION value is set to refer to the upper left corner of the window (default setting).
Parameters: If a parameter value does not have a leading sign, then its value is interpreted as an absolute value, in other words, as a value that specifies an offset from the upper left corner of the output page. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value. If one of the parameter specifications is missing, then no change is made to this parameter.
XORIGIN, YORIGIN
Origin of the coordinate system.
WINDOW
Sets the values for the left and upper edges to match those of the current window (default setting).
PAGE
Sets the values for the left and upper edges to match those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).
/: POSITION WINDOW
Sets the origin for the coordinate system to the upper left corner of the window.
/: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'
Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm from the upper edge of the output page.
/: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM
Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.
SIZE Command
Syntax
/: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command. When a window is first started, the SIZE value is set to the same values as the window itself (default setting).
Parameters: If one of the parameter specifications is missing, then no change is made to the current value of this parameter. If a parameter value does not have a leading sign, then its value is interpreted as an absolute value. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value.
WIDTH, HEIGHT
Dimensions of the rectangle or line.
WINDOW
Sets the values for the width and height to the values of the current window (default setting).
PAGE
Sets the values for the width and height to the values of the current output page.
/: SIZE WINDOW
Sets WIDTH and HEIGHT to the current window dimensions.
/: SIZE WIDTH '3.5' CM HEIGHT '7.6' CM
Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.
/: POSITION WINDOW
/: POSITION XORIGIN -20 TW YORIGIN -20 TW
/: SIZE WIDTH +40 TW HEIGHT +40 TW
/: BOX FRAME 10 TW
A frame is added to the current window. The edges of the frame extend beyond the edges of the window itself, so as to avoid obscuring the leading and trailing text characters.
http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
Regards
Anji
Similar Messages
-
How to design rows and columns in sapscript layout
Hi friends,
Please let me know how to design rows and columns in sapscript layout with example?
Thanks,
YogeshHi friends,
Please let me know how to design rows and columns in sapscript layout with example?
Thanks,
Yogesh -
To get the sum of column of SAPScript based upon condition
Hi,
I was first asked to get two new columns in ZF140_ACC_STAT_01 script with ZRFKORD10 print program. I did so by the writing the below code. Now, based on Document-Type (RV,DR,DZ,SA), all the amount with same Document Type are needed to be summed and assigned to separate variables.
How to get that done????? Please help me out.
PRINT-PROGRAM:-
FORM sep_amt_open TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
DATA: wf_temp_amt_open TYPE string,"rf140-wrshb,
amount_open TYPE string,
amt_shkzg_open TYPE bsid-shkzg,
doc_desc TYPE t003t-ltext.
READ TABLE in_par WITH KEY name = 'RF140-BELEGNUM'. " document no
IF SY-SUBRC = 0.
SELECT SINGLE SHKZG FROM BSID INTO (amt_shkzg_open)
WHERE BELNR = IN_PAR-VALUE.
ENDIF.
READ TABLE in_par WITH KEY name = 'T003T-BLART'. " document description
IF sy-subrc = 0.
SELECT SINGLE LTEXT FROM T003T INTO (doc_desc)
WHERE SPRAS = 'E' AND BLART = IN_PAR-VALUE.
IF sy-subrc = 0.
READ TABLE out_par WITH KEY name = 'DOC_DESC'.
IF SY-SUBRC = 0.
OUT_PAR-VALUE = DOC_DESC.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDIF.
ENDIF.
ENDIF.
READ TABLE in_par WITH KEY name = 'RF140-WRSHB'. " Amount
IF sy-subrc = 0.
wf_temp_amt_open = in_par-value.
ENDIF.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = wf_temp_amt_open
IMPORTING
OUTPUT = amount_open
IF amt_shkzg_open = 'S'.
READ TABLE out_par WITH KEY name = 'DEBIT_OPEN'.
IF SY-SUBRC = 0.
out_par-value = amount_open.
MODIFY out_par INDEX sy-tabix.
CLEAR out_par.
ENDIF.
ELSEIF amt_shkzg_open = 'H'.
READ TABLE out_par WITH KEY name = 'CREDIT_OPEN'.
IF SY-SUBRC = 0.
out_par-value = amount_open.
MODIFY out_par INDEX sy-tabix.
CLEAR out_par.
ENDIF.
ENDIF.
ENDFORM.
SAPSCRIPT:-
/:DEFINE &DEBIT_OPEN& = ' '
/:DEFINE &CREDIT_CLEAR& = ' '
/:DEFINE &DOC_DESC& = ' '
/:PERFORM SEP_AMT_OPEN IN PROGRAM ZF27_DRIVER_PROGRAM
/:USING &RF140-BELEGNUM&
/:USING &T003T-BLART&
/:USING &RF140-WRSHB&
/:CHANGING &DEBIT_OPEN&
/:CHANGING &CREDIT_OPEN&
/:CHANGING &DOC_DESC&
/:ENDPERFORM
T1 &RF140-BELEGNUM&,,&BSID-BLDAT&,,&T003T-BLART&,,&BSID-WAERS&,,&DOC_DESC&
= ,, &DEBIT_OPEN&,,&CREDIT_OPEN&,,
T1 ,,&BSID-SGTXT&
Thanks & Regards,
Rakesh NairIf you are mentioning about table/advanced table region you can enable totalling in those regions. Please check the Table / Advanced Table section as appropriate in Chapter 4 of the dev guide.
If it is not a table / advancedTable then you will have to programmatically total the column value and display it in the appropriate cell. -
Columns in sapscript form in main window
Hi,
In the script for packing list, i want to display columns for the item details for the item details in main window.
can any budy tell regarding how to write the box statement for the itrem details.
regards,
vamsykrishna.
reward point for good answershi vamsy,
try this:
Goto the text elements of main window spcify the following command.
/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
WIDTH
Width of the box. Default: WIDTH value of the SIZE command.
HEIGHT
Height of the box. Default: HEIGHT value of the SIZE command.
FRAME
Thickness of frame. Default: 0 (no frame).
INTENSITY
Grayscale of box contents as %.
Default: 100 (full black)
EXAMPLE:
/: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
thanks,
raji
reward if helpful -
Printing into multiples columns on several pages
Hi,
I am looking for a way to print a list in TWO columns using SAPscript.
Here is the SAPScript :
/E POS_ITEMS
L
L &itemno1& &itemno2&
a list that looks like this :
apricot
banana
chick peas
dill pickle
egg
french fries
grapes
would be processed to look like this with lines per page = 4 :
apricot__________egg
banana_________ french fries
chick peas______grapes
dill pickle
and would be processed to look like this, with lines per page = 2 :
apricot_________chick peas
banana_________dill pickle
egg____________grapes
french fries
Thanks!Maybe not pretty, but it works.
It's an example with four columns.
nb_col = 4.
nb_rangees = 6.
DESCRIBE TABLE it_table LINES nb_lignes.
nb_tableaux = ( nb_lignes DIV ( nb_rangees * nb_col ) ) + 1.
IF nb_lignes < nb_rangees.
nb_rangees = nb_lignes.
ENDIF.
pos = 1.
DO nb_tableaux TIMES.
DO nb_rangees TIMES.
1re colonne
index_col = pos.
PERFORM lire_valeur USING index_col CHANGING chaine.
WRITE:/ chaine.
2e colonne
index_col = pos + ( nb_rangees ).
PERFORM lire_valeur USING index_col CHANGING chaine.
WRITE: chaine.
3e colonne
index_col = pos + ( 2 * nb_rangees ).
PERFORM lire_valeur USING index_col CHANGING chaine.
WRITE: chaine.
4e colonne
index_col = pos + ( 3 * nb_rangees ).
PERFORM lire_valeur USING index_col CHANGING chaine.
WRITE: chaine.
pos = pos + 1.
ENDDO.
pos = pos + ( ( nb_col - 1 ) * nb_rangees ).
ENDDO.
WRITE:/ 'FIN'.
FORM lire_valeur *
FORM lire_valeur USING p_index
CHANGING p_valeur.
CLEAR p_valeur.
IF p_index <= nb_lignes.
READ TABLE it_table INDEX p_index.
p_valeur = it_table-nom.
ENDIF. -
Where to populate/update Reason code of BSEG in this BADI?
Hello
Under 'Dispute Management' our requirement is that when user creates a dispute case document (UDM_DISPUTE), user also inputs the 'Reason code', so this reason code should reflect on its associated accounting doc (BSEG-RSTGR), in this process i found one BADI - FDM_AR_DISP_COMPLETE with COMPLETE_DISPUTE method, this BADI is having code of pure OOPS, i don't know how to update the reason code, which structure i have to use, where should i set or populate the reason code? do i need to set any flags as well? how to declare and there by access the IMPORT structures data? pls. let me know
Thank you.Hi,
In the IMG check the documentation for the following node:
FI->AR & AP->SAP FI SCM->Disput Management Integration-> Customer Enhancemnets->Completion Dispute case.
Copied the text below:
Completion of Dispute Case
Functionality
You use the method COMPLETE_DISPUTE to include customer-specific BOR objects, attributes, or notes in the dispute case.
Parameters
I_ACTION
The parameter I_ACTION specifies which action is carried out on a dispute case:
I_ACTION = 1
The disputed item is included in a new dispute case.
I_ACTION = 2
An existing dispute case is changed (by a clearing transaction).
I_ACTION = 3
The disputed item is triggered from an existing dispute case and transferred to a new dispute case (splitting a dispute case).
I_ACTION = 4
A dispute case is created in Dispute Management. Open items are then selected and added using the relevant functkon keys.
T_DOCUMENTS
This table of the line structure FDM_AR_DOCUMENTS contains the keys of the line items that are included in the dispute case or (for clearing transactions) reassigned to the dispute case record. The classification enables you to recognize the target nodes in the record:
DISP... indicates disputed (open) items
SOLV... resolved (cleared) items
The table also specifies the change in value to the item that is carried out in the dispute case.
T_OBJECTS
This table of the line structure FDM_AR_OBJECTS contains the BOR keys of the linked objects in the dispute case but without the disputed or resolved line items.
The business partner that is directly involved in the dispute case is entered under the clasification BUPA, the other objects are informative (INFO...), for example, the underlying FI invoice and SD billing document or the account statement.
T_ATTRIBUTES
This table of the line structure FDM_ATTRIBUTE contains the values of the dispute case attributes for the technical names. For a list of the technical names, see the fields of the database tables SCMG_T_CASE_ATTR and UDMCASEATTR00 in the Repository Information System (ABAP Dictionary) of Dispute Management.
T_NOTES
This table of the line structure TLINE contains the dispute case notes. Each line of text consists of the usual format column in SAPscript texts and the actual (unformatted) text.
C_ADDITIONAL_OBJECTS
The table C_ADDITIONAL_OBJECTS can be filld with the customer- specific additional BOR objects in the BAdI. Make sure that you have set up the derivation of the element type in Customizing for this BOR object type.
C_ADDITIONAL_ATTRIBUTES
Table C_ADDITIONAL_ATTRIBUTES can be filled with the customer- specific additional attributes in the BAdI. You can only set standard attributes if they have not already been defined by the system. For customer-specific attributes, you must add these to the attribute profile first.
C_ADDITIONAL_NOTES
Table C_ADDITIONAL_NOTES can be filled with customer-specific notes in the BAdI. They are added to the existing notes.
Notes
If you want to add BOR objects or attributes when you create a dispute case with user dialog, use the Business Add-In FDM_USER_SCREEN.
If however, you want to add BOR objects, attributes, or notes derived from the FI data with no dialog when you create a dispute case, use this BAdI.
When you change a dispute case (by clearing open items, I_ACTION = 2) only additional BOR objects are included in the dispute case. Attributes and notes are only transferred if the parameter E_EXTENDED_CHANGE_MODE has been set.
When you create a dispute case from Dispute Management (I_ACTION = 4), only additional BOR objects and attributes are included in the dispute case.
See also
Kind regards,
Robert
PS. I have had no exposure to this BADi before but looking at it I would believe that you need to populate the T_ATTRIBUTES table with your reason code:
ATTR_ID 'REASON_CODE' -> type group FDMCO
ATTR_VALUE <your reason code value>
XDELTA 'X' indicating it is a change.
PPS. Re-reading your post maybe alos check the node in the IMG Customer Specific Default Values for Reason (FDM_AR_DEF_REASON) if this one serves your purpose.
Edited by: RJ. Schamhart on May 31, 2011 4:30 PM -
How to make a 2-column output in sapscript form
Hello Abap Professionals!
I have a sample standard text that has this content and layout:
Part I : This is an example only.This is an example only.This is an example only.
This is an example only.This is an example only.This is an example only.This is
an example only.This is an example only.This is an example only.This is an example
only.This is an example only.This is an example only.This is an example only.
Part II : This is an example only.This is an example only.This is an example only.
This is an example only.This is an example only.This is an example only.This is
an example only.This is an example only.This is an example only.This is an example
only.This is an example only.This is an example only.This is an example only.
The problem is....
HOW can I make it look like this in the MAIN Window of my Sapscript in Form (SE71)
see the picture below:
Link: [http://img122.imageshack.us/img122/9416/69640352uy2.jpg]
-Don't mind the font.. just the format. I want it to be in 2-column and I have to include the standard text in the Main Window of the Form.
Any help is highly appreciated,
THANKS in ADVANCE.Take two page windows of type MAIN in your page, arrange the page windows as two pages, call the text element from your driver program and write this way in you SAP script...
/E <text element>
/ Part I : This is an example only.This is an example only.This is an example only. This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.
/: NEW-WINDOW
/ Part II : This is an example only.This is an example only.This is an example only. This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.This is an example only.
P.S.: let the size of the main window be a bit bigger than it can accomodate the text. The command NEW-WINDOW lets the latter text to be written in the next MAIN window if no variable window is specified.
<REMOVED BY MODERATOR>
I.
Edited by: Alvaro Tejada Galindo on Jun 25, 2008 3:37 PM -
How to make a 2-column text in sapscript via standard text?
Hello ABAP Gurus! I'm having a hard time thinking on how I'm going to display a two-column text in the MAIN window of the form Using Form Painter(se71) and Standard Text (SO10). Let's put it this way, the scenario is like you are formatting a paragraph on MS word in to two columns by Format > Columns > Two. What am I going to do with this similar situation in SAP? Any help will be highly appreciated. Thanks
This is nothing with standard text.
Call READ_TEXT FM and here use two variables ,read first line and move to first variable ,again read second line and move to second variable.
Thanks
Seshu -
How to Calculate Line items Total of Matrix Column
hai experts,
Im facing a problem like
1. i have a matrix with a column Labour Costs in that im taking some cost.
2. in footer a have a Edit Text like Total Labour Cost
3 when i enter amount in matrix column it sholud disply that value in total labour cost and when we add new row ,labour cost it should add to 'total labour cost' in footer.Like Invoice Documents.Where do you want to implement this like sapscript / smartforms or adobe forms? please specify.
-
Printing date in the cheque date box column
Hello all,
I want to print the date in the cheque box column automatically.I used sy-datum.but its not coming in the proper field of day,month and year.can anyone please help me to do it .
Thank in advance.Check user master records for date format. Which tool did you use SapScript or Smartforms, you could alsop look for date formatting in those tools.
Smartforms : Smart Forms, Using SAP Smart Forms, Using Parameters in a Form, Using Fields in the Form, Output Options for Field Contents
Sapscript : BC Style and Form Maintenance, Formatting Options, Date Mask
NB: Better use sy-datlo if your systems have users worldwide.
Regards,
Raymond -
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. -
How do I return a numeric value to a Sapscript
Hi,
I'm calling a subroutine from a sapscript using the perform command. I'm passing a material number to the routine and it is suppose to return the unit price of the material to the sapscript form. This is not working because the field is a currency field and according to the documentation I read so far, the return values must be character strings, so how can I pass his non-character string value back to the sapscript form.
Please assist.
Thanks
ChrisIn column D I will insert the formula:
=IF(OR(ISBLANK(B),ISBLANK(C)),"",IF(C>B,"",1))
In A1 I will insert:
=SUM(D)<0
or
in column D
=IF(OR(ISBLANK(B),ISBLANK(C)),"",C>B)
in A1
=COUNTIF(D,FALSE)=0
Yvan KOENIG (from FRANCE mardi 2 septembre 2008 12:11:28) -
Box in SAPscript-Help Needed.
Hi ,
I want to make a box in script which it shud not hav any columns or rows. The box shud hav 4 lines of contents withan font of 10. Also i want to split the box in the centre. Kindly give some piece of code for it. It shud be helpful to me.
Also is ther any way to assign the SAPscript windows only on last page or windows only on first page option (i.e) option like in smartforms.
Thanks and regards,
KarthikHi,
It is very easy to create any BOX in script, Below is the command for same,
Create Boxes in the SAPscript using the BOX command specifying
the x,y co-ordinates and the width and the height
/: BOX XPOS '0' CM YPOS '0.5' CM WIDTH '9.2' CM HEIGHT '3.5' CM FRAME 8 TW
Try with this I know handle a BOX is difficult.
2. You can create a Static Window and can call it on Last Page.. I will work..
Edited by: Lokesh Tarey on Jul 30, 2010 8:23 AM -
Hi All,
I have created a script.....in that i have to print only long text in the main window.
Now my problem is...the LONG text is breaking and going to next page...
means a part on 1 page and remaining on subsequent pages..
And the problem is the box which i have put arround the main window is coming only in first page and last page . In between pages the box arround the main window is not coming .
How to get the box around those pages also.
help me out...
Thanks,
GuruHi
The property of MAIN window is like that, If the Data is more than a Page it automatically goes to next pages.
So better decide where I mean in which you wants to print ? In MAin window , then it automatcially goes to other pages. use a new paragraph format and mention PAGE PROTECTION for that such that it prints in the Same page.
For the boxes see the seetings of the main window in all pages, especially in NEXT page.. so that the box is coming properly
see the box related commands
SAPScripts
POSITION WINDOW
SIZE WIDTH '160' MM HEIGHT '140' MM
BOX FRAME 10 TW
Box
BOX HEIGHT '11' MM WIDTH '160' MM FRAME 10 TW INTENSITY 35
linessssssss
BOX XPOS '20' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
BOX XPOS '45' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
BOX XPOS '80' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
BOX XPOS '120' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
Boxes, Lines, Shading: BOX, POSITION, SIZE
Use the BOX, POSITION, and SIZE commands for drawing boxes, lines, and shading to print particular windows within a form or passages of text within a window in a frame or with shading.
The SAP printer drivers that are based on page-oriented printers (the HP LaserJet driver HPL2, the Postscript driver POST, the Kyocera Prescribe driver PRES) employ these commands when printing. Line printers and page-oriented printers not supported in the standard ignore these commands. You can view the resulting printer output in the SAPscript print preview.
Syntax:
/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
/: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
/: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
BOX Command
Syntax
/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
Effect: draws a box of the specified size at the specified position.
Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT, and FRAME, you must specify both a measurement and a unit of measurement. Specify the INTENSITY parameter as a percentage between 0 and 100.
XPOS, YPOS
Upper left corner of the box, relative to the values of the POSITION command.
Default: Values specified in the POSITION command.
The following calculation is performed internally to determine the absolute output position of a box on the page:
X(abs) = XORIGIN + XPOS
Y(abs) = YORIGIN + YPOS
WIDTH
Width of the box. Default: WIDTH value of the SIZE command.
HEIGHT
Height of the box. Default: HEIGHT value of the SIZE command.
FRAME
Thickness of frame.
Default: 0 (no frame).
INTENSITY
Grayscale of box contents as %.
Default: 100 (full black)
Measurements: You must specify decimal numbers as literal values (like ABAP numeric constants) by enclosing them in inverted commas. Use the period as the decimal point character. See also the examples listed below.
Units of measurement: The following units of measurement may be used:
TW (twip)
PT (point)
IN (inch)
MM (millimeter)
CM (centimeter)
LN (line)
CH (character).
The following conversion factors apply:
1 TW = 1/20 PT
1 PT = 1/72 IN
1 IN = 2.54 CM
1 CM = 10 MM
1 CH = height of a character relative to the CPI specification in the form header
1 LN = height of a line relative to the LPI specification in the form header
/: BOX FRAME 10 TW
Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
/: BOX INTENSITY 10
Fills the window background with shading having a gray scale of 10 %.
/: BOX HEIGHT 0 TW FRAME 10 TW
Draws a horizontal line across the complete top edge of the window.
/: BOX WIDTH 0 TW FRAME 10 TW
Draws a vertical line along the complete height of the left hand edge of the window.
/: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
/: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
POSITION Command
Syntax
/: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters of the BOX command. When a window is first started, the POSITION value is set to refer to the upper left corner of the window (default setting).
Parameters: If a parameter value does not have a leading sign, then its value is interpreted as an absolute value, in other words, as a value that specifies an offset from the upper left corner of the output page. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value. If one of the parameter specifications is missing, then no change is made to this parameter.
XORIGIN, YORIGIN
Origin of the coordinate system.
WINDOW
Sets the values for the left and upper edges to match those of the current window (default setting).
PAGE
Sets the values for the left and upper edges to match those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).
/: POSITION WINDOW
Sets the origin for the coordinate system to the upper left corner of the window.
/: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'
Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm from the upper edge of the output page.
/: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM
Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.
SIZE Command
Syntax
/: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command. When a window is first started, the SIZE value is set to the same values as the window itself (default setting).
Parameters: If one of the parameter specifications is missing, then no change is made to the current value of this parameter. If a parameter value does not have a leading sign, then its value is interpreted as an absolute value. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value.
WIDTH, HEIGHT
Dimensions of the rectangle or line.
WINDOW
Sets the values for the width and height to the values of the current window (default setting).
PAGE
Sets the values for the width and height to the values of the current output page.
/: SIZE WINDOW
Sets WIDTH and HEIGHT to the current window dimensions.
/: SIZE WIDTH '3.5' CM HEIGHT '7.6' CM
Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.
/: POSITION WINDOW
/: POSITION XORIGIN -20 TW YORIGIN -20 TW
/: SIZE WIDTH +40 TW HEIGHT +40 TW
/: BOX FRAME 10 TW
A frame is added to the current window. The edges of the frame extend beyond the edges of the window itself, so as to avoid obscuring the leading and trailing text characters.
http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
<b>Reward points for useful Answers</b>
Regards
Anji -
Problem with attachtment XLS (last column of the xls)
Hi,
iam working on interface in which i will be sending an email along with attachtment where my email along with attachtment are working perfectly ,the problem is with the XLS where the last column of the XLS is taking 255 char which is the length of the field .
How i have to restrict it ?
solution on this would be helpfull .
Thanks ,
shankar.
I have attached the sample code too.
FUNCTION zemail_send_attachment.
""Local Interface:
*" IMPORTING
*" VALUE(EMAILID)
*" VALUE(SUBJECT)
*" VALUE(ATYPE)
*" TABLES
*" ATTACH_FILE STRUCTURE SOLISTI1
*" BODY OPTIONAL
This table requires information about how the data in the
tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are
to be distributed to the documents and its attachments.
DATA objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
This table must contain the summarized data dependent on each object type.
SAPscript objects store information here about forms and styles,
for example. Excel list viewer objects store the number of rows and columns
amongst other things and PC objects store their original file name.
DATA objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
This table must contain the summarized content of the objects identified as binary objects.
DATA objbin TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
This table must contain the summarized content of the objects identified as ASCII objects.
DATA objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
This table must contain the document recipients.
DATA reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE .
This structure must contain the attributes of the document to be sent.
DATA: doc_ching LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
Create the internal table for body , subject
DATA: it_body LIKE solisti1 OCCURS 10 WITH HEADER LINE.
CONSTANTS: con_cret TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
con_tab TYPE c VALUE cl_abap_char_utilities=>cr_lf.
Move Body to Internal Table (body into it_body)
LOOP AT body .
MOVE body TO it_body .
APPEND it_body .
ENDLOOP.
doc_ching-obj_descr = subject. "Subject of the Email
Move the Subject and Body to OBJTXT
objtxt[] = it_body[].
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_ching-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.
Convert IT to Excel format
IF atype = 'XLS' .
LOOP AT attach_file .
REPLACE ALL OCCURRENCES OF '#' IN attach_file WITH con_cret ."INTO objbin.
IF sy-tabix = 1.
MOVE attach_file TO objbin.
ELSE.
CONCATENATE con_tab attach_file INTO objbin.
ENDIF.
APPEND objbin.
ENDLOOP.
ELSEIF atype = 'TXT' .
Convert IT to Text format
LOOP AT attach_file .
REPLACE ALL OCCURRENCES OF '#' IN attach_file WITH con_cret. " INTO objbin.
CONCATENATE attach_file con_tab INTO objbin .
APPEND objbin .
ENDLOOP.
ENDIF.
DESCRIBE TABLE objbin LINES tab_lines.
objhead = subject. APPEND objhead.
Creating the entry for the compressed attachment
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
IF atype = 'XLS'.
objpack-doc_type = atype.
ELSEIF atype = 'TXT'.
objpack-doc_type = 'RAW'.
ENDIF.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = 'TEST'. "Attachment File Name
objpack-doc_size = tab_lines * 255.
APPEND objpack..
reclist-receiver = emailid.
reclist-rec_type = 'U'.
APPEND reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_ching
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99 .
ENDFUNCTION.I had this problem after migrating to JDeveloper 10.1.3. Problem was with inconsistent DB column types. In our case, the DB column was CHAR containing only numbers, but VO defined it as NUMBER. This caused no problem in 9.0.3 we used before.
<ViewAttribute
Name="ParentFlagNew"
IsPersistent="false"
Precision="1"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
AliasName="PARENT_FLAG_NEW"
Expression="PARENT_FLAG_NEW"
SQLType="NUMERIC" >
<Properties>
<Property Name ="DISPLAY_LIST" Value ="1=Yes,0=No" />
<Property Name ="DISPLAY_LIST_sk" Value ="1=Áno,0=Nie" />
<Property Name ="Renderer" Value ="sk.transacty.cm_iface.bc4j_common.ListFieldRenderer" />
</Properties>
<DesignTime>
<Attr Name="_DisplaySize" Value="1" />
</DesignTime>
</ViewAttribute>
Maybe you are looking for
-
How to pass parameter in HTTP_POST or HTTP Class
I want to use HTTP_POST to pass xml info by http_post. I want to pass a simple parameter and receive it in a JSP first for test. I assign the value in the following way: TYPES: BEGIN OF text, line(256), END OF text. DATA xml TYPE TAB
-
Hi, I am using a two submit buttons in my jsp, inside a form. I am using struts, and when i click one submit button i need it should open a new window. How can i use url so that it will also using action mapping.. My code is.. <html:submit property="
-
Hi Gurus, I'm using BAPI BAPI_PO_CHANGE for chnaging PO Prices with in a Pricing Routine related to Sales Order processing... But the Po is not getting changed until it is been declared as shown below (in background Mode). CALL FUNCTION 'BAPI_PO_CHAN
-
We found different specifications for the same material say needle in two inspection lots. One contains correct values and other one has incorrect!! 1. What might be the root cause for such discrepancies on the specifications? 2. And how to avoid suc
-
Macbook pro has been extremely slow. Please advise!
Below is the result I got from running Etrecheck. Please advise. Thank you in advance! Problem description: computer is really slow , even so after upgrade to Yosemite EtreCheck version: 2.1.8 (121) Report generated April 10, 2015 at 6:11:59 PM AST D