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.
Similar Messages
-
Problem with sap script main window
Hi,
I am modifying the existed sap script. I added a box and some line items to the sap script main window.
Now i want to increase the size of the mainwindow.
Please guide me how to increase the lines of main window . I am unable to edit the standard attributes of the main window ,because all are in disable mode.
Please guide me how to increase the size of the main window.
Thanks in advance
Regards
SudhakarHi,
You might be trying to edit the script in non original language. You can change the layout only in the original language.
Check the attributes of the script to see the original language.
Thanks,
Vinod. -
Sap script main window related question
hi
i have a requirement to add a new column to sap script main window picking information from some table
this new column is C2 and it takes reference from C1
i ahve below queries
1) is is better to add a new column to main window and increase and decrease alsl columns width of all columns
or create a new window below the main window in which this new field will apear
ie C1 and C2 to appear in this new window
c1 is already coming in main window it needs to reaper with the new C2 in new window
my concern is that since main window is only one and it it being called again and again to polultate the data
how this new window will work will it be able to display the corect data
whcih is better approach
2) ASLO the requriement is that the new field should appear only when Reprint is done for the transfer order
can anyone tell how to catch the reprint option or code from teh program what is defined for reprint option in program and how to catch it and put condtion?
regards
AroraIf you would like to have vertical lines as well inside the frame....
/: BOX FRAME 10 TW
/: BOX XPOS '1.2' CM WIDTH 0 TW HEIGHT '12.7' CM FRAME 10 TW
/: BOX XPOS '11.00' CM WIDTH 0 TW HEIGHT '12.7' CM FRAME 10 TW
/: BOX XPOS '15.5' CM WIDTH 0 TW HEIGHT '12.7' CM FRAME 10 TW
/: BOX XPOS '18.4' CM WIDTH 0 TW HEIGHT '12.7' CM FRAME 10 TW
Regards,
Rich Heilman -
Box in a main window with a header text in it
Hi Abapers,
I am new to sapscripts and have got an issue where a box in the main window of the first page is not getting printed in the next page when the data is flowing to the next page .
below is the code in the main window.
BOX FRAME 10 TW HEIGHT 7 MM
BOX YPOS 142 MM FRAME 10 TW HEIGHT 0 MM
*BOX YPOS 26 MM FRAME 10 TW HEIGHT 10 MM
*HEADING_TEXT
Description Value in &bkpf-waers&
i have the same code in the main window of the next page also
what may be the problem here ?
Thanks in advance .Hi Sai Ram,
There is no condition palced before the box statement.
The next page also has a main window designed similar to the first page and an additional address window and a footer .
This page is printed as the last page and contains the page as required , the problem is that all the other pages which contain the data flowing from the first page donot contain the box header as desired .
Please let me know if the requirement is not clear , i will try and put it in a better way . -
Read header text from vf01 and print in script main window
Hi Gurus,
I need to read text from vf01 header note 1, there user type max 10 lines i want to read that 10 lines and print in sap script main window after line item printed. i used read text but one line only fetched. i declare variable like data : NEXRSP LIKE TLINE-TDLINE and read_text function module. pls provide solution for this.
Regards
G.VendhanHI GURUS,
Thank u for reply i declare like
ID = '0002'.
PERFORM READTEXT USING EN NAME OBJECT ID TEXT_OUTPUT.
NEXRSP = TEXT_OUTPUT . CLEAR TEXT_OUTPUT.
FORM READTEXT USING P_EN
P_NAME
P_OBJECT
P_ID
P_TEXT_OUTPUT.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = P_ID
LANGUAGE = P_EN
NAME = P_NAME
OBJECT = P_OBJECT
TABLES
LINES = LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
LOOP AT LINES.
P_TEXT_OUTPUT = LINES-TDLINE.
EXIT.
ENDLOOP.
FREE LINES. CLEAR LINES.
ENDFORM. " READTEXT -
Getting Dynamic XPOS and YPOS for drawing the line in MAIN window in SAP Script using BOX command
Hi Experts,
I am trying to draw a line using the BOX command in the main window.
/: BOX HEIGHT 0 TW FRAME 10 TW INTENSITY 100
I want to draw a line in XPOS and YPOS dynamically..
Is there any way to find such I can draw a line dynamically after triggering a Text element. or determine the XPOS and YPOS dynamically such that I can draw a line in an intended position dynamically.
Thanks in Advance
Regards
Rajesh Chowdary VelagaAny update on this ??
-
Vertical line issue in SAP Script main window
Hi All,
I want to draw a vertical line in my main window in SAP Script output.
But problem is in main window i am printing some texts at the beggining then i am printing line items.
So this is not fixed line (box). It may increase/decrease based on text available before line items.
How can i manage this prining vertival line as i don't know height, top of this line!
Thanks in advance.
Thanks,
Deep.Hai Deep,
Use Elements as suggested by Kodarapu.
Now goto Paragraph Formats create a format for Item lines.
ex.
Name Paragraph Format as 'IL' Now click on the Push Button "Tabs" on bottom Right.
now in "Tab Position" enter the spacing that you need for your item dispaly
ex.
Number Tab position Alignment
1 6.00 CH LEFT
2 25.00 CH LEFT
3 54.00 CH LEFT
The above example is for 3 items
Now in your Script Windows-> Main
do the following.
/E ITEM_LINE_A
IL &EKPO-EBELP&,,&EKPO-EMATN&,,,,&EKPO-TXZ01&
Hope it SOlves your Issue.
Cheers,
Suvendu -
Printing of Boxes dynamically in main window
Is it possible to provide some conditions in SAPScript (form) to add boxes depending on the presence of different number of document numbers?i.e if there are 10 document numbers 10 boxes to be provided.Can this be handled in Main window of the script?
Hi,
You can hnadle this,
You need to write a perform in the Script. and get the No of records which are printed in the main window according to that maintain 2 variables in that whcih we use the window size in the layout.
in the Main windoe element, write as
BOX WIDTH '1.2' CM HEIGHT <b>&HEIGHT&</b> CM FRAME 10 TW
BOX WIDTH '9.5' CM HEIGHT &HEIGHT& CM FRAME 10 TW
BOX WIDTH '11.5' CM HEIGHT &HEIGHT& CM FRAME 10 TW
BOX WIDTH '13.5' CM HEIGHT &HEIGHT& CM FRAME 10 TW
BOX WIDTH '15.9' CM HEIGHT &HEIGHT& CM FRAME 10 TW
BOX WIDTH '19.1' CM HEIGHT &HEIGHT& CM FRAME 10 TW
Height field should be in the TOP of the Driver program , i mean it should be a global field. and maintain this Height according to your requirment. -
How to print text into different boxes in a main window
Hi,
I divided the main window into 5 windows using boxes.
Now how can I print different data into each of these boxes.
The data comes from a print program .
Please suggest.Hi
In smartforms you can create a template object or a table object and set the boxes.
after you'll create the text object into the templeate and set on which box the data will write.
best regards
Marco -
Box in a main window in sapscript
Hello Forum!
In my sapscript there's a window MAIN with BOX FRAME. This window is in a first and next page, but the box only appears in the first page, not in the others.
Anybody knows what I shound be change? I need the box always appears (in all pages).
Thanks in advance!!!
Edited by: Pablo Ariel Vicente on Feb 14, 2008 3:57 PMHi!
Try specifying all the parameters (XPOS, YPOS, HEIGHT, WIDTH) in the BOX command. This may resolve the problem.
Cheers! -
Script - Main window Formatting issue
Dear Experts,
i am developing shipping note. used standard program and script, in main window contains many text elements. what ever not required text elements i commented. But problem is my text element is printing in last page, first pages are printing blank. i want to display the text element in my first page.
For understanding purpose i am giving the below details.
/E GENERAL_HEADER_DATA_TITLE
/E GENERAL_HEADER_DATA_TYPES
like this all text elements have.
/E SHIPPING_UNIT
/E SHIPPING_UNIT_DELIVERY_ITEM
i want to display shipping details in main window first page it self. i am getting data but it's not in first page.
if i delete unnessary text elements i am getting info messages while executing the transaction.
Thanks,
Satheesh.Hi,
Dont delete the text elements, Instead comments the lines below the text element.
/E SHIPMENT_HEADER
/E SHIPMENT_DET
Regards
Praveen -
Script Main window Width Adjustment Problem
Hi All,
I'm working on an existing Z script. In that I cant able to change the width of the Main window. It shows in Display mode.
Help me to solve this.
Points assured.
Regards,
Viji.The probelm for this is you original language is different from the language which you key in in your script.
To modify the main window, follow the below steps.
1) Go to SE71, give your form name, Display. Goto Header details, administrative Data and find out the original language, Ex, DE.
2) Go back to SE71, give form name and Language i.e., original language name identified in step 1 and click change. Now change your main window dimensions and adjust the width according to your requirment,save activate..now it will automatically reflects the changes for all languages.
3) Go back to SE71, give form name and language, now you will see the main window width is adjusted.
Close the thread once your question is answered.
Regards,
SaiRam -
Problem with line items print in Script MAIN window.
Dear Friends,
I am facing a problem with display the line items in main window.
Here i have created my form with 2 pages,
in first page i have created header window(my header information is full length of page), in second page i have created 2 windows, one for MAIN window and second for FOOTER window,
i am having the Footer information about to off the page.
and in my main window total 3 line items are coming, if i am having 3 line items then it is displaying properly (first 3 line items then immediately footer information on same page) but if am having more then 3 line items say four, then in my second page first it is printing 3 line items then it is switching into another page. After that footer is coming but. in previous page after printing 3 line items the remaining page is empty..
my client want me to remove that place also. he wants to display continue..
i think so u people r understand what is my problem...pls advice me what i want to do to solve this problem.
Thanks
Sridhar.Hi Sridher,
If you want to display the footer information only on the last page why dont you use a table to display your details and place the footer details in the table footer instead of a seperate footer window.
Regards,
Vidya. -
Cheque Script Main window question
Hi,
in Main window of F110_PRENUM_CHCK there are numbers in bold like 510-1 512 etc. Can you explain me what do they mean?
Thank you,
VitalyThey are the ELEMENTs within the Main window.
The driver program calls the Combination of the WINDOW and ELEMENT (e.g. MAIN and 520) and it will generate the output which in there under the ELEMENT.
Check this help:
http://help.sap.com/saphelp_nw70/helpdata/en/d6/0db400494511d182b70000e829fbfe/frameset.htm
Regards,
Naimesh Patel -
Box inside Main window issue in Scripts
I have issue in placing a box inside the main window. I would like to display text with a box frame at end of the line items.
I tried creating seperate FOOTER window in the Last page, but it dint work as expected, since if the line items ended in the first page then the LAST page did not trigger and one more complication was if there were 4 pages, then there was blank window (FOOTER) in 2 pages and it looks ugly.
I tried putting the box frame by using text element, calling after the end of the line items. The text displayed as needed, but the frame was misaligned.
Kindly help me. Thanks in advance.
Have a great weekend.Raj,
Try to find out which text element is trigerring after the line items text element while debuging the script and then place the box code in that text element.
regards.
Maybe you are looking for
-
Hi, I have two 10.7.4 clients running as PHD on a 10.7.4 server. I have noticed rec ently that neither of them sync themselves when they log out. All other syncing works (i.e log in, maually, and every 5 minutes). I have an exception errro in my F
-
Problem creating an extendable panel with a header
Hi - I'm trying to create a base panel class. What it needs is a header at the top of it with a title box(another panel) of a different color. The title of course is in the title box. My primitive solution was to create a parent panel and place the t
-
How to configure a Network Interface?
Hey guys. I'm very new to Solaris OS. I've now installed Solaris Express Developer Edition on my Laptop. After the restart of the installation,I find out, that my network don't work. I try to configure it with the network-admin-tool, but i can't add
-
Having trouble downloading the basic content
havingh trouble with downloading the basic content of main stage 3 at the end of the download it keeps saying something about Internet connection i tryed two different Internet places. my house and the apple stores as well did the same thing.
-
Hi I am new to coldfusion Got a database connected and displays first record How do I index the records and how do I find a record many thanks