on 09-15-2009 4:27 PM
hello to all, im new in Mii and i have a sql statement to populate the table but i want to know if it is possible to create a grid like the image in this link :
http://img17.imageshack.us/img17/3021/gridx.jpg
and then put the information that comes from the sql in the blank spaces
regards and thanks for the help in advance
Mário
hello i alredy know how to put the Shift 1, Shift 2,Shift 3 and Total but now i only need help to put the data in the blank spces
regards
Mário
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mario,
here is one idea:
- build a BLT that creates a XML output with three columns (Label, Quantity produced, Scrap)
- fill the rows with your values
- define a xacute query which calls your BLT
- define an iGrid in your web page that calls the xacute query
- try to set the column name of the leftmost column heading to space
If you want to fill the spaces in an html table using JavaScript, you may also call the xacute without a display template (to make it unvisible) and pick up the values from the query using the applet functions like getCellValue().
See also [iGrid component methods|http://help.sap.com/saphelp_xmii120/helpdata/en/44/d1e7a599f3409fe10000000a11466f/content.htm]
Michael
Edited by: Michael Otto on Sep 15, 2009 8:46 PM
hello, first i want to thanks for the idea of Michael, then i want to clarify somethings of your idea...
BLT..it is a transaction..correct?
you say to create a XML output with 3 columns..label, quantity, scrap but what do you want to say with label???
so in the transaction:
i create a XML Document with three fields then with my SQL instruction i fill the fields...
correct?
regards and thanks one more time
Mário
Hi,
You to do the fallowing things in BLS trnsaction:
1) Create a Doc action block with three columns like: Shift,Quantity,Scrap
2) Add SQLQuery Action block and configure it with already created SQL Query.
3) Put a repeater action block below that and configre with XPATH.
4)Add a Row action block,configure with Doc.output and map the each column from the repeater.
5) Also add other row with the total and take the sum of the quantity and scrap.
6) Create a transaction property of type xml with Output checked.
7) Add a sequence below th Doc action block and use Assignment action block. Map the Doc.output to transaction property.
8)Call this trnsaction in Xacute query with output selected and save.
9) Use iGrid Display template and map the created Xacute query.
10) In html page create table with the table title Summary of the day and put the appalet over here.
-Suresh
thanks all for your answers but just a little thing: the shift gonna be a parameter but i want to calculate at the same time the max yield and max scrap of all the 3 shifts...what i have to put in the transaction for the shift number passes of 1 to 2 and then 2 to 3...i know that i have to increment in somewhere...
regards
Mario
Hi,
If the data is from the Tag query(i.e TAGS Data), you can easily calculate the MAX,AVG,MIN etc from Statatics mode available there. But for sql query this option is not avaialble. But i SQL query itself you can achive this by using the MAX function. For example SELECT MAX(salary) as "Highest salary" FROM employees.
You can use For repeater action block for the shift increament if you have mutiple row data by configuring from 1 to 3. And in row expression use like this: "Shift"&ForNextRepeater_0.CurrentItem. If you have three rows of data then use repeater: "Shift"&Repeater_0.CurrentItem. Otherwise use Assignment action block, create Local property Shift and increament this shift property after each shift completion like this: Local.shift+1.
-Suresh
hello, correct me if i say something wrong of yours steps:
1) Create a Doc action block with three columns like: Shift,Quantity,Scrap......
and then i put another field Total....correct?!?! or not?
2) Add SQLQuery Action block and configure it with already created SQL Query.
the result of my SQLQuery comes like this...
Yield Scrap
5000 1100
this is the result of this query:
select sum(max(yieldqty)), sum(max(scrapqty))
from z_event
where linenumber= '[Param.1]' and shiftnumber = '[Param.2]'
and (eventtimestamp >= to_date('[Param.3] 00:00:00', 'dd.mm.YYYY hh24:mi:ss'))
and (eventtimestamp <= to_date('[Param.4]', 'dd.mm.YYYY hh24:mi:ss'))
group by ordernumber
its better that the shiftnumber comes to???if yes the result comes like this:
Yield Scrap ShiftNumber
3720 35 1
30878 117 1
3) Put a repeater action block below that and configre with XPATH.
4)Add a Row action block,configure with Doc.output and map the each column from the repeater.
5) Also add other row with the total and take the sum of the quantity and scrap.
how to make the SUM?!?! There isnt SUM Function...
like this Total = Total + Repeater_0.Output{/Row/MAX_YIELDQTY_} ???
regards and sorry for all this questions
matinha
Hi,
Yes ,absoultely right you have got my points correctly. For getting the total quantity you have to do like this:
Create a local property with name Tot_Qty.Use a assignment block below the row action block, and assign this local property with the expression: Local.Tot_Qty+Repeater_0.Output{/Row/MAX_YIELDQTY_}. Map ths Local.Tot_Qty to the Total row's columns. And for Scrap is also same.
-Suresh
hello Suresh, one thing that i dont understand how this transaction gonna do is:
in my sql i get this result :
Shift Yield Scrap
1 3720 35
1 30878 117
this is for Shift 1 and i want to join this two lines and then calculate shift 2 and shift 3...and only then i calculate
the total_Yield = Shift1_Yield + Shift2_Yield + Shift3_Yield and the total_Scrap = Shift1_Scrap + Shift2_Scrap + Shift3_Scrap
could you explain me this
regards
hello, thanks for your efort to explain me this things...now my transaction is working but only calculates for shift 1...the shift it is a parameter of SQL Query.
i have one question : you said to me to create a local variable(shift)..ok...and then use the Switch action block..but where i going to put his action block, i think that is before the repeater...is right??...
another question is how to calculate total of all the Shifts for Quantity Produced and Scrap..i dont understand of another times
my transaction is like this : http://img10.imageshack.us/img10/2029/celltrans.jpg
and my grid is like this : http://img29.imageshack.us/img29/772/gridk.jpg
regards and thanks a lot for your help
Mário
User | Count |
---|---|
12 | |
7 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.