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

getting syntax error in exception handling

Former Member
0 Likes
1,044

hi,

in my abap proxy in ecc 6.0, i write as follows..

data xref type ref to cx_root.

try.

.....

....

....

catch cx_root into xref

x_errmsg-msg_text = xref->get_text().

endtry.

x_errmsg is a structure in which msg_text is of type bapi_msg.

i get the following error during syntax check.

the format of field specification "xref->get_text()" is not supported. only field ...(...) is possible. e.g. KTNRA2(6).

what does this mean ?????

3 REPLIES 3
Read only

former_member195698
Active Contributor
0 Likes
688

As per the sample code given in the link...

http://help.sap.com/saphelp_nw70/helpdata/en/a9/b8eef8fe9411d4b2ee0050dadfb92b/content.htm

your code seems to be correct. The only thing that i could see different in your code could be

a) catch cx_root into xref ( Missing '.' in the end of the statement ) if that has been missed in the actual code also.

That might be the reason that your code is being interpretted in a wrong way.

Read only

0 Likes
688

Thanks abhishek. I had dot at the end of the line. THat was not the issue. Issue was a space was needed between ( and ) in get_text (). hope this info helps. thks

Read only

Former Member
688

resolved myself