Retreiving values for repeated tags
Hi,
I am a newbie to Oracle XML Data type.
I am currently stuck up in what i beleive should be a simiple problem.
I have an XML stored in the Oracle DB as XML Data type. This XML contains a tag which is repeated 'n' types in the XML. I want to retreive these values as separate elements ....
For example consider the XML
<file-list>
<file>FILE-1</file>
<file>FILE-2</file>
</file>
I want the output of the query as two elements in my result set.
A query like "SELECT f.ICN.extract('/file-list/file/text()').getStringVal() FROM FILE_LIST_TBL f" returns output as "FILE-1FILE-2" I want the output to be as two rows in the result FILE-1 and FILE-2.
The reason i want to have it as two rows is because i would have to a join with another relation table.
I am currently stuck up with this issue; Kindly guide me ....
Thanks & Regards,
Sriram
Be aware that the following are examples, that I fabricated out off my head, without testing them on a database.
So the syntax could be slightly wrong. Keep Marks advice at hart.
So -->TABLE(XMLSequence(extract())) should be applied < 10.2 >= XMLTable, for versions equal or higher than.
Be also aware tha XMLTABLE is much more flexible (and/or its complexity) regarding the syntax used here. See the XMLDB Developers Guides and/or the SQL Reference Guide.
<file-list>
<file>FILE-1</file>
<file>FILE-2</file>
</file-list>
select *
from FILE_LIST_TBL f
, TABLE(XMLSequence(extract(f.ICN,'/file-list/file/text()')));
SELECT *
FROM FILE_LIST_TBL f
, XMLTABLE('/file-list/file/text()'
passing f.ICN
BTW. the given xml data isn't wellformed...
Edited by: Marco Gralike on Feb 26, 2009 9:41 PM
Similar Messages
-
How to select XML value for a namespace when multiple namespaces
Hi,
I'm a beginner with this, but I'm doing well with your help from this forum in a recent post selecting out all the detail from my xml
out into my oracle relational tables. Stumped, though, on how to select a value for xml tag value referenced by a defined namespace.
Version, XML, what I want to select, and attempted sql is below. Thanks in advance!
select * from V$VERSION
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Solaris: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
drop table TRANSCRIPT;
create table TRANSCRIPT (
CONTENT xmltype
<?xml version="1.0" encoding="UTF-8"?>
<arb:AcademicRecordBatch xmlns:arb="urn:org:pesc:message:AcademicRecordBatch:v1.0.0">
<hst:HighSchoolTranscript xmlns:hst="urn:org:pesc:message:HighSchoolTranscript:v1.0.0" xmlns:ct="http://ct.transcriptcenter.com">
<TransmissionData>
<DocumentID>2013-01-02T09:06:15|D123456789</DocumentID>
</TransmissionData>
<Student>
<Person>
<Name>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
</Name>
</Person>
<AcademicRecord>
<AcademicSession>
<Course>
<CourseTitle>KEYBOARD 101</CourseTitle>
<UserDefinedExtensions>
<ct:TranscriptExtensions>
<NCESCode>01001E010456</NCESCode>
<CourseRigor>1</CourseRigor>
</ct:TranscriptExtensions>
</UserDefinedExtensions>
</Course>
<Course>
<CourseTitle>SCIENCE 101</CourseTitle>
<UserDefinedExtensions>
<ct:TranscriptExtensions>
<NCESCode>01001E010457</NCESCode>
<CourseRigor>2</CourseRigor>
</ct:TranscriptExtensions>
</UserDefinedExtensions>
</Course>
</AcademicSession>
<AcademicSession>
<Course>
<CourseTitle>MATH 201</CourseTitle>
<UserDefinedExtensions>
<ct:TranscriptExtensions>
<NCESCode>01001E010458</NCESCode>
<CourseRigor>2</CourseRigor>
</ct:TranscriptExtensions>
</UserDefinedExtensions>
</Course>
</AcademicSession>
</AcademicRecord>
</Student>
</hst:HighSchoolTranscript>
</arb:AcademicRecordBatch>I want to be able to select the NESCODE associated to each coursetitle (01001E010456, 01001E010457, 01001E010458), with NESCode defined by namespace, but getting out NULL.
DOCUMENTID LASTNAME COURSETITLE NCESCODE
2013-01-02T09:06:15|D123456789 Doe KEYBOARD 101
2013-01-02T09:06:15|D123456789 Doe SCIENCE 101
2013-01-02T09:06:15|D123456789 Doe MATH 201
My SQL is below. You'll see where I commented out a couple failed alternatives too. Thanks again in advance for any guidance.
select x0.DocumentID
,x1.LastName
, x3.CourseTitle
,x3.NCESCode
from TRANSCRIPT t
, xmltable(
xmlnamespaces(
'urn:org:pesc:message:AcademicRecordBatch:v1.0.0' as "ns0"
, 'urn:org:pesc:message:HighSchoolTranscript:v1.0.0' as "ns1"
--, 'http://ct.transcriptcenter.com' as "ns1b"
, '/ns0:AcademicRecordBatch/ns1:HighSchoolTranscript'
passing t.content
columns DocumentID varchar2(40) path 'TransmissionData/DocumentID'
, Student xmltype path 'Student'
) x0
, xmltable(
'/Student'
passing x0.Student
columns LastName varchar2(20) path 'Person/Name/LastName'
,AcademicRecord xmltype path 'AcademicRecord'
) x1
, xmltable(
'/AcademicRecord/AcademicSession'
passing x1.AcademicRecord
columns GradeLevel varchar2(20) path 'StudentLevel/StudentLevelCode'
, Courses xmltype path 'Course'
) x2
, xmltable(
xmlnamespaces('http://ct.transcriptcenter.com' as "ns2b")
, '/Course'
passing x2.Courses
columns CourseTitle varchar2(40) path 'CourseTitle'
,NCESCode varchar2(20) path 'UserDefinedExtensions/ns2b:ct/NCESCode'
--,NCESCode varchar2(20) path 'UserDefinedExtensions/ns2b:ct/TranscriptExtensions/NCESCode'
) x3
<<I'm assuming there is more to your XML than you showed, since
StudentLevel/StudentLevelCode
is not in the XML, but is in your query. >>
Yes, to simplify, I left out some of the additional XML data, which is typically present, sorry for any confusion. I should have removed those references to that data in my example which was failing to retrieve the NCESCode data which was denoted by that namespace.
Thank you very much! Your correction worked. I was not understanding until your correction how to properly reference in the XPATH for that namespace value. I'm a newbie at this, and this is my second post. But I've been able to populate quite a few relational tables and that was the first of several namespace tags I will have to deal with next, and with that help, I should be good with that syntax now.
Thanks again for your help on this. -
How to read repeated tag values using sql query
Database version
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
Question
How to get repeated tag values?
<TXLife>
<TXLifeRequest>
<TransRefGUID>10bc80e7d60e59b0:a134d0:10d7c4674ad:-7ffd</TransRefGUID>
<TransType tc="1203">OLI_TRANS_TRNHLD</TransType>
<TransExeDate>2011-02-27</TransExeDate>
<TransExeTime>15:06:35</TransExeTime>
<InquiryLevel tc="3">OLI_INQUIRY_OBJRELOBJ</InquiryLevel>
<InquiryView>
<InquiryViewCode>PLANUPDATE_CHBM_1203A</InquiryViewCode>
</InquiryView>
<OLifE>
<SourceInfo>
<SourceInfoName>CHBM Admin Tool</SourceInfoName>
</SourceInfo>
<Activity id="Activity1" HoldingID="Holding1">
<UserCode>User123</UserCode>
<LastUpdate>2011-02-27</LastUpdate>
<ActivityCode>CHBM10001</ActivityCode>
<OLifEExtension VendorCode="0098" ExtensionCode="Activity">
<ActivityExtension>
<SubActivityCode>CHBM20002</SubActivityCode>
<LastUpdateTime>15:06:35</LastUpdateTime>
</ActivityExtension>
</OLifEExtension>
</Activity>
<Holding id="Holding1">
<HoldingTypeCode tc="6">Group Master Contract</HoldingTypeCode>
<Purpose tc="36">Business Protection and Preservation</Purpose>
<Policy>
<CarrierAdminSystem>CHBM</CarrierAdminSystem>
<PolNumber>CHB0001234</PolNumber>
<OLifEExtension VendorCode="0098" ExtensionCode="Policy">
<PolicyExtension>
<BillingDetail>
<PaymentMode tc="3">Quarterly</PaymentMode>
<BillingOrder tc="1009800002">Employee ID</BillingOrder>
</BillingDetail>
<SalaryAllotment>12354333</SalaryAllotment>
</PolicyExtension>
</OLifEExtension>
</Policy>
<Attachment id="Attach1">
<DateCreated>2011-02-27</DateCreated>
<UserCode>System</UserCode>
<AttachmentBasicType tc="1">Text</AttachmentBasicType>
<Description>Event 4</Description>
<AttachmentData>Event Log</AttachmentData>
<AttachmentType tc="1009800001">Transaction Log</AttachmentType>
<AttachmentLocation tc="1">Inline</AttachmentLocation>
<OLifEExtension VendorCode="0098" ExtensionCode="Attachment">
<AttachmentExtension>
<Sequence>2</Sequence>
<CreationTime>16:05:45</CreationTime>
</AttachmentExtension>
</OLifEExtension>
</Attachment>
<Attachment id="Attach2">
<DateCreated>2011-02-27</DateCreated>
<UserCode>System</UserCode>
<AttachmentBasicType tc="1">Text</AttachmentBasicType>
<Description>Event 3</Description>
<AttachmentData>Event Log</AttachmentData>
<AttachmentType tc="1009800001">Transaction Log</AttachmentType>
<AttachmentLocation tc="1">Inline</AttachmentLocation>
<OLifEExtension VendorCode="0098" ExtensionCode="Attachment">
<AttachmentExtension>
<Sequence>1</Sequence>
<CreationTime>16:01:54</CreationTime>
</AttachmentExtension>
</OLifEExtension>
</Attachment>
<Attachment id="Attach3">
<DateCreated>2011-02-27</DateCreated>
<UserCode>P62350</UserCode>
<AttachmentBasicType tc="1">Text</AttachmentBasicType>
<Description>Note 2</Description>
<AttachmentData>Enter notes on changes or edits to plan</AttachmentData>
<AttachmentType tc="14">Note</AttachmentType>
<AttachmentLocation tc="1">Inline</AttachmentLocation>
<OLifEExtension VendorCode="0098" ExtensionCode="Attachment">
<AttachmentExtension>
<Sequence>2</Sequence>
<CreationTime>16:02:23</CreationTime>
</AttachmentExtension>
</OLifEExtension>
</Attachment>
</Holding>
</OLifE>
</TXLifeRequest>
</TXLife>
Expected output shoulb be like this
Description AttachmentType AttachmentData
Event 4 Transaction Log Event Log
Event 3 Transaction Log Event Log
Note 2 Note Enter notes on changes or edits to plan
Please help me any one on this
Edited by: LRAJESH on Apr 20, 2011 8:27 AMSELECT
t2. Description des,
t2.AttachmentType attty,
t2.DateCreated DateCreated,
t2.UserCode UserCode,
t1.Planid Planid,
t2.createdtime,
t1.Ausercode Ausercode
FROM (
SELECT xData doc
FROM dual
) temp_table,
XMLTable ( '/TXLife/TXLifeRequest/OLifE' passing doc
COLUMNS
Planid varchar2(20) path 'Holding/Policy/PolNumber',
AttachmentType xmltype path 'Holding//Attachment' ,
Ausercode varchar2(20) path 'Activity/UserCode'
) t1,
XMLTable
'/Attachment'
passing t1.AttachmentType
columns
Description varchar2(1000) path 'Description',
AttachmentType varchar2(1000) path 'AttachmentType/@tc',
DateCreated varchar2(20) path 'DateCreated',
createdtime varchar2(20) path 'OLifEExtension/AttachmentExtension/CreationTime',
UserCode varchar2(200) path 'UserCode'
) t2 -
Field values are repeating for search help.
Hello Friends.
I have a problem. When I create a search help for a field the identical field values are repeating. What should I do to trigger only the first time.
for example:
<u>Field-name</u>- <u>field-value</u>
Supplier Nr --- Commodity
5001 -
casting
5002 -
casting
5003 -
casting
So when I create the search help for commodity it is showing 'casting' 3 times in a pop-up window. It should not repeat. Can you please give me the solution what should I do?Hi
Search helps
Standard search help
Types of search helps
Concept of search help
Search Help Interface
Dialog behavior of search helps
Selection method for search helps
Performance of search helps
Attaching search helps
Hierarchy of search helps
Standard Search Help
The input help (F4 help) is a standard function of the R/3 System. It permits the user to display a list of possible values for a screen field. A value can be directly copied to an input field by list selection.
The fields having an input help are shown in the R/3 System by the input help key to the right of the field. This key appears as soon as the cursor is positioned on the corresponding screen field. The help can be started either by clicking on this screen element or with function key F4.
If the number of possible entries for a field is very large, you can limit the set of displayed values by entering further restrictions.
Further meaningful information about the displayed values is included in the display of possible entries, especially if the field requires that a formal key be entered.
TYPES OF SEARCH HELPS
Elementary search helps
Describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).
Collective search help
Combine several elementary search helps. A collective search help thus can offer several alternative search paths.
Search Help Interface
Search help interface determines how the exchange of values between the screen template and the selection method is implemented.
The search help interface defines the context data that can be used in the input help and the data that can be returned to the input mask. Analogously to the interface of a function module, the search help interface comprises interface parameters.
When you define an interface parameter of a search help, you must also define whether it should be used to copy data to the input help (IMPORT parameter) or whether it should be used to return data from the input help (EXPORT parameter). A parameter of a search help can also have both attributes at the same time.
The location from which the IMPORT parameters of a search help get their values and the screen fields in which the contents of the EXPORT parameters of the search help are returned are defined in the search help attachment. The search help itself should always be attached to an EXPORT parameter of the search help. If this parameter is also the IMPORT parameter, its contents are only used in the input help if it is a search string (that is, if it contains a ´*´ or a ´+´).
You must define the parameter types of a search help. You can do this by assigning them data elements.
Value Transport for Input Helps
NOTE:In the above example, screen fields A, B and C are linked with parameters of the search help. As a result, values can only be transported between the screen and the search help for these three fields. Existing contents of screen fields A and B can be used for selecting the hit list since they are linked with an import parameter of the search help. The values of parameters A and C can be returned to the screen from the hit list since these parameters are declared as export parameters of the search help.
Description of dialog behavior
A hit list might contain plentiful number of entries. A
dialog provides the user with an option to restrict the
entries displayed on the hit list.
In an input help process, the set of possible entries is presented in the dialog box as a list for displaying the hit list. The user selects the required value from this list by double clicking. Since the possible entries are often formal keys, you must be able to display further explanatory information about the possible entries in the list.
If the set of possible entries is very large, the user should be able to define additional conditions for the attributes of the selected entry. Restricting the set of data in this way both increases the clarity of the list and reduces the system load. Additional conditions can be entered in a further dialog window, the dialog box for restricting values.
Specifying the dialog type of a search help defines whether the dialog box for restricting values should be offered and if so under what conditions.
The attributes in the dialog box for displaying the hit list or in the dialog box for restricting values must be defined as internal parameters of the search help. An internal parameter can also be used in only one of the two dialog boxes. It can also belong to the search help interface.
The internal parameter types are also defined with data elements. These data elements define how the parameters are displayed in the two dialog boxes.
Reward if usefull -
"Unterminated value for attribute '' in XML Tag ''.(SBL-UIF-00265)"
Getting this message when I do Edit Web Layout for a view in Siebel tools 7.8.2 "Unterminated value for attribute '' in XML tag ''.(SBL-UIF-00265)"...Anyone have any idea why I am getting this message?
Thanks Joseph,
Actually I looked at the Refer ID 1280569.1 before also, some how I could not figured it out the exact location as I was searching for two "(double quotes).
Today I tried again and finally I found out the culprit. In my case actually there was no two double quotes, instead the " (double quote) was missing.
Thanks again.
Edited by: user624054 on Oct 5, 2011 8:10 AM -
Unexpected value type for Item Tag Name ; expected System.Single, received
Hi,
I am using PCo 2.1 with MII 12.1 to extract values from some PI tags. When I run the query, I get this error -
Unexpected value type for Item <Tag Name>; expected System.Single, received System.String[Value = Scan Off]
Can somebody explain what I need to do to get the correct result?
Regards,
Chanti.To make the service return "whatever is passed", you have to take a step back and realize that there is a little understanding of XML Schema required.
When using a complexType, which is defined as a sequence, then you are implying an ordered sequence of elements. Default value for the 'minOccurs' attribute is 1. It's also important to understand that there is a difference between minOccurs=0 and nillable="true".
nillable="true" just means that the name element can carry a null value. If you want the name element to be optional, then you must use the minOccurs=0 and keep the maxOccurs to it's default value of 1. Using an array is just a bad work around. This is for deserialization (XML to JAVA).
The second part of you problem is on the serialization (or JAVA to XML). When you have a JAVA Bean, there is no way to make the difference between a member's value being null or not set, so it's impossible to decide if you need to send back a nul (xsi:nil="true"), an empty element <ns1:name/> or nothing.
That said, if you do want to go the XML route, you can use the dataBinding="false" flag in the different WSA command. Instead of converting XML into JAVA, you will have SOAPElement parameters, where you can do all you want (see WS user's guide [1] for details - chapter 16). Note that you have to make sure that the WSDL (your contract) reflect what you are doing on the wire (format of your messages), so that you do not geopardize your interoperability with other toolkit.
Note that this only applies to literal message formats (use attribute in WSDL), which is your case.
Hope this helps,
Eric
[1] http://download-west.oracle.com/otn_hosted_doc/ias/preview/web.1013/b14434.pdf -
Bug in Interpolate 1D for repeated X values?
Using this vi: LabVIEW 2014:vi.lib:gmath:interp.llb:Interpolate 1D
If you have the (X,Y) points (100,1)(100,2)(200,3)(200,4) and you want to interpolate to find a value for X=150, you would expect (hope?!) to get the answer 2.5. However, the VI returns an answer of 2, since it only uses one (probably the second?) of the repeated values…
The attached VI illustrates the behaviour, and also a workaround, making the X values ever-so-slightly different, to force the Interpolate 1D to give the correct(?!) answer
Attachments:
InterpolateBug.vi 14 KBWhy not use the tools from the array palette?
(Of course the FOR loop is not needed for a single interpolation value, just tring to duplicate your setup)
LabVIEW Champion . Do more with less code and in less time .
Attachments:
Interpol.png 10 KB -
How to move ' 0 ' for repeated values
Hi Experts,
Please advice how to move zero or ' ' to a field if the values are repeating.
As per my requirement I need to fetch finished goods from mseg-matnr and raw materials from
resb-matnr where baugr eq mseg-matnr and I need to display
ebeln for the corresponding finished goods.
But when Iam displaying it I will sort out the finished goods (matnr) , rawmaterial so that
raw material and finished goods wont repeat as there are many ebeln for each matnr.
Now my problem is with the values of the corresponding rawmaterials as they connot be sorted
as per the raw material. So please advice how to move ' ' or zero to those values which are repeating.
LOOP AT IT_FIN_GOODS.
MOVE-CORRESPONDING IT_FIN_GOODS TO IT_FINAL.
LOOP AT IT_RAW_MAT WHERE EBELN EQ IT_FIN_GOODS-EBELN
AND EBELP EQ IT_FIN_GOODS-EBELP
AND BAUGR EQ IT_FIN_GOODS-MATNR.
MOVE IT_RAW_MAT-CON_KGS TO IT_FINAL-CON_KGS.
MOVE IT_RAW_MAT-STLNR TO IT_FINAL-STLNR.
MOVE IT_RAW_MAT-NORMS TO IT_FINAL-NORMS.
MOVE IT_RAW_MAT-MATNR TO IT_FINAL-IDNRK.
MOVE IT_RAW_MAT-SHKZG TO IT_FINAL-SHKZG.
MOVE IT_RAW_MAT-MEINS TO IT_FINAL-MEINS.
APPEND IT_FINAL.
CLEAR: IT_FINAL-WEMNG.
ENDLOOP.
ENDLOOP.
SORT IT_FINAL BY MATNR IDNRK EBELN LIFNR.
DELETE ADJACENT DUPLICATES FROM IT_FINAL COMPARING MATNR IDNRK EBELN LIFNR
SELECT * FROM MSEG AS A INNER JOIN MKPF AS B ON A~MBLNR EQ B~MBLNR
AND A~MJAHR EQ B~MJAHR
INTO CORRESPONDING FIELDS OF TABLE IT_OPEN FOR ALL ENTRIES IN IT_FINAL
WHERE A~MATNR EQ IT_FINAL-IDNRK
AND A~LIFNR EQ IT_FINAL-LIFNR
AND A~WERKS EQ IT_FINAL-WERKS
AND A~BWART IN ('541','542','543','544').
SORT IT_FINAL BY IDNRK.
LOOP AT IT_FINAL.
LOOP AT IT_OPEN WHERE MATNR EQ IT_FINAL-IDNRK
AND LIFNR EQ IT_FINAL-LIFNR
AND WERKS EQ IT_FINAL-WERKS
AND BUDAT IN O_DATE.
IF ( IT_OPEN-SHKZG = 'S' AND IT_OPEN-BWART = '541' )
OR ( IT_OPEN-SHKZG = 'H' AND IT_OPEN-BWART = '542' )
OR ( IT_OPEN-SHKZG = 'H' AND IT_OPEN-BWART = '543' )
OR ( IT_OPEN-SHKZG = 'S' AND IT_OPEN-BWART = '544' ).
IF IT_OPEN-SHKZG = 'H'.
IT_OPEN-MENGE = IT_OPEN-MENGE * -1.
ENDIF.
OBAL = OBAL + IT_OPEN-MENGE.
ENDIF.
ENDLOOP.
LOOP AT IT_OPEN WHERE MATNR = IT_FINAL-IDNRK
AND WERKS = IT_FINAL-WERKS
AND LIFNR = IT_FINAL-LIFNR
AND BUDAT IN BUDAT.
IF ( IT_OPEN-SHKZG = 'S' AND IT_OPEN-BWART = '541' ).
M541 = M541 + IT_OPEN-MENGE.
ELSEIF ( IT_OPEN-SHKZG = 'H' AND IT_OPEN-BWART = '542' ).
M542 = M542 + IT_OPEN-MENGE.
ELSEIF ( IT_OPEN-SHKZG = 'H' AND IT_OPEN-BWART = '543' ).
M543 = M543 + IT_OPEN-MENGE.
ELSEIF ( IT_OPEN-SHKZG = 'S' AND IT_OPEN-BWART = '544' ).
M544 = M544 + IT_OPEN-MENGE.
ENDIF.
ENDLOOP.
MOVE M541 TO IT_FINAL-M541.
MOVE M542 TO IT_FINAL-M542.
MOVE M543 TO IT_FINAL-M543.
MOVE M544 TO IT_FINAL-M544.
MOVE OBAL TO IT_FINAL-OBAL.
MODIFY IT_FINAL.
CLEAR: OBAL,M541, M542, M543, M544,IT_OPEN, IT_FINAL.
ENDLOOP.
Please advice how to move 0 or ' ' to OBAL,M541, M542, M543, M544
Thanks
Karthik.
Edited by: Karthik R on Mar 17, 2009 7:51 PMhi ,
MOVE M541 TO IT_FINAL-M541.
MOVE M542 TO IT_FINAL-M542.
MOVE M543 TO IT_FINAL-M543.
MOVE M544 TO IT_FINAL-M544.
MOVE OBAL TO IT_FINAL-OBAL.
MODIFY IT_FINAL.
hi if you want to move leading space's to fields M541,M542,M543,M544.
instead of above code try this..
WRITE M541 TO IT_FINAL-M541 RIGHT-JUSTIFIED.
WRITE M542 TO IT_FINAL-M542 RIGHT-JUSTIFIED.
WRITE M543 TO IT_FINAL-M543 RIGHT-JUSTIFIED.
WRITE M544 TO IT_FINAL-M544 RIGHT-JUSTIFIED.
WRITE OBAL TO IT_FINAL-OBAL RIGHT-JUSTIFIED.
MODIFY IT_FINAL. -
Repeating the values for the lower levels
Hi friends,
I have an issue regarding OBIEE using the cubes as database?
We have a value set at the year level as 50 for the one fact in the cubes.
when i go to the lower level (i.e.,) month level for that fact i am getting no results...
But i need to get that 50 value for all the months as a constant values......Is there any work around for this ?
Please post ur valued answers...
ThxFact you are saying might be the account/measures dimension member in the essbase and is imported to obiee.
You can write a dynamic calc formula in the essbase level to store the constant values for all the periods. -
Clearing the displayed value for a SELECT-OPTION
How do I clear the displayed value of a SELECT-OPTION?
I have 2 SELECT-OPTIONs on my screen (standard basic report program screen). I use code like this to populate the drop-down boxes for each one.
=====
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prgrp-low.
PERFORM fill_prgrp_values.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-low.
PERFORM fill_prctr_values.
=====
The value the user picks for the first SELECT-OPTION will affect what values I put in the drop-down list for the second SELECT-OPTION.
If a user enters a value for the second SELECT-OPTION, and then goes back and changes the value of the first SELECT-OPTION, then I want to do two things:
1. Create a new set of values for the drop-down list for the second SELECT-OPTION (no problem; working fine);
2. Clear the displayed value from the second SELECT-OPTION that the user entered previously. That value became invalid when the user picked a new value for the first SELECT-OPTION.
How do I clear that second displayed value?
I have tried CLEAR and REFRESH for the second variable using the formats s_prctr, s_prctr[], and s_prctr-low. They will erase the values of the internal table or part(s) of it, but the displayed value stays on the screen.
I need to clear out the displayed value so the user will either leave it blank or enter or select a new value.
I am using F4IF_INT_TABLE_VALUE_REQUEST to build the drop-down lists, and it works fine, but I do not see any function module to clear the displayed value off the screen.
Thanks for your help.Sorry, but calling DYNP_VALUES_UPDATE did not work. This is how I coded it.
fld_reset_rcd-fieldname = 'S_PRCTR'.
fld_reset_rcd-stepl = sy-stepl.
CLEAR fld_reset_rcd-fieldvalue. " re-initialize s_prctr
CLEAR fld_reset_rcd-fieldinp. " what goes in here?
APPEND fld_reset_rcd TO fld_reset_tbl.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = 'ZFI_GL_BALANCE_NGL'
dynumb = '1000'
TABLES
dynpfields = fld_reset_tbl
<Added code tags>
I have discovered that CLEAR and REFRESH of s_prctr will clear it somewhat. If I enter multiple values, ranges, etc., they will all be cleared, EXCEPT for the one single value that is displayed on the main screen. It is not cleared and it remains if you push the button to display the pop-up to enter ranges, etc.
To devrath.sampat -- Thanks for your example for building the drop-down list, but that is not the problem I am having. I am already able to build it just fine.
To repeat my problem, if I:
1. first enter / select a value for the first SELECT-OPTION s_prgrp
2. then enter / select a value for the second SELECT-OPTION s_prctr
3. And finally go back and select a new value of the first SELECT-OPTION s_prgrp from its drop-down list,
when I do, the program needs to clear the value displayed on the main screen for the second SELECT-OPTION s_prctr (any additional values, ranges, etc., are cleared by CLEAR and REFRESH, if I go look; but not the value shown on the main screen).
Edited by: Scott Crosby on Feb 14, 2012 4:20 PM
Edited by: Suhas Saha on Feb 15, 2012 12:03 PM -
Problem with netui:data repeater tag
Hi,
I have 10 checkboxes in a form. It is represented as array of boolean in the form.
The form and the checkbox values are initialised in the JPF class. Using repeater
tag to display the checkboxes.
When the user clicks on first check box, all other check boxes should be selected.
Need to do this with client side validation.
Can someone tell me how to do this?Hi kunal,
Thanks for your immediate response.
But, if I use , I am getting an saying that the file does not exist.
I have included your code, can you check it. Also, I just want the link to be displayed, not the values that I am getting through the netui-data:repeaterItem tag. Can you please help me.
I am attaching my code here:
<netui-data:repeater dataSource="{pageFlow.results2}">
<netui-data:repeaterHeader></netui-data:repeaterHeader>
<netui-data:repeaterItem >
<netui:label value="{container.item.title}" defaultValue=" " ></netui:label>
</netui-data:repeaterItem>
<netui-data:repeaterItem>
<netui:label value="{container.item.link}" defaultValue=" " ></netui:label>
</netui-data:repeaterItem>
<netui-data:repeaterItem>
<netui:label value="{container.item.title}" defaultValue=" "></netui:label>
</netui-data:repeaterItem>
<netui-data:repeaterFooter></ol></netui-data:repeaterFooter>
</netui-data:repeater>
Thanks,
Latha -
Netui-data repeater tag question
Hi,
I am using netui-data:repeater tag to iterate through the results. I am adding a small code snippet:
<netui-data:repeater dataSource="{pageFlow.results2}">
<netui-data:repeaterItem>
<netui:label value="{container.item.title}" defaultValue=" " ></netui:label>
<netui:label value="{container.item.link}" defaultValue=" " ></netui:label>
</netui-data:repeaterItem>
Once, I get the link and the title, I want to construct a href, using the above values. Can anyone tell me how this can be done.
Thanks,
LathaHi kunal,
Thanks for your immediate response.
But, if I use , I am getting an saying that the file does not exist.
I have included your code, can you check it. Also, I just want the link to be displayed, not the values that I am getting through the netui-data:repeaterItem tag. Can you please help me.
I am attaching my code here:
<netui-data:repeater dataSource="{pageFlow.results2}">
<netui-data:repeaterHeader></netui-data:repeaterHeader>
<netui-data:repeaterItem >
<netui:label value="{container.item.title}" defaultValue=" " ></netui:label>
</netui-data:repeaterItem>
<netui-data:repeaterItem>
<netui:label value="{container.item.link}" defaultValue=" " ></netui:label>
</netui-data:repeaterItem>
<netui-data:repeaterItem>
<netui:label value="{container.item.title}" defaultValue=" "></netui:label>
</netui-data:repeaterItem>
<netui-data:repeaterFooter></ol></netui-data:repeaterFooter>
</netui-data:repeater>
Thanks,
Latha -
Id attribute at ui:repeat tag
Hi.
I used ui:repeat tag,but this tag rendered dynamic id.
for example,
+<ui:repeat value="..." var="..." />+
+:::+
+<input id="formid:*j_idt7*:0:input1" type="text" name="formid:*j_idt7*:0:input1" value="a" />+
+<input id="formid:*j_idt7*:1:input1" type="text" name="formid:*j_idt7*:1:input1" value="a2" />+
So I used ui:repeat tag with id attribute.
I could generate static id.
+<ui:repeat value="..." var="..." id="repeat" />+
+:::+
+<input id="formid:*repeat*:0:input1" type="text" name="formid:*repeat*:0:input1" value="a" />+
+<input id="formid:*repeat*:1:input1" type="text" name="formid:*repeat*:1:input1" value="a2" />+
My question is where is this id attribute spec is written ?
I want to know the source.
Or if I did the mistake,please tell me the right way.
regards.You may find it helpful to read the javadoc for UIComponent.getClientId(). Also section 3.1.6 of the JSF 2 specification.
-
hi there,
has anyone had any experience with applescript and custom tags? i've gotten so far as to display the name of custom tags i've added, but i want to find a way to batch erase some i've added on several thousand pictures. any hints?
j
here's a snippet of the code i'm trying out. there must be some way to delete the tag, but i'm not fluent in applescript. the logic of the script has been copied off another one i've found somewhere on the net. the author is Steven Banick (http://banick.com)
repeat with countOfPhotos from 1 to the count of selectedPhotos
-- Get the photo's properties for the operation
set currentPhoto to item countOfPhotos of selectedPhotos
tell currentPhoto
-- Reset the variables in the loop
set the photoCustomTags to ""
-- Retrieve the Photo Metadata
set the photoCustomTags to the name of custom tags
-- Scan the individual custom Tags from the assigned Custom tags
repeat with currentcustomTag from 1 to count of photoCustomTags
set currentcustomTag to item currentcustomTag of photoCustomTags
-- ver quais são as custom tags e tentar apagá-las
if currentcustomTag = CustomTagName1 then
-- display dialog currentcustomTag
delete the item currentcustomTagI'm not sure if you can delete tags, but you can certainly empty them:
tell application "Aperture"
set selectedImages to the selection
repeat with i from 1 to number of items in selectedImages
set this_item to item i of selectedImages
try
set value of custom tag "Image ID" of this_item to ""
end try
end repeat
end tell
Just change "Image ID" to the name of your custom tag, and make sure that you only use it on the correct images...
Ian -
Netui:repeater tags with ranges (aka prev/next)
Is there some way to implement ranges using the <netui:data-repeater> tags? By
ranges, I mean where you have 123 items in a list and you only display numbers
1-50. Clicking NEXT would give you items 51-100. When you're there, clicking PREV
would take you back to 1-50.
Sample code would be nice. I think it could be done with the <netui:data-choiceMethod>
tags, but what I am envisioning would be pretty uglyI am still stuck. I have the pager working fine. But, I have a checkbox that needs
to be bound with the recordid. When the form is submitted after selecting records
on multilple pages, I want to retrieve the recordids of records that were checked.
How do I do that? A chckbox datasource can only be a one-value String property
of a form. But, I need to save an array of ids that were checked. I am so lost.
Please help.
"bindu" <[email protected]> wrote:
>
So sorry Eddie,
My bad I dint scroll down all the way. Thanks so much.
Bindu
Eddie O'Neil <[email protected]> wrote:
John--
Here's an example of implementing a paged repeater.
Briefly, here's how it works:
The entire data set (a Product[]) is stored in the JPF. When paging
through this data set, a
sliding window (also stored as a Product[]) is used to contain the "current"
set of products to
render in the page. The sliding window Product[] is of size PAGE_SIZE.
When transitioning between
pages, this window is recalculated for each page.
Also calculated are the "currentPage", "lastPage", "prevPage", and
"nextPage", which are used to
render a pager like this:
Page <currentPage> of <lastPage> <anchor to prevPage> <anchor to
nextPage>
The JPF and JSP are pretty well documented. To run the Page Flow,
drop the JPF and JSP into a
directory called "repeaterPaging" in an 8.1 SP2 webapp.
There are lots of other ways this could be done (and certainly some
that are more efficient :),
but hopefully this helps get you started.
Eddie
Eddie O'Neil wrote:
John--
Yep, I did promise that, and nope, it hasn't been done yet. :)
But, thanks for calling me on it.
Will try to do that and distribute it to the list in the next fewdays.
Eddie
John H wrote:
Eddie,
You mentioned putting together an example of paging a repeater in
this
thread.
Did you ever get a chance to put one together? Would really loveto
see it if
you did.
Thanks,
John
Eddie O'Neil <[email protected]> wrote:
Jan--
We're talking about adding a pager to the repeater in a future
release of Workshop, but I don't believe that it will appear inan
8.1
service pack.
Additionally in 8.1, we are not exposing a NetUI tag SDK.
That being said, it isn't that difficult ot build a pager from
scratch with the <netu:anchor> / <netui:parameter> tags and a little
code in a JPF.
You'd want to have "prev" and "next" actions in the JPF to which
anchors in the JSP are bound. Then, you can keep track of the "current"
page in the URL and build the previous and next page indices fromthe
value that is availble in the request. Finally, create an intermediate
data structure that contains the data to display in the "current"page
and bind the repeater to this data structure. You'd build the contents
depending on whether the prev or next links were clicked. For example,
if your data set has 100 items in it and you only want to displayitems
20-29, you'd be on page 2 (depending on whether you start countingat
0 :) and the intermediate list would contain exactly these items.
Might sound complicated, but I think this would work out prettywell.
Hope that helps...
Eddie
Jan Noppen wrote:
Are there any plans to include the pager tag with the repeater
in
the
next service packs or releases of WebLogic?
If not, is there a way to build on the netui:taglibs to extend
their
functionality?
I know the grid has paging functionality but it ties you to rowsetsfor input, whereas the repeater is much more flexible.
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
<%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
<%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
<netui-data:declarePageInput name="displayProducts" type="repeaterPaging.Controller.Product[]"/>
<netui:html>
<head>
<title>Paging with the Repeater</title>
</head>
<body>
<p>
<b>Paging with the Repeater</b>
>>
>> <!-- Pager Text -->
<netui:label value="Page {request.currentPage} of {request.lastPage}"/>
<!-- Previous page anchor -->
<%if(request.getAttribute("prevPage") != null) { %>
<netui:anchor action="page">
Previous
<netui:parameter name="_page" value="{request.prevPage}"/>
</netui:anchor>
<% } else {%>
<!-- don't render the anchor when there is no previous
page -->
<netui:label value="Previous"/>
<% } %>
<!-- Next page anchor -->
<% if(request.getAttribute("nextPage") != null) { %>
<netui:anchor action="page">
Next
<netui:parameter name="_page" value="{request.nextPage}"/>
</netui:anchor>
<% } else {%>
<!-- don't render the anchor when there is no next page
-->
<netui:label value="Next"/>
<% } %>
>> <!-- display the current window into the data set -->
<netui-data:repeater dataSource="{pageInput.displayProducts}"
ignoreNulls="true">
<netui-data:repeaterHeader>
<table class="tablebody" border="1" width="60%">
<tr class="tablehead" valign="top">
<th width="30%">Product ID</th>
<th>Name</th>
</tr>
</netui-data:repeaterHeader>
<netui-data:repeaterItem>
<tr valign="top">
<td align="center"><netui:label value="{container.item.id}"
defaultValue=" "></netui:label></td>
<td><netui:label value="{container.item.name}"
defaultValue=" "></netui:label></td>
</tr>
</netui-data:repeaterItem>
<netui-data:repeaterFooter></table></netui-data:repeaterFooter>
</netui-data:repeater>
</p>
</body>
</netui:html>
package repeaterPaging;
import com.bea.wlw.netui.pageflow.Forward;
import com.bea.wlw.netui.pageflow.PageFlowController;
* @jpf:controller
* @jpf:forward name="success" path="index.jsp"
* @jpf:forward name="page" path="page.do"
* @jpf:view-properties view-properties::
* <!-- This data is auto-generated. Hand-editing this section is not
recommended. -->
* <view-properties>
* <pageflow-object id="pageflow:/repeaterPaging/Controller.jpf"/>
* <pageflow-object id="action:begin.do">
* <property value="80" name="x"/>
* <property value="100" name="y"/>
* </pageflow-object>
* <pageflow-object id="action:page.do">
* <property value="120" name="x"/>
* <property value="100" name="y"/>
* </pageflow-object>
* <pageflow-object id="action-call:@page:index.jsp@#@action:page.do@">
* <property value="204,180,180,156" name="elbowsX"/>
* <property value="81,81,92,92" name="elbowsY"/>
* <property value="West_0" name="fromPort"/>
* <property value="East_1" name="toPort"/>
* </pageflow-object>
* <pageflow-object id="page:index.jsp">
* <property value="240" name="x"/>
* <property value="100" name="y"/>
* </pageflow-object>
* <pageflow-object id="forward:path#success#index.jsp"/>
* <pageflow-object id="forward:path#page#page.do"/>
* </view-properties>
public class Controller extends PageFlowController
// number of items to show on a single page
private static final int PAGE_SIZE = 5;
// URL parameter key for the value that will store the current page
private static final String PAGE_PARAM_KEY = "_page";
// Array to hold the entire data set
private Product[] products = null;
* Forward to the "page" action to set-up the first page of
* data to display in index.jsp.
* @jpf:action
protected Forward begin()
return new Forward("page");
* Change the page of data that is displayed in index.jsp. This
action
* is used if paging to either the previous or to the next page.
* @jpf:action
protected Forward page()
Forward f = new Forward("success");
page(f);
return f;
* Implement data set paging. This method uses a simple _page paramater
on the URL
* to indicate the correct "page" to display when "Prev" or "Next"
are clicked
* in the JSP. The key principle at work here is a sliding window
of size PAGE_SIZE
* that is moved forward and backward through the complete dataset.
This window
* contains the set of items to render for a single "page" in the
repeater. As
* the current page changes, this window (an array of size PAGE_SIZE)
is
* reconstructed.
* The pager consists of three parts:
* - a simple "Page # of #" label
* - a previous anchor that is enabled when there is a previouspage
* - a next anchor that is enabled when there is a next page
* To render a "page" of data, the _page parameter is convertedfrom
a String
* to an int. Using the page integer, the start and end of a window
into the
* complete data set is calculated. This windows slides back and
forth along the
* data set in PAGE_SIZE increments depending on the value of the
current page.
* In this case, with a PAGE_SIZE of 5 and data set size of 17,the
possible windows
* are:
* products[0] -> products[4]
* products[5] -> products[9]
* products[10] -> products[14]
* products[15] -> products[16]
* Thus, the lastPage value is 4, which is calculated with the Math.ceil(...)
* call below.
* Given the start and end of this window, a temporary array ofsize
PAGE_SIZE
* is created to hold references to the items that should render
from the complete
* data set. This array is passed to the page as a JPF page input
and is rendered
* with the <netui-data:repeater/>.
* Finally, four additional values are made available to the page
in the request
* and are used to render "Page # of #" and to provide parameters
to anchors that
* will display the previous and next pages:
* - Page # of # -- the first # is "currentPage" and the second#
is "lastPage"
* - prevPage -- the int value of the previous page. If there is
no previous page,
* this value is null in the request
* - nextPage -- the int value of the next page. If there is no
next page, this value
* is null in the request.
* Notes:
* - In order to have multiple repeaters on a page operating independently,
* the "_page" parameter would need to change to include a namespace
that
* would be used when finding the current page for a data set.
* - This JPF is implemented with a single "page" action that performs
both
* next and previous paging. This could also be implemented with
"prevPage" and
* "nextPage" actions that implement additional logic that runs
on the previous
* and next transitions.
* - No real error checking is done to ensure that the PAGE_SIZE
is greater than 0.
* Handling errors:
* - If parsing _page from the request fails to convert to an int,
a NumberFormatException
* is shown in the console and the first page will is used.
* - If the current page value is greater than the number of pages,
the last page will
* be displayed.
private void page(Forward f)
assert PAGE_SIZE > 0;
// calculate the last page
int lastPage = (int)Math.ceil((float)products.length / (float)PAGE_SIZE);
int currentPage = 1; // default page is page 1
Product[] displayProducts = new Product[PAGE_SIZE];
String currentPageStr = getRequest().getParameter(PAGE_PARAM_KEY);
if(currentPageStr != null)
try
currentPage = Integer.parseInt(currentPageStr);
catch(NumberFormatException nfe)
nfe.printStackTrace();
// continue with a current page of 1
// ensure the current page is not greater than the number
of pages
if(currentPage > lastPage)
currentPage = lastPage;
// index into the entire data set at which the window starts
// page indices are 1 based, adjust to be 0 based for accessing
// the Product[]
int start = (currentPage-1) * PAGE_SIZE;
// index into the entire data set at which the window ends or
the index
// of the last item when rendering the last page
int end = (currentPage != lastPage ? start + PAGE_SIZE : products.length);
// fill-up the set of Product objects to render up to PAGE_SIZE
// but don't run off the end of the products array
for(int i = 0; i < PAGE_SIZE && (start+i < products.length);
i++)
displayProducts[i] = products[start + i];
// set the previous page
int prevPage = currentPage-1;
if(prevPage > 0)
getRequest().setAttribute("prevPage", new Integer(prevPage));
// set the next page
int nextPage = currentPage+1;
if(nextPage <= lastPage)
getRequest().setAttribute("nextPage", new Integer(nextPage));
// set the current and last pages in the request in order to
show "Page # of #"
getRequest().setAttribute("currentPage", new Integer(currentPage));
getRequest().setAttribute("lastPage", new Integer(lastPage));
// set the current window in to the data set as a page input
f.addPageInput("displayProducts", displayProducts);
return;
* Initialize a simple, sample data set that contains
* 17 products with IDs running from 1-17 and text "Widget 1" to
* "Widget 17".
public void onCreate()
int size = 17;
products = new Product[size];
for(int i = 1; i <= size; i++)
products[i-1] = new Product("Widget " + i, i);
* Simple JavaBean that contains production information.
public static class Product
implements java.io.Serializable
private String name;
private int id;
public Product(String name, int id)
this.name = name;
this.id = id;
public String getName() {return name;}
public int getId() {return id;}
Maybe you are looking for
-
Choosing an external hard drive for back up
This is more for general advice than a specific question. Right now I have my hard drive partitioned and use the second as a backup with Time Machine. It will work for most situations but not all, such as a home fire or break-in (all my photos and mu
-
Password no longer works after installing 4.0.3 !
Brand new Mac mini running 10.10.2. I downloaded the new OS X Server v 4.0.3 app and all installed fine.. I even created a share and transferred some test data okay... But my main login password on longer worked when I went to go access something in
-
Is there a Safari extension (or plug-in) for Acrobat Pro?
Is there a Safari extension (or plug-in) for Acrobat Pro? I use to have one, then when I updated to the new Yosemite operating system, it disappeared.
-
Hi folks, I had asked this question originally back in mid July but didn't get a useful answer. Can anyone tell me why the 'select text' for highlight / add note to text / copy functions is not working? When I right-click the popup menu appears and
-
"Required file is in use" error
I have recently consolidated my library onto an external. I am trying to add some music to itunes but get the message that "the required file is in use" How do I remedy this?