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

runtime error

Former Member
0 Likes
593

Hello All,

DATA: regex TYPE REF TO cl_abap_regex,
      moff TYPE i,
      mlen TYPE i,
      text  TYPE        string.


CREATE OBJECT regex
  EXPORTING
    pattern      = 'f'
    simple_regex = 'X'.

cause an runtime error if no input field is populated.

Some times it is possible to keep the fields empty.

But anyway the programm should not dump.

How can I prevent that ?

Regards

sas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
567

Hi!

Try out CATCH command, it might help.

Regards

Tamá

4 REPLIES 4
Read only

Former Member
0 Likes
568

Hi!

Try out CATCH command, it might help.

Regards

Tamá

Read only

Former Member
0 Likes
567

You are right this shouldn't dump, what does the dump say?

Michael

Read only

Former Member
0 Likes
567

For the currect statement, only character-type fields and objects of the

type "CL_ABAP_REGEX" are allowed as search pattern. However, in this

particular cas, an object of the type "ã½°" was transferred.

This error could not be detected during the syntax check, because the

affected argument is typed with ANY.

Read only

0 Likes
567

Can you post more details of the dump, e.g exactly at what statement it dumped and what the values of the involved variables are?

Thanks,

Michael