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

How to read Screen Stack

Former Member
0 Likes
3,948

Hi ABAP Gurus,

I have a requirement where i need to read Screen Stack.

The stack in debug mode is -

Debug 1.jpg

I need to get the highlighted value (transaction).

I tried FM 'SYSTEM_CALLSTACK' and it only gives ABAP stack details.

Debug 2.jpg

I need a way to read Screen Stack only.

Any guidance would be highly appreciated.

BR,

Ankit Maskara.

4 REPLIES 4
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,840

Take a look at class CL_TPDA_CONTROL, methods IF_TPDA_CONTROL~GET_DYNPRO_STACK.

Regards,

Raymond

Read only

0 Likes
1,840

Hi Raymond,

Thanks for bringing a viewpoint.

I have used below code -

DATA: zob1 TYPE REF TO cl_tpda_control.

  CREATE OBJECT: zob1.

*DATA INCL_EM_STACK TYPE FLAG.

  DATA stacktab      TYPE tpda_sys_dy_stacktab.

  TRY.

      CALL METHOD zob1->get_dynpro_stack

        EXPORTING

          incl_em_stack = ' '

        IMPORTING

          stacktab      = stacktab.

    CATCH cx_tpda_sys_dyn_spa .

    CATCH cx_tpda_sys_dyn_notyet .

    CATCH cx_tpda_sys_dyn_notcons .

    CATCH cx_tpda_sys_dyn_nody .

    CATCH cx_tpda_sys_dyn_nodata .

    CATCH cx_tpda_sys_comm .

    CATCH cx_tpda_sys_version .

    CATCH cx_tpda_sys_internal .

  ENDTRY.

But,

An exception (CX_TPDA_SYS_COMM_SLAVENOTCONN) occurred and stacktab[] is coming empty.

BR,

Ankit Maskara.

Read only

0 Likes
1,840

Hello Guys,

I could not find any working solution for this problem so i had to change the design.

BR,

Ankit Maskara.

Read only

Former Member
0 Likes
1,840

Hi Ankit,

I think you tried to read the original transaction in which SM30 was called.

You can achieve the same with below:

    DATA: sy_tcode TYPE sy-tcode.

    CALL 'GET_PARAM_TCOD' ID 'PTCOD' FIELD sy_tcode.

 

SY_TCODE is your YTV023(SM30)