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

display content of any variable (especially CX_ROOT subclass instance)

Sandra_Rossi
Active Contributor
0 Likes
1,293

Hello,

Do you know any FM or method to display the content of any variable? (elementary, deep structure, instance, ...) I can't know its type, except that it's an instance that is a subclass of CX_ROOT.

In fact, this question is related directly to my workflow question : when a class-based exception occurs, I serialize it into an XML string, and I'd like to display it on request (via business object methods) so that to help technicians. Of course, I know how to display any XML, but I'd prefer to use a specialized API.

Hope it's clear!

Thx

sandra

Hello,

Do you know any FM or method to display the content of any variable? (elementary, deep structure, instance, ...) I can't know its type, except that it's an instance that is a subclass of CX_ROOT.

In fact, this question is related directly to my workflow question : when a class-based exception occurs, I serialize it into an XML string, and I'd like to display it on request (via business object methods) so that to help technicians. Of course, I know how to display any XML, but I'd prefer to use a specialized API.

Hope it's clear!

Thx

sandra

2 REPLIES 2
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
923

Hi Sandra,

I am not sure if this helps. But even if you are not aware of the subclass you can cast it (rather narrow cast) to the super class which in this case is CX_ROOT.

BR,

Suhas

Read only

0 Likes
923

Hello Suhas,

handling/catching exceptions is not the issue. Here is an example what happens: one of the possible exceptions is CX_SWF_RUN_WIM_DEF_FAILED.

I know I can get the short exception text (and the long text if it exists), but it often doesn't give many details. For example:

Exception CX_SWF_RUN_WIM_DEF_FAILED survenue (programme : CL_SWF_RUN_WIM_FACTORY========CP, include : CL_SWF_RUN_WIM_FACTORY========CM004, ligne : 239)

I'd like to display its attributes, which could be (debugger view):


CX_ROOT	                              
          CX_ROOT	16AA9A3937A9BB56E10000000A11447B
          TEXTID	16AA9A3937A9BB56E10000000A11447B
          PREVIOUS	{O:23*\CLASS=CX_SWF_RUN_WIM_DEF_READ_FAILED}
          KERNEL_ERRID	
          INTERNAL_SOURCE_POS	Structure: flat & not charlike
CX_STATIC_CHECK
CX_SWF_IFS_EXCEPTION	                              
          TIMESTAMP	0.0000000
          TIMEZONE	                              
          T100_MSG	WL    820E000000000003   WS90000001
          LOG_CONTEXT	Structure: deep
          EXCP_TAB	Standard Table[0x1(8)]
CX_SWF_RUN_WIM	                              
          WI_ID	                     000000000003
          RETURN	Structure: flat & not charlike
          LOG_HANDLE	{O:25*\CLASS=CL_SWF_RUN_WIM_LOG}
          OBJECT_PRP	Structure: flat & charlike
CX_SWF_RUN_WIM_DEF_FAILED

They are very interesting because we see the true error message WL820 for example, which means: Work item 000000000003: Task WS90000001 cannot be read.

Of course, there are many exception classes, it's why it should be dynamic.