2015 Sep 07 4:36 PM
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.
2015 Sep 08 5:25 AM
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.
2015 Sep 07 5:44 PM
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
2015 Sep 07 6:11 PM
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
2015 Sep 08 5:25 AM
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.
2015 Sep 08 11:15 AM
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.
2015 Sep 08 1:24 PM
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.
2015 Sep 08 2:52 PM
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
2015 Sep 08 3:48 PM
Dear Raymond,
simply analyzed the memory of the main transaction report
I will be thankful for kindly explaining how above can be done?
2015 Sep 08 3:56 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |