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

SAP ABAP Object ERROR

Former Member
0 Likes
724

HI

I GOT THESE TYPE OF ERROR IN THE EXCEPTION HANDLING IN THE CLASS BASED METHOD.,HERE I WRITE THE CODE

TRY.

CALL METHOD OL_OBJ->GET_DATA

EXPORTING

IM_VAL = 23

IM_VAL1 = 34.

CATCH ZCX_ERROR INTO LP_ZCX_ERROR.

IF NOT LP_ZCX_ERROR IS INITIAL.

RAISE EXCEPTION TYPE ZCX_ERROR

EXPORTING

TEXTID = IP_ZCX_ERROR->TEXTID

NODE_TYPE = IM_NODE_TYPE.

ENDIF.

ENDTRY.

I GOT THE THESE KIND OF ERROR

ERROR MESSAGE

Old and new exceptions cannot be used the same time.

YOU HAVE ANY IDEA

MEANS

REGARDS

GG

4 REPLIES 4
Read only

thomas_szcs
Active Contributor
0 Likes
548

Hi Guna,

I am afraid there's no workaround to this. Just decide for one type of exception declaration in your method GET_DATA or your current method depending on where this error is reported.

Kind regards,

Thomas

Read only

0 Likes
548

hi

i am calling the method inside another method.,

i want to raise the exception when it fails.,

so that i am using the TRy endtry block

Read only

0 Likes
548

Hi Guna,

The question is: Does the method called support class based exceptions? If not, you cannot catch them, but you should use old style exceptions.

Furthermore, the next question is if the current method already has old style or class based excpetions? If it has old style exceptions you cannot raise a class based one, but you need to raise a old style one.

Hope, this clarifies.

Kind regards,

Thomas

Read only

Former Member
0 Likes
548

Hi Guna,

i guess that the method OL_OBJ->GET_DATA has a EXCEPTION in the definition.

It's not allowed to match class-based-exception and the this old exception concept.

Hope I'm not wrong,

Stefan