on 11-14-2008 12:59 PM
hello experts,
I got the following scenario:
Node
@ id
@ description
for all the records in the input file should I check that @id exists in sap, so that
if there is -> the record is valid for the interface
does not exist -> this record should not be at the interface
I am using a UFD in this function check to see if the id exists or not.
The SAP R3 function give me a exception if the id don't exist, my questions are:
1 .- how to handle returned by the exception in my UFD R3 (my knowledge of java is very low)?
2 .- How to XI indicated that the register has given an exception should not be treated in my interface?
thanks very much,
very thanks experts,
need to use the createif, because if the condition is not met the node should not be created, while if there is, I must inform you with the result of a concatenation. Do not get the 2 things or all focus the matter differently
thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
IfWithoutElse function will do the job for you. Since you are already checking your condition in the if part of your function, so even if you remove the createif function it will take care of both conditions, I mean when your condtion is ture it will allow to create the node and when false then it will suppress it and will not allow to create the node.
Just do the testing, you will come to know..
Regards,
Sarvesh
very thanks experts, the question have been solved,
Sarvesh as indicated, if function does it all, it is not necasario using the createif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok, i send you the image via mail , -> silvia.dzb gmail
thanks very much, silvia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Remove createif and map equalS directly to ifWithoutElse function and it will work.
Reason: if your condition is true then creatif function returns EMPTY [ ] value, and you can not pass an [ ] value in ifWithoutElse function. This is the reason you are getting the error "can not caste to boolean".
Regards,
Sarvesh
sorry, the correct link are:
[[img]http://img529.imageshack.us/my.php?image=mappingmv5.jpg[/img]]
[img]http://img253.imageshack.us/my.php?image=mapping2dz7.jpg[/img]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks,
you can see the attachment, now, the error it's same before, cannot cast to boolean..
first is mapping, second is error,
[<a href="http://img583.imageshack.us/my.php?image=mappingnv8.jpg">[IMG]http://img583.imageshack.us/img583/7127/mappingnv8.th.jpg[/IMG]</a>]
[<a href="http://img211.imageshack.us/my.php?image=mapping2xk3.jpg">[IMG]http://img211.imageshack.us/img211/9229/mapping2xk3.th.jpg[/IMG]</a><a href="http://g.imageshack.us/thpix.php">[IMG]http://img211.imageshack.us/images/thpix.gif[/IMG]</a>]
thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Sudhir,
still not created the node,
thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank Sudhir , I just try and indicate what the node is not created
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks experts,
i'he solved the question but other problem occurs,
the solution is
id -> UFD -> createif -> node target
the problem is this node (target), if exist, it must have value. This value is the result of concat id and description separated by ;. I don't know how put this value because the target node
has already been allocated. It's possible assign two functions to one target node?
i've try the follow
id -> UFD -> createif -> if (then -> result of concat) -> node target
but the error 'cannot caps to boolean' occurs,
thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you very much at all!
the response that applies to point 2 of my question,
but I must call my UFD for checking whether there id in the sap, depending on whether the sap can not find the value, there is a runtime error, as it treated?
very thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Silvia,
In addition to experts suggestion I would like to add.... check if your target structuer is mandatory i.e. it it having 1:1 occurrence then you should pass some default value before mapping it to the UDF.
For this you can use the standard function "MapWithDefault".
@id -
> MapWithDefault -
> UDF -
> target
Also if target occurrence is 0..1 then you should use MapWithDefault function, so that your UDF will not throw any exception when @id does not exists.
So by this way, MapWithDefault will help in both the cases..
I hope this solves your problem.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Silvia
If i understand your requirement correctly you can achieve this using standard graphical mapping function itself
Do like this
@id -> exists ->createif -> target
This will check if id exists in source then only you get the target node else no target node will be created.
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Silvia,
According my understading, You need to create a certain node if some field exists. It is not necessary to create UDF in order to handle that, so You can try to use two functions : "exits" and "CreateIf". I give you a link for more information about Standard Functions into PI.
[http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm]
I hope this helps you.
Ivan
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 | |
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.