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

search pattern

Former Member
0 Likes
485

Hi All,

I have to find nos of literals in a given code.How can i scan through the code and find out actual nos of literals used.

3 REPLIES 3
Read only

Former Member
0 Likes
466

All the literals are put in ' ' single quotes.

If you are using the new abap editor then they are shown in the colour green.

Regards,

Manish

Read only

Former Member
0 Likes
466

Hi,

declare a variable for that literal

data v_lit(10) type c value 'asgdfdhjkf'.

find the length of that string in which you have tosearch these literals.

v_length = STRLN ( String).

do v_length times.

if string CP(contains patters) or CS (contains String) v_lit.

count the occurances into a variable here.

endif.

enddo.

reward if useful

regards,

Anji

Read only

0 Likes
466

can u elaborate it more.

I have to count all literals in any given code.the length of string will vary.

Is it possible to use Search?