cancel
Showing results for 
Search instead for 
Did you mean: 

Udf from fixed values

former_member452321
Participant
0 Kudos

I need help for the following logic from fixed values
.Nothing comes from source. Only I need to check E1EDK01.BSART =EC

Fixed values

key    values
0      standard
1     (1)general terms and conditions ....
2      (2)TestTestTestTestTestTestTestTest
like this up to entries

16                 (16)Test1Test1Test1Test1Test1Test1
default%          error

Target
Notes 
ID     0.1
Text   1..1

Logic
If E1EDK01.BSART =EC  then

(do ((i 0 (+ i 1))) ((>= i 17))
        constant ST >notes.id
       concatenate all values from fixed values to Notes.Text

Thanks or your help

Accepted Solutions (0)

Answers (1)

Answers (1)

Harish
Active Contributor
0 Kudos

Hi Mahesh,

Try the below code in UDF after fix map and when you have E1EDK01.BSART =EC

String result;

for(int i=0;i<17;i++)

{

result = result+input[i];

}

return result;

Regards,

Harish

former_member452321
Participant
0 Kudos

Thanks Mahesh for the quick help. What input should I give before fixed values. Screen shot attached

Harish
Active Contributor
0 Kudos

Hi Mahesh,

you need to put fix value after the if statment.

And the input to fix value should be you key of fix value. If you are not getting the key from source and want to use numbers (0,1,2...) then use the index function.

Regards,

Harish

former_member452321
Participant
0 Kudos

I am not getting any input field from source . Could you pl help with index function without getting any input from source .For index also requires inputs

former_member184720
Active Contributor
0 Kudos

Curious to know - if there is no input value then what is the purpose of having fixed value lookup?

U can pass the entire string to target field directly right?

i mean concat all the values into a string and just check if BSART=EC then pass the string..

former_member452321
Participant
0 Kudos

How to caoncanetate. they have all these values in a file with format as i put in the fixed values. I need to concatenat all these as it is . The flle format is

1  (1) some terms and conditions 

2  (2)some terms and conditions

so i thought i can put in fixed values and concatenate . Is there any other way I can concatenat all these .

2

former_member184720
Active Contributor
0 Kudos

you can simply create a constant with all these values right?

create a constant and in the value just paste the values one after the other...attached screenshot

former_member452321
Participant
0 Kudos

That I have already idea. I was looking for  any udf instead of adding all the 16 constatns and concatening . Thanks for your time and help

Harish
Active Contributor
0 Kudos

you can use any input field which is reapeting that many times.

I would suggest to use constant for this as you do not need to validate the source and you can put all the constant (16 constant) concated in one constant.

Regards,

Harish

former_member184720
Active Contributor
0 Kudos

when these values are not coming from source.. there is no way that u can achieve it/creating a constant is the simplest way..

*P.S inorder to pass it to a UDF you still need a constant

former_member452321
Participant
0 Kudos

This is way I am doing. How can I do 16 constants concatenate to one constant . Pl help .coudl you send one screen shot

Harish
Active Contributor
0 Kudos

Hi Mahesh,

If you need only concat value after the condition E1EDK01.BSART =EC, then just take all your values (values in fix value map) and put in one constant. No need to concat or req. value mapping.

you can just pass one constand (concated all values) to the output.

Regards,

Harish

former_member452321
Participant
0 Kudos

Thanks . Is there any limitation on constant. I am getting the system error after adding all these vlaues in one constatant

Harish
Active Contributor
0 Kudos

Hi Mahesh,

How many char are you having in the constant?

Regards,

Harish

former_member452321
Participant
0 Kudos

There are 9108 chars. But now it is working fine . Thanks Harish.