cancel
Showing results for 
Search instead for 
Did you mean: 

Condition..?

Former Member
0 Kudos

Hello All,

I am working idoc to file scenario.

my source field name kunnr, Target field name CustomerNumber. If Kunner Value either of KD,VC,VE,VF,VI,VJ,VB. then onely map soure field kunnr to target field CustomerNumber. Can any one please suggest me how will i write condtion.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

For this simply use the " FixValues " standard function (you can find this under Conversions ).

In FixValues define all your KD,VC,VE,VF,VI,VJ,VB as key and give 1 for all under value. e.g.

>

>KD -


1

>VC -


1

>VE -


1

>VF -


1

>VI -


1

>VJ -


1

>VB -


1

>

Now use the below metnioned functions in your mapping.

1. if

2. Equals

3. Constant (value 1)

now mapp like this

KUNNR ---> FixValues -


> Equals (in lower input box map constant) -


> if -


> Then -


> KUNNR -


> CustomerNumber.

Regards,

Sarvesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Aamir

Can you tell me how can i write userdefined function for this one. Can you explain step by step.

Thanks

Venkat

Former Member
0 Kudos

HI,

In Mapping,

1. Select Create new UDF from left bottom most corner icon

2. it will open one pop-up window give the name and description for UDF, then Input parameter as A ie.e for KUNNR on source side

3. Select Cache parameter Check box as "Value"

3. Click ok to open the Java editor where you will add the below code as it is. Copy paste below code

if(A == "KD" || A== "VC" || A== "VE" || A== "VF" || A== "VI" || A== "VJ" || A== "VB")

return(A);

else;

return();

4. Save and close the window.

5. Now in Mapping API list one User defined catergory is available similar to Text, Boolean, arithmetic etc.

6. Map as below

kunnr ---> TestUDF -


> CustomerNo

This will resolve the purpose

Thanks

Swarup

Edited by: Swarup Sawant on Jun 11, 2008 12:53 AM

Former Member
0 Kudos

Hey

You can do this either via UDF or through nested If-Else.KD,VC,VE,VF,VI,VJ,VB

If (Kunnr=KD or Kunnr=VC or Kunnr=VE or Kunnr=VF or Kunnr=VI or Kunnr=VJ or Kunnr=VB)->customerNumber

Thanx

Aamir

Former Member
0 Kudos

Hi,

You can use simple if else logic to apply this kind of logic with graphical mapping

Source Field Name

kunnr --> If (equals "KD" ) then -->CustomerNumber

..............else (again another IF condition (Equals "VC"))

This way you need to apply internal if conditions and any one of the condition is true then the source field will map with target field

Thanks

Swarup

Former Member
0 Kudos

Hi Swarup

Can i use if conditon in Boolean functions or need to write userdefined function.

Thanks&Regards,

Venkat

Former Member
0 Kudos

Venkat,

Use if else condition in boolean.

Regards,

---Satish

Former Member
0 Kudos

Hi,

You can either use the UDF with java code or can go for if else. with boolean.

Because with udf also you will using same logic as

for e.g.

Kunnr --> A

CustomerNo --> B

if(A == "KV")

return(A);

elseif(A== "KD")

return(A);

..

.....

...

and so on..

Use Bollean fraphical function as its already available.

thanks

Swarup