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

compare char40 field

Former Member
0 Likes
752

hey everybody

i want to compare the values about two char field, it has 40 length.

how can i do that?`

thx anujit marty

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
700

Hi:

Either you can use like field1 = field2

or use offset method, for details have a look

[Link|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb341a358411d1829f0000e829fbfe/content.htm]

Regards

Shashi

hey everybody

i want to compare the values about two char field, it has 40 length.

how can i do that?`

thx anujit marty

3 REPLIES 3
Read only

Former Member
0 Likes
701

Hi:

Either you can use like field1 = field2

or use offset method, for details have a look

[Link|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb341a358411d1829f0000e829fbfe/content.htm]

Regards

Shashi

Read only

Former Member
0 Likes
700

Try like this :

Data : Field1(40) type c value '1234567abcdefgh78965789'.

Data : Field2(10) type c value 'abcdefgh'.

Field1 = Field+7(8)

IF Field1 = Field2.

< your code >

Endif.

Read only

Former Member
0 Likes
700

Hi,

There are many relational operators to compare Char fields.

Some of them are CA (Contains Any), CO (Contains Only) etc.

If you want some more operators, go to Tcode:abapdocu->ABAP-By Theme->Controlling the Program Flow ->log_exp - Logical Expressions->log_exp - Relational operators->log_exp - Relational operators for character-type operands.

Revert back if any issues.

Lohitha