IDoc should be generated depends on the unique value
Hi friends,
XML file contains multiple Purchase orders which are not sorted. number of idoc should be genereated depends up on the unique purchase order number.
My question is how to create idocs based on the unique purchase order number.It's very urgent my friends if any one faced this type of requriments pls give me complete description and how to sort the purchase order numbers
Edited by: prathima on Oct 9, 2011 12:32 PM
Hi,
First take the IDoc xsd and change the <IDOC> occurrence to unbounded by adding maxOccurs attribute.
Refer this wiki page,
http://wiki.sdn.sap.com/wiki/display/XI/ChangingtheOccurrencesofStandard+IDOC
Then import this new xsd as an External Definition and use as target structure in Message Mapping.
Sort the unique PO value from source xml and then split by value[value change] to map to <IDOC> node.
You can test the input xml in the message mapping and hope this should work
Thanks,
Zameer
Similar Messages
-
How do I count the unique value pairs in two columns of a table?
I have a table (Table 2) that is populated with data from an imported .csv file. On table 1 I need to count the unique value pairs in two columns of Table 2.
Here's what I have:
Date Person
7/10/2011 A
7/12/2011 W
7/12/2011 X
7/12/2011 X
7/12/2011 X
7/12/2011 Z
7/14/2011 Z
7/15/2011 X
7/16/2011 Z
I'm focusing on person "X" and can easily count how many days that person shows up but what I want is to see on how many unique days that person shows up.
Here's the result I'm looking for (Person "X" shows up on 2 different days - 3 times on 7/12/2011 and once on 7/15/2011):
X 2
I can't seem to find a function that allows me to do that. I also am not allowed to modify Table 2 so that leaves me to come up with a solution on Table 1.
Any ideas would be greatly appreciated.Hi John,
Not being allowed to modify Table 2 is a minor inconvenience. Just copy (using a formula) the necessary two columns onto Table 1.
Yellow columns may be hidden. The procedure progresses from left to right. All formulas are entered into row 2 then filled down that column to the end of the table. The table must be as long as the list in column A of Table 2.
A2: =Table 2::A
Fill right to column B.
Fill both columns down as far as needed.
I've used actual Date and Time values in column A, formatted to show only the Date part, but the technique will work with text in these cells, provided all cells representing the same 'date' have exactly the same content.
C2: =A&B
This concatenates the contents of each row of columns A and B into a single text string.
D2: =COUNTIF($C$2:C2,C)
This counts the number of occurrences of the Date&Name string on the current row from the first regular cell in column C (C2) to the current cell.
E2: =IF(COUNTIF($B$2:B2,B)=1,MAX($E$1:E1)+1,"")
This constructs the index of first occurrences of each name, in the order they first occur. The index is used by LOOKUP in column F.
F2: =IF(ROW()-1>MAX(E),"",LOOKUP(ROW()-1,$E,$B))
This uses the index value created in E as a search-for value to extract a single copy of the names in column B. The result is a list of all distinct names in the list. Note that spelling differences will be counted as distinct names.The IF statement stops the listing when the last distinct name is extracted.
G2: =IF(LEN(F)>0,COUNTIFS($B,"="&F,$D,"=1"),"")
This counts the number of 'first occurrences of distinct Date & Name strings for each name on the list (ie. the number of distinct dates on which each name appears in the original list).
All of the functions used are described, with at least one example for each, in the iWork formulas and Functions User Guide. You can download the guide, and the Numbers '09 User Guide, via the Help menu in numbers.
Regards,
Barry -
Value of an operation parameter depending on the characteristic value
Hi,
Is it possible to set the value of the Normal Duration (or any other parameter of the operation) depending on the value of one characteristic?
For example: The value of my characteristic A is 2, so I want to set Normal Duration = 10*(Value_of_A) = 20 for the first operation of the standard network. Is it possible in standard SAP???
Thanks in advance,
Luis.Your question is quite clear, Please go this links may be helpful.
Tcode realted to variant configuration
http://help.sap.com/erp2005_ehp_03/helpdata/EN/bc/f48e3823f46f51e10000009b38f842/frameset.htm
Help materal related to variant configuration
http://help.sap.com/erp2005_ehp_03/helpdata/EN/92/58c3fc417011d189ec0000e81ddfac/frameset.htm
Regards
Nitin
Edited by: Nitin Patoliya on Dec 3, 2008 9:56 AM -
Setting a composite key where the 2nd PK is generated depending on the 1st
Hi,
I am dealing with a large database with a composite primary key made up of 1. ID 2.Sequence. Now my problem is for a particular ID I want to assign Sequence numbers starting from one to however many instances of that ID is there. This numbering will restart for another ID.Thus the combination of the ID and Sequence will make it unique.E.g.:
ID 1 has sequence 1,
ID 1 has sequence 2,
ID 1 has sequence 3,
ID 2 has sequence 1,
ID 2 has sequence 2....
For performance issues I will be using bulk bindings. Here is my go at the code. Can someone please suggest how I can optimize the code or make it better.
Code:
DECLARE
CURSOR c_orders IS
SELECT ID
FROM customer_orders;
TYPE t_num_array IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
v_order_ids t_num_array;
v_orders_sequence t_num_array;
v_row_count NUMBER := 0;
v_orders_sequence(1) := 1;
v_orders_sequence(2):=1;
BEGIN
OPEN c_orders;
LOOP
FETCH c_orders
BULK COLLECT INTO v_order_ids
LIMIT 100;
EXIT WHEN v_row_count = c_orders%ROWCOUNT;
v_row_count := c_orders%ROWCOUNT;
FOR i IN 2..v_order_ids.count LOOP
if(v_orders_id(i) = v_orders_id(i-1))
v_orders_sequence(i)=v_orders_sequence(i) + 1;
else
v_orders_sequence(i) = 1;
END LOOP;
FORALL i IN 1..v_order_ids.count
UPDATE customer_orders
SET sequence = v_orders_sequence(i)
WHERE id = v_order_ids(i);
END LOOP;
CLOSE c_orders;
COMMIT;
END;
Again if I made any mistakes please point it out and suggest any improvements to the code.
Edited by: user13579621 on Mar 3, 2011 3:40 PM
Edited by: user13579621 on Mar 3, 2011 3:43 PM
Edited by: user13579621 on Mar 4, 2011 7:15 AM
Edited by: user13579621 on Mar 4, 2011 7:19 AM
Edited by: user13579621 on Mar 4, 2011 9:35 AMHi,
The thing is both the id and the seqnums are part of a primary key. So say an ID has 3 instances this week and four the next week.
Week 1:
ID1 has Seq Num1
ID1 has Seq_num2
ID1 has Seq_num3
Week2:
ID1 has Seq Num1
ID1 has Seq_num2
ID1 has Seq_num3
ID1 has Seq_num4
Using an analytical function the sequence numbers will now be changed to reflect the new numbers. But what if the new ID coming in this week has a lesser ROWID in the original table. From what I understand your logic will now assign this new ID a sequence number of 1 and change the sequence numbers of the 3 existing from last week from 1 to 2,3,4 accordingly. But since it is part of the primary key we dont want to change them. The new ID coming in should always be assigned a sequence number of 4 not 1. Any ideas about how to achieve this.
Also it does not have to be the way I do it. Let me just go back and rephrase what I want to achieve.
I have a new table primary key(id,seqnum) which gets data from another table. Now I want to set the id incremented normally and the sequence number incremented uniquely like I mentioned before for each unique id and then reset for the next ID. How do I go about achieving this efficiently, keeping in mind that if a new id comes in next week the new id will always be assigned a sequence number that is +1 of the last sequence number for that ID? -
Change the Report Title for XML Publisher, depending on the field value.
I want to change the Report Title as below.
if the field_A='B' then the report title as it is defined in report defination
else the report title is 'XXX"
Please let me know whether it is possible, if yes please guide me. how can we do it.
Thanks
VenkatTim covered the inline if statement, though not specifically regarding a title, in his blog recently:
http://blogs.oracle.com/xmlpublisher/2007/12/18#a723
The syntax is:
xdoxslt:ifelse(.//WM_FLAG='C’,'Canceled','Approved') -
Help to extract the Column Name depending on the row values
Hello All,
I have a table with below format
Table Name: Employees
Emp Name Monday Tuesday Wednesday Thursday Friday Saturday
John yes NULL yes yes NULL NULL
Michael NULL yes NULL yes yes NULL
Smith NULL yes yes NULL yes yes
In the above I have explicitly mentioned NULL just for better understanding.
I am trying to send an email using HTMLDB_MAIL.SEND which will have the body as following
"John is absent on Tuesday, Friday and Saturday
Michael is absent on Monday, Wednesday and Saturday
Smith is absent on Monday and Thursday"
I am trying to do this using cursor, fetching each row and matching the value with NULL. But I am not able to display the column name.
Can somebody please help me?
Regards,
RS.
Edited by: user8966924 on Jan 24, 2013 4:35 AMHi,
just use Peter's query, collect into a nested table the output and create one CLOB variable from collection to use it as a body:
create or replace function getbodyemp
return clob
is
p_body_out clob;
type tp_tbemp is table of varchar2 (100);
v_tbemp tp_tbemp;
begin
-- collect the output into a nested table
with employees as
select 'John' Emp_Name , 'yes' Monday, null Tuesday, 'yes' Wednesday, 'yes' Thursday, null Friday, null Saturday from dual union all
select 'Michael' Emp_Name , null Monday, 'yes' Tuesday, null Wednesday, 'yes' Thursday, 'yes' Friday, null Saturday from dual union all
select 'Smith' Emp_Name , null Monday, 'yes' Tuesday, 'yes' Wednesday, null Thursday, 'yes' Friday, 'yes' Saturday from dual
select
e.emp_name || ' is absent on ' ||
replace (trim( ',' from nvl2(monday,null, 'Monday')
|| nvl2(Tuesday,null, ',Tuesday')
|| nvl2(Wednesday,null, ',Wednesday')
|| nvl2(Thursday,null, ',Thursday')
|| nvl2(Friday,null, ',Friday')
|| nvl2(Saturday,null, ',Saturday')), ',', ', ') txt
bulk collect into v_tbemp
from
employees e
where
monday is null
or tuesday is null
or wednesday is null
or thursday is null
or friday is null
or saturday is null
for i IN 1 .. v_tbemp.count
loop
p_body_out := p_body_out || v_tbemp(i) || chr(10);
end loop;
return p_body_out;
end getbodyemp;
select getbodyemp() from dual;
GETBODYEMP()
John is absent on Tuesday, Friday, Saturday
Michael is absent on Monday, Wednesday, Saturday
Smith is absent on Monday, Thursday
1 row selected.Regards.
Al -
Generating number depending on the condition
Dear All,
I have table with following structure.
formno number(5)
name Varchar2(100)
centreno number(2)
rollno Varchar2(10)
I want to generate rollno depending on the following condition.
1. Roll number should be generated based on the centreno
2. Roll number should be generated based on the alphabets but not in a sqeuence.
For eg.
my data is like
form no name centreno rollno
200 A1 01 1
206 A2 01 4
502 A3 02 6
234 A4 03 10
400 B1 01 2
501 B2 02 7
788 C1 01 3
100 C2 02 8
343 C3 01 5
130 C4 02 9
232 C5 03 11
i.e. first I need to sort names alphabetically by centreno. But then I need generate number in a sequence that first A, B, C...Z will be generated. Then it starts again from A, B, C...Z for that centre. Then it will run same process for other centres.
Any ideas how to do this?
Regards
Trusha
Edited by: trusha on Oct 10, 2008 3:53 PMSomething like .. (for given sample data)
SQL> select * from test;
C1 C2 C3
200 A1 01
206 A2 01
502 A3 02
234 A4 03
400 B1 01
501 B2 02
788 C1 01
100 C2 02
343 C3 01
130 C4 02
232 C5 03
11 rows selected.
SQL> select c1,c2,c3,
2 row_number() over(order by c3,rn,c2) regno
3 from(
4 select c1,c2,c3,
5 row_number() over(partition by c3,substr(c2,1,1) order by c2) rn
6 from test)
7 order by c2;
C1 C2 C3 REGNO
200 A1 01 1
206 A2 01 4
502 A3 02 6
234 A4 03 10
400 B1 01 2
501 B2 02 7
788 C1 01 3
100 C2 02 8
343 C3 01 5
130 C4 02 9
232 C5 03 11
11 rows selected.
Edited by: jeneesh on Oct 10, 2008 4:51 PM
corrected -
GUID generation issue, SYSUUID always returns the same value.
Hi,
I'm using "SELECT SYSUUID FROM DUMMY" to get a guid value but it always return the same value.
What should I do to get a unique value each time I execute the query above.
Thanks.I thought I had the same problem and I found that if you generate multiple UUID's in the same SQL, it they will be the same. If you make multiple calls, you should get multiple UUID's.
Try this:
SELECT SYSUUID as UUID1 FROM DUMMY;
SELECT SYSUUID as UUID2 FROM DUMMY;
I get the following results:
UUID1 = 538632FD7EA20426E10000000A3F10A9
UUID2 = 538632FE7EA20426E10000000A3F10A9
Notice that the strings look almost identical, but the 8th character on UUID1 is a D and the 8th on UUID2 is a E.
Jim -
The above error occurs when I place unique constraint on a column in a custom list. This error only occurs because the custom list has been configured to only allow creaters to view and edit their own list items.
I just can't see why that should prevent SP from placing a unique value constraint though.
One easy workaround would be to place the unique constraint on the SQL Server table that represents this list. However, in a hosted environment, it is not always possible to gain access to the backend server. What is more, I am uncomfortable with this
approach as it may break other parts of SP 2010.
Is there any other approach?Hi,
If SharePoint were to enforce uniqueness on a column in a list where users are only allowed to see and edit list items that have created, then you could have a scenario where -
a. user1 tries to add a new item to the list which violates the uniqueness constraint
b. SharePoint reports an error
c. user1 gets to know that there is another item containing the same value in this list
d. this violates the security settings that you configured (each user should be allowed to only see the items that they have created). Now if you change the permissions settings to allow users to SEE all items, but only
edit items that they have created, this error disappears (obviously).
Now getting to the workaround you mentioned (creating a unique constraint on the SQL Server table). This is not going to be possible for numerous reasons -
a. Modifying (or for that matter, even performing SELECT operations on) the SQL Server tables is an unsupported operation and it will definetely break other things in SharePoint, not
to mention that you will lose all support options from Microsoft. However if you don't care about this, then it will still not be technically possible because...
1. SharePoint does not create a new SQL Server table for every list/library.
2. If you did get around to enforcing a unique constraint in the one single table that SharePoint uses for all lists, then you will be enforcing this constraint on each and every list in all the sites and in all the site
collections that are assigned to that content database.
Please "Mark as Answer" if a post has answered your question or "Vote as Helpful" if it was helpful in some way. Here's
why -
Read two CSV files and remove the duplicate values within them.
Hi,
I want to read two CSV files(which contains more than 100 rows and 100 columns) and remove the duplicate values within that two files and merge all the unique values and display it as a single file.
Can anyone help me out.
Thanks in advance.kirthi wrote:
Can you help me....Yeah, I've just finished... Here's a skeleton of my solution.
The first thing I think you should do is write a line-parser which splits your input data up into fields, and test it.
Then fill out the below parse method, and test it with that debugPrint method.
Then go to work on the print method.
I can help a bit along the way, but if you want to do this then you have to do it yourself. I'm not going to do it for you.
Cheers. Keith.
package forums.kirthi;
import java.util.*;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import krc.utilz.io.ParseException;
import krc.utilz.io.Filez.LineParser;
import krc.utilz.io.Filez.CsvLineParser;
public class DistinctColumnValuesFromCsvFiles
public static void main(String[] args) {
if (args.length==0) args = new String[] {"input1.csv", "input2.csv"};
try {
// data is a Map of ColumnNames to Sets-Of-Values
Map<String,Set<String>> data = new HashMap<String,Set<String>>();
// add the contents of each file to the data
for ( String filename : args ) {
data.putAll(parse(filename));
// print the data to output.csv
print(data);
} catch (Exception e) {
e.printStackTrace();
private static Map<String,Set<String>> parse(String filename) throws IOException, ParseException {
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(filename));
CsvLineParser.squeeze = true; // field.trim().replaceAll("\\s+"," ")
LineParser<String[]> parser = new CsvLineParser();
int lineNumber = 1;
// 1. read the column names (first line of file) into a List
// 2. read the column values (subsequent lines of file) into a List of Set's of String's
// 3. build a Map of columnName --> columnValues and return it
} finally {
if(reader!=null)reader.close();
private static void debugPrint(Map<String,Set<String>> data) {
for ( Map.Entry<String,Set<String>> entry : data.entrySet() ) {
System.out.println("DEBUG: "+entry.getKey()+" "+Arrays.toString(entry.getValue().toArray(new String[0])));
private static void print(Map<String,Set<String>> data) {
// 1. get the column names from the table.
// 2. create a List of List's of String's called matrix; logically [COL][ROW]
// 3. print the column names and add the List<String> for this col to the matrix
// 4. print the matrix by inerating columns and then rows
} -
Creating a list of unique values within a range.
I have a huge data set I am working with and need to do two things.
First I need to get rid of any repeat entires, which there are many.
Second, and more importantly, I need to generate a list of unique values within a column for which I have no idea what the number or sort of values might be. For instance, say the column contained flavors of ice cream, I am looking for a formula that can return an array of the flavors listed.
Can either of these two things be done in numbers?CJ Eder wrote:
I have a huge data set I am working with and need to do two things.
First I need to get rid of any repeat entires, which there are many.
If entries are in column B starting from B2
In C2 enter the formula:
=IF(COUNTIF($B$1:$B1,B)=0,B,"")
and apply fill down.
You will get a single copy of existing entries.
Select the column C
Copy to Clipboard
Paste in column C
Sort on column C
delete the rows whose cell of column C is blank.
If I understand well, the same protocol apply to your second request.
Yvan KOENIG (from FRANCE mercredi 15 juillet 2009 21:32:30) -
Select Statement to Get Unique values in a Column
I am trying to figure out how to get all the unique values from a
table column?
select code from atable sort unique?
I am running 8.1.7
Does anyone know how to do this?
Thanks,Hi,
Here is the code for that.
Select empno from emp
group by empno
having count(empno) = 1
Regards,
Ganesh R -
Getting unique values from an arraylist
Hi
I have an arraylist that contains stringbuffer objects. The arraylist has duplicate values of the objects. I have to create another arraylist with only the unique values from the first arraylist. I tried it many ways and using many functions, but no luck. Can someone provide me the code for this , as i need to do this urgently.
Thank U
Mansoor,> Sanity check: when are StringBuffers equal?
Same character sequence.
[EDIT] Or so I thought. Just tested, and found I was wrong. A quick glance at the API confirmed my error; StringBuffer doesn't override Object.equals().
~ -
How to get the key values of record in ADF Read-only Form?
Hi
I am using ADF Business Component VO.
I have a search page( ADF Search Form) and I am displaying the results of the search in a ADF Read-Only Table( only few columns are shown) .Then by selecting a record and clicking on the button 'View' , I am navigating to a different page(ADF Read-Only Form) to show all the columns of the table for the selected record.
In the second page, I have one more button 'view child details'.Now when I click on this view child details button, I have to show another page(ADF Read-Only Form) which fetches the data from one of the child tables of parent record.
My idea is to create a ViewLink between the parent and child tables.( I have more than 15 child tables for a parent table).
Is there anyother way to achieve this functionality?
Please respond ASAP.
Thanks in advance.
~Sivaji..
Message was edited by:
Sivaji...the bossSijav,
ASAP?
Anyway - yes, you can do this with a view link. When you add the child table to the application model, make sure you actually add it as a child of the parent table instance (select the parent VO first, then use the shuttle to add it). This way, the parent->child relationship should be coordinated for you automatically. You should not need to get the key values manually.
Then, when you create the page to show the detail table, make sure you use the child table that is shown as a child of the parent table in the data control palette (expand parent table to see the child).
Hope this helps,
John -
Changing the Condition value in Quatation only and not in Order
Hi Gurus,
We have a Requirement from Client in which the Client should be Able to change the condition Value PR00 in the Quotation and not in Sales order......can someone please let me know how's that possible?
Because if we try to make Changes in Condition Type in V/06 it will also allow changes in Sales Order....Hi
You can use user-exit USEREXIT_PRICING_PREPARE_TKOMP in the include MV45AFZZ.
IF VBAK-AUART = (Your quotation type)
LOOP AT XKOMV.
IF XKOMV-KSCHL = 'PR00'.
SELECT * FROM T685A INTO TABLE I_T685A WHERE KSCHL = 'PR00'.
READ TABLE I_T685A WITH KEY KSCHL = XKOMV-KSCHL.
I_T685A-KMANU = 'C'.
MODIFY I_T685A INDEX SY-TABIX.
MODIFY T685A FROM TABLE I_T685A.
REFRESH I_T685A.
ENDIF.
ENDLOOP.
like this discuss with your abapper and build the logic
regards
Prashanth
Maybe you are looking for
-
How do I sync iMessage from iPhone to iPad mini
I can't seem to receive iPhone iMessages on my iPad mini?
-
How to transfer data from a program to excel format?
Hi, <h4> I want to convert the abap output to excel format. Please tell me how to do it?</h4> Megha Jain.
-
Complete freezing of computer and solution IMAC 21 5/3 500 GB 9400 N
-
I am getting several checkboxes on a JSP form that are created depending on the no. of iterator values. e.g. <s:iterator value="group"> <s:checkbox name="check"/> <s:textfield name="name"/> </s:iterator> Now all the check boxes created are having sam
-
Keyboard Shortcuts for Mail Message
I switched to Mail from MozillaThunderbird. In Thunderbird, one can move through OPEN mail messages via Keyboard Shortcut; a simple "F" for next message or "B" for previous message. In Mail, the only thing I've figured out is that one can arrow throu