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

Finding the program name and table name in debugger in user exit

sanjay_deshpande4
Participant
0 Likes
6,579

Hi All,

I am working on a user exit and want to access a table user exit not available in user exit.

For that I need to find a program and an internal table name(defined as global) and then access it using field symbol.

Am trying to do something as follows.

FIELD-SYMBOLS: <fs_xvbap> TYPE STANDARD TABLE OF vbapvb.

  ASSIGN '(SAPMV45A)XVBAP[])' TO <fs_xvbap>.    <<<<<<<<<<<<<<<<<--------------

  IF sy-subrc EQ 0.

   "Further logic to access data from <fs_xvbap>

  ENDIF.

However I don't  know how writer came to conclusion that SAPMV45A is the form/include/programme to be used.

Basically how he realized that we can access internal table using SAPMV45A and internal table name as well.

Any help in this regards will be helpful.Thanks in advance.

1 ACCEPTED SOLUTION
Read only

agnihotro_sinha2
Active Contributor
0 Likes
3,448

In the new Debugger, in DESKTOP 2 mode, you can get the previous programs which has called your current code... Basically the calling program details

Double click a program and you will get to the code.

Check the Internal tables of that program - stack program data.

Come back to your current program - Paste the variables you want to check in this format 

"(stack_prog_name)variable)"

If you want to call this variable/internal table , it should first show up in the debugger in your current code at this point.

Hi All,

I am working on a user exit and want to access a table user exit not available in user exit.

For that I need to find a program and an internal table name(defined as global) and then access it using field symbol.

Am trying to do something as follows.

FIELD-SYMBOLS: <fs_xvbap> TYPE STANDARD TABLE OF vbapvb.

  ASSIGN '(SAPMV45A)XVBAP[])' TO <fs_xvbap>.    <<<<<<<<<<<<<<<<<--------------

  IF sy-subrc EQ 0.

   "Further logic to access data from <fs_xvbap>

  ENDIF.

However I don't  know how writer came to conclusion that SAPMV45A is the form/include/programme to be used.

Basically how he realized that we can access internal table using SAPMV45A and internal table name as well.

Any help in this regards will be helpful.Thanks in advance.

8 REPLIES 8
Read only

MariaJooRocha
Contributor
0 Likes
3,448

Hi,

constants: c_prog(40) type c value 'RPCIIDP0)TAB_RESID_AMOUNTS'.

field-symbols: <fs> like t_tab_resid_amounts.

data: t1_tab_resid_amounts like t_tab_resid_amounts.

assign (c_prog) to <fs>.

t1_tab_resid_amounts = <fs>.

Hope this exemple helps.

Regards,

Maria João Rocha

Read only

former_member184158
Active Contributor
0 Likes
3,448

Hi,

when you want to assing a value to any abap program. This operation called "Dirty Assign".

So you can google about it and you can find many examples.

DATA ls_xvbap TYPE vbapvb.

FIELD-SYMBOLS <lt_XVBAP> TYPE ANY TABLE.

ASSIGN ('(SAPMV45A)XVBAP[]') TO <lt_xvbap>.


  IF sy-subrc EQ 0.

   "Further logic to access data from <fs_xvbap>

so , here , you can read the table :;

read table ls_xvbap   index 1.


or

loop at  <lt_XVBAP> into ls_xvbap.

endloop.

  ENDIF.

Regards

Ibrahim

Read only

agnihotro_sinha2
Active Contributor
0 Likes
3,449

In the new Debugger, in DESKTOP 2 mode, you can get the previous programs which has called your current code... Basically the calling program details

Double click a program and you will get to the code.

Check the Internal tables of that program - stack program data.

Come back to your current program - Paste the variables you want to check in this format 

"(stack_prog_name)variable)"

If you want to call this variable/internal table , it should first show up in the debugger in your current code at this point.

Read only

shadab_maldar
Active Participant
0 Likes
3,448

Hi,

For tables you can check in global tab and from system variables sy-repid - program name or

sy-cprog - calling program name you will get the program name.

Basically when we want any screen field data which is not available at runtime, we go for 'Dirty Assign' method.

Here the field name and program name will get from F1 help on that field.

Regards,

Shadab.

Read only

Former Member
0 Likes
3,448

You just have to debug from the very first statement(Use /h) that executes once you press any key in standard programs.

Constantly check stack programs and it's global variables from which you can get the data you need before reaching the user exit.

It requires lot of patience. Debug through every single step in standard code.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,448

Either the original writer debugged the report and analyzed the Abap stack, or simply analyzed the memory of the main transaction report, or he read the well known (help.sap.com) User Exits In Sales Document Processing which gave him name of includes available, those include are well documented and referenced in many threads/document in help/scn.sap.com

Regards,

Raymond

Read only

0 Likes
3,448

Dear Raymond,



simply analyzed the memory of the main transaction report

I will be thankful for kindly explaining how above can be done?

Read only

0 Likes
3,448

Search help.sap.com for keywords: The Memory Analysis tool

Regards,

Raymond