Dynamic messageChoice based on value in each row
Hi All,
Am trying to implement a requirment, am not sure how i can acchive this in OAF.
I would appriciate any one who points me in the right direction
How to have a dynamic messageChoice in OAFTable.
My scenario is like this,
OAFTable[UI Table]
========================================
| Name | xxx | MessageChoice values |
========================================
| 12-A | xxx | Apple,Airport |
| 15-B | xxx | Ball,Box |
| 20-S | xxx | Singapore |
=======================================|
VALUE_TABLE[DB table]
=======================
| Letter | Value |
=======================
| A | Apple |
| S | Singapore |
| A | Airport |
| B | Ball |
| B | Box |
=======================
There is a messageChoice column in my OAFTable(third column as represented above),
values for this messageChoice should be filtered on 'Name' column in each row i.e extract the letter and use this extracted value to filter the values in VALUE_TABLE.
Where clause for each rows message choice should dynamically modify as
Row 1 : select value from VALUE_TABLE where letter = 'A'
Row 2 : select value from VALUE_TABLE where letter = 'B'
Row 3 : select value from VALUE_TABLE where letter = 'C'
since messageChoice EVENT is generated only after value is changed, i cann use that to modify the where clause of the VO.
Is there any feature in OAF that modifyes VO's WHERE clause for each row?
what will be the ideal approach to acchive this. surely some one would have resolved this kind of scenario..
Advance thanks for any suggestions :)
srinath
Hi,
Yes there is a standard approach available
Consider a container, such as a table, that has two columns. One column displays a department, while the
other column displays all the employees of that department in a poplist. The view object used for the poplist
(Pick List View Definition) needs the department number (the "Deptno" field of the container) bound for bind
variable :1. This can be done with the following code example in the controller's processRequest method:
OATableBean table = ...
OAMessageChoiceBean empPoplist =
(OAMessageChoiceBean)table.findChildRecursive("EmpName");
empPoplist.setListVOBoundContainerColumn(0, /* bind index */
table,"Deptno");
This code binds the first (0th) bind index of the employee poplist view object to the value displayed by the
column named Deptno in the table.
The method setListVOBoundContainerColumn can be called multiple times if the query used for the poplist has
multiple bind variables. Note that this approach effectively simulates a BC4J view link except that it relies on
the UI table columns for the bind values rather than the view object attribute values directly.
Thanks,
Gaurav
Similar Messages
-
Finding minimum value in each row using dynamic query
need to find the minimum and maximum value from each row using dynamic query
[from curr] will be given as input
TukyDECLARE @t TABLE(a INT,b INT,c INT);
INSERT @t VALUES(1,2,3),(9,8,7),(4,6,5);
SELECT *
, ( SELECT MAX(val)
FROM (VALUES (a)
, (b)
, (c)
) AS value(val)
) AS MaxVal
, ( SELECT MIN(val)
FROM (VALUES (a)
, (b)
, (c)
) AS value(val)
) AS MinVal
FROM @t;
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
How to retrive KFF segment values in each row of VO?
Hi,
I need to retrve Special Information Type values in HR screen.
There is a table based on the VO and on of the column is a flex (KFF) linked ot the same VO.
How can i retrieve the KFF segments values from each row of the table (or VO row).
The VO contains the ID_FLEX_NUM only.
Specific issue details:
It is an HR screen
page : PersonSIT Page
Region : SpecialInformationType(Table)
VO : SpecialInformationDetailsVO
flex id="HrSitKeyFlex" flexName="PEA" flexFieldAppShortName="PER" user:akAttributeCode="HR_PERSON_SIT_FLEX"
Any information is of great help
Thanks,
Kamath..Vo Query is
SELECT /*+ ORDERED */pac.analysis_criteria_id,
ppa.analysis_criteria_id old_analysis_criteria_id,
ppa.person_analysis_id,
ppa.object_version_number,
ppa.id_flex_num,
ppa.business_group_id,
ppa.person_id,
ppa.date_from,
ppa.date_to,
'DB_ROW' status,
ppa.date_from old_date_from,
ppa.date_to old_date_to,
ppa.attribute1,
ppa.attribute2,
ppa.attribute3,
ppa.attribute4,
ppa.attribute5,
ppa.attribute6,
ppa.attribute7,
ppa.attribute8,
ppa.attribute9,
ppa.attribute10,
ppa.attribute11,
ppa.attribute12,
ppa.attribute13,
ppa.attribute14,
ppa.attribute15,
ppa.attribute16,
ppa.attribute17,
ppa.attribute18,
ppa.attribute19,
ppa.attribute20,
ppa.attribute_category
FROM per_person_analyses ppa,
per_analysis_criteria pac
WHERE ppa.business_group_id = :1
AND ppa.person_id = :2
AND ppa.id_flex_num = :3
AND pac.analysis_criteria_id = ppa.analysis_criteria_id
The values from log file for a single row is as below
i = 0
row.getAnalysisCriteriaId()=68198
row.getAttribute1()=null
row.getAttribute10()=null
row.getAttribute11()=null
row.getAttribute12()=null
row.getAttribute13()=null
row.getAttribute14()=null
row.getAttribute15()=null
row.getAttribute16()=null
row.getAttribute17()=null
row.getAttribute18()=null
row.getAttribute19()=null
row.getAttribute20()=null
row.getAttribute2()=null
row.getAttribute3()=null
row.getAttribute4()=null
row.getAttribute5()=null
row.getAttribute6()=null
row.getAttribute7()=null
row.getAttribute8()=null
row.getAttribute9()=null
row.getAttributeCategory()=null
row.getBusinessGroupId()=83
row.getDateFrom()=2009-10-01 03:32:38.0
row.getDateTo()=null
row.getIdFlexNum()=50454
row.getPersonAnalysisId()=null
row.getObjectVersionNumber()=null
row.getOldAnalysisCriteriaId()=null
row.getOldDateTo()=null
row.getOldDateTo1()=null
row.getPersonId()=46788
row.getSelectFlag()=Y
row.getStatus()=NEW_ROW
Here, row.getIdFlexNum()=50454 is the id_flex_num- KFF structure code which has 4 segments.
I need to get the value for the VaueSet of Segment1
The segment values are displayed in the OAF page but i did not get how did std oracle code fetch it
Thanks,
kamath -
How to set Dropdown list in tablen whith others Dropdown values in each row
how to set Dropdown list in tablen whith others Dropdown values in each row of the table
hi ,
You have to add the parent element before adding data to the child node ...you follow the below steps it will work
1) Take ContextStructure as follows ...
tabledata (valuenode)
ddownbyindex( value node) --within the tabledata node
value (attribute)
2)Binding to your layout
tabledata (node) ---bind this to the dataSource property of your table
ddownbyindex( node)
Value (attribute)--bind to the texts property of you DDbyIndex
3)In wdinit() method add the following code
IPrivate<Your view name>.ITabledataElement tabledataElement =wdContext.createTabledataElement();
wdContext.nodeTabledata().addElement(tabledataElement);
for(int i=0;i<5;i++)
IPrivate<Your viewname>.IDdownbyindexElement ddbyindexElement=wdContext.createDdownbyindexElement();
ddbyindexElement.setValue("Value"+i);
wdContext.nodeDdownbyindex().addElement(ddbyindexElement);
And set the cardinality property of the table node as 0..n
and dropdownbyinex node to 1..n
You try it ...
Regards
Madhavi
Edited by: madhavi kotra on Sep 2, 2008 6:00 PM -
Table control list box. different values in each row of the list box
Hi all,
i have a requirement to display text box in table control. Each row of list box should contain different values.
i tried with the below code but the values are not getting populated in list box. please give your ideas.
I tried with list box which is having same values in all rows, it is working fine.
loop at itab.
select vbeln from ZSD_PS_BLAWB into ZSD_PS_BLAWB-vbeln
where BLAWBNO = itab-BLAWBNO and
BLAWBDT = itab-BLAWBDT and
CTRNO = itab-CTRNO.
if sy-subrc = 0.
index = 1.
list3-key = index.
list3-text = ZSD_PS_BLAWB-vbeln.
append list3 to list2.
index = index + 1.
endif.
endselect.
clear index.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'ITAB-VBELN'
VALUES = list2
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
modify itab.
endloop.
Thanks in advance.Hi,
this is code example for listbox
TYPE-POOLS vrm .
DATA: lt_vrm_values TYPE TABLE OF vrm_value.
DATA: wa_vrm_values TYPE vrm_value.
PARAMETER p_list AS LISTBOX VISIBLE LENGTH 10.
INITIALIZATION.
wa_vrm_values-key = 'Key1'.
wa_vrm_values-text = 'Value1'.
APPEND wa_vrm_values TO lt_vrm_values.
wa_vrm_values-key = 'Key2'.
wa_vrm_values-text = 'Value2'.
APPEND wa_vrm_values TO lt_vrm_values.
wa_vrm_values-key = 'Key3'.
wa_vrm_values-text = 'Value3'.
APPEND wa_vrm_values TO lt_vrm_values.
AT SELECTION-SCREEN OUTPUT.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_LIST'
values = lt_vrm_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
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 fill it with data from DB, just do select in INITIALIZATION and put that values with same alghoritmus.
Manas M.
P.S.: This is very easy question, you should use search ... -
Hi
My application is generating a 2-dimensional array of data as it performs multiple sweeps. I would like to take the mean of all the data in each row and thereby reduce to a 1-dimensional array. Does anybody have a quick solution.
(Sorry - I am posting many messages at present, I promise to share my acquired knowledge!!!).
Thanks
Ashley.Try this.
Attachments:
Mean.JPG 5 KB -
DVWP XSLT count number of column having Yes/No values for each row
I have a Data View Web Part .Now I have a column that contains either 'Yes' or 'No'
and i want to count the number of 'Yes' for the rows and column .
below image will help to understand better what i am tying to achieve.Here is XSLT code , you may find this usefull
Row View Template :
<xsl:template name="dvt_1.rowview">
<xsl:param name="Rows"/>
<xsl:variable name="CountYesForAll" select="number((. = contains(@Richard,'Yes')))
+number((. = contains(@AndrewP,'Yes')))
+number((. = contains(@Damien,'Yes')))
+number((. = contains(@AndrewC,'Yes')))
+number((. = contains(@Tiffany,'Yes')))
+number((. = contains(@David,'Yes')))
+number((. = contains(@Tony,'Yes')))
+number((. = contains(@Saj,'Yes')))
+number((. = contains(@Miguel,'Yes')))
+number((. = contains(@Viv,'Yes')))
+number((. = contains(@Paula,'Yes')))
+number((. = contains(@Helen,'Yes')))
+number((. = contains(@Matthew,'Yes')))"/>
<xsl:variable name="RichardsCount" select="count($Rows[(@Richard)='Yes'])"></xsl:variable>
<xsl:variable name="AndrewPsCount" select="count($Rows[(@AndrewP)='Yes'])"></xsl:variable>
<xsl:variable name="DamiensCount" select="count($Rows[(@Damien)='Yes'])"></xsl:variable>
<xsl:variable name="AndrewCsCount" select="count($Rows[(@AndrewC)='Yes'])"></xsl:variable>
<xsl:variable name="TiffanysCount" select="count($Rows[(@Tiffany)='Yes'])"></xsl:variable>
<xsl:variable name="DavidsCount" select="count($Rows[(@David)='Yes'])"></xsl:variable>
<xsl:variable name="TonysCount" select="count($Rows[(@Tony)='Yes'])"></xsl:variable>
<xsl:variable name="SajsCount" select="count($Rows[(@Saj)='Yes'])"></xsl:variable>
<xsl:variable name="MiguelsCount" select="count($Rows[(@Miguel)='Yes'])"></xsl:variable>
<xsl:variable name="VivsCount" select="count($Rows[(@Viv)='Yes'])"></xsl:variable>
<xsl:variable name="PaulasCount" select="count($Rows[(@Paula)='Yes'])"></xsl:variable>
<xsl:variable name="HelensCount" select="count($Rows[(@Helen)='Yes'])"></xsl:variable>
<xsl:variable name="MatthewsCount" select="count($Rows[(@Matthew)='Yes'])"></xsl:variable>
<tr>
<xsl:if test="position() mod 2 = 1">
<xsl:attribute name="class">ms-alternating</xsl:attribute>
</xsl:if>
<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
<td class="ms-vb" width="1%" nowrap="nowrap">
<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
</td>
</xsl:if>
<td class="ms-vb">
<xsl:value-of select="@Title"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Richard) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Richard"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@AndrewP) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@AndrewP"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Damien) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Damien"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@AndrewC) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@AndrewC"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Tiffany) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Tiffany"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@David) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@David"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Tony) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Tony"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Saj) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Saj"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Miguel) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Miguel"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Viv) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Viv"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Paula) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Paula"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Helen) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Helen"/>
</td>
<td class="ms-vb">
<xsl:attribute name="style">
<xsl:if test="normalize-space(@Matthew) = 'NA'">background-color: #000000;</xsl:if>
</xsl:attribute>
<xsl:value-of select="@Matthew"/>
</td>
<td>
<xsl:value-of select="$CountYesForAll"/>
</td>
<td>
<xsl:if test="normalize-space(@Title) = 'Richard'">
<xsl:value-of select="$CountYesForAll + $RichardsCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Andrew P'">
<xsl:value-of select="$CountYesForAll + $AndrewPsCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Damien'">
<xsl:value-of select="$CountYesForAll + $DamiensCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Andrew C'">
<xsl:value-of select="$CountYesForAll + $AndrewCsCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Tiffany'">
<xsl:value-of select="$CountYesForAll + $TiffanysCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'David'">
<xsl:value-of select="$CountYesForAll + $DavidsCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Tony'">
<xsl:value-of select="$CountYesForAll + $TonysCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Saj'">
<xsl:value-of select="$CountYesForAll + $SajsCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Miguel'">
<xsl:value-of select="$CountYesForAll + $MiguelsCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Viv'">
<xsl:value-of select="$CountYesForAll + $VivsCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Paula'">
<xsl:value-of select="$CountYesForAll + $PaulasCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Helen'">
<xsl:value-of select="$CountYesForAll + $HelensCount"/>
</xsl:if>
<xsl:if test="normalize-space(@Title) = 'Matthew'">
<xsl:value-of select="$CountYesForAll + $MatthewsCount"/>
</xsl:if>
</td>
</tr>
</xsl:template>
Footer template to show sub total :
<xsl:template name="dvt_1.footer">
<xsl:param name="Rows" />
<div class="bupareport">
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td width="8%">Sub Total :</td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Richard)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@AndrewP)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Damien)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@AndrewC)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Tiffany)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@David)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Tony)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Saj)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Miguel)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Viv)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Paula)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Helen)='Yes'])" /></td>
<td width="6%"> <xsl:value-of select="count($Rows[(@Matthew)='Yes'])" /></td>
<td width="6%"> </td>
<td width="8%"> <xsl:value-of select="@AndrewP"> </xsl:value-of></td>
</tr>
</table>
</div>
</xsl:template> -
Build Dynamic Query based on values of multiselect list
I am trying to implement the same functionality as shown in this app.
http://htmldb.oracle.com/pls/otn/f?p=9741:6:13406902443304236283:::::
I have hit a brick wall when I try to set the value of my text area/select statement, even after viewing the detail section in above app.
Does anybody know exactly how I can set the value of a text area from multiselect list values??Hi Sam,
check out How to use multi select in a query report
See also Denes sample application which has and example where you can still do an index access if a index is defined for the column. http://htmldb.oracle.com/pls/otn/f?p=31517:138
Patrick
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/ -
Problem in displaying dynamic values in dropdown list for each row
I want to display dynamic values in a drop down list for each row, and these values depends on the column value in each row(ptaid), based on each ptaid i need to fetch values for drop down list. so how can i achieve this..
Thanks
BabuBabu,
This has been discussed in many old threads, try to find them. Also u can refer to article "Dependent Dynamic message choicelists ", at my blog
http://www.mukx.blogspot.com/
--Mukul -
Select item on a Tabular form with a different dynamic LOV on each row
I would like to use a tabular form where one of the columns is a dynamic LOV based Select, and where that dynamic LOV refers to one of the column values on each row.
So if the tabular form represented a list of teams and the LOV-based Select column was the current team leader, I would want that select list to be populated only with the members of that team (different for each row). Since the list of team members is in some other table (all_players or something) I would want to populate the LOV with a query with a where clause that selected only those players records with a team-membership equal to the current tabular form's team id. So, on each row that select list's contents would be different.
-- JustinI'm beating a dead horse here but I did get something to work with "less" code. My current needs do not require me to cascade drop downs, I only want 1. You can use the query like the in the first reply (but I don't have a table with joins) I created a simple two column table dept_emp with 4 records 10,null 20,null .... I want to fill the nulls with an employee but ONLY an employee that matches the dept. (Same concept of team leader and members).
Here's the query:
select apex_item.display_and_save(1,dept) dept,
apex_item.select_list_from_query(2, name, 'select ename from emp where deptno='||dept) name
from dept_emp
I removed the code that was there already (ApplyMRU) and just put in this code:
BEGIN
FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
UPDATE dept_emp
SET
name=HTMLDB_APPLICATION.G_F02(i)
WHERE dept=to_number(HTMLDB_APPLICATION.G_F01(i));
END LOOP;
END;
The G_F01 matches the column 1 and so forth. There's more documentation but little explanation at:
http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/api.htm#sthref2171
The thing I could not get to work was a dynamic message
#MRU_COUNT# row(s) updated, #MRI_COUNT# row(s) inserted.
Not sure when the MRU_COUNT gets populated (probably in the routine I removed ;))
You're probably way past me by now but I like to have as little code as possible when it comes to maintaining an app. That's why I liked oracle forms so much. This kind of stuff was pretty easy to do.
Thanks again everybody! -
Different values in a list box for each row of the table control...
Dear Experts,
Is it possible to populate different values for each row in a listbox inside a table control ?
Example,
Row 1 in the the table contains A, B & C
Row 2 in the same table contains C, D & E
If yes, How?
yes i am using
call function 'VRM_SET_VALUES'
exporting
id = i_name
values = i_list.
Thank you .
Message was edited by:
Kokwei Wong
Message was edited by:
Kokwei WongHi Wong,
this is code example for listbox
TYPE-POOLS vrm .
DATA: lt_vrm_values TYPE TABLE OF vrm_value.
DATA: wa_vrm_values TYPE vrm_value.
PARAMETER p_list AS LISTBOX VISIBLE LENGTH 10.
INITIALIZATION.
wa_vrm_values-key = 'Key1'.
wa_vrm_values-text = 'Value1'.
APPEND wa_vrm_values TO lt_vrm_values.
wa_vrm_values-key = 'Key2'.
wa_vrm_values-text = 'Value2'.
APPEND wa_vrm_values TO lt_vrm_values.
wa_vrm_values-key = 'Key3'.
wa_vrm_values-text = 'Value3'.
APPEND wa_vrm_values TO lt_vrm_values.
AT SELECTION-SCREEN OUTPUT.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_LIST'
values = lt_vrm_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
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 fill it with data from DB, just do select in INITIALIZATION and put that values with same alghoritmus.
Manas M.
P.S.: This is very easy question, you should use search ... -
Column with dropdown with different values in each cell
Hello,
I have a Table and one of the columns contains a dropdown list (dropdownbykey). My problem is that the list of values for each drop down element is different because it depends on the value in the rest of the row cells. Obviously I need to calculate the values dynamically at runtime.
I have created a context node and linked it to the table columns, one of the attributes in the node is linked to the 'selectedKey' property of the dropdown. Then in my code I try to give the list of values to this attribute using the method set_attribute_value_set from the if_wd_context_node_info interface. The process it's explained in the DEMO_UIEL_STD_SELECTION component.
But I only get the same values for each row.
I would like to know if it's possible to have dropdowns with different values in the same column of a Table, and if so any indication of how to do that.
Best regards,Hello Javier,
unfortunately you cannot use dropdown by key if you want to have different dropdowns per line of your table.
Instead you will need to use dropdown by index, and bind your dropdown to a subnode of the table element (ensure that this is a non-singleton node).
To make life easier for yourself, I would also have an attribute in your main structure that holds the selected value of the dropdown by index - update this value on any "onSelect" action of the dropdown by index.
e.g. for a table that holds addresses:
Context Node Address:
attribute street
attribute city
attribute country
attribute region
subnode regionlist
...attribute regionkey
...attribute region_text
table - bound to node address
input field bound to street
input field bound to city
dropdown by key bound to country (onSelect event populates subnode regionlist)
dropdown by index bound to subnode regionlist, text bound to region text, (onSelect event populates address element attribute region with key field of selected element).
I hope this helps,
Chris -
Changing column value on every row in invoice matrix
Hi,
I'm trying to change the value of the GLaccount column for every row in the invoice matrix when the user changes the document owner. The code seems to work for the first row but then on other rows I get a message that says the item can't be changed because it can't get focus. I know there are similar posts on the forum already, but nothing that solves this problem that I can see.
My code follows:
<B1Listener(BoEventTypes.et_CHOOSE_FROM_LIST, False)> _
Public Overridable Sub OnAfterChooseFromList(ByVal pVal As ItemEvent)
Dim ActionSuccess As Boolean = pVal.ActionSuccess
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
Dim item As Item = form.Items.Item("222") 'document owner
Dim item2 As Item = form.Items.Item("38")
Dim Matrix As Matrix = CType(item2.Specific, Matrix)
Dim userID As String
userID = ChooseFromList_Value(pVal)
If ActionSuccess And pVal.InnerEvent Then
ChangeMatrixAccounts(Matrix, userID)
End If
End Sub
Friend Function ChangeMatrixAccounts(ByVal zMatrix As SAPbouiCOM.Matrix, ByVal zDocOwner As String) As ReturnStatus
For x = 1 To zMatrix.RowCount
Dim cell As SAPbouiCOM.Cell = zMatrix.Columns.Item("159").Cells.Item(x)
Dim oedit As SAPbouiCOM.EditText = zMatrix.Columns.Item("159").Cells.Item(x).Specific
cell.Click(SAPbouiCOM.BoCellClickType.ct_Regular) 'force focus, I hope
ChangeRevenueAccountInCell(oedit, WhseGLLocCode)
Next
end function
Private Function ChangeRevenueAccountInCell(ByVal zGLAcct As SAPbouiCOM.EditText, ByVal zWhseGLLocCode As String) As ReturnStatus
Dim tempwork(2) As String
'change the value of the matrix cell passed in to the new gl acct
tempwork = zGLAcct.Value.Split("-")
<b>zGLAcct.Value = tempwork(0) & "-" & tempwork(1) & "-" & zWhseGLLocCode</b>
Console.Write(" Changed GL value")
End Function
Is there more to it than that? -- THANKS!Hi John,
I don't know if this is of use, but here's the code I used to set the project code value on each row of a marketing document through the UI (which is similar to what you are looking to do). The Project Code column needs to be visible and editable for this to work:
Private Function SetProjectCodeOnRows(ByVal oForm As SAPbouiCOM.Form, ByVal oMatrix As SAPbouiCOM.Matrix, ByVal sProjectCode As String) As Boolean
Dim bSuccess As Boolean = True
Dim sItemCode As String
Dim sExistingProjCode
Dim i As Int32
Dim oCol As SAPbouiCOM.Column
Dim oEdit As SAPbouiCOM.EditText
Dim oFolder As SAPbouiCOM.Folder
'Select the Contents folder before updating any project codes
oFolder = oForm.Items.Item("112").Specific
oFolder.Select()
For i = 1 To oMatrix.RowCount
Try
' Check to see if an item code has been entered (last line will always be empty)
oCol = oMatrix.Columns.Item("1")
oEdit = oCol.Cells.Item(i).Specific
sItemCode = oEdit.String
' Read the project code from the row
oCol = oMatrix.Columns.Item("31")
oEdit = oCol.Cells.Item(i).Specific
sExistingProjCode = oEdit.String
If sExistingProjCode = "" And sItemCode <> "" Then
oEdit.Value = sProjectCode
End If
Catch ex As Exception
m_sboApp.SetStatusBarMessage(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Medium, True)
bSuccess = False
End Try
Next i
SetProjectCodeOnRows = bSuccess
End Function
Kind Regards,
Owen -
Highlighting Min and Max Values on each line
Hello,
Is it possible to highlight the Min and Max values on each row of a Query. For example I have sales below by product line for the last seven quarters. The user
would like the Max value (150) for Product Line ABC Highlighted as Green and the Min value (1055) color coded as Red. Like wise for each line - DEF 200 as green and 100 as red and GHI - 400 as green and 100 as red.
FYQ Q207 Q307 Q407 Q108 Q208 Q308 Q408
ABC 1500 1200 1400 1050 1100 1100 1100
DEF 1550 1000 1560 1220 1340 1640 2000
GHI 1000 2000 3000 4000 3250 2220 3750
Is this possible using Exceptions? or may be any other means? We are on Bex 7.0
Best Regards,
SanjivHello Sanjiv,
I think it can be done by JavaScript, but needs more effort
[Use of JavaScript Functions|http://help.sap.com/saphelp_nw04/helpdata/en/d9/4a853bc623c075e10000000a114084/content.htm]
Try the exception available in the BW[BW Stylesheets|http://help.sap.com/saphelp_nw04/helpdata/en/3f/ca453afbf37b54e10000000a11402f/content.htm]
SAPBEXformats - Formatting cell (scaling factors)
SAPBEXexcGood1 - Exception with priority good 1
SAPBEXexcGood2 - Exception with priority good 2
SAPBEXexcGood3 - Exception with priority good 3
SAPBEXexcCritical4 - Exception with priority critical 4
SAPBEXexcCritical5 - Exception with priority critical 5
SAPBEXexcCritical6 - Exception with priority critical 6
SAPBEXexcBad7 - Exception with priority bad 7
SAPBEXexcBad8 - Exception with priority bad 8
SAPBEXexcBad9 - Exception with priority bad 9
See this thread,
Change the colour of a cell text depending on the value Web Reports (NW04s)
Thanks
Chandran
Edited by: Chandran Ganesan on Mar 19, 2008 4:27 PM -
Hide multiple rows in a dynamic table based on the row value.
Hi,
I need to hide multiple rows in a dynamic table based on the specific value of that row.
I cant find the right expression to do that.
please helpGo to the Row Properties, and in the Visibility tab, you have "Show or hide based on an expression". You can use this to write an expression that resolves to true if the row should be hidden, false otherwise.
Additionally, in the Matrix properties you should take a look at the filters section, perhaps you can achieve what you wish to achieve through there by removing the unnecessary rows instead of just hiding them.
It's only so much I can help you with the limited information. If you require further help, please provide us with more information such as what data are you displaying, what's the criteria to hiding rows, etc...
Regards
Andrew Borg Cardona
Maybe you are looking for
-
How to check for errors in starting workflow from plsql?
Hi All, I am using the below code to start a custom workflow. DECLARE l_itemtype VARCHAR2(30) := 'XXPWA'; l_itemkey VARCHAR2(30) := '1116410C'; error_code VARCHAR2(2000); error_msg VARCHAR2(2000); BEGIN wf_engine.createprocess(l_itemtype, l_ite
-
i want to know the table where latest price of a material is updated irrespective of material whether it is internal material or mpn material. plz give me reply as soon as possible. prasad.
-
How to Delete KE30 Reports and Forms?
I want to delete some KE30 reports and forms associated with them. The QA and PRD environment are in synch in regards to the number of reports, but Dev environment is not in synch with the QA or PRD system. What would be the best to do in this case?
-
Is there any way in Keynote to identify the name and location of the actual movie file that has been inserted into a Keynote presentation?
-
Unhandled Win32 in RH8 RoboHelp HTML Project
When I Launch RoboHelp HTML Project File I get an unhandled exception win32 and the app closes. I saw thread posts for this in RH6 a couple years ago but I can't find anything for RH8. Any thoughts? -Tom