How to draw a dynamic box in sapscript?
Hello experts,
I am currently facing a problem wherein in the main window I have multiple line items. What I want to do is that for every new line item, I would draw a box and so on...for example:
BOX 1
BOX 2
BOX 3
Here is the attributes of the main window where I would like the boxes to be drawn:
MAIN 00 Main window 2,00 CH 15,00 LN 78,00 CH 30,00 LN
hi vijay please try out this code,
u have to keep all the code as single text element,
POSITION XORIGIN 2 CM YORIGIN +9 MM
" the next two ines will dra a box
SIZE WIDTH 180 MM HEIGHT 40 MM
BOX FRAME 30 TW
OSITION XORIGIN 2 CM YORIGIN +9 MM
SIZE WIDTH 180 MM HEIGHT 0 MM
BOX FRAME 30 TW
POSITION XORIGIN 2 CM YORIGIN +12 MM
SIZE WIDTH 180 MM HEIGHT 0 MM
BOX FRAME 30 TW
POSITION XORIGIN 8 CM YORIGIN -21 MM
SIZE WIDTH 0 MM HEIGHT 40 MM
BOX FRAME 30 TW
POSITION XORIGIN 2 CM YORIGIN +43 MM
Similar Messages
-
Hi,
I am using the BOX control command in SapScript.
Is it possible to assign the values of Xpos and Ypos
dynamicalliy.
In BOX XPOS 16 CH WIDTH 0 MM HEIGHT 18 MM FRAME 10 TW,
i want to assign the values at runtime, instead of
xpos 16 , something like Xpos Var, where var contain the value of xposition.
or any other method to print dynamic box in sap scriptHi
yes it is possible
see this
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
Reward points for useful Answers
Regards
Anji -
How display a DATE IN BOXS IN SAPSCRIPT
how display a DATE IN BOXS IN SAPSCRIPT
use cal = Calendar.getInstance() to get the current date/time
use cal.get(Calendar.DAY_OF_WEEK) to get what today is
calculate n = days to next Thursday
advance the calendar with cal.add(Calendar.DATE, n). -
Write dynamic box using sapscript
I would like to write two box layout. but each box layout are variants, so i can wirte a fixed height. how can i when the first box is finished, then close the bottom line, and the start to write second box and the close. Thanks!
I would like to write two box layout. but each box layout are variants, so i can wirte a fixed height. how can i when the first box is finished, then close the bottom line, and the start to write second box and the close. Thanks!
-
How to print inside a box in sapscript
Hi,
I've created a box in sap script. when i try to print something inside it....it either prints above or below the box and not inside it...
any suggestions will be appreciated.
Thanks.Hello,
Printing the text in the box is some what Trial and error method.
I have faced the similar problem, what I have done is first i have displayed the data I want and then displayed box .
If u want I can help u further make urself clear and maile me.
Regards -
SAPscript - Dynamic box position and height.
Greetings...
How to print dynamic box according to the Element. I have an element with looping condition when i used box the line only printed on the first loop, but and no line printed on the next looping even though its is different element.. Below is the sneak peak of my code.
/E 101
/: BOX WIDTH 0 MM HEIGHT '2' MM FRAME 20 TW
/: POSITION YORIGIN '+2' MM
W2 <B>&text&</><B>,,&zvalue&</>
Thank youHi
it is very hard to print a dynamic box with sapscript.
It is more easy to develop a new-smartform then to develop a dynamic box.
i know only 1 sapscript which is using dynamic boxes. I do not know the sapscript only the fucntional name we use. That is shopfloor papers (for a production order). It has a good combination of printprogram and sapscript which both has to be working together to get it done. Try to find it and study it. Then you will find out how it works.
There is no way to get it done with only changes in your sapscript.
an alternative is to use tab's and '|' and ulines to make something that look a bit like boxes.
Hope this will help you out.
Gr., Frank -
Hi All,
I have a one question , in SAP Scripts/Smartforms how can i draw a dynamic box's. if there is one record one box (Like Table with 3 Cells(rows & coloums)) has to appear, if it is 2 ,two box's has to appear depending up on the records.
Please if any one having the code3 or path to slove this Problem, please give me the advice.
Thanks very much in advance for your answer.
NarenIn print program, something like this
data: ypos(5), ht(5).
move '1.75' to ypos.
move '3.00' to ht.
call function 'WRITE_FORM'
exporting
element = 'HEAD'
exceptions
element = 01
function = 02
type = 03
unopened = 04
unstarted = 05
window = 06.
if sy-subrc ne 0.
message e205 with 'WRITE_FORM failed.' sy-subrc element.
endif.
And in the SAPScript:
/E HEAD
/: BOX YPOS &YPOS& LN HEIGHT &HT& LN INTENSITY 10
Regards,
SaiRam -
Sap script creating dynamic box problem
Hi all,
I am unable to create dynamic box in sap script.
Because the printing lines in the main window changing from one customer to another customer.
So could you please guide me how to create a dynamic box in sap script and also how to know the printing line nunber in main window.
Advance thanks for your suggestion
Regards,
Sudhakar.In script form u can write following code
/: DEFINE &MY_XPOS& = ' '
/: DEFINE &MY_YPOS& = ' '
/: DEFINE &MY_HEIGHT& = ' '
/: DEFINE &MY_WIDTH& = ' '
/: PERFORM GET_BOX_SIZE IN PROGRAM Z_MY_PROG
/: CHANGING &MY_XPOS&
/: CHANGING &MY_YPOS&
/: CHANGING &MY_HEIGHT&
/: CHANGING &MY_WIDTH&
/: BOX XPOS '&MY_XPOS' MM YPOS '&MY_YPOS' MM HEIGHT '&MY_HEIGHT' MM WIDTH '&MY_WIDTH' MM INTENSITY 10 FRAME 0 TW
In report u can write following code
Form Get_Box_Size TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
Loop at Out_Par.
Case Out_Par-Name.
When 'MY_XPOS'.
Out_Par-Value = 100.
When 'MY_YPOS'.
Out_Par-Value = 57.
When 'MY_HEIGHT'.
Out_Par-Value = 300.
When 'MY_WIDTH'.
Out_Par-Value = 'Does it matter?'.
EndCase.
Modify Out_Par.
EndLoop.
EndForm. -
hi all,
How do i create dynamic logo in sapscripts. i need to change the logo depending upon the company code. and there are 10 company codes. i have done my logic but how do i keep my variable.
my varaible: complogo.
thanxs in advance.Hi hari,
make an if-statement for burks. You have to insert
the logos as stadart-text.
do this in script
IF &BUKRS& = '0001'
INCLUDE Z00001 OBJECT TEXT ID ST
ENDIF
IF &BUKRS& = '0002'
INCLUDE Z00002 OBJECT TEXT ID ST
ENDIF
regards, Dieter -
How to Draw table in SAPscript ???
Hi all Guru of SAPScript!
I want to draw a table with column and row in SAPscript. Who can help me step by step?
Thanks!
Edited by: kathy a on May 6, 2008 11:53 AMHi,
Use BOx Syantax How to Draw table in SAPscript ??? Pls Read the description
Syntax:
1. /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
2. /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
3. /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
BOX
Syntax:
/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
Effect: draws a box of the specified size at the specified position.
Parameters: For each parameter (XPOS, YPOS, WIDTH, HEIGHT and FRAME), both a measurement and a unit of measure must be specified. The INTENSITY parameter should be entered 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: Decimal numbers must be specified as literal values (like ABAP/4 numeric constants) by being enclosed in inverted commas. The period should be used as the decimal point character. See also the examples listed below.
Units of measure: The following units of measure 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 layout set header
1 LN = height of a line relative to the LPI specification in the layout set header
Examples:
/: 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 shadowing 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
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 which 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 be the same of those of the current window (default setting).
PAGE: Sets the values for the left and upper edges to be the same as those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).
Examples:
/: 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
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.
Examples:
/: 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.
Reward Helpfull Answers
Regards
Fareedas -
How to write the dynamic code for RadioGroupByKey and Check Boxes?
Hi,
Experts,
I have created a WD ABAP application in that i have used RadioGroupByKey and CheckBox Ui elements but i want how to write the dynamic code to that i want to display male and female to RadioGroupByKey and 10 lables to check boxs.
Please pass me some idea on it and send any documents on it .
Thanks in advance ,
Shabeer ahmed.Refer this for check box:
Do check :
bind_checked property is bind to a node with cardinality of 1:1
CHECK_BOX_NODE <---node name
-CHECK_BOX_VALUE <--attribute name of type wdy_boolean
put this code under your WDDOMODIFYVIEW:
DATA:
lr_container TYPE REF TO cl_wd_uielement_container,
lr_checkbox TYPE REF TO cl_wd_checkbox.
get a pointer to the RootUIElementContainer
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_checkbox = cl_wd_checkbox=>new_checkbox(
text = 'WD_Processor'
bind_checked = 'CHECK_BOX_NODE.CHECK_BOX_VALUE'
view = view ).
cl_wd_matrix_data=>new_matrix_data( element = lr_checkbox ).
lr_container->add_child( lr_checkbox ).
Refer this for Radiobutton :
dynamic radio button in web dynpro abao
Edited by: Saurav Mago on Jul 17, 2009 10:43 PM -
How to draw cut the rope style box
Hi. I was wondering how to draw a cut the rope style box.
What I mean is how to they get that look. Is there a texture overlay? I suppose there is some blurring too.
https://www.google.es/search?q=cut+the+box+menu&espv=2&biw=1242&bih=641&source=lnms&tbm=is ch&sa=X&ei=xf2kVOG2D8P3UqLjg9A…Hi.
Yeah sorry.
Cut the rope is a popular game app available on the app store or google play. That's why I left the link.
The menu is made up of boxes. Each box has a pattern.
With the following link you can see the texture even more closely. It is the green rectangle image at the top with green circles etc...
Complete Guide to all Cut the Rope Drawings -
Dynamically table for sapscript
hi expects,
how could i create dynamical table for form in script.hi,
to pass the table to script means passing a field sting to script by using function module write_form.
example program,
TABLES: SPFLI,SFLIGHT.
DATA: BEGIN OF FS_SFLIGHT,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
FLDATE TYPE SFLIGHT-FLDATE,
CITYFROM TYPE SPFLI-CITYFROM,
CITYTO TYPE SPFLI-CITYTO,
END OF FS_SFLIGHT.
TABLES SCARR.
DATA T_SCARR LIKE STANDARD TABLE OF SCARR.
DATA: W_LINES TYPE I,
W_P TYPE I,
W_TEMP TYPE I .
DATA T_FLIGHT LIKE STANDARD TABLE OF FS_SFLIGHT.
SELECT SPFLI~CARRID
SPFLI~CONNID
SFLIGHT~FLDATE
SPFLI~CITYFROM
SPFLI~CITYTO
INTO CORRESPONDING FIELDS OF TABLE T_FLIGHT
FROM SPFLI AS SPFLI JOIN SFLIGHT AS SFLIGHT
ON SPFLICARRID = SFLIGHTCARRID AND
SPFLICONNID = SFLIGHTCONNID
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'YH648_060104'
LANGUAGE = SY-LANGU
OPTIONS =
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
SPONUMIV =
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
CODEPAGE = 11
OTHERS = 12
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DESCRIBE TABLE T_FLIGHT LINES W_LINES.
LOOP AT T_FLIGHT INTO FS_SFLIGHT.
ADD 1 TO W_TEMP.
IF W_LINES NE W_TEMP.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'BOXES'
FUNCTION = 'SET'
TYPE = 'TOP'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
IF W_TEMP NE W_LINES.
AT NEW CONNID.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DATA'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDAT.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DATA1'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
SELECT CARRID CARRNAME
FROM SCARR
INTO TABLE T_SCARR.
LOOP AT T_SCARR INTO SCARR.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'PROTECT1'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'WINDOW2'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
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.
ENDIF.
ENDLOOP.
IF W_LINES NE W_TEMP.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'LAST'
FUNCTION = 'SET'
TYPE = 'TOP'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
CODEPAGE = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
to draw boxes on script the syntax will be
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. -
Dynamic Box Formatting in Scripts
Hi,
My requirement is ,
This is regarding to SAPScripts.
I should populate some data in a box.
The box should adjust depending upon the data.( Whether the data is 2 lines or 10 lines).
Help me out.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Jul 8, 2008 11:21 AMHi Manjunath,
Here is the code which can help you get the dynamic box's from the script.
Here the element is TAB.
There is a loop for this element in the driver program.
Here the code works this way the YORIGIN is incremented by 0.6CM each time it is in the loop thus drawing tables dynamically.
/E TAB
/: POSITION XORIGIN '0.9' CM YORIGIN '+0.6' CM
/: SIZE WIDTH '3.0' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW.
/: POSITION XORIGIN '3.9' CM
/: SIZE WIDTH '7.3' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW.
/: POSITION XORIGIN '11.2' CM
/: SIZE WIDTH '2.8' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW.
/: POSITION XORIGIN '14' CM
/: SIZE WIDTH '2.6' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW.
/: POSITION XORIGIN '16.6' CM
/: SIZE WIDTH '3.2' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW
P4 &X_VBAP-KWMENG(C)&,,&X_VBAP- ARKTX&,,&V_TOTALa&,,&V_TOTALb&,,&V_TOTALc&
Hope this Solves your Problem in dynamic Table drawings.
<REMOVED BY MODERATOR>
Thanks,
Tej..
Edited by: Alvaro Tejada Galindo on Jul 8, 2008 11:21 AM -
PLZ HELP SAP SCRIPT ISSUE (DYNAMIC BOX)
Hi all
I want to include a dynamic text (means number of lines can vary) inside a box .
please guide me how i can create this box whose size would be dynamic according to this text.
plz help i am not able to find ne solution
Thanx in advance
Edited by: SARABPREET CHADHA on Mar 14, 2008 11:33 AMFollowing things to be done in Driver program.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = TEXT_ID
LANGUAGE = PRINT_LANGUAGE
NAME = TEXT_NAME
OBJECT = TEXT_OBJECT
IMPORTING
HEADER = TABLE_HEADER
TABLES
LINES = TABLE_LINES
EXCEPTIONS
ID = 01
LANGUAGE = 02
NAME = 03
NOT_FOUND = 04
OBJECT = 05
REFERENCE_CHECK = 06.
then
CALL FUNCTION 'WRITE_FORM_LINES'
EXPORTING
HEADER = TABLE_HEADER
WINDOW = WINDOW
IMPORTING
FROMPAGE = FROMPAGE " not interested ?
TABLES
LINES = TABLE_LINES
EXCEPTIONS
FUNCTION = 01
TYPE = 02
UNOPENED = 03
UNSTARTED = 04
WINDOW = 05.
and then in sap script.
/: INCLUDE &THEAD-TDNAME& OBJECT &THEAD-TDOBJECT& ID &THEAD-TDID&
/: PARAGRAPH T6 LANGUAGE
Your text will apper in sapscript.
Award points if useful...
Maybe you are looking for
-
When I select from the LOV, it is not storing in the database
Have a field (Manager) where the user selects their manager from the select list(generated from the query below) select FIRST_NAME || LAST_NAME d, MANAGER_ID r from PERSONNEL where TITLE = 'MGR' order by 1 After the manager is selected and Apply chan
-
Replication of BP Relationships --- ISU ECC 6.0 to CRM 7.0
Hi All - We have an ISU ECC 6.0 Ehp 4and CRM 7.0 sp3 system. I am trying to set up the replication of Business Partner Relationships. I am using the cookbook avbl in Service Marketplace. I have a couple of questions. 1. The cookbook says something ab
-
Itunes for windows 7 won't load?? Please Help
I've tried loading iTunes after restarts and re-installations but for some reason it won't load. I've never had this problem before and can't seem to solve it. Any help would be much appreciated Thanks Trickster
-
Quick Selection Tool doesn't work
This has probably been addressed, but can't seem to find it. It's driving me nuts. In Elements 6.0, I have found the Quick Selection Tool quite useful. However, I often find that it does not work; not creating an outlined selection. Have others fo
-
Probook 430 M.2 (NGFF) SSD
I recently bought a HP probook 430 G1 laptop. It came with a standard 500GB 5400RPM HDD. I want to upgrade it with an SSD. Obviously I have the standard option of a 2.5" SSD, but I know that this laptop has an empty slot, which should be an M.2 slot,