cancel
Showing results for 
Search instead for 
Did you mean: 

RE: UDF to remove/skip BLANKS in Display Queue

Former Member
0 Kudos

Hello! Gurus

I am trying to skip blanks in a display queue - for which I do have logic which checks length > 1 and if then else and block/skip the balnks form being passed.

However, it is becoming too cumbersome - as I have additional logic and a lot of fields.

Hence, in order to keep it clean I would like to use a UDF Function which will ignore the MSG's which are blank.

Thank you so much for your help!!

Thank you,

Ritu

Accepted Solutions (1)

Accepted Solutions (1)

praveen_sutra
Active Contributor
0 Kudos

hi ritu,

PFB hope this solves your issue.

http://scn.sap.com/docs/DOC-45503

thanks and regards,

Praveen T

Former Member
0 Kudos

Thank you ALL for your quick responses!! - I am going to try them out and update you on whichever works the best in my scenario!!

Thanks again,

Ritu

Former Member
0 Kudos

Hi! Guys

The below UDF is working for my reqiurement - however there is an additional logic which I have realized needs to be added.

I am leveraging the below UDF provided by Haressh Gampa.

Now, it is removing the BLANKS as needed - However, there are some VALID blanks which were eliminated.

Logic to identify valid blanks - there are Field # 1, Field # 2, Field # 3 & Field # 4 :-

1.Remove BLANKS in all fields.

2.However, if Field1 in not having a blank value and Field # 4 is BLANK - then this is a valid BLANK and should pass AS IS like a BLANK.

I hope I am clear ... Please, let me know if we can handle this outside of the UDF provided by Hareesh - before or after identifying the VALID BLANKS based on Field # 1 being NOT NULL.

Your help is greatly appreciated!!

Thank you,

Ritu

P.S: Will try to send some screenshot of mocked up example ...

........ Currently using the below UDF to eliminate BLANKS ....

for(int i=0;i<var1.length;i++)

{

if(!(var1[i].equals("")))

{

result.addValue(var1[i]);

}

}

........ This UDF is working fine except for identifying the VALID blanks based on the Field # 1 being NOT NULL ....

former_member184720
Active Contributor
0 Kudos

Hi Ritu - Concat field1 and field4 with a delimiter string ":" and pass it to the below UDF and see if that is what you were expecting..

for(int i=0;i<var1.length;i++)

{

if(!(var1[i].equals(":")))

{

result.addValue(var1[i].substring(var1[i].indexOf(":")+1));

}

}

Former Member
0 Kudos


Thank you!! Hareesh - Your solution worked!!

Thank you,

Ritu

Answers (2)

Answers (2)

Harish
Active Contributor
0 Kudos

Hi Ritu,

You can achieve this with standard function.

Source --> Map with default (blank) = Constant (blank) --> Not --> If without else --> map the source with target

you will get the source to target without blank.

regards,

Harish

former_member184720
Active Contributor
0 Kudos

for(int i=0;i<var1.length;i++)

{

if(!(var1[i].equals(""))

{

result.addValue(var1[i]);

}

}

var1 is your input field..