Splitting a message into multiple messages.
All,
I will simplify the issue we have and explain.
We have the following structure. (the occurence <data> node is unbounded)
<source>
<data>...</data>
<data>...</data>
<data>...</data>
</source>
we need to split this into another message <source2> with the exact same structure... but we need only 10 <data> nodes in the <source2>. In this <source2> the <data> node is of max occurs 10.
so if we get a <source> message with 1000 <data> nodes comes in, we need to split it into 100 <source2> messages.
How can we do this? (due to constraints we cannot use the file content conversion)
Thanks.
Hello,
Please check whether the below logic suits your scenario.
Change Messages - http://flickr.com/photo_zoom.gne?id=1064675286&size=o
Mapping -http://flickr.com/photo_zoom.gne?id=1064675070&size=o
Mapping -http://flickr.com/photo_zoom.gne?id=1064675164&size=o
UDF's- http://flickr.com/photo_zoom.gne?id=1064675480&size=o
Results http://flickr.com/photo_zoom.gne?id=1064675320&size=o (Source 4 Data)
Results http://flickr.com/photo_zoom.gne?id=1064675430&size=o (Source 5 Data)
The above example will split source data into 2 messages each.
If it doesn't helps, let me know.
Best regards,
raj.
Similar Messages
-
Split the IDOC into multiple IDOC if the IDOC has more than 500 records
Hi All,
I developed an outbound IDOC in which we are facing an issue.
There is some limitation on the maximum idoc size it can handle.
If number of records is more than 500, split the idoc into multiple iDoc's, e.g. if it would have 1300 records , the result would be 2 iDoc's with 500 records, and the last one would have 300 records
How can i acheive this.
Regards
JaiHi,
1) first you need to know which message type/Idoc type you are triggering.
2) Get the Corresponding processcode from Partner profiles(WE20/ WE41).
3) Then the look for prper user-exit in the related processing FM.
4) write logic to split the IDoc accordingly.
if no proper user exit available then copy the standard processing FM and need to all ALE related configurations.
Catch hold any ABAP expert in your team to do all these.
Suresh -
Split Single IDOC into Multiple IDOC's Based on Segment Type
Hi Experts,
I have a scenario IDOC to FILE , Split Single IDOC into Multiple IDOC's based on Segment Type
Outbound:
ZIdocName
Control Record
Data Record
Segment 1
Segment 2
Segment 3
Status Record
I should get output like below
Inbound:
ZIdocName
Control Record
Data Record
Segment 1
Status Record
ZIdocName
Control Record
Data Record
Segment 2
Status Record
ZIdocName
Control Record
Data Record
Segment 3
Status Record
Please suggest me step by step process to achieve this task.
Thanks.Thanks a lot Harish for reply.
I have small doubt. According to your reply , If we have N number of segments in single IDOC with same fields in all segments then for splitting Single IDOC into Multiple IDOC's based on Segment Type we need to duplicate N number of target IDOC tree structure.
Is that possible to Split single IDOC into Multiple IDOC's based on Segment Type using only one Target IDOC structure without duplicating the Target IDOC structure tree. -
Split a record into multiple records
Hi,
I have situation where i need to split a record into multiple records.
InputData :
value|BeginDate |EndDate
15 |2002/10/15|2002/10/16
13 |2002/10/13|2002/10/20
19 |2002/10/19|2002/10/23
10 |2002/10/10|2002/10/12
OutPut :
10 |2002/10/10|2002/10/12
13 |2002/10/13|2002/10/15
15 |2002/10/15|2002/10/16
13 |2002/10/16|2002/10/19
19 |2002/10/19|2002/10/23
ThanksHi ,
As a far I understood from your example ,
I have few questions...
1. You have information about the patient in a 1 source table.
2. how u are identifying for patient X u need 5 rows to be created. R u storing these informations in seprate table or how ...
3. if you have these information in a seperate tables ..... a simple cross join in ODI should get you the expected result.....
Or give some more information with a example ..that would be great ...
Thanks -
Split one row into multiple columns
Hi,
Data in one CLOB column in a table storing with delimiter, ##~~##. Ex. ##~~##abc##~~##defgh##~~##ijklm##~~##nopqr (data starts with delimiter). Please help me to split the data into multiple rows like below and it should be in the same order.
abc
defgh
ijklm
nopqr
I am using Oracle 11g.
Thanks.Thanks Hoek for your response. Before posting my question in the forum, I tried similar query. It is working with one character as delimiter.
with test as (select 'ABC,DEF,GHI,JKL,MNO' str from dual )
select regexp_substr (str, '[^,]+', 1, rownum) split
from test
connect by level <= length (regexp_replace (str, '[^,]+')) + 1;
Above query is giving correct result by fetching 5 rows. I have modified the query like below...
with test as (select 'ABC,,,DEF,,,GHI,,,JKL,,,MNO' str from dual )
select regexp_substr (str, '[^,,,]+', 1, rownum) split
from test
connect by level <= length (regexp_replace (str, '[^,,,]+')) + 1;
Above query resulting 13 rows and last 8 rows are nulls. Number of null rows are increasing, if I increase number of characters in delimiter. Could you please tell me how to avoid those null rows.
Thanks. -
Split single row into multiple rows containing time periods
Hi,
I have a table with rows like this:
id, intime, outtime
1, 2010-01-01 00:10, 2010-01-3 20:00
I would like to split this row into multiple rows, 1 for each 24hr period in the record.
i.e. The above should translate into:
id, starttime, endtime, period
1, 2010-01-01 00:10, 2010-01-02 00:10, 1
1, 2010-01-02 00:10, 2010-01-03 00:10, 2
1, 2010-01-03 00:10, 2010-01-03 20:00, 3
The first starttime should be the intime and the last endtime should be the outtime.
Is there a way to do this without hard-coding the 24hr periods?
Thanks,
Dan Scott
http://danieljamesscott.orgThanks for all the feedback, Dan.
It appears that the respective solutions provided will give you: a) different resultsets and b) different performance.
Regarding your 'truly desired resultset' you haven't answered all questions from my previous post (there are differences in the provided examples), but anyway:
I found that using CEIL or ROUND makes quite a difference, using my 'simple 3 record testset' (30 records vs. 66 records got initially returned, that's less than half of the original). That's quite a difference. However, I must call it a day (since it's almost midnight) for now, so there's room for more optimizement and I haven't thoroughly tested.
But this might hopefully make a difference performancewise when compared to my previous 'dreaded example':
SQL> drop table t;
Table dropped.
SQL> create table t as
2 select 1 id, to_date('2010-01-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-01-03 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
3 select 2 id, to_date('2010-02-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-02-05 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
4 select 3 id, to_date('2010-03-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-03-03 00:10', 'yyyy-mm-dd hh24:mi') outtime from dual;
Table created.
SQL> select id
2 , max(intime)+level-1 starttime
3 , case
4 when level = to_char(max(t.outtime), 'dd')
5 then max(t.outtime)
6 else max(t.intime)+level
7 end outtime
8 , level period
9 from t
10 connect by level <= round(outtime-intime)
11 group by id, level
12 order by 1,2;
ID STARTTIME OUTTIME PERIOD
1 01-01-2010 00:10:00 02-01-2010 00:10:00 1
1 02-01-2010 00:10:00 03-01-2010 00:10:00 2
1 03-01-2010 00:10:00 03-01-2010 20:00:00 3
2 01-02-2010 00:10:00 02-02-2010 00:10:00 1
2 02-02-2010 00:10:00 03-02-2010 00:10:00 2
2 03-02-2010 00:10:00 04-02-2010 00:10:00 3
2 04-02-2010 00:10:00 05-02-2010 00:10:00 4
2 05-02-2010 00:10:00 05-02-2010 20:00:00 5
3 01-03-2010 00:10:00 02-03-2010 00:10:00 1
3 02-03-2010 00:10:00 03-03-2010 00:10:00 2
10 rows selected.
SQL> By the way: I'm assuming you're on 10g, is that correct?
Can you give us some information regarding the indexes present on your table? -
Split XSLT Output into Multiple Files
I have an XML-to-File scenario working, but now I need to split my XSLT map output into multiple files based on the data. I have been reading the Jin Shin blog on message splitting, but don't know that it pertains to my situation.
XML data getting mapped with XSLT map creates output formatted like this.
<?xml version="1.0" encoding="utf-8"?>
<ns1:ColdInvoiceData xmlns:ns1="http://graybar.com/cold/invoice">
<Header>
<RecordID>HDR</RecordID>
<InvoiceNumber>15</InvoiceNumber>
</Header>
<Details>
<RecordID>DTL</RecordID>
<LineItemNumber>001</LineItemNumber>
<UnitPrice>1.25</UnitPrice>
</Details>
<Details>
<RecordID>DTL</RecordID>
<LineItemNumber>002</LineItemNumber>
<UnitPrice>2.22</UnitPrice>
</Details>
<Header>
<RecordID>HDR</RecordID>
<InvoiceNumber>16</InvoiceNumber>
</Header>
<Details>
<RecordID>DTL</RecordID>
<LineItemNumber>001</LineItemNumber>
<UnitPrice>3.33</UnitPrice>
</Details>
</ns1:ColdInvoiceData>
I currently have this output writing to a file (FTP, File Conversion). A single file is no issue, but I need to send multiple files for every set of HDR/DTL(s). I also need to put the invoice number in the filename (which is working fine as a parameter in my single FTP File CC now).
Can I make this happen with message splitting and maybe a second map (GUI map)? Do I need to adjust the XSLT output XML format to have an invoice level? Is there a better way to go?
Thanks!I made a change to the namespace used on the Messages/Message1 nodes (since the system-assigned ns0 was already being used in my xml data) and now I am getting output.
The problem is that the output matches my input. As aforementioned, I started with just a one-to-one mapping on every node and field.
When I change the mapping to try to force multiple ColdInvoiceData nodes, I get the following error (when my source has two Invoice nodes):
<Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ns0:Messages/ns0:Message1/ns1:ColdInvoiceData[2]/Invoice. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at
When my source has one invoice node, it works ok.
Here is a screenshot of my mapping structure.
http://webpages.charter.net/kpwendel2/ib.jpg -
C# Split xml file into multiple files
Below i have an xml file, in this file, i need to split this xml file into multiple xml files based on date column value,
suppose i have 10 records with 3 different dates then all unique date records should go into each file . for ex here i have a file with three dates my output should get 3 files while each file containing all records of unique date data. I didn't get any idea
to proceed on this, thats the reason am not posting any code.Needed urgently please
<XML>
<rootNode>
<childnode>
<date>2012-12-01</date>
<name>SSS</name>
</childnode>
<childnode>
<date>2012-12-01</date>
<name>SSS</name>
</childnode>
<childnode>
<date>2012-12-02</date>
<name>SSS</name>
</childnode>
<childnode>
<date>2012-12-03</date>
<name>SSS</name>
</childnode>
</rootNode>
</XML>Here is full code:
using System.Xml.Linq;
class curEntity
public DateTime Date;
public string Name;
public curEntity(DateTime _Date, string _Name)
Date = _Date;
Name = _Name;
static void Main(string[] args)
XElement xmlTree = new XElement("XML",
new XElement("rootNode",
new XElement("childnode",
new XElement("date"),
new XElement("name")
string InfilePath = @"C:\temp\1.xml";
string OutFilePath = @"C:\temp\1_";
XDocument xmlDoc = XDocument.Load(InfilePath);
List<curEntity> lst = xmlDoc.Element("XML").Element("rootNode").Elements("childnode")
.Select(element => new curEntity(Convert.ToDateTime(element.Element("date").Value), element.Element("name").Value))
.ToList();
var unique = lst.GroupBy(i => i.Date).Select(i => i.Key);
foreach (DateTime dt in unique)
List<curEntity> CurEntities = lst.FindAll(x => x.Date == dt);
XElement outXML = new XElement("XML",
new XElement("rootNode")
foreach(curEntity ce in CurEntities)
outXML.Element("rootNode").Add(new XElement("childnode",
new XElement("date", ce.Date.ToString("yyyy-MM-dd")),
new XElement("name", ce.Name)
outXML.Save(OutFilePath + dt.ToString("yyyy-MM-dd") + ".xml");
Console.WriteLine("Done");
Console.ReadKey(); -
How to Split 1 Order into Multiple Deliveries based on Partner Function ?
Hello,
How can I split one Sales Order into multiple deliveries, based on the partner function "managed by" ?
The requirement is that one order will be created for different "managed by".
If partner function "managed by" is same at line item level in order, than the items having same "managed by" can be combined in one delivery, else delivery will split and multiple deliveries will be created from 1 Order.
Jatin MistryHi,
You need to create a new requirement in tcode VOFM for that, together with your ABAP consultant. This requirement will be used in copy contol.
http://saptechsolutions.com/pdf/VOFMCopyRequirementRoutines.pdf
MdZ -
MIRO : split line item into multiple
I have senario were we need to split 1 PO line into multiple line items in MIRO due to different tax applicable for different amounts....
Hi,
How same material from same vendor with same time in a single PO have different tax structure?
You have following options, chose your suitable one:-
Option-1
Create single PO with 10 qty and do not enter tax code in PO. Do invoice 2times for your PO ie.. invoice with 4qty with value 400 for tax code XX and again invoice with 6qty with value 600 for tax code ZZ
Option-2
Create single PO with two line items……1st line item with 4qty & value 400 with tax code XX and 2nd line item with 6qty & value 600 with tax code ZZ. Do invoice directly for that PO.
Option-3
Create two PO separately ie….. One PO with 4qty with value 400 with tax code XX and Another PO with 6qty & value 600 with tax code ZZ. Do invoice two PO’s
Regards,
Biju K -
How can i prevent itunes from splitting individual albums into multiple albums?
How do prevent itunes from splitting albums with various artists into multiple albums?
Thanks for your help!It's probably better to put Various Artists into the Album Artist box rather than just "various". Make sure it's the Album Artist field though. In addition, you need to mark the album as a compilation. When setting the complete album, the Part of a compilation is on a drop-down menu on the File/Get Info/Options tab:
but if changing just one song, it's a tick-box on the Info tab:
and needless to say, the album name must be exactly the same for each track. -
Split delimited file into multiple structures
Hi experts,
I have a delimited text file that has multiple row types - each row contains only one structure, but there could be 10 different row types (structures) in the file. I can figure out which structure each row belongs. Just need to come up with a way to dynamically split each line.
I am trying to stay away from:
case 'row type'
when 'structure A'
split into A1, A2, A3...
when 'structure B'
split into B1, B2, B3...
end with.
Rather, create a routine accepting file line and structure (or structure name) that returns the structure with data populated.
Any suggestions?
Thanks,
Hyun KangThis may give you some ideas.
report zrich_0001.
data: begin of itab1 occurs 0,
fld1(10) type c,
end of itab1.
data: begin of itab2 occurs 0,
fld1(10) type c,
fld2(10) type c,
end of itab2.
data: begin of itab3 occurs 0,
fld1(10) type c,
fld2(10) type c,
fld3(10) type c,
end of itab3.
data: tab_name type string.
data: istr type table of string with header line.
data: isplit type table of string with header line.
field-symbols: <dyn_tab> type table,
<dyn_wa>,
<fs>.
start-of-selection.
call function 'GUI_UPLOAD'
exporting
filename = 'C:test.txt'
tables
data_tab = istr.
loop at istr.
split istr at ',' into table isplit.
read table isplit index 1.
concatenate isplit '[]' into tab_name.
assign (tab_name) to <dyn_tab>.
assign (isplit) to <dyn_wa>.
delete isplit index 1.
loop at isplit.
assign component sy-tabix of structure <dyn_wa> to <fs>.
if sy-subrc <> 0.
exit.
endif.
<fs> = isplit.
endloop.
append <dyn_wa> to <dyn_tab>.
endloop.
loop at itab1.
write:/ itab1-fld1.
endloop.
loop at itab2.
write:/ itab2-fld1, itab2-fld2.
endloop.
loop at itab3.
write:/ itab3-fld1, itab3-fld2, itab3-fld3.
endloop.
My file looks like this.
ITAB1,Value1
ITAB1,Value2
ITAB2,ValueA,ValueB,
ITAB2,ValueC,ValueD,
ITAB3,ValueR,ValueS,ValueT
ITAB3,ValueU,ValueV,ValueW
You can see in this program, that the first column drives what internal table the data is written to for that line.
Regards,
RIch Heilman -
Easy Question: How to split concatenated string into multiple rows?
Hi folks,
this might be an easy question.
How can I split a concatenated string into multiple rows using SQL query?
INPUT:
select 'AAA,BBB,CC,DDDD' as data from dualDelimiter = ','
Expected output:
data
AAA
BBB
CCC
DDDDI'm looking for something kind of "an opposite for 'sys_connect_by_path'" function.
Thanks,
TomasHere is the SUBSTR/INSTR version of the solution:
SQL> WITH test_data AS
2 (
3 SELECT ',' || 'AAA,BBB,CC,DDDD' || ',' AS DATA FROM DUAL
4 )
5 SELECT SUBSTR
6 (
7 DATA
8 , INSTR
9 (
10 DATA
11 , ','
12 , 1
13 , LEVEL
14 ) + 1
15 , INSTR
16 (
17 DATA
18 , ','
19 , 1
20 , LEVEL + 1
21 ) -
22 INSTR
23 (
24 DATA
25 , ','
26 , 1
27 , LEVEL
28 ) - 1
29 ) AS NEW_STRING
30 FROM test_data
31 CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(DATA,'[^,]','')) - 1
32 /
NEW_STRING
AAA
BBB
CC
DDDD -
Splitting a string into multiple parts from particular position (string has no delimiter )
Hello Gurus,
I need to make string of having length 1000 into multiple parts from a particular position which has some text without any delimiter and i want to populate each part into an internal table which has one filed...
eg : string = 'sap abap sap abap sap abap sap abap sap abap sap abap sap abap sap sap sap abap sap abap'
suppose i want to start splitting from 40th position...assume that i have 3 parts
and these 3 parts i have put into an internal table..
lt_itab = [sap abap sap abap sap abap sap abap,
sap abap sap abap sap abap sap abap,
sap abap sap sap sap abap sap abap]
plese help!
any help would be Appreciated ...thank youHi,
Try this code.
TYPES: BEGIN OF ty,
b TYPE string,
END OF ty,
tt TYPE STANDARD TABLE OF ty.
DATA: a TYPE string VALUE 'aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll',
tb TYPE tt,
wa TYPE ty,
off TYPE i,
len TYPE i,
count TYPE i,
count1 TYPE i,
temp TYPE i.
len = 8. "Position
off = 0.
count = strlen( a ).
count1 = count / 8.
temp = len - 1.
DO count1 times.
temp = off + len.
IF temp > count.
wa-b = a+off.
ELSE.
wa-b = a+off(len).
ENDIF.
off = off + len.
SHIFT wa-b LEFT DELETING LEADING space.
APPEND wa to tb.
ENDDO.
LOOP AT tb INTO wa.
write: / wa-b.
ENDLOOP. -
Splitting single video into multiple files - workflow improvements?
I regularly need to split a single video into multiple separate files that are used by other programs. I'm using Premiere Pro CS4 for a number of reasons including the ability to easily and accurately select a scene by individual frames, native audio and video effects/filters, and the ability to import and export various video types. I'm open to using other tools, but I haven't yet found one that is even close to Premiere Pro when it comes to accurately selecting split points.
I'm not a Premiere Pro expert. I have been doing this for about four months and have read many resources (books, forum posts, help guides) to refine the workflow I'm currently using. My question: does anyone know any improvements that might save me time/keystrokes.
Current workflow:
I've bound F8 to File > Export > Media
Import video file
Open in source monitor
Set In and Out points for scene in source monitor
Ctrl-drag from source monitor to Project Panel (creates a subclip)
Repeat 3 and 4 for all scenes/subclips
Select all subclips from Project Panel and drag to timeline
Set work area bar to first subclip in timeline by the following four keystrokes: Home, Alt-[, PageDown, Alt-]
Type F8 (File > Export > Media shortcut). Type output file name, click OK and the first subclip is put in the AME queue
For the remaining subclips, type: Alt-[, PageDown, Alt-], F8, output file name, OK and repeat until done
Any thoughts/ideas on workflow improvements?
Thank you!Thank you Hunt.
For the sake of brevity, I didn't include all of the details about the various aspects of the projects.
Early on I was doing what you suggested and yes, it is a little quicker. I learned (painfully) a couple of months later that I sometimes have to go back and adjust the clips and this method (trim to timeline with no subclips) resulted in quite a bit of duplicate effort (to reobtain start/stop points). I've since learned that managing the "scenes" as subclips in topical bins allows me to go back and make adjustments, long after I've totally forgotten about the project content, without a lot of unnecessary reworking. -
Split SQR output into multiple files And Rename each file.
Greetings!
We ran into scenario where we need to split an SQR output (PDF) split into multiple files (each page , each file). More over the out put has to be renamed with EMPLID.
It is for printing Advices, where we run DDP003 to print all of them, Our requirement needs to have one PDF file for each employee to placed into a shared drive OR to be emailed.
I was thinking of running the same process in a loop individually, but this is resource intensive. Is there any way we can batch run this SQR process and split into each page (each paychek comes to one page),
AND
I need them renamed by SQR as it creates them, Each file would be names as EMPLID.
This is all in alternative to run process individually by employee , via self service. to not to over laod Process scheduler server.
Can anyone help me how can we get these thigns done in SQR?
Thanks in advance.You can use the SQR command new-report for each employee which closes the current report output file and opens a new one with the specified file name (e.g. EMPLID).
Maybe you are looking for
-
URGENT: Tcode for display of the inspection set up
Hi, i want to hav a tcode which displays the insepction ste up present in materials (i.e. MM02 or 01 in Quality view ) ,i want to see which are the inspection set ups available in it . actaully there are about 700 matreials of which i have change the
-
What is this little AS2 code in AS3?
Hey guys! I got something to embed HTML with it's pics and text and stuff... But this is in AS2.0 and I would need it in AS3.0.. I was checking the AS2.0 migration on Adobe website, but I can't find / don't know some things.. What I got in AS2.0: fun
-
After receiving a call on my iPhone 4s I decide I want to add their number to a specific group in my contacts using the "Create New Contact" option. When I do this it only is established in the "All Contacts" group. Is there a way to add it directl
-
Hi , Can we default values at qualified tables by running assignments . I tried to run a assignment on qualified table to default the value but I am unable to assign the value.Is there any speicific conditions we need to mention ? Thanks in advance.
-
Any need to keep old versions of Logic
Is there any need to keep my older versions of Logic... I know have Logic 6 thru Logic 9.... Those of you with all the versions do you keep the older versions or do you keep them laying around? thanks RD