on 05-31-2007 6:11 PM
Hi mates,
I've an optional node (occurrence 0..1) in my target structure under which there are mandatory elements (occurrence 1..1). I've a UDF which returns ResultList.SUPPRESS or "" (empty string) based on a condition mapped to this optional target node. UDF is behaving similar to std function 'createIf' but based on a condition..
when i look at the queue in data flow editor...I see the value 'SUPPRESS' for the target node queue...mapping for this is successful..but when I execute the whole mapping in the 'test' tab...mapping terminates with the error <i>'Cannot produce target element /ns0:Messages/ns0:Message1/ns1:MT_SFE_DATA. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd'</i>
I'm puzzled as why the runtime is complaining abt not producing an option field? Am I missing or doing something wrong here? When I disable the this target optional node in the mapping...the rest of the mapping is successful in the test tab...I appreciate ur help in resolving this...
thx
praveen
Hi mates,
I've found a work around for my problem...
My problem in brief..I get an error if I try to suppress an optional node/element using stad node function createIf or any simple UDF which returns ResultList.SUPPRESS
Work-around...I've an adv UDF which produces result queue. In case I need produce a node/element I add empty string ("") to the result queue. In case I need to suppress a node/element, I do nothing, instead of adding ResultList.SUPPRESS
Henrique...thanks & points for your hint...to use an adv UDF..
praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi;
Instead of making MT_SFE_DATA node as optional try to make the insert node optional and place the condition on that.
Mudit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mudit,
I tried suppressing the optional elements other than root node...still the same error...infact I tried the std node function 'createIf' in a simple 1-1 message mappign and it fails...I'm on SP17..I wonder if anyone is able to execute mappings with creatIf on SP17 successfully.
thanks for your inputs..
praveen
Hi Praveen
As this node is optional, if there is no source data coming then it will not generate this target node. Is this UDF really required ?
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
Can you tell how you did the mapping..
Did you do the mapping with node level or field level where the UDF is used?
Regards,
sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Henrique,
My scenario is this...for the field 'Business_unit' in source message I do a value lookup from another DB and get the look up vlaue 'MSA No'. For some reason, if I cant get MSA No for a Business_unit I need to mark it as error otherwise I need to update the entry into target system database.
In the best case, I'll find MSA No for all Business units in the source...then the message type for errors (MTSFE_ERRS) should not be created...to avoid creating a blank error report..
In the worst case, I'll not find MSA No for not even a single Business_unit, in that case message type for data (MT_SFE_DATA) should not be created.. to avoid attempt insert blank records..
I'm using this mapping in enhanced ID which dynamically produces the corresponding messages..
I guess the scenario is clear now...
Using the createIf for other elements than the root, its the same fate..it errors out..infact I tried the standard node function 'createIf' for an optional element..still it fails...I'm on SP17..I'm not sure if the problem is related to SP level...anyone able to execute mapping with 'createIf' on SP17 successfully?
thx for your time
praveen
In the process of analyzing the error, I tried using the standard createIf function and it gives the same error in 'test' tab and 'SUPPRESS' in the data flow editor queue.
why should all multi mappings be 0...unbounded occurrence? anyways...I tried with that as well...same error...it doesnt help
praveen
Praveen,
If its possible can you paste the source & target messages, it could be easier to analyze.
Best Regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Raj,
Here is my source msg structure
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_PSHR_DATA xmlns:ns1="http://xyz.com/pshr">
<row>
<EMPLID/>
<FIRST_NAME/>
<LAST_NAME/>
<MIDDLE_NAME/>
<BUSINESS_UNIT/>
<JOBCODE/>
<TITLE/>
<EMPL_STATUS/>
<JOB_ENTRY_DT/>
<ADDRESS1_2/>
<ADDRESS2_2/>
<CITY2/>
<STATE2/>
<POSTAL2/>
</row>
</ns1:MT_PSHR_DATA>
</ns0:Message1>
</ns0:Messages>
Target structure
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_SFE_DATA xmlns:ns1="http://xyz.com/pshr">
<Insert>
<SE_REPS action="INSERT">
<table/>
<access>
<REP_NO/>
<REP_NM/>
<ADDRESS_1/>
<ADDRESS_2/>
<CITY_NM/>
<STATE_CD/>
<POSTAL_CD/>
</access>
</SE_REPS>
<SE_REP_JOBS action="INSERT">
<table/>
<access>
<REP_NO/>
<FAC_IDU/>
<JOB_CD/>
<JOB_TITLE/>
<EMPL_STATUS/>
<EFFECTIVE_DT/>
</access>
</SE_REP_JOBS>
</Insert>
</ns1:MT_SFE_DATA>
</ns0:Message1>
<ns0:Message2>
<ns1:MT_SFE_ERRS xmlns:ns1="http://xyz.com/pshr">
<header>
<title/>
<row_count/>
</header>
<row>
<rep_no/>
<fac_idu/>
<error/>
</row>
</ns1:MT_SFE_ERRS>
</ns0:Message2>
</ns0:Messages>
This mapping is to be used in enhanced ID where it dynamically produces Msg types MT_SFE_DATA & MT_SFE_ERRS.
Mappign runtime errors out though the node MT_SFE_DATA is optional.
thanks
praveen
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.