cancel
Showing results for 
Search instead for 
Did you mean: 

I need to add the logic for posting key,

former_member223435
Participant
0 Kudos

I need to add the logic for posting key, if posting key = 50 then amount is credit (add negative sign in amount field).

I creadted this scenario in mapping, We wanted to make sure that the negative sign was placed in the amount field if the posting key was = 50. So it seems we are good. We will just need to test.

How i can test this case?

Please do needful.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

use equals function to check the key and then use if then else and add negative before amount field and map it to output...for false condition pass amount as it is.

U can test it from test tab of message mapping.

chirag

former_member223435
Participant
0 Kudos

Hi chirag,

in that mapping Field1 is the posting key, and amount fileds are source fields using IF condition target field id Amount_Doccr.

So negative sign to amount is added in target filed Amount_doccr rite?

please suggest

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You need to use an IfElse node function in your mapping in which the input should be the posting key from the source structure.

You need to check in the IfElse statement whether the posting key=50, if it is true, then use concat node function to concat the negative sign("-") along with the original value to be passed to the amount field on the target side. Else, if the condition is false(i.e posting key!=50), then simply pass the value to the amount field as it is without adding the negative sign.

After the mapping is done, go to the test tab and then insert the values in the source fields and then execute from the lower left button showing start transformation. You need to test with the value of posting key=50 once and with the value not equal to 50 once.In the first case, the output amount field should have the negative sign, which should not be present in the second case.

You will find your target structure in the righter half of your screen. That's it mate

Thanks

Biswajit

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>>> How i can test this case?

Please use message mapping test tab and insert the values for the source fields and execute test using lower left icon which shows "start the transformation'. You will find result on the target side .

Use IF else arithmetic followed by concat to achieve your requirement. Concat is to append negative sign to the amount.

Edited by: Baskar Gopal on Feb 15, 2011 3:39 PM