Tables in sapscript
Hi,
I have two queries on 'tables in sapscript'.
1> For some longer records,the extended part of the last field is coming down below the first field..like
field1 field2 field3
AAA BBBB CCCCCCCC
CC
How to prevent this ?
If the length of field3 data is more,i want it to come in second line of field 3 itself.
2>I have created separate element for the column headings.Now,the space between the column headers remain constant even if the spacing between the contents are varrying.
field1 field2 field3
AAAAAAAAAA BBBBBB CCCCCCC...
How to make the distances between the column headers same as the contents ?
Please help.Thanks in advance.
Regards
Ananya
I hope ur query 1 is solved .
//I have created separate element for the column headings.Now,the space between the column headers remain constant even if the spacing between the contents are varrying.
column headings are Fixed length and it will remain constant .
where as ur field contents may vary
Remember that i have only finite space ( equal to that of the column header ) to display the data .
if the field data is more than you need to set the column heading in proportion to the column heading .
ex.
material description is 35 char
then
Material Description Plant "<-- heading
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2222 "<--field val
i can only fit that size of 35 for material description.
The texts will not vary .
regards,
vijay.
Similar Messages
-
How to draw the tables in sapscript?
Is there any other way then draw box for vetical and horizontal line.Hi
See this and draw the boxes in Script
SAPScripts
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
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.
Reward points if useful
Regards
Anji -
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 psss a table from sapscript to routine program
HI,
i want to pass a table from sapscript to routine program.
the requirment is to sor the table by material number wise.
how do we pass throug itcsy structure.
Regards,
BalachandranREPORT YMMR_TDS_LPRG .
TABLES: ADRC."Central address administration
FORM FETCH_VEN_ADD *
--> IN_TAB *
--> OUT_TAB *
FORM FETCH_VEN_ADD TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
DATA: L_STREET4 LIKE ADRC-CITY2,
L_STREET5 LIKE ADRC-LOCATION,
L_INDEX1 LIKE SY-TABIX.
DATA: LEN TYPE I.
DATA: Z1(5) VALUE '00000'.
LEN = STRLEN( IN_TAB-VALUE ).
IF LEN = 5.
CONCATENATE '00000' IN_TAB-VALUE INTO IN_TAB-VALUE.
ELSEIF LEN = 6.
CONCATENATE '0000' IN_TAB-VALUE INTO IN_TAB-VALUE.
ENDIF.
SELECT CITY2 LOCATION FROM ADRC
INTO (L_STREET4,L_STREET5)
WHERE ADDRNUMBER = IN_TAB-VALUE.
IF SY-SUBRC = 0.
LOOP AT OUT_TAB.
CLEAR L_INDEX1.
IF OUT_TAB-NAME = 'ADRC-CITY2'.
L_INDEX1 = SY-TABIX.
OUT_TAB-VALUE = L_STREET4.
MODIFY OUT_TAB INDEX L_INDEX1 TRANSPORTING VALUE.
ELSE.
L_INDEX1 = SY-TABIX.
OUT_TAB-VALUE = L_STREET5.
MODIFY OUT_TAB INDEX L_INDEX1 TRANSPORTING VALUE.
ENDIF.
ENDLOOP.
ENDIF.
ENDSELECT.
ENDFORM.
Se71
/:PERFORM FETCH_VEN_ADD IN PROGRAM YMMR_TDS_LPRG
/:USING &T001-ADRNR&
/:CHANGING &ADRC-CITY2&
/:CHANGING &ADRC-LOCATION&
/:ENDPERFORM -
How to create a table in SAPscript
Hello,
I am quite new at SAPscript, and cannot figure out how to create a table in my main window.
I have read this forum post : Script: tabs, boxes, tables but am having problems with the way to fill in tabs, so if someone could help me understand better I would be very grateful.
i need to create the following scenario:
|ITEM |MATERIAL |QTY |PRICE |CURRENCY | <-Headr
| xxxx |xxxxx |xxxx |xxxx |xxxx | <-Item
| xxxx |xxxxx |xxxx |xxxx |xxxx | .
| xxxx |xxxxx |xxxx |xxxx |xxxx | .
| xxxx |xxxxx |xxxx |xxxx |xxxx | .
| xxxx |xxxxx |xxxx |xxxx |xxxx | <-Item
Total Amount xxxx
I have created a paragraph format PF with all the necessary tabs.
1) How do I create the table and the dividing lines ?
In the line editor I typed
<b>/E</b> TABLE
<b>PF</b> Item,,Material,,Quantity,,Price,,Currency
(will these be translated when I translate the form with the SE63 transaction? Or should I put the technical name for them, for example: &BKPF-BELNR&,,&BKPF-UZEGF&,,etc ?)
what is the use of the <b>/E</b> TABLE ? All it does is print "/E TABLE" in my print preview... is this normal or did I forget to do something ?
2) now in the Items, how do I input the different elements ?
If I just type
<b>PF</b> &BSEG-BSHL&,,&BSEG-BSGY&,,etc will I get as many lines as I have items ?
I read on a forum that I need to type itab, but how do I syntax it so that it works with the technical info of a field?
&itab-BSEG-BSHL& doesn't work, I get an error message saying "unknow symbol itab-BSEG-BSHL"
Thank you in advanceHi Micol,
Create a window for the below ( Header window )
|ITEM |MATERIAL |QTY |PRICE |CURRENCY | <-Headr
<b>In text elements of this window write this
PH ,,ITEM,,MATERIAL,,QTY,,PRICE,,CURRENCY
Here PH is a paragraph format give appropriate tabs.</b>
| xxxx |xxxxx |xxxx |xxxx |xxxx | <-Item
| xxxx |xxxxx |xxxx |xxxx |xxxx | .
| xxxx |xxxxx |xxxx |xxxx |xxxx | .
| xxxx |xxxxx |xxxx |xxxx |xxxx | .
| xxxx |xxxxx |xxxx |xxxx |xxxx | <-Item
Assume the fields are
Item - itab-item
material - itab-material
quantity - itab-qty
price - itab-price
currency - itab-currency
<b>In text elements of main window write
/E TABLE
PI ,,&ITAB-ITEM&,,&ITAB-MATNR&,,&ITAB-QTY&
,,&ITAB-PRICE&,,&ITAB-CURRENCY&
</b>
In u r driver program
loop at itab
Call function 'WRITE_FORM'.
under element take 'TABLE'
window 'MAIN'
endloop -
Mapping data from internal table to SAPSCRIPT Box.
Hi Gurus,
I have to create a sapscript where in I should get data from standard tables and display the data in box (table format) in sapscript. I know how to get a field (perform in zprogram) into sapscript form zprogram. I dont know how I can get data (internal table) from my zprogram into sapscript and display in a box.
Your help is highly appreciated.Hi David,
consider the below example say if your zprogram having the internal table table loop and you want to print the contents line by line or in a box,
LOOP AT tj_1irg23d.
header line
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'ITEM_HEADER1'
EXCEPTIONS
OTHERS = 1.
endloop.
then in your sap script main window or where ever you want to print just straight away give your internal table fileds as follows(just for example)
I2 ,,&J_1IRG23D-ZEILE(Z)&,,&J_1IRG23D-MATNR&,,&J_1IRG23D-CHAPID&,,
= &J_1IRG23D-MENGE(Z)&,,&J_1IRG23D-MEINS&,,0.0,,
then it will bring the values of your internal table in the form. -
Passing Internal table to SAPscript from report
Hi Experts..
I have a requirement of sending Rate Change notification to the business partner and the code of which is written in SAPscript
I've written the query part in driver program but I am unable to send the vkonto(Contract Account) which is in internal table(IT_EVER) to the SAPscript, though I am using OPEN_FORM, WRITE_FORM and CLOSE_FORM function modules, but still I am unable to get the values in SAPscript.. I unable to pass IT_EVER to SAPscript..
SELECT-OPTIONS: S_VKONT FOR FKKVKP-VKONT MODIF ID TT. " Contract Account Number
SELECT VERTRAG ANLAGE VKONTO INTO TABLE IT_EVER FROM EVER WHERE VKONTO IN S_VKONT.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX' " Standard Text
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = ' '
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.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = ' '
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.
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.but where do i have to write the SAPscript's name in the function module? And where do I have to write IT_EVER internal table which I want to pass to SAPscript..
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX' " Standard Text
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = ' '
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.
LOOP AT IT_EVER INTO WA_EVER.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = ' '
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.
ENDLOOP.
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. -
Creation of table in SAPScript
Hi,
I am new to SAPScripts.
Could you please give me a sample code to draw a table with 5 rows and 4 columns in SAPScriptTry this.
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&
the driver program's piece of code.
LOOP AT it_vbap INTO x_vbap.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'TAB'
window = 'MAIN'
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.
Regards,
SaiRam -
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. -
Hi all,
My requirement is to draw a table with 4 rows and 5 columns.
I tried to code like this :
/E BOX
/:BOX HEIGHT '0.5' CM FRAME 10 TW
/:BOX XPOS '.48' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW
/:BOX XPOS '.78' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW
/:BOX HEIGHT '1.0' CM FRAME 10 TW
/:BOX XPOS '.48' CM YPOS '0.5' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW
/:BOX XPOS '.78' CM YPOS '0.5' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW
/:BOX HEIGHT '1.5' CM FRAME 10 TW
/:BOX XPOS '.48' CM YPOS '1.0' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW
/:BOX XPOS '.78' CM YPOS '1.0' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW
However my output is not the same as what I seen in the preview and real printout.
Preview
http://i566.photobucket.com/albums/ss106/wkw510/pic12.jpg
Printout
http://i566.photobucket.com/albums/ss106/wkw510/pic13.jpg
Can someone please guide me how to resolve this?
Or provide me some code or reference how to get the above requirement?
Many thanks!Hi,
In WINDOW draw a horizontal line in the starting and in end again draw a horizontal line to close the table and the height with the vertical line.
or.
BOX XPOS '3' CM WIDTH 0 TW HEIGHT '8.2' CM FRAME 10 TW.
Regards,
jaya -
Issue in drawing table as XPOS and YPOS can't be determine SAPscript
Hi All,
I'm in a issue in drawing a table in SAPSCRIPT.
I have to draw a fix 5 rows 5 coloumns table.
But issue is that i cannot give the X and Y pos as above to it is text element which displays some other line items.
So as the items may vary and thereafter i have to draw a new table.
I used sy-uline and sy-vline but it is not looking completely like a table as it has broken lines.
Kindly advice.ZS &uline(80)&
ZF &vline& Shift 1,,&vline&,,|,,&vline&,,&vline&,,&vline&
ZS &uline(80)&
in this way im making boxes , but for box statment i will need xpos and ypos else it will draw box at the beginning of window.
Can any one please help me with this paragraph format.
I have used small text but exact tabular structure is not possible.
Paragraph format used : ZF : Line Spacing 0.80 LN
Family HELVE
Font Size 10.0 pt
What else can help it to look like a complete table ? Srihari any advice ?
Edited by: ujjwal_d15 on Feb 7, 2012 12:47 PM -
SAPSCRIPT: How change background color cell/table
Hi!
How can I change background color cell/table in Sapscript?
Thanks very much!Hi ,
Normally we use Scripts and smartforms for submitting the output to customers or for tax purpose and so on,,in such case we wont submit in differnt color other than white and black,so formatting in other colors is not possible in Script and smartforms.
Please let me know if have any issues on this.
Thanks and regards,
Rajeshwar -
Table for Long Texts of MICs in Tasklist
Dear All
Can any body tell me from which SAP table i can get the LONG TEXT maintained for MICs in any tasklist.
Table PLMK only shows wether long text maintained or not, but i want the value in LONG TEXT.
thanks
ZeeshanThis may be helpful.
SAP stores comments (text fields) in a separate table. STXH is the text
"header" table (STXD SAPscript text file header). STXH-TDOBJECT =
'KNA1' will bring back all the customer comment headers. STXH-
TDNAME='0000010744' is the header record for the comment for customer
10744.
It is not always so simple to figure out what the TDOBJECT (object needed by function below - sometimes it is a table name, other times...), TDNAME (name needed by function below - sometimes it is a document number & line item or customer number, other times... ) & TDID (id needed by function below - it is always the long text id). There are several methods that can be used. You can create the long text that you are researching and using, SE16 for table STXH search TDLUSER = to your kerberos principal and TDLDATE = to today's date. This is modify date & user. Alternatively, you can find an existing item with the long text and figure out the date and user who last modified it and use this information in your search. Once you have STXH row for text of interest, use ZCAFTXT to test your research. Project Titles and WBS Titles are a bit more complex.
Changes to sales contract long text between 3.0F and 4.5B.
The following code is a function that will return a customer comment.
form get_comment using cur_kunnr.
call function 'READ_TEXT'
exporting
id = '0002'
language = sy-langu
object = 'KNA1'
name = cur_kunnr
importing
header = thead
tables
lines = tlinetab
exceptions
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
others = 8.
if sy-subrc = 0.
loop at tlinetab.
write / tlinetab-tdline.
add 1 to line_cnt.
endloop.
endif.
endform.
The above subroutine is called with the following code:
if p_cmnt = 'X'.
tdname = cur_cust-kunnr.
perform get_comment using tdname.
endif.
These data elements are defined as:
data: begin of tlinetab occurs 100. "table to process comments
include structure tline.
data: end of tlinetab.
data: tdname like thead-tdname.
Vishal Jonnalwar -
How Can I perform the external abap programe transmit the internal table in
Hi,all
In Sapscript,I want calculate a internal table and return the changed table to Sapscript
I know used the transmit result variable for example:
/:PERFORM GET_MAKTX IN PROGRAM ZXX
/:USING &MATNR&
/:CHANGING &MAKTX&
/:ENDPERFORM.
How can I set Using with a table?
Thanks
SunHi,
As per my knowledge it is not possible to pass the entire table at a time using PERFORM in PROGRAM ,,, USING and CHANGING.
Solutions:
1) If possible do the same thing in the Print Program:
using CONTROL_FORM call element and print in the script
2) if you know the all table entries.: Pass all records at time:
Ex: PERFORM Pxxxx in PROGRAM PROGXXXX
USING <MATNR1>
<MATNR2>
<MATNR3>..............
CHANGING < MAKTX1>
<MAKTX2>
<MAKTX3>............
ENDPERFORM -
hi experts,
How to handle table control in scripts pls suggest me in this regard.
regards,
k.rajesh.Hi,
Refer to:
SAP Script - Tables creation & displaying data in right place in table?
creating tables in sapscript
Regards,
Priyanka.
Maybe you are looking for
-
Hi all, I have one role play dimension with some null key in fact table, I liked know if it's a good practice? thanks
-
in the welcome menu of itunes i had switched off an option of openning itunes automatically whenever ipad is connected now how do i undo it
-
Supply on USB power adapter exchange program
Just wondering anyone who has done an online request for an exchange of their adapter got a delay recently. After visiting the Fairview mall Apple Store last Saturday, Oct 18th, they were out of stock and asked me to register online. I did and now a
-
WINDOWS 7 RC 2009 & Hp 7660 Printer
After months of trying several drivers, even those suggested by HP and Microsoft, with problems concerning the full use of the HP Photosmart 7660 printer in Windows Vista and now Windows 7, I had to use the alternate printer in Vista but found I co
-
Since updating to iPhoto 9.5.1 on 12/16 cannot add music to slideshow. Have done this before with no problem