Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP Conditional syntax

hossain_rajib55
Participant
0 Likes
1,475

Hello Expert!!!

I have an internal table where having different department ,based on werks (Personnel area).Like i have werks = DBRS and want to use it like wa-werks = 'D%' , but don't get the result.Need your assist.

6 REPLIES 6
Read only

maheshpalavalli
Active Contributor
1,372

Hello Rajib Hossain

I think what you are looking for is Contains pattern CP. instead of "=" use "CP" and '*'

" where cond CP 'D*' ".

https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abenlogexp_strings.htm

Thanks,

Mahesh

Read only

0 Likes
1,372

Hello Mahesh !! Thanks for your link.

I write my condition like :

if wa_principal-werks = 'D*' and ( wa_principal-btrtl <> '*DS' and wa_principal-btrtl <>'*MS') and wa_principal-btrtl eq '*SP'.

Could you please write it using CP.

Read only

0 Likes
1,372

Rajib Hossain sorry my bad, I gave some incoorrect link. Now check the help link.

Just replace "=" with "CP". Check the help.

Br,

Mahesh

Read only

0 Likes
1,372

Hello Mahesh

insted of = use CP but insted of <> what i used.....

Read only

0 Likes
1,372
Rajib Hossain Just go through the help link that i pasted, it is there just below "CP", which is "NP". Thanks,Mahesh
Read only

0 Likes
1,372

NP is the same as NOT CP (choose the one you prefer, sometimes people don't remember all the operators, so using NOT is a good tip)