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,
Deeps
Hi 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.
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 -
Help required in configuring counting rule
I have limited experience in SAP-HR configuration. Kindly help me quota configuration. The client has only absence type u2013 Earned Leave. The leave rule is the same for all the employees. The leave rules are:
1. The employees are credited with earned Leave on Jan 1 every year, for the attendance days put in during the previous calendar year.
2. The employee is eligible for Earned Leave only if he has attendance for at least 240 days during the previous year. If the employee has joined the company during the middle of the previous year, then he should have attendance for at least 2/3 of the remaining working days during the year.
3. The employee should be credited with 1 day EL for every 20 working days. If the employee, for example, has worked for 268 days during the year then he should be credited with 13 days EL (268/20=13, with 8 days as remainder). The remainder days, if any, should be carried forward to the next year and considered at that point as added to the number of working days. E.g. employee has worked for 268 days in year 2010. He will be credited with 13 days EL on 1 Jan 2011. Assume he has worked for 256 days in year 2011. Then while creating the absence quota for EL on 1 Jan 2012, the system should consider working days as 256 (from year 2011) + 8 (remainder from year 2010) = 264. Hence the employee should be credited with 13 days of EL on 1 Jan 2012 (264/20 = 13 days; 4 days remainder).
4. Leave carry forward rules: The employee is allowed to carry forward the EL balance to the next year. However, after carry forward the total balance should not go beyond 30 days. Any thing in excess of 30 days will get lapsed, if it is not encashed.
Kindly let me know how to configure the counting rule & the deduction rule for the above scenario.Hi
Configuring of EL need PCR Calculation and Standard Configuration with time Types
000010 D VARSTCURMO
000020 ** COLOP*
000030 04 D VARSTFDYPP
000040 04 N
000050 04 Y D HRS=0 HRS=FR11C HRS?300
000060 04 Y *
000070 04 Y < D HRS-300 HRS*-1 ADDDB9509 ADDDB9558 HRS?15
000080 04 Y < * Z HRS=0 HRS=M9500 GCY ZAC2
000090 04 Y < < Z GCY ZAC3
this when u go for GCY ZAC2
D HRS?10
D HRS/10 ROUNDH<60HHRS?CELACR
* D HRS-CELACRHRS?0
* * HRS*-1 ADDDB9501
* > HRS=0 ADDDB9500ZADDMB9500ZADDDB9501ZADDMB9501Z
> HRS=0 ADDDB9500ZADDMB9500ZADDDB9501ZADDMB9501Z
< HRS=0 HRS=CELACRADDDB9501 HRS=0 ADDDB9500ZNEXTR A
< A ADDMB9500Z
This when u click ZAC3
000010 D HRS=0 HRS=M9500 HRS?10
000020 * HRS/10 ROUNDH<60HADDDB9557 HRS-D9509 ADDDB9556 NEXTR A
000030 * A D HRS*-1 HRS?0
000040 * * COLOP*
000050 * > ADDDB9501 HRS=0 ADDDB9500ZADDMB9500ZADDDB9509ZNEXTR A
000060 * > A ADDMB9509Z
000070 < HRS=0 HRS=M9509 ADDDB9501 HRS=0 ADDDB9500ZNEXTR A
000080 < A ADDMB9500ZADDDB9509ZADDMB9509Z
This PCR is for EL with 300 Limit
Regards
Raja Sekhar -
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,
Rakhi1) 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 -
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. -
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 in File Adapter Module Development
Hi All,
I am working out a File to File scenario where my source file is in some different format. Please find the below sample:
<Root>
<ID>100</ID>
<NAME>SAP</NAME>
<END-Root>
Before taking this into IS, I need to change the file to a proper XML format. I need to replace "END-" with "/".
<?xml version="1.0" encoding="UTF-8" >
<Root>
<ID>100</ID>
<NAME>SAP</NAME>
</Root>
I think I can achive this by developing Adapter Modules. I am new to Adapter Module development.
Can you please tell me if there are any inbuilt Adapter Modules for this. If not please suggest me some relevant blogs to solve this issue. Thanks in Advance.Hi Phani Kumar
There are more than one ways to do this. As per your timelines and skill set you can decide
1. You can use the XMLAnonymizerBean this is an inbuilt module
Check Stefen's blog
Remove namespace prefix or change XML encoding with the XMLAnonymizerBean
2. You can read this complete file in a single field and then you can create XSLT or Java mapping to parse it in a target XML you desire.
Check these
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken](XSLT mapping)
Java Mapping (Part I) (Java Mapping)
The specified item was not found. (Java Mapping helper DOM)
The specified item was not found. (XML Node into string)
3. You can develop Adapter modules for this
Refer
Check Guides
XI 3.0
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a
PI 7.0
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e
PI 7.1
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00838345-708c-2a10-1199-9514c0b0a91c -
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 -
Is Multi Mapping will work with node function useAsMany with SP10 ?
Hi friends,
I am working some sample Multi Mapping scenario . My XI 3.0 SP is 10 .
I am getting the following error , while i am testing the Mapping with <b>useAsMany Node function </b> it is giving the Following Error
<b>
Cannot produce target element /ns0:Messages/ns0:Message1/ns1:MT_MSG_IB[2]/root/Element1. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd</b>
Will Multi Mapping work with this SP 10 ?
Best Regards.,
V.RangarajanHi ,
I have just taken the Model as the following link
/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi
I have designed the Objects as same as which is specified in that link . But my Service pack is 10.
It is showing the above specified error
Regards.,
V.Rangarajan -
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
Maybe you are looking for
-
What do i do if my home button is not working very well if at all on my ipod touch 4g
my home button has not been working very well if at all lately. it really buggs me because i have to use the little assistive touch thing, it gets kinda annoying after using that for awhile. now i know that you can take it off and replace it your sel
-
Data Services- The job server you selected is not working
Long Text: After logging in to the Data Services designer,when try to run a job it shows error -The job server you selected is not working Latest Software version -BODS 4.0 SP2 Reproduce Steps: 1. Double click on the Project from repository, it will
-
Firewire Target Disk mode confusion
Alright, so after 1.5yrs my PowerMac decides to crash...after spending time on phone with Apple support and internet, only option is complete reinstall. So I was told about Firewire Target Disk Mode and the ability to transfer all data from crashed c
-
Printing window causes exe to freeze
in windows xp pro only when running apps using v5.01 labview app builder ( on different system) when i want to print window, the app freezes after the printer is finished printing window, any idea why?
-
Firmware 2.1 update - Battery life
If for no other reason, I'm grateful my batter life is almost double, if not more, than what it was before. Thankyou guys...