Multiple occurances of lin itm seg based on a field using graphical mapping
Hi
I have a scenario where in i have to populate the target segment multiple times based on quantity field LFIMG
Source structure in IDOC and target structure is XSD. In the following we need to have multiple occurances of S_LIN based on LFIMG. So if the value of LFIMG is 6 we need to have 6 occurances of S_LIN.
Source structure
E1EDL24 (segment)
LFIMG (field)
Target structure
ITEM (segment)
GSHL (segment)
S_LIN (segment)
Hello Kalyan,
You need to write an udf like this.
LFIMG (change context Queue)---->UDF ---> S_LIN
Variable : source and separator(",")
String[] values = source.split(separator);
for(int i = 1 ; i < values.length ; i++){
result.addValue(values<i>);
result.addValue(ResultList.CC);
Regards
Pothana
Similar Messages
-
New line for each segment for Inhouse files using bic mapping..!!
Hi ,
Idoc to File scenario.
In the receiver adapter, we need to convert the XML into file(Inhouse format) by using seeburger mapping.
We have generated the map for this in bic and used in Module configuration of receiver adapter.
Now the question is I need to get each segment of XML file into a separate line in the output file like below.
HDR ... ......
DTL .........
DTL ........
where HDR is the header and DTL is the details segments.
Iam getting the output in a single line like HDR.........DTL.........DTL.........
but not as expected like above .
I tried by using newLine = true in module configuration, but no use.
I digged into bic designer to search for any option , but no use.
Kindly suggest me if any one has any idea on this.
Thanks&Regards'
Deepthi.Hi Deepthi,
Did you find the solution, please let me now if you get.
did you mention the below code to solve the issue.
copy the below section in the NewMapping Program:
SetDestinationDelimiter("SubElement", ">");
SetDestinationDelimiter("Element", "~");
SetDestinationDelimiter("Segment", "\n");
Regards,
Varun Reddy.K -
To create multiple files on the receiver side based on key field
Hi Gurus,
My scenario is File to File
My Source structure is as below
My File looks like
My file looks like below
570774 11/26/2008 8:12 6296 xxxxxxx 985-399-5157 1153 Teche Road Morgan City United States Lori Eisenman Louisiana 70380 0 1153 Teche Road Morgan City United States Lori Eisenman Louisiana 70380 303 101400100000 3365440332522 ELLE YVES SAINT LAURENT Eau de Parfum Spray 2 61 78 156 184 184 0
570774 11/26/2008 8:12 6296 xxxxxxx 985-399-5157 1153 Teche Road Morgan City United States Lori Eisenman Louisiana 70380 1153 Teche Road Morgan City United States Lori Eisenman Louisiana 70380 376 106074700JP0 3365440347229 GOLDEN GLOSS N° 27Shimmering Lip Gloss 1 28 28 28 0
570775 11/26/2008 8:15 6296 xxxxxxx 985-399-5157 1153 Teche Road Morgan City United States Lori Eisenman Louisiana 70380 7 1153 Teche Road Morgan City United States Lori Eisenman Louisiana 70380 284 9000400000 3365440316546 L'HOMME Eau de Toilette Spray 1 53 53 53 60 60 0
for each new order number(key field ex: 570774) a new xml file to be created , from the above example 2 xml files sholud be created(one for 570774 and the other for 570775)
How can i acheive this functionality?
Please help me on this, Thanks in advance
Regards
SrinivasHi Srinivas,
map the key field to the parent record of the target field. Use the split by value and change the source key field level to higher one so that the all occurences of the key field are occuring. The mapping will be like this;
Source Key Field (change to higher level) --> Spli by value --> Filename creation UDF --> Target header field.
Try this.
Regards,
Murugavel. -
I am trying create Stored Proc which takes 2 inputs from user @PreviousMonthYear,@CurrentMonthYear
Below is my table schema.[TableIPPortStatus]
Such 1000's of rows will be available in TableIPPortStatus for every IP Port combination for every Scan. Stored Proc will take input as @PreviousMonthYear = 'Jan-2013' and @CurrentMonthYear = 'Feb-2013'
Expected stored proc o/p is to get changed status in @CurrentMonthYear rows compared with the same IP/Port combination from @PreviousMonthYear rows. so for for above e.g. expecting to get below result.
Since in Scan 2222 Port 80 of IP 1.0.0.0 got closed & Port 80 of IP 1.0.0.1 got open and for 1.0.0.2 status was unchanged.
Also, if any new IPPort combination is added in Feb-2013 that needs to make available in the output.
Please suggest way to accomplish this in SQL. Thanks in Advance!DId you try this? ACtually you dont even need prevmonthyear parameter. you can simply get result using single parameter
If its sql 2012 this is very easy
DECLARE @CurrentMonthYear varchar(30)
SET @CurrentMonthYear = 'Feb-2013'
SELECT ScanId,MonthYear,IP,Port,Status
FROM
SELECT *,
LAG(Status,1,'') OVER (PARTITION BY IP,Port ORDER BY CAST('01-' + MonthYear AS datetime)) AS PrevStatus
FROM Table
)t
WHERE PrevStatus <> Status
And if its sql 2008 or below
DECLARE @CurrentMonthYear varchar(30)
SET @CurrentMonthYear = 'Feb-2013'
;With CTE
AS
SELECT *,
ROW_NUMBER() OVER (PARTITION BY IP,Port ORDER BY CAST('01-' + MonthYear AS datetime)) AS Seq
FROM Table
WHERE MonthYear = @CurrentMonthYear
)t
SELECT c1.*
FROM CTE c1
LEFT JOIN CTE c2
ON c2.IP = c1.IP
AND c2.Port = c1.Port
AND c2.Seq = c1.Seq - 1
WHERE c2.Status <> c1.Status
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Can we sort one field based on other field in messsage mapping !!
Hi Folks,
I have got source xml with couple of Vendors, Vendors has got promotions on different products with different dates. If I sort date field, product quantity is not sorting. How Can I sort both fields at the same time, if I sort Promotion date field in ascending order, the product quanitity has to sort respectively?
Any one can help in this please , any links are examples etc..
Kind Regards
Thanks in advance.
SanHi Folks,
I have tried with this function SortbyKey, it always throuing exception. That's the reason I came to you guys. Please have a look following mapping
ZY2K_DATE ----> Remove Context -->
Sortbykey -----> Condition etc.,
ZA02_QTY -----> Remove Context -->
if I try to see display queue on Sortbykey I am getting ' Exception'
Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Queues have different lengths in function sortByKey] in class com.sap.aii.mappingtool.flib7.NodeFunctions method sortByKey[[Ljava.lang.String;@5be18f1d, [Ljava.lang.String;@357ae80b, SortComparator.CASE_SENSITIVE, SortOrder.ASCENDING, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@1818459b,
Source
<ROOT>
...<OUTPUT> - - - - 0..unbound
.......<Group_LIN> - - - 0..unbound
..........<Group_ZA> - - - 0..unbound
..............<D02_ZA> - - - 0..unbound
..................<ZA01>QD</ZA01>
..................<ZA02>35.0</ZA02>
..................<ZA03>CT</ZA03>
..................<Z_Y2K_DATE>20100723</Z_Y2K_DATE>
..............</D02_ZA>
...........</Group_ZA>
........</Group_Lin>
....</OUTPUT>
Target
ProductDemandInfluencingEventNotification 0..unbound
...ProductDemandInfluencingEvent 1..1
.......Item 1..unbound
..........OrderForecastTimeSeries 0..1
..............Item 1..unbound
.................ValidityPeriod 1..1
......................StartDateTime 0..1
......................EndDateTime 0..1
.................Quantity 1..1
the above D02_ZA tag sometimes comes more than one QD with different dates. Same dates has to go under one tag with respective quantities!! This is the situation, can any solve this please?
The target tag "ProductDemandInfluencingEventNotification" will generate based on number of promotions on particular date. Ex: if one vendor has 'n' number products promotions on 3 different dates, 3 "ProductDemandinfluenceevennotifications" has to generate, that three promotion dates and quantities has to respectively.
That ZA02 (Qty) value has to go Quantity target field.
Kind Regards
San -
Problem with changing required property based on another field using EL
Hi,
In my form, I want to set required property should be true or false for field 'B' based on value of field 'A'.
Value of 'A' is from 1 to 10 as choice list.
If 'A' value is 1 then i want i want to set required property of 'B' is false.otherwise the field 'B' should be required.
I set auto Submit to true for field 'A' and 'A' assigned as partial trigger for 'B'.
In required property of 'B', i given
#{bindings.ScheduleLevel.inputValue!=1}
Now, it is working fine if i try to change the list value of 'A' from 2 to 1 or 1 to 2 or more in the existing record.
But, if i click create button, then if i choose 1 for 'A', then the 'B' field is not changing from required to non-required.
my jdev version is 11g.
Any suggestions please.
Thanks in advance,
SANThis would not work as validations would fire before. So you will have to accomplish this using a valuechangelistener like this.
Keep a boolean variable which captures whether field is required or not let' say brequired
for field A
set immediate=true, autosubmit=true
then in value change listener of A you use the code as follows:-
public void onAChange(ValueChangeEvent valueChangeEvent) {
Object value=valueChangeEvent.getNewValue();
if(value!=null&&!value.toString().trim().equalsIgnoreCase("")){
setBrequired(true);
FacesContext.getCurrentInstance().renderResponse();
else{
setBRequired(false);
FacesContext.getCurrentInstance().renderResponse();
} -
Can I get multiple sums in a single column based on a "code" I place.
After importing a file of check/debit card activity from my bank, can I 'code' the line items based on tax categories ie Utilities, Medical expenses, Auto expenses, etc. and then get sums for each based on that code I placed in a single column? That would mean multiple sums in a single column based on the code used for each tax related expense. For instance, I would put UT in the column for utilities expenses and MED in the same column if it were a medical expense. I would then want the sum for all items in that column for each item code. Is this possible or do I need to use a different approach to get this information.
My guess is that the SUMIF function may be your friend.
It's well described in the *iWork Formulas and Functions User Guid*e which every user may download from the Help menu.
Yvan KOENIG (VALLAURIS, France) samedi 2 janvier 2010 21:56:39 -
Import Map file failes with single/Multiple Occurance
Hi All,
Using a file I mapped the source and target structures.. The source file has one multiple occurance node . so I used look up option in source table and mapped with target fields...saved the map..
When I used the following XML file .. I used the same map created befoe... I see the Remote System fields are not failed to map to target structure.. How can I get rid of this issue....
<Product>
--<Name>Rajeev</Name>
--<REMOTE_SYSTEM>
<Z_MDM_REMOTE_SYSTEM>
<Z_MDM_SYSTEM_NAME>Panaroma AW Customer ID</Z_MDM_SYSTEM_NAME>
<Z_MDM_VALUE>600013</Z_MDM_VALUE>
<Z_MDM_VALUE1>600011</Z_MDM_VALUE1>
<Z_MDM_VALUE2>600012</Z_MDM_VALUE2>
</Z_MDM_REMOTE_SYSTEM>
--<REMOTE_SYSTEM>
</Product>
Using above I saved the map.. Its fine.. I am able to import data in to MDM..
When the file has multiple values of remote system as shown below then field are unmapped... vice versa is also the same..
<Product>
--<Name>Rajeev</Name>
--<REMOTE_SYSTEM>
<Z_MDM_REMOTE_SYSTEM>
<Z_MDM_SYSTEM_NAME>Panaroma AW Customer ID</Z_MDM_SYSTEM_NAME>
<Z_MDM_VALUE>600013</Z_MDM_VALUE>
<Z_MDM_VALUE1>600011</Z_MDM_VALUE1>
<Z_MDM_VALUE2>600012</Z_MDM_VALUE2>
</Z_MDM_REMOTE_SYSTEM>
<Z_MDM_REMOTE_SYSTEM>
<Z_MDM_SYSTEM_NAME>Panaroma AW Customer ID</Z_MDM_SYSTEM_NAME>
<Z_MDM_VALUE>600013</Z_MDM_VALUE>
<Z_MDM_VALUE1>600011</Z_MDM_VALUE1>
<Z_MDM_VALUE2>600012</Z_MDM_VALUE2>
</Z_MDM_REMOTE_SYSTEM>
--<REMOTE_SYSTEM>
</Product>
Do I need to create a seperate map for multiple iteration and single occurance..OR missing some thing? Please advice..
Thanks
RajeevHI Ravi,
May be I took the wrong example..
I am not talking about remote systems... I am talking about XML source file.. If the XML source file consist of single occurance of any qualifier table then those qualifier table fields are not mapping.. IF I used the base file as multiple occurance Qualifier table....
In the same way if I use base file as single occurance of Qualifer table .. Qualifier Fields are not getting mapped if the source file is single occurance..
Suppose :If I use the base file as this and save the map.. I am able to import files whcih are single occurance of EMAIL...
Fields are not getting mapped if the EMAIL occurnace is multiple.....
<Product>
--<Name>Rajeev</Name>
--<EMAIL>
<Z_MDM_EMAIL>
<ID>ABC_yahocom</ID>
<TYPE>TEMP</TYPE>
</Z_MDM_EMAIL>
--</EMAIL>
</Product>
In the same way: If I use the following XMl as base and create a map and save it.. Able to import files which had email occurance multiple.. Unable to import data and the fields are not mapped ......
<Product>
--<Name>Rajeev</Name>
--<EMAIL>
<Z_MDM_EMAIL>
<Z_MDM_EMAIL>
<ID>ABC_yahocom</ID>
<TYPE>TEMP</TYPE>
</Z_MDM_EMAIL>
<Z_MDM_EMAIL>
<ID>CDE_yahocom</ID>
<TYPE>TEMP</TYPE>
</Z_MDM_EMAIL>
--</EMAIL>
</Product>
Please advise.. Thanks Rajeev. -
MRP creating multiple delivery schedule lines in PR
Hi,
We have activated MRP (type PD) where Purchase requiesition is auto created by system for requirement quantity. We require to optimize delivery schedule in such a way that entire PR quantity is broken into various delivery schedule based on planned delivery time and requirement. Scenario can be further explained with following example.
Material Requirement for a month is say 1,25,000 units
Closing Stock say 25,000 units
PR Generated by system for 1,00,000 units. The entire quantity is schdulled with only one delivery schedule line as per planned delivery time.
The requirement is to generate multiple delivery schedule lines automatically in Purchase requisition based on planned delivery time so that Purchase orders can be placed with system generated delivery schedule lines.
How can it be achieved ?
Regards,
Nirav KinkhabwalaDear
Are you dealing with Single vendor where you want Multiple Schedule Line item through single PR which should be generated through MRP run ??
What you will have to do is to set up the Outline Agreement or Info Record for your vendor and material and then create the source record for this vendor- material relationship and make sure that this source record is set as MRP relevant. Once MRP is run, the vendor is automatically defaulted to your PRs. If in your material master, you have defined the same purchasing group for various material numbers, then with Transaction ME59, it is feasible that you can combine various PRs of the same purchasing group by flagging onto the 'Per Purchasing Group' indicator checkbox. Make a trial test and let me know how it goes.
Or you can use Qouta arrabgement in that case for different vendor .Please refer : Multiple Requisition line itme for Quota arrangement
Just check and revert
regards
JH
Edited by: Jiaul Haque on Dec 25, 2010 1:52 PM -
How to generate a new segment in IDoc for multiple occurance of Control Num
Hi Experts,
In my scenario, i need to generate a new segment in IDoc(Target Structure) based on Control Number Field in the Source Structure.
The segment need to be created for multiple occurance of the Control Number.
Ex:
Control Number - 100 appears 5 times in Source Structure.This control Number is mapped to one of the Field in the Segment of IDoc.
Now my requirement is to generate the Segment 5 times with respective to this Control Number.
please help me out to resolve this issue.
Thanks,
Kish.Hi,
Here is the XML Structure of my Source:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:GoodsReceipt_MT xmlns:ns0="urn:WOL-com:XI:data:HJ:10">
<row>
<CONTROL_NUMBER>111</CONTROL_NUMBER>
<LINE_NUMBER>1111</LINE_NUMBER>
<CONTROL_NUMBER_2/>
<OUTSIDE_ID/>
<WH_ID>111111</WH_ID>
<LOCATION_ID/>
<HU_ID>11111</HU_ID>
<NUM_ITEMS/>
<ITEM_NUMBER>111111</ITEM_NUMBER>
<CONTROL_NUMBER_3>LR</CONTROL_NUMBER_3>
<LOT_NUMBER>11111</LOT_NUMBER>
<UOM>11111</UOM>
</row>
<row>
<CONTROL_NUMBER>111</CONTROL_NUMBER>
<LINE_NUMBER>12222</LINE_NUMBER>
<CONTROL_NUMBER_2/>
<OUTSIDE_ID/>
<WH_ID>12222</WH_ID>
<LOCATION_ID/>
<HU_ID>1222</HU_ID>
<NUM_ITEMS/>
<ITEM_NUMBER>112222</ITEM_NUMBER>
<TRAN_QTY>112222</TRAN_QTY>
<CONTROL_NUMBER_3>LR</CONTROL_NUMBER_3>
<LOT_NUMBER>12222</LOT_NUMBER>
<UOM>1122222</UOM>
</row>
<row>
<CONTROL_NUMBER>222</CONTROL_NUMBER>
<LINE_NUMBER>2222</LINE_NUMBER>
<CONTROL_NUMBER_2/>
<OUTSIDE_ID/>
<WH_ID>22222</WH_ID>
<LOCATION_ID/>
<HU_ID>222222</HU_ID>
<NUM_ITEMS/>
<ITEM_NUMBER>2222222</ITEM_NUMBER>
<TRAN_QTY>22222222</TRAN_QTY>
<LOCATION_ID_2>33333333</LOCATION_ID_2>
<CONTROL_NUMBER_3>LR</CONTROL_NUMBER_3>
<LOT_NUMBER>22222</LOT_NUMBER>
<UOM>22222</UOM>
</row>
<row>
<CONTROL_NUMBER>333</CONTROL_NUMBER>
<LINE_NUMBER>3333</LINE_NUMBER>
<CONTROL_NUMBER_2/>
<OUTSIDE_ID/>
<WH_ID>33333</WH_ID>
<LOCATION_ID/>
<HU_ID>33333</HU_ID>
<NUM_ITEMS/>
<ITEM_NUMBER>333333</ITEM_NUMBER>
<TRAN_QTY>33333333</TRAN_QTY>
<CONTROL_NUMBER_3>LR</CONTROL_NUMBER_3>
<LOT_NUMBER>33333</LOT_NUMBER>
<UOM>333333</UOM>
</row>
</ns0:GoodsReceipt_MT>
Now Control_Number 111 occurs 2 times, 222 & 333 occurs 1 time.
Now one IDoc for 111,222 & 333 should be generated.
But Control_number 111 appears 2 times.
Now the data in the 2 rows should be passed to Single IDoc by repeating the segments inside the IDoc.
As u said i changed the Occurance of IDoc to 0...unbound and imported as External Definition. I have done upto Generating IDoc for each unique Control_Number.
I stuck up at repeating the Segments in the IDoc.
So please help me out.
Thanks,
Kish. -
I want to pick up Schedule line Delivery date based on Sales Order of Mater
Hi Experts,
I have one scenario like,
I want to pick up Schedule line Delivery date based on Sales Order of Material.
For example :
Go to va03
Give the order no
Press the enter
Double click on material.
Go to Schedule line Tab
Then we can find out the Delivery date .
I want to pick up the that Delivery date. Could you please help on that.
Thanks,
Amjad.Hi,
schedule line dates are available in VBEP.
VBEP-VBELN = sales order number.
VBEP-EDATU = schedule line date.
REgards,
Raghavendra -
How to create additional Line in file based on condition available as part of ZINVOIC02 Idoc segment
Scenario Details:
Receiving Zinvoic02 Idoc in PI. Idoc to file translation creates comma separated file with .csv extn
The logic was kept in such a way that how many E1EDP01 (items) are available in IDoc that many no of records will be created in csv file.
The file logic for some the fields is as below:
No of records
InvNumber
InvDate
CusNumber
LineitemDesc
Tax1Type
Tax1%
for 1st E1EDP01
E1EDK01-BELNR
E1EDK03-DATUM
E1EDK01-PARTN
Populate when E1EDP04/MSKWZ=O2 or O4 with E1EDP19/KTEXT
Hardcode when E1EDP04/MSKWZ=O2 or O4
Sum all E1EDP04 /MSATZ when E1EDP04/MSKWZ=O2 or O4
for 2nd E1EDP01
E1EDK01-BELNR
E1EDK01-DATUM
E1EDK01-PARTN
same as above
same as above
same as above
for 3rd E1EDP01
E1EDK01-BELNR
E1EDK03-DATUM
E1EDK01-PARTN
same as above
same as above
same as above
Additional Line to be created when one or more of E1EDP01 is having E1EDP04/MSKWZ = O3
same as above
same as above
same as above
Hardcode "REIM for USE TAX"
Hardcode ""
Hardcode ""
Now we have got addition requirement to add a new lineitem when tax code is equal to O3 for any of the E1EDP01.
Is it possible to create additional lineitem based on condition. If yes, please share what should be the approach.
How we can create the additional lineitem?
Currently we are using E1EDP01 to do context handling.
The target structure is :
MT_FILE
INVOICE 0..unbounded
InvNumber 0..1
InvDate 0..1
CusNumber 0..1
LineitemDesc 0..1
Tax1Type 0..1
Tax1% 0..1Hello,
Please add one extra field in the data structure of the target mapping and let its occurrence be 0..unbounded under the root node 'MT_ADP_Invoice'.
Apply the condition, if tax code MSKWZ (with its context changed to E1EDP01) equalsS to '03', then map it to the newly created target field whose occurrence is 0..unbounded.
This will then create an additional field which is your requirement.
The above is one way.
But if you want to have the same target field name as ADP_File appended for tax field being '03'.
Then in that case you can you two message mapping for one common operational mapping / interface.
In the first message mapping you need to have one target data structure created with the source data structure remaining the same as the one shown by you in scrn shot. Now this target data structure will be similar to the source, except that you need to add one more field at the end(name different from other fields) in target (whose occurrence should be 0..unbounded), and it needs to be mapped to E1EDP01 provided the tax code field MSKWZ(its context changed to E1EDP01) equalsS to constant '03'.
In the second message mapping you need to map the target structure of previous message mapping to the actual required structure. The newly added field should be mapped to ADP_File of your final target structure.
This will then create the same structure as required.
Note : Please change the occurence of ADP_File to 0..unbounded.
Regards,
Souvik -
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 -
Query multiple occurances of min value from table using group by
Hello all,
I am using Oracle 10.2 on Windows 2003
I am attempting to select the min value from a table, and if there are multiple occurances of a min value, to list all not just one row. For example, the following query
with test1 as(
select to_date('2009-11-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual
union all select to_date('2009-12-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual
union all select to_date('2010-01-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual
union all select to_date('2010-02-01','YYYY-MM-DD') t_date, 't_1' t_name, '3' t_value from dual
union all select to_date('2010-03-01','YYYY-MM-DD') t_date, 't_1' t_name, '4' t_value from dual
union all select to_date('2010-04-01','YYYY-MM-DD') t_date, 't_1' t_name, '5' t_value from dual
union all select to_date('2010-05-01','YYYY-MM-DD') t_date, 't_1' t_name, '6' t_value from dual
union all select to_date('2010-06-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual
union all select to_date('2010-07-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual
select trunc(t_date,'YYYY') t_date, min(t_value) min_value
from test1
group by trunc(t_date,'YYYY') gives the following results
t_date min_value
01-JAN-09 1
01-JAN-10 1so I looked at the forums and tried the following query
with test1 as(
select to_date('2009-11-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual
union all select to_date('2009-12-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual
union all select to_date('2010-01-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual
union all select to_date('2010-02-01','YYYY-MM-DD') t_date, 't_1' t_name, '3' t_value from dual
union all select to_date('2010-03-01','YYYY-MM-DD') t_date, 't_1' t_name, '4' t_value from dual
union all select to_date('2010-04-01','YYYY-MM-DD') t_date, 't_1' t_name, '5' t_value from dual
union all select to_date('2010-05-01','YYYY-MM-DD') t_date, 't_1' t_name, '6' t_value from dual
union all select to_date('2010-06-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual
union all select to_date('2010-07-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual
select t_date,min_value
from (select t_date,min(t_value) min_value,
rank() over (order by min(t_value) ASC) RN
from test1 group by t_date)
where rn=1I get the desired results with this query, which are
t_date min_value
01-NOV-09 1
01-JAN-10 1
01-JUN-10 1
01-JUL-10 1the problem is, when I change the values in the test1 table to the following
with test1 as(
select to_date('2009-11-01','YYYY-MM-DD') t_date, 't_1' t_name, '123' t_value from dual
union all select to_date('2009-12-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual
union all select to_date('2010-01-01','YYYY-MM-DD') t_date, 't_1' t_name, '21' t_value from dual
union all select to_date('2010-02-01','YYYY-MM-DD') t_date, 't_1' t_name, '13' t_value from dual
union all select to_date('2010-03-01','YYYY-MM-DD') t_date, 't_1' t_name, '24' t_value from dual
union all select to_date('2010-04-01','YYYY-MM-DD') t_date, 't_1' t_name, '15' t_value from dual
union all select to_date('2010-05-01','YYYY-MM-DD') t_date, 't_1' t_name, '26' t_value from dual
union all select to_date('2010-06-01','YYYY-MM-DD') t_date, 't_1' t_name, '100' t_value from dual
union all select to_date('2010-07-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual
select t_date,min_value
from (select t_date,min(t_value) min_value,
rank() over (order by min(t_value) ASC) RN
from test1 group by t_date)
where rn=1i get the following results
t_date min_value
01-JUN-10 100I expected to get the results
t_date min_value
01-DEC-09 2
01-JUL-10 2any help would be appreciated
CheersBecause t_value is character.
You should To_NUMBER(t_value)
with test1 as(
select to_date('2009-11-01','YYYY-MM-DD') t_date, 't_1' t_name, '123' t_value from dual
union all select to_date('2009-12-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual
union all select to_date('2010-01-01','YYYY-MM-DD') t_date, 't_1' t_name, '21' t_value from dual
union all select to_date('2010-02-01','YYYY-MM-DD') t_date, 't_1' t_name, '13' t_value from dual
union all select to_date('2010-03-01','YYYY-MM-DD') t_date, 't_1' t_name, '24' t_value from dual
union all select to_date('2010-04-01','YYYY-MM-DD') t_date, 't_1' t_name, '15' t_value from dual
union all select to_date('2010-05-01','YYYY-MM-DD') t_date, 't_1' t_name, '26' t_value from dual
union all select to_date('2010-06-01','YYYY-MM-DD') t_date, 't_1' t_name, '100' t_value from dual
union all select to_date('2010-07-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual
select t_date,min_value
from (select t_date,min(t_value) min_value,
rank() over (order by min(To_NUMBER(t_value)) ASC) RN
from test1 group by t_date)
where rn=1 -
In COGI error text "Multiple assignment of line item"
Hi Guru,
In COGI error text "Multiple assignment of line item"
Description:
ultiple assignment of a line ID
Message no. M7357
iagnosis
An item table, in which the line ID (LINE_ID)
was transferred to the function module MB_CRE
ystem Response
Processing is terminated.
rocedure
Contact the system administration.
rocedure for System Administration
There is an error in the calling application.
Please help me to resolved this issue.
Thanks and regards
PNUHi,
Thanks for reply,
It is possible to remove material from COGI list. We need to stop creation of this error.
Is there other solution to control creation of error "Multiple assignment of line item"
Thanx & regd.
PNU
Maybe you are looking for
-
Web.show_document in Forms 11g
Hi, I've migrating my application from forms 6i to forms 11g. In my application I use web.show_document to open some document using the http alias defined in httpd.conf under Oracle iSuites Http Server in httpd.conf I define Alias /my_document_folder
-
Migration from 10.4.11 to 10.5.1 Server
I just upgraded a OD Master from 10.4.11 to 10.5.1 everything was installed and did a reboot. After the reboot it was hang at license screen where you need to enter the serial number to upgrade the server. I did a restart and after entering serial nu
-
PNGs from Premiere to PhotoShop
First, I apologize upfront for not knowing the proper nomenclature. I'm hoping this is a basic question for those that know the answer. Ok, this is a combo question that involves both Premiere and PhotoShop (cs5). While in Premiere, I'll take a PNG p
-
Class not found error while using ikvm error code IKVMC0100: class "javax.b
hi iam writing a java application which uses bluetoth i.e. javax.bluetooth; now i need to create exe for c# i.e. my GUI is C# and business logic is java, so these are steps i have followed * created a java project (iam using netbeans 6.1) * after bui
-
How to use iTunes as a recorder
How do I use an Ipad2 for voice recording, via iTunes or an new app? Cheers