Complex Mapping :-Help Required
Hi All,
I have a scenario XI--IDoc.
Sender structure is having one field as Description which will carry some informatiom.I have to read the Summary Field and if I get XAA1:686,XAA2:767 or XAA3:876 like this inside this inside this field than I have substring and take those value individually than we have to map it accordingly.
You can consider all these value will come separated by ,(comma) and based of the sbustring we have to map it.
Thanks,
Rakhi
1) Pattern p = Pattern.compile("\\b([X][A-Z]{2}[0-9][:][0-9]{3})\\b");
we made a regular expression here and compiled it and then we make a object of class Matcher to match this compiled regex with our string
Matcher m = p.matcher(str);
//then we traverse through the results given to us my this matcher in an array form that is a array constituted by the different values that match this regex.....we traverse this array (m.find()) until this condition is true.....
then we add the result into the display queue.
while (m.find())
String s = m.group(1);
result.addValue(s);
(\\b is actually \b to include this \(escape character) i had used two \\
this is the real regex
\b([X][A-Z]{2}[0-9][:][0-9]{3})\b
\b means a seprator between words it can be anything tab or whitespace or new line
() we use these brackets to mark a word or a unit here this XAA8:456 is a unit so we put the reg ex for this inside braces
[X] single value mentioned means that it searches for only the single X character
the very next [A-Z]{2} means that it searches for any character in range A-Z and this rule searches for combination of two letters that follow this rule it means that it searches for two characters together following this i.e adjacent like DF, GY if you think that you want to further drill down your pattern and you will always have AA you can replace this [A-Z]{2} by [A]{2} so it searches for XAA
now the next thing should be a digit so we have 0-9 if you dont specify {3} or any number in curly braces it assumes that you are searching for a single character
then [0-9]{3} digits in the end.....
use this site if you want to learn regex you can test your regex here
http://regexr.com/#
working on your next req
Similar Messages
-
XSLT mapping Help Required.
XSLT mapping Help Required.
Hi Experts,
I am New to XSLT Mapping. I am practising the below Example:
InputXML File:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
<ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
<Person>
<FirstName>Anshul</FirstName>
<LastName>Chowdhary</LastName>
<Gender>Male</Gender>
<Address>
<Street>2nd Main</Street>
<Houseno>83/b</Houseno>
<City>Mysore</City>
</Address> </Person>
</ns0:MT_XSLT_Source>
XSL StyleSheet File:
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/Gen"
Xmlns:ns1=”http://XYZ.com/Test”>
<xsl:template match="/">
<ns1:MT_XSLT_Target>
<Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
<Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
</Name>
<Street> <xsl:value-of select="concat(concat(ns0:Mt_XSLT_Source/Person/Address/Houseno,' '),
ns0:Mt_XSLT_Source/Person/Address/Street)"/> </Street>
<City> <xsl:value-of select="ns0:Mt_XSLT_Source/Person/Address/City"/> </City>
</ns1:MT_XSLT_Target>
</xsl:template>
</xsl:stylesheet>
The Desired Output shuold be:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT_XSLT_Target xmlns:ns1="http://XYZ.com/Test">
<Title>Male</Title>
<Name>Anshul Chowdhary</Name>
<Street>83/b 2nd Main</Street>
<City>Mysore</City>
</ns1:MT_XSLT_Target>
I have refered the xsl in xml and i am getting the below Oupt in a Single line like this:
Anshul Chowdhary Male 2nd Main 83/b Mysore
I am Unable to display in Target XML Fomrat as shown above. Please check and do the needful.
Regards,
GIRIDHARHi,
I have used below for testing.
Input xml:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
<ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
<Person>
<FirstName>Anshul</FirstName>
<LastName>Chowdhary</LastName>
<Gender>Male</Gender>
<Address>
<Street>2nd Main</Street>
<Houseno>83/b</Houseno>
<City>Mysore</City>
</Address> </Person>
</ns0:MT_XSLT_Source>
xsl code:
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/gen"
xmlns:ns1="http://XYZ.com/Test">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<ns1:MT_XSLT_Target>
<Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
<Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
</Name>
<Street> <xsl:value-of select="concat(concat(/ns0:MT_XSLT_Source/Person/Address/Houseno,' '),
/ns0:MT_XSLT_Source/Person/Address/Street)"/> </Street>
<City> <xsl:value-of select="/ns0:MT_XSLT_Source/Person/Address/City"/> </City>
</ns1:MT_XSLT_Target>
</xsl:template>
</xsl:stylesheet>
For testing in PI ,change the extension from .txt to .xsl and zip it and upload into PI as an imported archive .
Regards
Venkat -
Child to Parent Node Creation, Mapping Help required
Hi Guys,
I need some suggestions on the following mapping problem, kindly suggest some solution if possible:
I have a sender structure as:
ParentNode
..........RecordSet (0 to 1)
................ SValue1 (0 to 1)
................ SValue2 (0 to 1)
.................SValue3 (0 to 1)
For the receiver Structure I have following:
ParentNode
..........RSet (0 to unbounded)
............. RValue (0 to 1)
..............RField (0 to 1)
Now my mapping conditions requires for every SValue1, SValue2, SValue3 source fields, I should generate at receiver side a new RSet and the value of SValue1/SValue2/SValue3 field(s) should be Provided into RValue, and RField should have the respective field name.
I am trying this with PI Graphical mapping, is there any better solution for it?Hi,
As source structure occurence is 0..1 in this case duplicate the target structure and use create if function with source as SValue1 ...so that for each of Svalues...a corresponding target node will get generated...
With graphical mapping you should be able to do this...else need to go for UDF...
HTH
Rajesh -
Scenario mapping - help required
Scenario:
A Customer sends a material (for e.g., SUGARCANE) to the company (SAP Implementing). It processes it and send back as SUGAR.
The customer is charged for the services rendered.
The stock of sugarcane/sugar should be visible in the system.
Please guide me how to map this scenario.
I will be very much grateful.
Regards,
AnbuThis sales process is referred as Job Work in SAP.
Refer following SDN thread that can be helpful to you in understanding / reference:
- Sales Process of JOB WORK
If in case you have any concern or doubt about the process, do revert back.
But don't forget to put a effort search more information on JOB WORK for reference/understanding. So that you can specific to your requirement.
Regards
JP -
Dear Experts,
We are working in PI 7.1 Source and target structure are like:
Node1
F1
F2
F3
F4
Node2
F1
F2
F3
F4
Node2
F1
F2
F3
F4
The requirement like if F2's value is X then we have to pass only that field of that Node in the target side and if F2 is '0' then all the fields would be passed. Target structure is same as source.
Please advise how can I achieve this.
Regards,
KamiHi Kami,
refer the mapping concept wiki
Mapping Concepts in SAP XI - Process Integration - SCN Wiki
regards,
Harish -
Mapping help required - extension
Hi,
I 've done the mapping based on the below conditions
Let say 3 fields called : a,b,c
if a = RAM then
b = b/c
here b field is in one segment and a & c fields are in child segment of above segment.
Note : all the above fields occurance : 0 to 1
But, i need to display the target including with the above condition also i need the value of the field "b" should display at target side where the condition doesn't satisfy .. ie., a # RAM.
Here i 've tried with if then else condition...but that doesn't work.
Please help me out how can i get the output.
Thanks in advance for your help
Regards,
Y.RajHi Yeshwant,
IF you have the source structure as:
segment
--b
---subsegment
a
c
then you may need these changes in Raj's mapping image
b-----------------------------------|
c (context changed to parent of c)--| useoneasmany -- divide
c ----------------------------------|
b-----------------------------------|
c (context changed to parent of c)--| useoneasmany -- else
c ----------------------------------|
Regards
Suraj -
Mapping Help required for ORDER Idoc to EDI file
Hi
My source strcture is as follows
E1EDP01
E1EDP01
E1EDPT1 (TDID=0001)
E1EDPT2
TDLINE = abcd
E1EDPT1 (TDID=0001)
E1EDPT2
TDLINE = XYZ
and my target line item is mapped with TDLINE(Context E1EDP01)-exist then createif LineItem(This is working fine but item filed is failing)
The logic to populate itemFIELD1 is if E1EDT1(TDID==0001) then pass TDLINE to ItemFIELD1, how to map this
(Sometimes E1EDPT2 populate multiple times for one E1EDPT1)>and my target line item is mapped with TDLINE(Context E1EDP01)-exist then createif LineItem(This is working fine but item filed is failing)
Why don't you create the LineItems only when TDID = 0001 because this will ensure to populate item fields with correct value.
The mapping logic to produce the LineItems should be like this..
IF (TDID = 0001) THEN (TDLINE set context to E1EDPT1)---RemoveContext---LineItem.
>The logic to populate itemFIELD1 is if E1EDT1(TDID==0001) then pass TDLINE to ItemFIELD1, how to map this
In this mapping make sure the context of TDLINE is set to E1EDPT1 and then use RemoveContext ---SplitByValue to the output of "IF" function. e.g.
IF (TDID = 0001) THEN (TDLINE set context to E1EDPT1)---RemoveContext---SplitByValue---FIELD1. -
Mapping Help required in Node count
Hi Friends,
i need to count the number of occurences of source node. i'm able to count the occurences.
but i have some problem with this node. Source node happens only some times.
Source node.
<Event>
type- attribute
<Date>20092509</Date>
</Event>
Sometimes Event tag comes as </Event> without any type value then i need to pass " 0 " value.
Cases :
1. if empty Event tag happens then need to Pass "0"
2. <Event>
type
<Date></Date> in this case also need to pass 0.
3. <Event>
type "Order"
<Date>20092509</Date>
</Event>
<Event>
type "Delivery"
<Date>20092509</Date>
</Event>
in this case need to pass node count as "2"
please suggest me on this;
Regards,
DeepsHi sandeep,
Map like this..
Date--\
then
Date---->NotEquals---->if -----\
Constant[]/ \
else \
Constant[0]/ \
then
Date----->Exisists---->if-------- ----->Output
else
Constant[0]/
I tested this...
Working Fine...
Thanks. -
XI IDoc complex mapping problem - help needed!
Hi all,
I am mapping WPUBON IDoc (sent as IDoc XML file) to WPUBON IDoc in R/3. However, I have a complex mapping requirement that I am trying to use the graphical tool for.
Source segment structure is such that we have:
E1WPB01 (header) has one or many E1WPB02 (items) and E1WPB05 (coupons).
E1WPB02 (items) have one or many E1WPB03 (item conditions).
So for each IDoc, we can have many items (E1WPB02), each item can have many conditions (E1WPB03) and each IDoc can have many coupons (E1WPB05).
For each E1WPB05 received, we need to take the value and divide it proportionately in order to add an extra E1WPB03 discount condition segment to each E1WPB02 item (we are a retailer and this will allow us to break down customer coupon discounts across each item in the basket). For example, if we have 2 E1WPB02 items with values $2 and $3 and the coupon is worth $1, item 1 needs a new E1WPB03 segment with a value of $0.40 and item 2 needs one with a value of $0.60.
This process needs to occur for each E1WPB05 segment (customers could have more than one coupon). No E1WPB05 segments are required in the target IDoc.
I have tried a few things but really am a bit stuck on where to start.... any ideas anyone?
Thankyou.
Stuart RichardsStefan,
Here's some sample source XML:
<?xml version="1.0" encoding="UTF-8"?>
<WPUBON01>
<IDOC>
<EDI_DC40>
<TABNAM>EDI_DC40</TABNAM>
<MANDT>104</MANDT>
<DOCNUM/>
<DOCREL>620</DOCREL>
<DIRECT>2</DIRECT>
<IDOCTYP>WPUBON01</IDOCTYP>
<MESTYP>WPUBON</MESTYP>
<MESCOD>ST6</MESCOD>
<SNDPOR>WPUX</SNDPOR>
<SNDPRT>KU</SNDPRT>
<SNDPRN>0799</SNDPRN>
<RCVPOR>SAPRD1</RCVPOR>
<RCVPRT>KU</RCVPRT>
<RCVPRN>0799</RCVPRN>
<REFINT>00000000000016</REFINT>
</EDI_DC40>
<E1WPB01 SEGMENT="1">
<POSKREIS>0001</POSKREIS>
<KASSID>1</KASSID>
<VORGDATUM>20060107</VORGDATUM>
<VORGZEIT>134512</VORGZEIT>
<BONNUMMER>120572</BONNUMMER>
<KASSIERER>4400</KASSIERER>
<CSHNAME> </CSHNAME>
<BELEGWAERS>GBP</BELEGWAERS>
<E1WPB02 SEGMENT="2">
<VORGANGART/>
<QUALARTNR>ARTN</QUALARTNR>
<ARTNR>000005034394436881</ARTNR>
<VORZEICHEN>-</VORZEICHEN>
<MENGE>1</MENGE>
<REFBONNR> </REFBONNR>
<E1WPB03 SEGMENT="3">
<VORZEICHEN/>
<KONDITION>PN10</KONDITION>
<KONDVALUE>10.00</KONDVALUE>
<CONDID/>
<QUALCONDID/>
</E1WPB03>
</E1WPB02>
<E1WPB02 SEGMENT="5">
<VORGANGART/>
<QUALARTNR>ARTN</QUALARTNR>
<ARTNR>000005034394471158</ARTNR>
<VORZEICHEN>-</VORZEICHEN>
<MENGE>1</MENGE>
<REFBONNR> </REFBONNR>
<E1WPB03 SEGMENT="6">
<VORZEICHEN/>
<KONDITION>PN10</KONDITION>
<KONDVALUE>20.00</KONDVALUE>
<CONDID/>
<QUALCONDID/>
</E1WPB03>
</E1WPB02>
<E1WPB02 SEGMENT="8">
<VORGANGART/>
<QUALARTNR>ARTN</QUALARTNR>
<ARTNR>000005034394469131</ARTNR>
<VORZEICHEN>-</VORZEICHEN>
<MENGE>1</MENGE>
<REFBONNR> </REFBONNR>
<E1WPB03 SEGMENT="9">
<VORZEICHEN/>
<KONDITION>PN10</KONDITION>
<KONDVALUE>30.00</KONDVALUE>
<CONDID/>
<QUALCONDID/>
</E1WPB03>
</E1WPB02>
<E1WPB05 SEGMENT="11">
<VORZEICHEN>+</VORZEICHEN>
<RABATTART>PTCS</RABATTART>
<RABVALUE>6.00</RABVALUE>
</E1WPB05>
<E1WPB06 SEGMENT="11">
<VORZEICHEN>+</VORZEICHEN>
<ZAHLART>PTCS</ZAHLART>
<SUMME>10.00</SUMME>
<KARTENNR/>
<ZUONR>120572</ZUONR>
</E1WPB06>
</E1WPB01>
</IDOC>
</WPUBON01>
So we have one coupon worth $6.00. We have 3 items in the basket worth $10, $20 and $30 respectively. The additional E1WPB03 for each will need to contain $1, $2 and $3 respectively to give:
<?xml version="1.0" encoding="UTF-8"?>
<WPUBON01>
<IDOC>
<EDI_DC40>
<TABNAM>EDI_DC40</TABNAM>
<MANDT>104</MANDT>
<DOCNUM/>
<DOCREL>620</DOCREL>
<DIRECT>2</DIRECT>
<IDOCTYP>WPUBON01</IDOCTYP>
<MESTYP>WPUBON</MESTYP>
<MESCOD>ST6</MESCOD>
<SNDPOR>WPUX</SNDPOR>
<SNDPRT>KU</SNDPRT>
<SNDPRN>0799</SNDPRN>
<RCVPOR>SAPRD1</RCVPOR>
<RCVPRT>KU</RCVPRT>
<RCVPRN>0799</RCVPRN>
<REFINT>00000000000016</REFINT>
</EDI_DC40>
<E1WPB01 SEGMENT="1">
<POSKREIS>0001</POSKREIS>
<KASSID>1</KASSID>
<VORGDATUM>20060107</VORGDATUM>
<VORGZEIT>134512</VORGZEIT>
<BONNUMMER>120572</BONNUMMER>
<KASSIERER>4400</KASSIERER>
<CSHNAME> </CSHNAME>
<BELEGWAERS>GBP</BELEGWAERS>
<E1WPB02 SEGMENT="2">
<VORGANGART/>
<QUALARTNR>ARTN</QUALARTNR>
<ARTNR>000005034394436881</ARTNR>
<VORZEICHEN>-</VORZEICHEN>
<MENGE>1</MENGE>
<REFBONNR> </REFBONNR>
<E1WPB03 SEGMENT="3">
<VORZEICHEN/>
<KONDITION>PN10</KONDITION>
<KONDVALUE>10.00</KONDVALUE>
<CONDID/>
<QUALCONDID/>
</E1WPB03>
<b> <E1WPB03 SEGMENT="9">
<VORZEICHEN/>
<KONDITION>PN10</KONDITION>
<KONDVALUE>1.00</KONDVALUE>
<CONDID/>
<QUALCONDID/>
</E1WPB03></b>
</E1WPB02>
<E1WPB02 SEGMENT="5">
<VORGANGART/>
<QUALARTNR>ARTN</QUALARTNR>
<ARTNR>000005034394471158</ARTNR>
<VORZEICHEN>-</VORZEICHEN>
<MENGE>1</MENGE>
<REFBONNR> </REFBONNR>
<E1WPB03 SEGMENT="6">
<VORZEICHEN/>
<KONDITION>PN10</KONDITION>
<KONDVALUE>20.00</KONDVALUE>
<CONDID/>
<QUALCONDID/>
</E1WPB03>
<b> <E1WPB03 SEGMENT="9">
<VORZEICHEN/>
<KONDITION>PN10</KONDITION>
<KONDVALUE>2.00</KONDVALUE>
<CONDID/>
<QUALCONDID/>
</E1WPB03></b>
</E1WPB02>
<E1WPB02 SEGMENT="8">
<VORGANGART/>
<QUALARTNR>ARTN</QUALARTNR>
<ARTNR>000005034394469131</ARTNR>
<VORZEICHEN>-</VORZEICHEN>
<MENGE>1</MENGE>
<REFBONNR> </REFBONNR>
<E1WPB03 SEGMENT="9">
<VORZEICHEN/>
<KONDITION>PN10</KONDITION>
<KONDVALUE>30.00</KONDVALUE>
<CONDID/>
<QUALCONDID/>
</E1WPB03>
<b> <E1WPB03 SEGMENT="9">
<VORZEICHEN/>
<KONDITION>PN10</KONDITION>
<KONDVALUE>3.00</KONDVALUE>
<CONDID/>
<QUALCONDID/>
</E1WPB03></b>
</E1WPB02>
<E1WPB06 SEGMENT="11">
<VORZEICHEN>+</VORZEICHEN>
<ZAHLART>PTCS</ZAHLART>
<SUMME>10.00</SUMME>
<KARTENNR/>
<ZUONR>120572</ZUONR>
</E1WPB06>
</E1WPB01>
</IDOC>
</WPUBON01>
The 3 new segments required are highlighted in bold. Note that coupon segment can be repeating but is not required in the target message.
Cheers -
Inbound Delivery Idoc- Create ... help required
Hi,
I'm using DELVRY01 idoc to create deliveries. when i execute using test tool, the idoc gets created with error status 51 with following errors:
Field EXIDV empty
Message no. VL243
Diagnosis
A required field in the intermediate document (IDoc) is not filled. This is the field EXIDV in segment 000042.
Field VHILM empty
Message no. VL243
Diagnosis
A required field in the intermediate document (IDoc) is not filled. This is the field VHILM in segment 000039
But these errors reflect to handling unit from segment E1EDL37 and its sub nodes which are really NOT required in my case.
Now confused if i'm using a wrong reference of creating inbound delivery. Pls shre some thoughts on it on troubleshooting this issue.Hi Prabhu
these two fields are mandatory .. fill below details
E1EDL37-Handling unit header
EXIDV <XXXXXXXXXXXXX> External Handling Unit Identification
GWEIT <LB> Weight Unit Tare
BRGEW <000XX> Total Weight of Handling Unit
VHILM <Dummy Packing Material> Packaging Materials
E1EDL44-IDoc: Handling Unit Item (Delivery)
VBELN <Delivery nO> Sales and Distribution Document Number
POSNR <900004> Item number of the SD document
EXIDV <XXXXXXXXXXXXX> External Handling Unit Identification
VEMNG <00001> Base Quantity Packed in the Handling Unit Item
Dont forget to create Dummy packing material no...
i think above mapping helps you...
Thanks
Ramesh -
Help required on Execution of Surveys through E-mail Campaigns
Dear all,
Our Client wants to execute the Customer Satisfaction Survey through an E-mail Campaign and wants to receive the customer feedback to evaluate the customer response.
I have the following concerns to map this requirement in SAP CRM
1. as per some SAP documentation we have to create an URL link for our Survey, here how can we insert this link in to an E-mail? Should we need to create a personalized E-mail form to insert this link?
2. Upon customer clicks on this URL link, and enters the feedback form, how the responses are getting back to CRM server and where the Questions and answers are storing in SAP?
3. What configuration do we need to do in SAP CRM to achieve this requirement?
4. How can we evaluate the Customer answers and responses without integrating BIW system?
5. What standard reports available in SAP CRM to evaluate the customer response based on ratings given to the each answer?
6. How to track whether customer review the mail or not, in case if customer doesn't want to give the feedback?
I believe that, in SAP CRM a standard solution and reports will be available to address this requirement. I request you to help me in resolving the problem.
it would be helpful if you can refere andy step by step configuration manual for this requirement.
Your suggestions and help will be highly appreciated.
Thank you
Raghu ramThere are quite a few threads with these questions answered in this forum:
SAP CRM: Marketing -
Mapping Help for replacing source value
Mapping Help for replacing source value
Posted: Mar 14, 2006 1:06 AM Reply
Hi all,
I am unable to do transform the source value to required target value,
From Source ADDRESS_TYPE = 'HOME' should be replaced with 03 to target field ANSSA, and 'MAIL' to be replaced with 05, I am trying to do it but i am unable to handle it, please give u r valuable suggestions,
The source structure is like this,
- <Event ID="239" TRANS_TYPE="ADR">
<PersAddr GEO_LOC_CD="US" EMPLID="29" ADDRESS_TYPE="HOME" EFFDT="02/15/2006" ADDRESS1="92nd Floor" ADDRESS2="812backstreet" ADDRESS3="" ADDRESS4="" CITY="London" COUNTY="" STATE="AN" POSTAL="EC2N 4AG1" COUNTRY="GBR" KEY1="29" KEY2="HOME" KEY3="02/10/2006" />
<PersAddr GEO_LOC_CD="US" EMPLID="29" ADDRESS_TYPE="MAIL" EFFDT="02/15/2006" ADDRESS1="92nd Floor" ADDRESS2="812backstreet" ADDRESS3="" ADDRESS4="" CITY="London" COUNTY="" STATE="AN" POSTAL="EC2N 4AG1" COUNTRY="GBR" KEY1="29" KEY2="MAIL" KEY3="02/10/2006" />
</Event>
REGARDS,
sridharHi,
This can be done using user-defined function as well.
Code the function as...
if(Addr_Type.equals("HOME"))
return "03";
else if(Addr_Type.equals("MAIL"))
return "05";
else
return "Invalid Address Type";
Here, Addr_Type is Input String Argument for this function.
Map this function between ADDRESS_TYPE and ANSSA.
Regards,
Uma -
Complex mapping with deep structure
Hi all,
I need to create a complex mapping as follows:
Source message:
CreateOrder (0..1)
-sell-order (0..1)
--items-sell-order (0..1)
---items-sell-request (0..unbounded)
sell-discount (0..1)
sell-discount (0..unbounded)
discount-id (0..1)
discount-quantity (0..1)
description (0..1)
Target message:
MT_xxxx
-ORDER_V3 (0..1)
--TDESC (0..1)
---item (0..unbounded)
ITEM_NUMBER (0..1)
discount (0..unbounded)
REASON (0..1)
VALUE (0..1)
DESCRIPTION (0..1)
--TPLUGIN (0..1)
---item (0..unbounded)
ITEM_NUMBER (0..1)
discount (0..unbounded)
ID (0..1)
QUANTITY (0..1)
The mapping has some rules:
If sell-order - items-sell-order - items-sell-request - sell-discount - sell-discount - discount-id .length > 0 then the structure TPLUGIN must be filled
else
the structure TDESC must be filled
The problem is: the field ITEM_NUMBER is an index that is unique and must increment each record of node items-sell-request, and it is not mandatory an item to have discounts.
When I test with n items and all items with discount node, it works perfect. However, if I put for example 10 items in the source array, and for example the records 5 and 6 doesn't have discounts, the association item x discount makes the mapping get lost and mess all the target nodes.
Could anyone help me?
Thanks in advance.
Ricardo.Hi Luis,
An example for source message could be something like:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:CreateOrder>
<ns0:sell-order>
<ns1:items-sell-order>
<ns1:items-sell-request>
<ns1:sell-discount>
<ns1:sell-discount>
<ns1:discount-id>1</ns1:discount-id>
<ns1:discount-quantity>10</ns1:discount-quantity>
<ns1:description>Description1</ns1:description>
</ns1:sell-discount>
<ns1:sell-discount>
<ns1:discount-id>2</ns1:discount-id>
<ns1:discount-quantity>20</ns1:discount-quantity>
<ns1:description>Description2</ns1:description>
</ns1:sell-discount>
</ns1:sell-discount>
</ns1:items-sell-request>
<ns1:items-sell-request>
*other fields not mentioned here, without sell-discount node*
</ns1:items-sell-request>
<ns1:items-sell-request>
<ns1:sell-discount>
<ns1:sell-discount>
<ns1:discount-id>A</ns1:discount-id>
<ns1:discount-quantity>50</ns1:discount-quantity>
<ns1:description>DescriptionA</ns1:description>
</ns1:sell-discount>
<ns1:sell-discount>
<ns1:discount-id>B</ns1:discount-id>
<ns1:discount-quantity>100</ns1:discount-quantity>
<ns1:description>DescriptionB</ns1:description>
</ns1:sell-discount>
<ns1:sell-discount>
<ns1:discount-id>C</ns1:discount-id>
<ns1:discount-quantity>200</ns1:discount-quantity>
<ns1:description>DescriptionC</ns1:description>
</ns1:sell-discount>
</ns1:sell-discount>
</ns1:items-sell-request>
<ns1:items-sell-request>
<ns1:sell-discount>
<ns1:sell-discount>
<ns1:discount-id>I</ns1:discount-id>
<ns1:discount-quantity>400</ns1:discount-quantity>
<ns1:description>DescriptionI</ns1:description>
</ns1:sell-discount>
<ns1:sell-discount>
<ns1:discount-id>II</ns1:discount-id>
<ns1:discount-quantity>500</ns1:discount-quantity>
<ns1:description>DescriptionII</ns1:description>
</ns1:sell-discount>
</ns1:sell-discount>
</ns1:items-sell-request>
</ns1:items-sell-order>
</ns0:sell-order>
</ns0:CreateOrder>
And an example for target message related to this source is:
<?xml version="1.0" encoding="UTF-8"?>
<ns2:MT_xxxx">
<ORDER_V3>
<TDESC>
<item>
<ITEM_NUMBER>4</ITEM_NUMBER>
<discount>
<REASON>I</REASON>
<VALUE>400</VALUE>
<DESCRIPTION>DescriptionI</DESCRIPTION>
</discount>
</item>
</TDESC>
<TPLUGIN>
<item>
<ITEM_NUMBER>1</ITEM_NUMBER>
<discount>
<ID>1</ID>
<QUANTITY>10</QUANTITY>
</discount>
<discount>
<ID>2</ID>
<QUANTITY>20</QUANTITY>
</discount>
</item>
<item>
<ITEM_NUMBER>3</ITEM_NUMBER>
<discount>
<ID>A</ID>
<QUANTITY>50</QUANTITY>
</discount>
<discount>
<ID>B</ID>
<QUANTITY>100</QUANTITY>
</discount>
<discount>
<ID>C</ID>
<QUANTITY>200</QUANTITY>
</discount>
</item>
</TPLUGIN>
</ORDER_V3>
</ns2:MT_GerarOrdVd_req>
Edited by: Ricardo Guedes on Oct 20, 2011 3:03 AM -
Need Mapping Help: Generate index if value comes
Hi Experts,
I need mapping help to generate index if value comes form source. we have 4 fields in item level of source and target side we have to pass the these filed values and sequence number.
below given the structures:
Source: Target:
Item Item
A1 Text
A2 Seq_No
A3
A4
my requirement is if A1 filed values comes from source we should pass to text and pass seq_no to constant-1, same as A2,A3 and A4 filed values also we should pass to text and seq_no for A2 is 2 and A3 is 3 and A4 is 4. suppose if A1 value is not coming from source we should pass seq_no for A2 is 1. if A1 and A3 filed values are not coming from source then we should pass seq_no for A2 and A3 are 1 and 2.
can you please help me how to achieve this. appreciate for your support.
Regards,
Sanjay.Hi Sanjay,
you can try this mapping
1. Generate the target 4 ITEM's by duplicating the subtree as shown below 3 times.
Now create the each target item starting from first by mapping them to A1,A2,A3 and A4 respectively. I have shown the first ITEM mapping above. similarly you can map A2 to ITEM[1],
A3 to ITEM[2] and A4 to ITEM[3].
2. Now you can map the A* fields to Text one to one as shown below
Please repeat the same for A2,A3 and A4 to respective Text fields.
3.
First seq_no field as shown
and similarly others as shown
Regards
Anupam -
KPI Reports in BI - Help required
Hi,
I am having a requirement - KPI Report needs to show KPI target values. These data are neither stored in any transactional documents (such as Notification or Work Order) nor in any additional fields that can be used via customizing. This data is coming from Legacy system only which require lot of conditions & customizations to arrive in to final KPI target values.
Can you please help me to anser to following questions?
1. Is there any possibility to map this requirement with Business Content in BI? (I believe No)
2. What is the best possible solution to implement this scenario - I mean first load this Legacy data in to ECC side tables and extract the same using Generic Extractor OR Load the data in to BI system and utilize for reporting?
Thanks!
Best regards,
Venkata ChalapathiYes, it takes bit more time for calculations.
For that only BW system is there. for complicated calculations. Do calculations or derivation at extraction level(from ODS to cube) then at reporting side.
Or if you are planning to do at R/3 side again it takes same amount of time. Main drawback is we dont have any control on data calculations. For any adjustment we need to depend on source side. for any change also. Very tidious process to control.
So i suggest, avoid R/3, load directly to BW and do calculations, so we have complete access and control over it.
Srini
Maybe you are looking for
-
i dont know how i got my photos to my ipod touch from my pc and now i wanna delete them but couldn't. so need help. please let me know.
-
How to use spirit:componentGenerators with Vivado?
Hi, I'm trying to use <spirit:componentGenerators> with Vivado, but aren't very successful at it. Unfortunately I don't have any other IP-XACT DE nor any existing core that uses it as reference. This makes it rather hard to get started.. As a simple
-
Session State Protection Confusion!
Hello all, I'm looking into SSP, and find it very confusing; there are so many ways to implement it, and I'm just not sure which I should choose. I basically want to stop people tampering with the URL to change the values of variables and the like. I
-
Input/output error when performing CP
When I try to.. cp /mnt/cdrom/<filename>.gz /home/<directory>/<filename>.gz from a mounted CD to a directory in /home/ (on a differing partition), I receive an input/output error and the file isn't copied as a result (while logged in as root). I'm br
-
hi guru's in internal table how i can delete 3 ,15 ,21(index) in the table help me plz.