Color the row based on condition
Hello all,
I am woring on an interactive adobe form being called by a web dynpro application.
The adobe form interface used is XML Schema based. The form displays some data at header level and item level.
The item details are displayed in a table. Now. my requirement is that i have a field 'STATUS' in the item table. I want to display the row with RED color if the STATUS = 'X' . How can i achieve this.. i tried using java script at Row initialze event but that didn' work.
Please let me know if you have some solutions.
Thanks & Regards,
Ravi Aswani
Try this code
var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
var custordertext;
for (var i=0; i <= fields.length-1; i++)
if (fields.item(i).name == "STATUS")
if(fields.item(i).rawValue == "X")
this.fillColor = "50, 50, 255";
use this event in calculate event
Thanks,
Rakesh
Similar Messages
-
Table Control - Input Enabling/Diabling of Rows based on Condition.
Hi,
In the TC, I want to Input Enable/Disable the rows based on Conditions. The First row is input enabled always. But the other rows, (2nd onwards) need to be Input Enabled/Disabled based on some conditions. It is possible to make this working. Can you please provide me a suitable solution for this?
Appreciate Your Help.
Thanks,
KannanHi Kannan...
If we are talking about "Rows"...
then identify based on some conditions the row numbers and in PBO...loop at screen with screen name..set thier input properties and modify screen (make them input only)
If we are taking into consideration "columns"
There is an internal structure COLS where we can identify column number of screen name ...or we can take except for one particular column..
if some condition satisfied....
loop at screen where screen-name <> "Column which is input'.
Loop at screen...and make other columns display only.
modify screen
endif.
Regards
Byju -
Color report rows based on a value in that row
I would like to Color report rows based on a value in that row.
For examplle with the "EMP" table:
I would like job=MANAGER to be red and job=CLERK to be green etc etc
The other example I found only had the option of one color either the highlight or the default color.
I am looking for a way to do multiple colors.Hi,
In the row template, you can use #1#, #2#, etc to indicate where a field in the report needs to be output. This does not have to be plain text - ie, you can use it within style tags if you like.
So, take a query like:
SELECT EMPNO,
ENAME,
DEPTNO,
DECODE(DEPTNO, 10, 'green', 20, 'red', 30, 'cyan', 'white') BG_COLOUR
FROM EMPYou get columns 1=empno, 2=ename, 3=deptno and 4=bg_colour. In the row template, you can then do:
Before Rows setting (sets up the table):
<table>
<tr><td>ID</td><td>Name</td><td>Dept</td></tr>After Rows setting (closes the table):
</table>Row Template 1 (used for ALL rows):
<tr style="background-color:#4#;"><td>#1#</td><td>#2#</td><td>#3#</td></tr>Then, for every row, the colour that has been calculated using the DECODE function will be used in the style tag to colour the background for the entire row.
How you determine the colours is up to you. I've used DECODE here, but you could use a field on the DEPT table to hold this and use this in your SQL statement.
Andy -
How can hide the buttons based on condition
Dear all
I have to hide the button based on condition
When I open the third page directly I want to hide that button
When I open the third page via first and second page I need to visible that button
I pass spell parameter from first to second and second to third
In third page I get the value using pagecontext
I write the code in third page co
If I go directly third page it is null
If I go to third page via first the value is Y
If(“Y”.equals(pmode))
OASubmitButtonBean btn =( OASubmitButtonBean )webBean.findChildRecursive(“<id>”);
If(!btn=null)
btn.setrendered(true);
else
btn.setrendered(false);
but the button is not hiding
Regards
SreekanthHi Srikanth,
I have modified ur method:
OASubmitButtonBean btn =( OASubmitButtonBean )webBean.findChildRecursive(“<id>”);
If(btn !=null)
If(“Y”.equals(pmode))
btn.setrendered(true);
else
btn.setrendered(false);
Thanks,
'Kumar
Edited by: Kumar Kovela on Aug 3, 2009 5:53 AM -
Conditionally Color a row based on the Day of the Week for that row ?
Hi,
I have a Table containing some timing entries for each day. I have been trying to format some rows depending on a value in one of the columns for that row. What I would like to achieve is color the cell background gray for every row where the Date found in the first Column isn't a Week Day.
I have been trying many things by now, but can't seem to figure it out. Does anyone have suggestions ? I have included a screenshot of what I would like to achieve :
Thanks a lot in advance,
Stefaan
Message was edited by: Stefaan LesageVariations on my post linked in Badunit's message here:
You'll need a second table with one column and as many rows as Table 1 (which contains the dates).
The formula for Table 2 assumes the dates are in column B of Table 1.
=OR(WEEKDAY(Table 1::B)=1,WEEKDAY(Table 1::B)=7)
Enter the formula in the same row as the first data row in Table 1, and Fill it down.
Rule for conditional formatting for all cells in Table 2: Equals TRUE
Other instructions as in the linked message.
Regards,
Barry -
Formating the Row Based on one column value
Hi Friends
I am trying to format the Entire row based on the value of the first column in my Answers.
Example if first column value in 'F' now i want the Entire row to be colored
I can do conditional formating on one column but i want to do it on the entire row
F 8.1 % 12.0 %
E 5.2 % 3.5 %
M 2.3 % 3.3 %
If any one has done this or any suggestions please respond
Thanks
SangIts a Pivot View
F 8.1 % 12.0 %
E 5.2 % 3.5 %
M 2.3 % 3.3 %
the column 1 --> F,E,M are the Product
the column 2 --> 8.1% , 5.2% , 2.3% are the sales in year 2008
the column 3 --> 12.0 % , 3.5 %, 3.3 % are the sales in year 2009
So will i be able to apply the formating in pivot view based on one column to other column If yes please let me know how or
suggest if this can be done using the BI Office , or BI publisher
sing the BI Office i can do the formating in Excel but once i refresh the data all the formating is gone ... :(
I am donno BI Publisher if we have to use BIP please suggest any solution its very very very urgent and important report formating they need here ....
Thanks in advance David
sango -
Planning Form: Suppress row based on condition
Dear All,
Is it possible to do this in hyperion planning. for example:
- i have member A
- in the data form, i want to show row only when member A have value equal to 1. other is suppressed.
- in another form, i want to show only when A = 2, other is suppresed.
did anybody have this experience, or is there any other way to do this?
Thanks in advance.
Regards,
FeriHi, i assumed as answered because in fact, the Planning dataform don't have that functionality, but in the new version (11.1.2.2) you might want to try the filter functionality.
It was a long time ago, but if i'm not mistaken, previously i solve this problem by separating the member for each condition.
example:
member A: have all data
(copy the data from member A to member B and C with condition)
member B: contain data for condition 1
member C: contain data for condition 2
then you can select which condition that you need to show. -
Add different UI in each row based on conditions in ALV
Hell All,
i am working on dynamic ALV in which i have created 3 methods 1. which creates the columns 2. Which sets the data into teh created columns. 3. which does teh alv customizations.
So now my requirement is based on some condition i want to change the UI element
eg
i have
column1 column2 column3
1 link_to_action name
2 link_to_url name2
so based on the condition i would like to display the ui elements as above.
I was able to do till this end so far..
1.in create_columns method i created a column call cell_varaint
2 when i was passing data into the columns
'when column1'
IF colum1 = 1.
<field> = 'link_to_url'
else.
<f_field> = ' '.
endif.
when 'column2'
CREATE OBJECT lr_link_to_actn.
<ls_column>-r_column->set_cell_editor( lr_link_to_actn ).
CREATE OBJECT l_cv.
l_cv->set_key( value = 'LINK_TO_URL').
l_cv->set_editor( value = lr_lnk_to_url ).
<ls_column>-r_column->add_cell_variant( r_cell_variant = l_cv ).
<ls_column>-r_column->set_sel_cell_variant_fieldname( 'cell_varaint).
so now i am able to get only empty column with no data into it ... and my cell varaint column shows me the values like LINK_to_URL or space.
I am sure tht some where i am missing something...
Please tell me the correct procedure to use it...
Regards,
Sana.I hope it is Hello not Hell
if i understand your question correctly, You want the first row of column to LinkToAction UI element and second row LinktoURL.
follow the link where it is nicely explained however he is making one row as text view and other as checkbox.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0e7461d-5e6c-2b10-dda9-9e99df4d136d?quicklink=index&overridelayout=true -
Suppressing a segment in the target based on condition
Hi Guys,
Iam working on an interface which has a requirement in which we need to suppress the segment in the target XML file of the IDOC Structure, Based on the data coming from a particular field in the Source IDOC iam doing a java lookup, if the condition fails in the lookup it should suppress the segment in the target XML file of the IDOC.The occurance of the particular segment in the IDOC is 0 to 999999.
Kindly throw some light on the procedure in which this can be acheived.
Any sort of suggestions regarding this are appreciated.
Thanks in Advance.
Praveen.May be it help you:
(not so trivial solution)
Try to create Advanced User-Defined function (in mapping designer) with at least 2 parameters. (first - this segment, second - particular field) (check "Cache entire queue" option)
something like this:
public void Suppress(String[] a, String[] b, ResultList result, Container container){
String segment = a[0];
for(int i=0; i < b.length; i++) {
String data = b<i>;
if(data != null and data.equals('race conditions')) {
result.addValue(segment);
break;
}else {
//ignore.
//note: for empty segment - result.addSuppress() -
Hi every 1 ,
I am displaying the grid output with material and batch.
but for every change of batch i want to change the color for that row .
its urgent please any body help me to resolve this problem.
thanks in advancemadhavi,
check these below links may be useful for you
http://www.sapfans.com/forums/viewtopic.php?t=52107
change color of particular cell in input enable ooalv
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm
Coming to Colors in ALV's. Following links would help you.
Re: Color cell
Re: Cell Colors in ALV report
Cell Colors in ALV report
Colors in ALV
Colors in ALV
we can also manipulate the color in each cell.
2.
IMPORTANT THINGS
a. Extra field in internal table
clr TYPE slis_t_specialcol_alv,
(this field will contain the colour codes)
b. assign fieldname to alv layout
alvly-coltab_fieldname = 'CLR'
c. work area for colour
DATA : clrwa TYPE slis_specialcol_alv.
d. Populating the color
Once again
Loop at ITAB.
*********logic
if itab-field < 0 "---negative
clrwa-fieldname = 'FIELDNAME'. "<--- FIELDNAME FOR COLOR
clrwa-color-col = 6. <------- COLOUR 0-9
APPEND clrwa TO itab-clr.
MODIFY ITAB.
endif.
ENDLOOP.
5. just copy paste in new program
6.
REPORT abc .
NECESSARY / MUST
TYPE-POOLS : slis.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvly TYPE slis_layout_alv.
ITAB DECLARATION
DATA : prg TYPE sy-repid.
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : clname(3) TYPE c,
clr TYPE slis_t_specialcol_alv,
END OF itab.
DATA : clrwa TYPE slis_specialcol_alv.
PARAMETERS : a TYPE c.
DATA : flname TYPE slis_fieldname.
SELECT
START-OF-SELECTION.
SELECT * FROM t001
INTO CORRESPONDING FIELDS OF TABLE itab..
LOOP AT itab..
IF SY-TABIX <= 5.
itab-clname = 'C50'.
ELSE.
itab-clname = 'C30'.
ENDIF.
MODIFY itab.
ENDLOOP.
LOOP AT ITAB.
check itab-bukrs = '1000'
clrwa-fieldname = 'BUTXT'.
clrwa-color-col = 6.
APPEND clrwa TO itab-clr.
MODIFY ITAB.
clrwa-fieldname = 'LAND1'.
clrwa-color-col = 4.
APPEND clrwa TO itab-clr.
MODIFY ITAB.
ENDLOOP.
prg = sy-repid.
flname = 'CLNAME'.
alvly-info_fieldname = 'CLNAME'.
alvly-coltab_fieldname = 'CLR'.
LOOP AT ITAB.
if sy-tabix = 3.
clrwa-fieldname = 'BUTXT'.
clrwa-color-col = 6.
APPEND clrwa TO itab-clr.
MODIFY ITAB.
clrwa-fieldname = 'LAND1'.
clrwa-color-col = 1.
APPEND clrwa TO itab-clr.
MODIFY ITAB.
endif.
ENDLOOP
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = prg
i_internal_tabname = 'ITAB'
i_inclname = prg
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
minimum
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2
extra
sy-uname = 'XYZAB'.
prg = sy-repid.
Excluding
DATA : excl TYPE slis_t_extab.
DATA : exclwa TYPE slis_extab.
exclwa = '&OUP'.
APPEND exclwa TO excl.
exclwa = '&ODN'.
APPEND exclwa TO excl.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
i_callback_program = sy-repid
is_layout = alvly
i_callback_user_command = 'ITAB_USER_COMMAND'
it_excluding =
excl
i_save = 'A'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
*& Form itab_user_command
text
-->WHATCOMM text
-->WHATROW text
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
BREAK-POINT.
ENDFORM. "itab_user_command
Mark the points if u find useful
~~Guduri -
Select rows based on condition of same row
Hello,
I have the following table structure and rows defind here
http://sqlfiddle.com/#!4/3f474/3
I would like to select rows if PRODUCT_NO is null then I need to select rows which are having IS_PAYABLE='Y'. If PRODUCT_NO is not null
then IS_PAYABLE will be 'N' or IS_PAYABLE will be null.
E.g.
For PRODUCT_REG HPO_FABRIC, one PRODUCT_NO null so I need select that row only, not the other two rows.
I can do
select * from SUPPLIER_DETAILS where IS_PAYABLE='Y', but what if there are many records with PRODUCT_NO having null or not null
How can I do this using sql?This simple query!!!
select *
from supplier_details
where (product_no is null
and is_payable = 'Y')
or (product_no is not null and is_payable is null);
PRODUCT_REG PRODUCT_SUPPLIER_CODE PRODUCT_NO START_DATE END_DATE IS_PAYABLE
HPO_FABRIC JP_008 01-AUG-01 31-AUG-01 Y
HPO_FABRIC JP_008 STGA-FABR1 16-AUG-01 31-AUG-01 --Edited:- Modified Query and Results for 2nd Requirement
Edited by: Purvesh K on Sep 17, 2012 4:55 PM
--Removed NVL
Edited by: Purvesh K on Sep 17, 2012 5:04 PM -
Regarding Suppressing the Idoc based on Condition
Hi All,
Its File to Idoc one, Here is the logic,
If Status code = X1 or AB then only create the Idoc AND also create the one one Idoc for each and every line item
If we have 2 line items from text file, we have to create 2 idocs in ECC.
We setup in the following way....
To create the Multiple Idocs for multiple Line items, i changed the IDOC segment Occurence to 0-9999 and Idocs are getting posting correctly.
The thing is if the status code is either X1 or AB then it is getting creating idocs as per the logic. If the status code is not either one means it is failing in XI MONI.
please advice me i shld not see the failed message in MONI
Regards
VamsiHi Vamsi,
If you donot want to generate the IDOC when the Status Code is not X1 or AB, either use create function as mentioned by Raj or also craete a dummy receiver in ID and use conditions in receiver determination and route the data as per the status code.
If Status Code = X1 or AB receiver= idoc
If Status Code != X1 or AB receiver= dummy receiver
I hope this is helpful.
Regards,
Sarvesh Desai -
Calculating the sum based on condition
Hello Everybody,
I am currently working on a report, where i have to calculate sum on transaction amount for all account numbers. Below is the example of data.
masteraccount accountno transaction amount
1001 001 50000000
1001 002 50000000
1001 003 50000000
1002 004 98765
1002 005 98765
here i have to calculate the sum of transaction amount based on distinct master account.
Thansk
Ramcreate a group for master account
use manual running totals.
RESET
The reset formula is placed in a group header report header to reset the summary to zero for each unique record it groups by.
whileprintingrecords;
Numbervar X := 0;
CALCULATION
The calculation is placed adjacent to the field or formula that is being calculated.
(if there are duplicate values; create a group on the field that is being calculated on. If there are not duplicate records, the detail section is used.
whileprintingrecords;
Numbervar X := x + ; ( or formula)
DISPLAY
The display is the sum of what is being calculated. This is placed in a group, page or report footer. (generally placed in the group footer of the group header where the reset is placed.)
whileprintingrecords;
Numbervar X;
X -
Formula to Copy all the values based on condition
Hi All,
I have Text Column called "PASS" in Pivot table holding values like and NA and 0.0133333333333333 .
So I want to create the calculate column "CALS "and copy all the values which are not holding NA into this column and set value 0 if found NA.Can any one help me how can I solve this.
Thanks,
SidHello Sid,
For this you can use a calculate column a simple condition with the IF function like
=IF(MyTable[MixedValueColumn] = "NA", 0, CURRENCY(MyTable[MixedValueColumn]))
Olaf Helper
[ Blog] [ Xing] [ MVP] -
To disable fields on the screen based on condition
Hello folks,
Iam doing one module pool program in that in one screen i need to disable the 3 fields based on the value entered in the 1st field.
for me its working but after entering the value in field 1
I need to press enter key then only it is working.
is it possible to gray those 3 fields just by entering values and without pressing the enter key.
any suggestion will be rewarded
Regards,
cnuHi,
It is not possible to gray field without pressing enter key.
Because a key is pressed it will trigger an event ..i.e PAI .
So if we dont press enter .System will not do anything.cause it does not know which event to trigger..
So we have to press enter
Best regards,
Brijesh
Maybe you are looking for
-
I can't open iTunes.I've tried everything. help!
When I try to open iTunes i get this msg : The file iTunes Library.itl cannot be read because it was created by a newer version of iTunes. I don't want to be doomed to never using my ipod. pls help
-
File import failure in premiere pro on specific files
I have installed the latest version of Premiere Pro CC 2014. I am trying to import several video files that i have recorded on a Canon 5D Mark III. The problem is that while some of the files gets successfully imported, many files cant import because
-
Error with internet browser while running oracle 10g forms
Dears, Please do help if someone can. I m using Forms [32 Bit] Version 10.1.2.0.2 (Production) for some project development. I have a form "customers". Last night as i was shutting down my system, everything was OK. Next day as i started oc4j and com
-
Data Cleansing Terms Clarification
Folks, Another question and thanks again to all those that have been helpful so far. In a data flow that I am building I have both customer information and address information. I plan on running my data both through an English base data cleanse and a
-
What wmp do you recommend..ASAP h
what windows media player do you rrecommend for me? i have a zen micro.if not wmp, then what?