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

string comparing with criterias

Former Member
0 Likes
733

Dear Abap Experts,

I am facing to the following problem.

When I compare those below shown strings, the check statement

is ok, while both strings are similar.

But sometimes the variable lv_kum-co_code can have

the value * (Asterisk) for all company codes. The check should retrieve OK also in such cases.

The string lv_kum-co_code can be * or a company code . Both situation may occur.

How can I achieve this requirement.

CHECK: lv_item-be_co_code CP lv_kum-co_code.

Kindly Regards

Marco

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
595

you can simply use

CHECK: lv_item-be_co_code CP lv_kum-co_code or lv_item-be_co_code = '*'.

Dear Abap Experts,

I am facing to the following problem.

When I compare those below shown strings, the check statement

is ok, while both strings are similar.

But sometimes the variable lv_kum-co_code can have

the value * (Asterisk) for all company codes. The check should retrieve OK also in such cases.

The string lv_kum-co_code can be * or a company code . Both situation may occur.

How can I achieve this requirement.

CHECK: lv_item-be_co_code CP lv_kum-co_code.

Kindly Regards

Marco

2 REPLIES 2
Read only

Former Member
0 Likes
596

you can simply use

CHECK: lv_item-be_co_code CP lv_kum-co_code or lv_item-be_co_code = '*'.

Read only

Former Member
0 Likes
595

Do CHECK only, when unequal to asterisk ...

if  lv_kum-co_code NE '*'.
  CHECK: lv_item-be_co_code CP lv_kum-co_code.
endif.

Regards,

Klaus