Link to display Cost accounting document via KE23N and skip first screen

I’m looking for an easy way to link to KE23N. It doesn’t seem to follow the usual “set parameter id … call transaction and skip first screen”, so I’m debugging the link from KE24 which goes like this:

data: ind type i.
data: dli_dialog(40) value 'RKE_KE23_1010'.
data: dli_dialog_n(40) value 'RKE_KE23N'.
data: begin of ep_tab2 occurs 1.
include structure ce01010.
data: end of ep_tab2.
ind = 2 which is the line I clicked on
export ep_tab from ep_tab2 to memory id 'KE23N'.

call dialog dli_dialog_n and skip first screen
exporting index_ep from ind
g_erkrs from rkb1x-erkrs
importing index_ep to ind.

So, we would need to fill the internal table of ep_tab2 prior to doing the call.

Accessing fields in a user exit

This is one of the most useful and dangerous tricks I’ve learned in the ABAP
world.

It is particularly useful when a user exit doesn’t provide enough parameters
to let you make intelligent business decisions.

What you do is create a field symbol to point to the variable you need, and
then specify the calling program name like this:

FIELD-SYMBOLS: <svbap> LIKE svbap.
ASSIGN (‘(SAPMV45A)svbap’) TO <svbap>.
<svbap>-tabix = svbap-tabix.

For example, this code says to access the SVBAP structure in calling program
SAPMV45A.  From there, I can modify the global variables.

Use this responsibly and don’t do anything stupid!  If SAP isn’t giving you
access to values, there is probably a reason so look for other alternatives
and use this with caution.  Make sure that you are providing secure SAP consulting solutions for your users while supporting your ABAP manager’s need for standards.