BOX in Scripts.
I want to display box in script dynamically.
please tell how this is possible.
Hi,
Create a main window with 2 Lines height,
Create box for entire manin window,
Position multiple main windows on one page, we can keep upto 99 main windows in one page.
Sample code
/E ITEM_A
IA &EKPO-EBELP&,,&T165M-ABSGR_TXT&
IA
/:BOX FRAME 10 TW
/:BOX XPOS 16 CH YPOS 0 LN WIDTH '0' CM HEIGHT 2 LN FRAME
10 TW
Regards
Bala Krishna
Similar Messages
-
How to acheive check box in SCRIPTS
Hi All,
I am working on SCRIPTS, I want a check box with checked in the layout after execting. I am not changing any driver program
How to acheive this.
Thanks in advanceHi,
You can achive check boxes in scripts using this below link
http://abapeasy.blogspot.com/2008/03/3-easy-way-to-add-checkbox-in-your.html
with out modifying the print program u can check the check box using the PERFORM ---ENDPERFORM CONTROL COMMAND
see this link how to use preform contorl command in script
http://help.sap.com/saphelp_nw04/helpdata/en/d2/cb3d07455611d189710000e8322d00/frameset.htm
Regards
Jagadeesh -
Is it possible to change the colour of box in script from black to blue
Hi,
Is it possible to change the colour of box in script from black to blue or some other colour and background colour also...if so how....
Thanks.No..
It is not possible in scripts..
In scripts u cannot use colors..
In smartforms u can do that..
reward if it helps u..
sai ramesh -
Hi,
I have a script which currently prints a number of item details.
Users want to change the layout so that the result is given in tabular format,i.e, the item details need to be displayed in rows and column format. As the number of items can vary, could you please help me with the logic of displaying this using script?
Thanks in advance,
NeethuHi,
Creating dynamic boxes in script is possible but formatting and getting proper allignment is very tedious job. I had similar requirement for creating dynamic boxes in SAP Script, but getting right allignment of those boxes was not possible and hence I switched to smartform. So I would advise you the same to use smartform for such type of requirement. In smartforms it becomes very easy.
Still try the following syntax:
/:POSITION XORIGIN '5' CM YORIGIN '5'CM
/:SIZE HEIGHT '0' CM WIDTH '0' CM
/:BOX FRAME 10 TW INTENSITY 10
Hope this helps.
Reragds,
Abhijeet -
Drawing Boxes in Script - main window
hi,
In script, in main window <u>after table line item datas</u>, i want to draw a box in which i will place some text. On drawing box, it appears on top of that window which i dont want, since it should be placed after item details.
kapil.I do not know this is still relevant for You or not but here is the solution what I did:
First of all I have to mention this requires SAP standard object modification. !!!
1.Start SE80 and get into STXC function group.
2.Select COP_RELATIVE_NUMBER subroutines and double click on that.
3.Click on Edit button and Get SSCR Object number from SAP.
4.Change interface of the COP_RELATIVE_NUMBER subroutines extending it with TYPE parameters
5.Change the first if Statement.
6.Extend the Relative case section with a new WHEN '#'.
7. Cange All COP_RELATIVE_NUMBER calls with new input parameter in CO_BOX, In CO_POSITION, In CO_SIZE.
From now in Your SAP script You can call BOX statement like this:
BOX XPOS #10 TW YPOS #10 TW ..
Will start drowing BOX from cursor current position plus 10 twip.
Numbers after the # sign are optional.
Solution works only with TW.
form co_box.
data: begin of bx,
x type i,
y type i,
w type i,
h type i,
f type i,
i(3) type n,
end of bx,
next(10),
xpos type i,
ypos type i,
is_relative like boolean.
bx-x = ft-wpx.
bx-y = ft-wpy.
bx-w = ft-wpw.
bx-h = ft-wph.
while co-endline = false.
perform cop_next using next 10.
case next.
when 'XPOS'.
*{ REPLACE ED1K902054 1
* perform cop_relative_number using is_relative xpos.
perform cop_relative_number using is_relative xpos 'X'.
*} REPLACE
add xpos to bx-x.
when 'YPOS'.
*{ REPLACE ED1K902054 2
* perform cop_relative_number using is_relative ypos.
perform cop_relative_number using is_relative ypos 'Y'.
*} REPLACE
add ypos to bx-y.
when 'WIDTH'.
perform cop_number_value using bx-w.
when 'HEIGHT'.
perform cop_number_value using bx-h.
when 'FRAME'.
perform cop_number_value using bx-f.
when 'INTENSITY'.
perform cop_next using next 3.
bx-i = next.
when space. exit.
when '.'. exit.
when others.
perform cop_warning using subrc_param_unknown next.
endcase.
endwhile.
perform cop_end.
check co-error = false.
perform pc_box using bx-x bx-y bx-w bx-h bx-f bx-i.
endform.
form co_position.
data: begin of pos,
x type i,
y type i,
end of pos,
next(10),
relative like boolean,
xpos type i,
ypos type i.
pos-x = ft-wpx.
pos-y = ft-wpy.
while co-endline = false.
perform cop_next using next 10.
case next.
when 'XORIGIN'.
*{ REPLACE ED1K902054 1
* perform cop_relative_number using relative xpos.
perform cop_relative_number using relative xpos 'X'.
*} REPLACE
if relative = true.
add xpos to pos-x.
else.
pos-x = xpos.
endif.
when 'YORIGIN'.
*{ REPLACE ED1K902054 2
* perform cop_relative_number using relative ypos.
perform cop_relative_number using relative ypos 'Y'.
*} REPLACE
if relative = true.
add ypos to pos-y.
else.
pos-y = ypos.
endif.
when 'WINDOW'.
pos-x = ft-tdwlefts.
pos-y = ft-tdwtops.
when 'PAGE'.
pos-x = 0.
pos-y = 0.
when space. exit.
when '.'. exit.
when others.
perform cop_warning using subrc_param_unknown next.
endcase.
endwhile.
perform cop_end.
check co-error = false.
ft-wpx = pos-x.
ft-wpy = pos-y.
endform.
form co_size.
data: begin of dim,
w type i,
h type i,
end of dim,
next(10),
relative like boolean,
width type i,
height type i.
dim-w = ft-wpw.
dim-h = ft-wph.
while co-endline = false.
perform cop_next using next 10.
case next.
when 'WIDTH'.
*{ REPLACE ED1K902054 1
* perform cop_relative_number using relative width.
perform cop_relative_number using relative width 'X'.
*} REPLACE
if relative = true.
add width to dim-w.
else.
dim-w = width.
endif.
when 'HEIGHT'.
*{ REPLACE ED1K902054 2
* perform cop_relative_number using relative height.
perform cop_relative_number using relative height 'Y'.
*} REPLACE
if relative = true.
add height to dim-h.
else.
dim-h = height.
endif.
when 'WINDOW'.
dim-w = ft-tdwwidths.
dim-h = ft-tdwheights.
when 'PAGE'.
dim-w = form_header-tdpagwidth.
dim-h = form_header-tdpagheigh.
when space. exit.
when '.'. exit.
when others.
perform cop_warning using subrc_param_unknown next.
endcase.
endwhile.
perform cop_end.
check co-error = false.
ft-wpw = dim-w.
ft-wph = dim-h.
endform.
*{ REPLACE ED1K902054 3
*form cop_relative_number using is_relative like boolean
* val type i.
form cop_relative_number using is_relative like boolean
val type i
type type c.
*} REPLACE
data: num type f,
next(10).
clear is_relative.
perform cop_next using next 10.
*{ REPLACE ED1K902054 1
* if next(1) cn '+-.0123456789 '.
if next(1) cn '#+-.0123456789 '.
*} REPLACE
perform cop_warning using subrc_param_unknown next.
clear: is_relative, val.
exit.
else.
if next+1(9) cn '.0123456789 '.
perform cop_warning using subrc_param_unknown next.
clear: is_relative, val.
exit.
else.
case next(1).
when '+'.
is_relative = true.
num = next+1(9).
when '-'.
is_relative = true.
num = next+1(9).
num = -1 * num.
*{ INSERT ED1K902054 2
when '#'.
is_relative = true.
num = next+1(9).
case type.
when 'X'.
num = ( ft-line_width - ft-rem_width ) + num.
when 'Y'.
num = ( ft-fill_height - ft-rem_height ) + num.
endcase.
*} INSERT
when others.
num = next.
endcase.
endif.
endif.
perform cop_num_val using num.
val = num.
endform. -
How to use box in Scripts?
Hi Guys,
can anybody tell me how to use Box and purpose of box?
My req is i have to display 5 columns ina Script thru printer but problem is i am not able to display the columns values in a vertical way i am getting in a jig jag way.so what shall i use ? is BOX ok ?
Thanks,
Gopi.Hi Kodandarami,
I had done like that only see here is the code below.here L1 L2 L3 and L4 are paragraph left Justified item's.
so do u think is ther anything wrong with the code Now my doubt is what shall i do to get the Columns Values in staright even if there is not value for some of their previous columns?
= -
L1 Itm,,Material,,Mat.Desc,, Batch,, SLoc,, Stor.bin
/* Stock type
L3 ,, Counted qty.,,Un
L -
= -
/E POS_BELZEILE2
/: PROTECT
/: BOX WIDTH '5.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 6
L4 &ISEG-ZEILI&,,&ISEG-MATNR+0(5)&,,&MABDR-MAKTX&,,&ISEG-CHARG&,,
= ,,&ISEG-LGORT&,,&MABDR-LGPBE&
/* ,&T064B-BTEXT&
L3 ,, _______________,,&ISEG-ERFME&
/: ENDPROTECT
/E POS_ENDPAGE
Thanks,
Gopi. -
Hello experts,
i got a requirement like to add a check box to the form. is it possible in scripts. if yes can u tell me how can we add a check box in the form(scripts).
thanks is advancethanks yaar.
but in first option iam not understanding textelement(f9) what is that mean.
after going to text element we have to press f9 right. then we have to write [] like this in text editor. is it right?
actually my output is like this
slno qty mtlno desc
in the below of slno i have to add check boxes and after that i have to implement some logic if it is checked like that i want.
thanks & regards
raj -
hi
can anyone send how to create box, like table including vertical and horizontal lines in sap-scripts
regards
ratnaBOX Command
Syntax
/: BOX
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.
SIZE Command
Syntax
/: SIZE
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. -
Hi i am Dinakar,
How can we add a check box in a SAP Script Layout.
Plz explain the procedure.
Thanks & Regards
DinakarHi,
Refer the link.Here Checkbox is done in Smartforms.. hope it will be same for Script as well.
Re: Quick Question on Smartforms
Re: putting tick mark into check box in smartform
Reward points if this Helps.
Manish -
Hi all,
For printing boxes in sap scripts we have a command ie. POSITION WINDOW,BOX FRAME HEIGHT WIDTH XPOS YPOS XORIGIN YORIGIN like this we have.Here my question is can any one explain me about this syntax means what exactly this syntax and how it will draw a box?
Thanks & Regards.
Laxman.P
B'lore.Hai Laxman,
<u><b>Boxes, Lines, Shading: BOX, POSITION, SIZE</b></u>
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.
<b><u>POSITION Command</u></b>
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.
<u><b>SIZE Command</b></u>
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.
Regards,
Ajith V -
Printing check box in script side by side
Hi All,
I have a requirement like i have to print the check box in SAP script side by side like this
1) check box 2) checkbox2
3) check box3.
And i have checked the sap symbols and character formats i am getting only the marked check boxes.
how to get the unmarked one and how to place the check boxes side by side in SAP Script.
Thanks in advance,
JoeCheck the following thread.
link: [Checkbox in sap scripts;
[check boxes in SAP SCRIPT layout; -
Dear All,
I am trying to print Dynamic position box in sap script.If any body know the please tell me.
Thanks,
P G Venkatesh
Edited by: venky.pg132 on Jun 27, 2011 2:10 PMadd Boxes dynamically to SAPScript But you can specify this in the print program.
DATA COM(100).
com = 'BOX WIDTH ''17.5'' CM HEIGHT 5 CM FRAME 10 TW INTENSITY 15'.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = COM
EXCEPTIONS
UNOPENED = 1
UNSTARTED = 2
OTHERS = 3 -
Check the check-box using script
Hi
I have a requirement where from script i need to check the check box.
Based on if a condition is true , when i execute the script , the check box field needs to be auto-checked .
Appreciate the helpHi,
Access the field and set it to true. If it is a standard field it should have its getter and setter, you should use that. In case of an extension field do this :
doc.getExtensionField("FIELD_NAME").set(true);
Thanks
Devesh -
When I change pages I get a box 'java script uninstal set' how do I get rid of this?
every time I change pages I get several error boxes saying java script application, uninstal set (misspelled) . I cannot continue til I close all the boxes. It also has a yellow triangle with an exclamation point
click on the pair of eyeglasses
-
Need Help With Check Box count Script
Need to count the number of checked boxes. I'm using the script below and its not working. What I'm I doing wrong? It's driving me crazy.
// document level function to sum named fields
function Sum(aFieldNames) {
var sum = 0; // sum of values
// loop through fields
for (var i = 0; i < aFieldNames.length; i++) {
if(!isNaN(this.getField(aFieldNames[i]).value) )
sum += Number(this.getField(aFieldNames[i]).value);
return sum;
} // end of Sum function
// array of field names sum
var aCheckBox = new Array('Check Box5', 'Check Box8', 'Check Box11', 'Check Box16', 'Check Box19','Check Box22', 'Check Box25','Check Box28', 'Check Box31', 'Check Box34','Check Box37', 'Check Box40','Check Box43', 'Check Box46', 'Check Box49','Check Box52', 'Check Box55','Check Box58', 'Check Box61', 'Check Box64','Check Box68');
// sum named fields
event.value = Sum(aCheckBox);Then why are you checking if they're a number by using the isNaN function, and then trying to add that number to the sum variable? It looks like you just copied the code from somewhere else, even though it doesn't apply to your situation.
Replace those two lines of the code with this:
if (this.getField(aFieldNames[i]).value!="Off") sum++;
Maybe you are looking for
-
My External Hard Drive Won't Work With Final Cut Pro
Hi everyone! I occasionally use my external HDD for Fianl Cut projects, but only when I'm done editing it. While I'm editing the project, I keep it on my SSD. My external HDD has 3 partitions, one for storage, one formatted for windows storage, and t
-
Firefox 4 displays closing CDATA tag ]] on the screen for object tag
With the recent Firefox 4 version. I am facing following problems with the website I am developing: 1. For svg objects inside html page with Firefox 4 it now displays closing CDATA tag on the screen. It only displays ]]> on the screen. I have object
-
ADF Application gets auto refreshed
Hi i have my ADF application deployed in one of the weblogic clustered server. There are four weblogic managed cluster. In my application i am reading a csv file and performing some user operation with OIM. It is taking much time around more than 5 m
-
Change Itunes display from albums to songs?
When I downloaded the new version of ITunes(11.0.2.25) for my PC it displays all the music in albums, I would like to display the music a songs . Can't find the menu item to do that? Thanks
-
Total storage in User file greater than size of all folders
I am trying to clear space of Startup drive. When i "Get info" on User it shows 91 GB, but total of all files under User is less than 45 GB. Where are the other files?