cancel
Showing results for 
Search instead for 
Did you mean: 

IF condition in Standard Task description not working

vishesh_malik
Participant
0 Kudos

Hi Experts,

I have an issue with IF condition used in workflow task description.

I have to display a certain description to user only if one of the container element has some value. If that container element is blank then description should not appear to the user to achieve it I have used IF-ENDIF but it is not working, task is displaying entire task even if value of container element is blank. We have few other tasks in our system with IF conditions implemented which are working fine.

Please let me know what could be the possible reason for this.

Thanks,

Vishesh

Accepted Solutions (0)

Answers (4)

Answers (4)

vishesh_malik
Participant
0 Kudos

Hi All,

Thanks for your responses!

I have got the issues with the ABAP statement I used inside task.

  1. '&' was not concatenated with the variable that was used in IF condition. My Bad! I noticed it later.
  2. SPACE was used for comparison with variable which doesn't work with Standard task description commands. I replaced ' IF &VARIABLE& NE SPACE.' with 'IF &VARIABLE& NE ''. '   , now it is working fine.

While testing above part I did few tests with other values as well and found in workflow standard task description few parameters does not work. Below are my findings :

  1. IS INITIAL or IS NOT INITIAL  does not work. For e.g,  IF &TEST& IS INITIAL won't work.
  2. Comparison with ABAP_TRUE , ABAP_FALSE , SPACE does not work. For e.g., IF &TEST& EQ ABAP_TRUE is incorrect, instead we should use &TEST& EQ 'X'  .
  3. Logical operators ( OR , AND ) does not work. If we use logical operators, only first condition is checked rest all are ignored.


I have concluded above points based on results of tests I performed. If I mistook anything, please feel free to correct me. Also, if anyone knows/finds a link where we could read about all such possibilities and incompatibilities then please share.

Thanks,

Vishesh

Message was edited by: Vishesh Malik

Former Member
0 Kudos

do not manually put & for container elements. Instead insert them from EXPRESSION link in task description editor. it will insert &

Former Member
0 Kudos

Hi Vishesh,

I think you are putting your condition in IF as &CON_ELEM& = ' ' OR &CON_ELEM& = ABAP_FALSE.

This will not work.

Instead create one additional container element of same type as that of container element which you want to compare in task container tab. This container will always be blank and it will be just used for comparison in IF statement. this way it works. i have used in this way in my workflows.

Thanks,

Ibrahim

vishesh_malik
Participant
0 Kudos

Hi Ibrahim,

First of all thanks a lot , I noticed missing &s in my code only after your reply .

Also, you have mentioned that &CON_ELEM& = ' ' won't work , it actually works. If you meant use of Logical operator(OR , AND) won't work then you are right and I misunderstood. I replied just to make sure that you are also aware of this, just in case you are not.

Cheers,

Vishesh

vishesh_malik
Participant
0 Kudos

Hi Ibrahim,

First of all thanks a lot , I noticed missing &s in my code only after your reply .

Also, you have mentioned that &CON_ELEM& = ' ' won't work , it actually works. If you meant use of Logical operator(OR , AND) won't work then you are right and I misunderstood. I replied just to make sure that you are also aware of this, just in case you are not.

Cheers,

Vishesh

former_member185167
Active Contributor
0 Kudos

Hello,

Show us the code and we'll be able to tell you the answer.

regards

Rick Bakker

Pyc
Participant
0 Kudos

G'day Vishesh,

Is the variable you're checking a simple character field? If not you might want to try using one.

Have fun,

Mark