cancel
Showing results for 
Search instead for 
Did you mean: 

mapping supress

Former Member
0 Kudos

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,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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,

Former Member
0 Kudos

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

Answers (12)

Answers (12)

Former Member
0 Kudos

very thanks experts, the question have been solved,

Sarvesh as indicated, if function does it all, it is not necasario using the createif.

Former Member
0 Kudos

ok, i send you the image via mail , -> silvia.dzb gmail

thanks very much, silvia

Former Member
0 Kudos

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

SudhirT
Active Contributor
0 Kudos

Yes,

The concept is exactly as Sarvesh told. If your req. is to use CreateIF just check the mail.

Thanks!

Former Member
0 Kudos

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]

SudhirT
Active Contributor
0 Kudos

Hi Silvia,

I am not able to view the images you sent, Just tell me your mailID, I will explain the mapping and forward.

send to sudhirincgi at gmail.com

Thanks!

Edited by: sudhir tiwari on Nov 21, 2008 12:23 PM

Former Member
0 Kudos

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,

Former Member
0 Kudos

hi Sudhir,

still not created the node,

thanks,

SudhirT
Active Contributor
0 Kudos

Hi,

Where exactly you are stucking? and what are the errors you are getting.I have tried same mapping without any input value its creating node. Check in display queue of each step of mapping.

Thanks!

Former Member
0 Kudos

thank Sudhir , I just try and indicate what the node is not created

SudhirT
Active Contributor
0 Kudos

Hi,

I dint get you. Wasnt your node created? if yes then try like this

Use the same condition I provided Before passing value to CreateIF and after output of CREATEIF.It will definitly work.

Thanks!

Former Member
0 Kudos

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,

SudhirT
Active Contributor
0 Kudos

Hi Silvia,

Add one more step into your mapping, Just use Equals text function after output of CreateIF and compare it with Constant function with(No Value or blank value) then pass the output to IF condition.

Thanks!

Former Member
0 Kudos

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,

prateek
Active Contributor
0 Kudos

This will help

Regards,

Prateek

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

you need use Node funtions in message mapping to reslove this.

Better go through this Blog:

Regards

Upendra

Former Member
0 Kudos

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