on 11-04-2005 2:09 PM
Hi,
is it possible to decide in order to my incoming value if a IDOC segment should be created or not? Because I'm getting scared of trying that
Or is this just possible using Java functions?
Thanks for any help?
Matt
you can use the node function <b>exists</b> with a <b>ifwithoutelse</b> condition.
regards
Shravan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Firstly - Thanks for your quick response...
I use Message Mapping (not XLST), and yes I like to decide from incoming value if or if not to create segment.
for example I get to rows in source message (once with jes once with no):
sourcevalue = jes--> if yes --> segement
sourcevalue = no --> if yes --> NO segement
like this... at the moment I try it that way:
field --> RemoveContext --> SplitByValue(value change) --> segement
This works if I need to create just one IDOC - if I get more datasets he always create all of this (special) segements in the first IDOC...
I don't understand that :-(((((((
THANKS
Matt
Hi Matthias,
using equals and ifwithoutelse you can decied wheather to create a target segment or not.
1. use equals function and pass your source value as one of the inputs to equals function a constant 'jes' as the second input.
2. Pass the output of equals function as a input to ifwithoutelse function.The second input for your ifwithoutelse will be your source value itself.
Your target segment will be created only if the sourcevalue is 'jes'.
Refer this link for more information...
http://help.sap.com/saphelp_nw04/helpdata/en/5d/db0e83e8e74202a5bff527055ab7e5/content.htm
Regards
Anand
HI Matthias,
"This works if I need to create just one IDOC - if I get more datasets he always create all of this (special) segements in the first IDOC... "
Can u elaborate on this ??
If you are mapping with source as Flat XML and Target as deeply nested Idoc structure , then it is very diffcult with Message Mapping. So it is better to go either XSLT or Java Mapping.
Regards,
Moorthy
Hello Moorthy,
thanks for your response! I try to elaborate it:
I have an source like this:
row(1)
- key
- field1
- field..n
row(2)
- key
- field1
- field...n
and so on...
for every change of field KEY I create an IDOC. So If I have just one key (1 key could be in more than one row)
my target looks like this:
IDOC(1)
- Headersegmet
- Segement1
- Segement2(should be the special segment)
- Segement..n
In case of more than 1 key my target looks like this:
IDOC(1)
- Headersegmet
- Segement1
- Segement2(should be the special segment)of IDOC 1
- Segement2(should be the special segment)of IDOC 2
- Segement2(should be the special segment)of IDOC 3
- Segement..n
IDOC(2)
- Headersegmet
- Segement1
- Segement..n
IDOC(3)
- Headersegmet
- Segement1
- Segement..n
all the other segements are correctly in each IDOC - just my special one (with correct data inside) is allways in the first one - scared!!
By the way - where can I find a good tutorial or blog how to use java as mapping programm?
THX
Matt
qMoorthy: I could also provide you some screen shots...
and my XLST (generated by XI) looks like this:
/ACC_DOCUMENT02/IDOC/E1BPACKEC9=SplitByValue(removeContexts(ifWithoutElse(FixValues(/p2:MT_SQL_QUERY_response/StmName_response/row/BEP_ZEILE_KZ=), /p2:MT_SQL_QUERY_response/StmName_response/row/HGB__BK_KEYi=)))=SplitByValue(removeContexts(ifWithoutElse(FixValues(/p2:MT_SQL_QUERY_response/StmName_response/row/BEP_ZEILE_KZ=), /p2:MT_SQL_QUERY_response/StmName_response/row/HGB__BK_KEYi=)))
Message was edited by: Matthias Boettger
Message was edited by: Matthias Boettger
Hi Matthias
Help on your second part, i.e blogs on java mapping,
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
/people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping
cheers
Sameer
Hi,
I am struggling with this same issue.Using exists and ifwithoutelse will only solve this issue, if the target has a min occurs of "0".
In my case the min occurs is "1", so ifwithoutelse wouldnot create the target node if the condition is not satisfied and my mapping is not activated without correcting this.
So I am forced to use ifwithelse, in which case what value should I pass in the else?
A Space? if I pass a space, it is rewriting the old values with a space in the next iteration.
Hope I made it clear.Please help me with this issue.
Thanks
JD
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct me if I get your question wrong..
Did u mean to use incoming value to decide whether the IDOC segment needs to be created..?
If so, offcourse it can be done , for example in the XSLT mapping we can just check the incoming value using a <xsl:if test=<<Test Condition>>> before creating the IDOC segment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.