Mapping complete input XML structure into one field on target
Hi,
I have a scenario where I need to map the complete input XML structure as it is, into one field on target side. so can we achieve this in Graphical Mapping? If yes, please share your valuable info.
Regards,
Shiva.
Hello,
this is the java map code.just compile it and made a .zip file import it and use it Interface Mapping.
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.AbstractTrace;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import java.util.Map;
import java.io.*;
public class PayloadToXMLField1 implements StreamTransformation {
String strXML = new String();
//Declare the XML tag for your XML message
String StartXMLTag = "<DocumentBody>";
String EndXMLTag = "</DocumentBody>";
//String StartXMLTag1 = "<Code>";
//String EndXMLTag1 = "</Code>";
AbstractTrace trace;
private Map param = null;
public void setParameter(Map param) {
this.param = param;
public void execute(InputStream in, OutputStream out) {
trace =
(AbstractTrace) param.get(
StreamTransformationConstants.MAPPING_TRACE);
trace.addInfo("Process Started");
try {
StringBuffer strbuffer = new StringBuffer();
byte[] b = new byte[4096];
for (int n;(n = in.read(b)) != -1;) {
strbuffer.append(new String(b, 0, n));
strXML = strbuffer.toString();
} catch (Exception e) {
System.out.println("Exception Occurred");
String outputPayload =
StartXMLTag
+ "<![CDATA["
+ strXML
+ "]]>"
+ EndXMLTag;
try {
out.write(outputPayload.getBytes());
trace.addInfo("Process Completed");;
} catch (Exception e) {
trace.addInfo("Process Terminated: Error in writing out payload");;
Similar Messages
-
Mapping an XML structure into one field
Make use of XSLT mapping (available on SDN...just search with CDATA...i think there is a new feature in PI7.1 (Copy XMl to subtree....something like that).
Regards,
Abhishek.Hi,
Chk this:
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
Re: Conversion of source XML structure to single string using PI 7.1
Thanks
Amit -
Question: map the whole source message into one field in the target.
Hi Friends,
Is there a way to populate the whole source message into one of the fields in the target message?
I am trying to do this in message mapping. Guide if this could be done in any other way or is there a way to do it in message mapping.
Waiting for your valuable guidance,
Regards,
LakshmiHi Friends,
I tried to convert the source message into a string using XSLT mapping. It was successful, however i need to have the source message in XML format and not in any other format. This is because, I am mapping the source XML into a field in a WSDL. The webservice requires the entire source message be inside a field called "Request" in the WSDL (it is like XML inside another XML).
Is there any way to do this? Please suggest.. (Im not good at java programming... may be i dont know) -
Hi , we have a scenario where we have to move entire source structure into one of the fields of the target structure.
Example:
Source:
item1
description
store
storedescription
price
batch
Target:
item1
store
xmlstring
we would like to do following mappings:
1. item1 in source to item1 in target
2. store in source to store in target
3. entire source structure in XML format into xmlstring in target
we reffered following blog , but couldnt map to our requirement.
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
XML to single element: Attn: Henrique
Thanks,
RajeshHI
I think you need to write UDF for this. there is library from apache called XML Serializer. Below is the sample file how you achieve that using that. Use that code in your UDF.
http://www.informit.com/articles/article.asp?p=31349&seqNum=3&rl=1
Even just concatenate into one field in the target during mapping and the send the data . this could also achive your requirments. no need to go for Java mapping
thanks
Swarup
Edited by: Swarup Sawant on Feb 15, 2008 11:42 AM
Edited by: Swarup Sawant on Feb 15, 2008 11:42 AM -
Hi all,
How to do the mapping since all source xml is in one field. I am on PI 71 ehp1.
Thanks JanosHow to do the mapping since all source xml is in one field. I am on PI 71 ehp1
Is your source structure something like:
<SRC>
<Filed1><Name>SAP</Name><Location>Germany</Location></Field>
</SRC>
i.e. an XML in one node and now you want to separate it into the relevant message structure in XI?
If yes then follow the De-serialization logic as mentioned by Udo in this thread:
Re: Changing XML message into a string
Regards,
Abhishek. -
How to change XML Structure from one form to another form using OO ABAP.
Hi Experts,
In my Scenario, i need to do ABAP Mapping in order to change Incoming structure from one form to another.
My Input to ABAP Mapping (OO ABAP Program)would be :
<A>..........</A>
<B>..........</B>
<C> .........</C>
<D>..........</D>
<E>..........</E>
<F>..........</F>
OO ABAP Program need to read this input and change the XML Structure into below form:
<A>..........</A>
<B>..........</B>
<C> .........</C>
<X>
<D>..........</D>
<E>..........</E>
<F>...............<F>
Please provide inputs (sample Code) to solve this issue.
Thanks,
Kish.
Edited by: Kishore Reddy Thamma on Jan 22, 2008 2:51 PM
Edited by: Kishore Reddy Thamma on Jan 22, 2008 2:52 PMHi,
Please provide sample code or Material for converting XML Structure from one form to another using OO ABAP and
Steps for ABAP MAPPING.
Thanks,
Kish. -
How to map a deep xml structure to flat structure
Hi, I'm trying to map a deep xml structure to a flat file structure. See this:
<SalesPoint>
<header>
<idTx></idTx>
<opCode></opCode>
</header>
<body>
<DataSet>
<codOperacion></codOperacion>
<codCanalDeVenta></codCanalDeVenta>
<cuitDeposito>
<docMinorista>
<fechaOperacion>
<codCC>
<Details>
<Dato>
<nroSerieEquipo></nroSerieEquipo>
<codNMU></codNMU>
<codOrigenEquipo></codOrigenEquipo>
<codConcepto></codConcepto>
<codSegmento></codSegmento>
<motivoSiniestro></motivoSiniestro>
</Dato>
</Details>
</DataSet>
</body>
</SalesPoint>
to:
<SalesPoint>
<idTx></idTx>
<opCode></opCode>
<codOperacion></codOperacion>
<codCanalDeVenta></codCanalDeVenta>
<cuitDeposito></cuitDeposito>
<docMinorista></docMinorista>
<fechaOperacion></fechaOperacion>
<codCC></codCC>
<nroSerieEquipo></nroSerieEquipo>
<codNMU></codNMU>
<codOrigenEquipo></codOrigenEquipo>
<codConcepto></codConcepto>
<codSegmento></codSegmento>
<motivoSiniestro></motivoSiniestro>
</SalesPoint>
Thanks in advance!!!!I do not think this is a complex XML structure. All that you need to take care is about the contexts. How ever it is not possible to give u the complete mapping here. If you have tried mapping already and facing some issues.. please put it here.. so that some one can help you.
VJ -
Validating input XML structure
Hi All,
If i need to validate the input XML structure, is there any standard modules available. I heard some options are available in PI7.0..Can any one explain in detail for validating the structure without any custom programming.
Regards,
BabuHello Babu,
This feature will be avauilable in Stanndard from Pi 7.1 Currently you would need to have custom coding to do this.
/people/morten.wittrock/blog/2006/03/21/validating-messages-in-xi-using-xml-schema
/people/jacob.vandborg/blog/2005/11/29/schema-validation-of-incoming-message
http://help.sap.com/saphelp_nw70/helpdata/en/c4/e1343e8c7f6329e10000000a114084/frameset.htm
With Regards,
BVS -
Multiple Checkbox Values Into One Field
Hopefully someone can help me with this issue I'm having.
I'm trying to save the values of multiple selected checkboxes into one field separated by commas through ADDT's Insert Transaction code. I can do this easily with DW's standard insert record wizard by using the PHP implode() function but I haven't been able to figure it out with ADDT's code.
<form>
<input type="checkbox" value="1" name="program[]" /> Program One
<input type="checkbox" value="2" name="program[]" /> Program Two
<input type="checkbox" value="3" name="program[]" /> Program Three
<input type="checkbox" value="4" name="program[]" /> Program Four
</form>
THIS IS ADDT'S CODING
$ins_quoteManager->addColumn("programs", "STRING_TYPE", "POST", "programs");
THIS WORKS VIA DREAMWEAVER'S INSERT RECORD WIZARD
Original: GetSQLValueString($_POST['programs'], "text"),
Modified: GetSQLValueString(implode(',',$_POST['programs']), "text"),
Anyone know how to modify the ADDT code with the implode function to get this to work?Have you tried ADDT´s "comma-separated checkboxes" form control, which will also store the values into a field of your choice (and of course retrieve them from there on update record - pages) ? The only possible drawback might be, that the checkboxes can´t be defined statically, means that the array of value/label - pairs will be retrieved from another table by establishing an additional recordset.
Cheers,
Günter -
How to merge many XML files into one?
Hi: I got a small project to combine many XML files into one and convert the combined XML file in Excel using AppleScript. My XML files look like this:
<?xml version="1.0" encoding="UTF-8"?>
<Metadataobject>
<from>[email protected]</from>
<jobname>B3_IM09MBDUF</jobname>
<pages>2</pages>
<priority>3</priority>
<timezone>CEST</timezone>
<year>2013</year>
<month>7</month>
<day>15</day>
<hour>11</hour>
</Metadataobject>
and like this...
<?xml version="1.0" encoding="UTF-8"?>
<Metadataobject>
<from>[email protected]</from>
<jobname>P1_FR1330G006007_Kate_van der Vaart</jobname>
<pages>2</pages>
<priority>1</priority>
<timezone>CEST</timezone>
<year>2013</year>
<month>7</month>
<day>12</day>
<hour>16</hour>
</Metadataobject>
I get many XML files like this. And I want them to be combined and shown like this:
<?xml version="1.0" encoding="UTF-8"?>
<Metadataobject>
<job id="1">
<from>[email protected]</from>
<jobname>B3_IM09MBDUF</jobname>
<pages>2</pages>
<priority>3</priority>
<timezone>CEST</timezone>
<year>2013</year>
<month>7</month>
<day>15</day>
<hour>11</hour>
</job>
<job id="1">
<from>[email protected]</from>
<jobname>P1_FR1330G006007_Kate_van der Vaart</jobname>
<pages>2</pages>
<priority>1</priority>
<timezone>CEST</timezone>
<year>2013</year>
<month>7</month>
<day>12</day>
<hour>16</hour>
</job>
</Metadataobject>
And finally the combined XML file converts in Excel sheet with column headings "Job ID", "From", "Job Name" and so on...
Or there is another best way to get the same result...
ThanksThat is just an intermediary state to get to the excel version. Actually I get many small XML files (as shown above) from client and I want them all combined in an excel sheet with common column headings... like this...
from
jobname
pages
priority
timezone
year
month
day
hour
id
[email protected]
B3_IM09MBDUF
2
3
CEST
2013
7
15
11
1
[email protected]
B3_IM09MBDUF
2
3
CEST
2013
7
15
11
2
Thanks for your response. -
SQL Query -How2bring multiple results into one field using Formatted Search
Hi Everyone
i am trying to bring in the results of the field dbo.Lot_ITEM.LOT using a formatted search into a row level using the following query:
SELECT dbo.LOT_ITEM.LOT
FROM dbo.DLN1 INNER JOIN dbo.LOT_ITEM ON dbo.DLN1.ItemCode = dbo.LOT_ITEM.ITEM
WHERE dbo.LOT_ITEM.ITEM=$[DLN1.ItemCode]
however the result of the dbo.Lot_ITEM.LOT field could be more then one value depending on how many lots are assigned for that item
(for example this query would be similar to assigning batch/serial numbers to an item being despatched - as you can choose multiple batches/serials depending on the quantities available and required and then move from the left to the right side of the selection window) if that makes sense!
is it possible to bring in the multiple results into one field? and how can i amend the above query to include this?
Thankyou in advance :o)
Edited by: Asma Bi on Apr 23, 2008 7:22 PM
Edited by: Asma Bi on Apr 23, 2008 7:24 PMHi Suda
Thanks for replying :o) but im not sure about the query?
just to simplify it (as the query im working with is to do with 3rd party addons) i have used the serial/batchs field instead and used standard demo database fields from SBO 2005 sp01:
SELECT dbo.ixvSerialNoFact.SRI1_IntrSerial
FROM dbo.DLN1 INNER JOIN
dbo.ixvSerialNoFact ON dbo.DLN1.DocEntry = dbo.ixvSerialNoFact.SRI1_BaseEntry
WHERE dbo.ixvSerialNoFact.ItemCode='g1000' and dbo.ixvSerialNoFact.SRI1_BaseEntry = '193'
The above brings me the relevant results but when i change it to be used in a formatted search:
SELECT dbo.ixvSerialNoFact.SRI1_IntrSerial
FROM dbo.DLN1 INNER JOIN
dbo.ixvSerialNoFact ON dbo.DLN1.DocEntry = dbo.ixvSerialNoFact.SRI1_BaseEntry
WHERE dbo.ixvSerialNoFact.ItemCode=$[dln1.itemcode] and dbo.ixvSerialNoFact.SRI1_BaseEntry = $[dln1.DocEntry]
i cant seem to get it to work - now this may be because the serial number is not allocated until teh record is added to the system, however when this happens i am unable to go back in and manually trigger the query as the delivery note rows cannot be selected!
i think as what im originally wanting an answer for is same as this example, im wanting to know if this is even possible?
Thanks
Edited by: Asma Bi on Apr 24, 2008 3:53 PM
Edited by: Asma Bi on Apr 24, 2008 3:55 PM -
BI for NW04S: Concatenating multiple chars into one field in BI query
Hi,
We have BI for NW04S. We have a requirement of concatenating multiple characteristics into one field in the BI report. This single field should have the usual drill down and other olap functionalities that a single characteristic usually enjoy in a BI report.
In BI for NW04 (Not the S) this probably can be done using the table interface in WAD. However in BI7 WAD functionality are through Java.
Also can this be done using Query designer alone.
Can anybody help?
ThanksHi,
Can you please elaborate on your Query designer option. You can always have a variable and in the user exit can write code, but what is not clear that
1> How will you acheive the contatenation done for every row of the report in the BEX user exit variable( since it's called during the beginning of the query execution and not for all rows of the report
2> How do you transfer the char variable into a char field in the report.
Please elaborate .
Thanks -
Which utility - to input XML objects into the Apps through an API
Hello.
We are just starting on XML Publisher in 11i10.2. We will need to automate the migration of saving templates into the apps through scripting so that new development can be migrated up our test environments and into production without human intervention.
Is anyone aware of where we can find information on utility to input XML objects into the Apps through an API?
Thank you.Hi all,
You can download this document from the following location as long as Tim doesnot publishes it as a Metalink note :-o).
The URL is:
http://yuvi.esmartdesign.com/index.htm
Navigate to the downloads section and check the XML Publisher section under it for the document.
This document shall be available for a limited amount of time :-o)
Hope this helps all.
Thx,
Nitin -
Putting 7 table fields into one field with line breakes included!
Hi People
I Need to assamble 7 fields from a view, into one field with some line brakes in Reports, how do I do that???
E.g :
Field names : Name, Collection1, StreetName, StreetNo, ExtraCity, ZipCode, City
Should be put into one field called address and be displayed like this
Name
Collection1
StreetName StreetNo
ExtraCity
ZipCode City
I hope someone can help me *S
/Stig :-)The following should give you some idea. It might depend if you run your report on Windows or Unix.
select
Name || decode(Name, null, null, chr(13)||chr(10))||
Collection1 || decode(Collection1, null, null, chr(13)||chr(10))||
StreetName || decode(StreetName, null, null, ' '||StreetNo||chr(13)||chr(10))||
ExtraCity || decode(ExtraCity, null, null, chr(13)||chr(10))||
ZipCode || decode(ZipCode, null, null, ' '||City )
from MyView -
XML Unbounded values into one field - Message Mapping
Dear All,
I am trying to convert an unbounded multifield XML structure to a 0.1 field so that the maltiple values are mapped into a single fields in semi-colon seperated fasion.
The source:
<MT_dates>
<date>05-10-2011</date>
<date>10-11-2011</date>
<date>10-12-2011</date>
<date>10-13-2011</date>
</MT_dates>
date field is 0.. unbounded
target
<MT_dates>
<dates>05,10,2011;10,11,2011;10,12,2011;10,13,2011</date>
</MT_dates>
dates field is 0 .. 1
can anybody please help?
Regards,
Haikchk this:
input will be : var1
execution type All values of a context
int a = var1.length;
String b="";
for(int i=0;i<a;i++)
b =b +var1<i> + ";";
int c=b.length();
String output =b.substring(0,c-1)
result.addValue(output);
date-UDF--dates
Maybe you are looking for
-
can i hook up a projector to my mac os x (version 10.6.8)? I am trying to project a 08 imovie to a large audience. If I can, what projector would I need? thank you!
-
Should i go ahead and play with my new 16 gig 3g or wait...
i got it saturday and its still nib. i didn't mess with it or even intend to use it till my contract with verizon was up. now all the hype and finally 3gs has a confirmed release date i have it safely tucked away in the box waiting for june 19th so i
-
iam trying to modify MEDRUCK for request for quotation printing. in the standard script i was trying to print all variables in one line . for dng that i have to condense variable . how can i condense variables ? i tried with by giving &variable(c)&.
-
CS5 - all products - I receive the following error when I try to open a program: Application Error: The Instructions at "0x00864a4a4d" referenced memory at "0x00000000". The memory could not be read. Click OK to terminate the program. Click Cancel t
-
Preselect an option in html:select
Hey, I am implementing struts in my application. How do i preselect an option in <html:select> tag here is what i am doing but the option does not get preselected.. the collection below returns A, B , C etc.. <html:select property="accountClass" name