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

Modify Std. code to get value for User Exit.

Former Member
0 Likes
1,535

I am executing release strategry at user exit EXIT_SAPLEBND_002 ( Exit Name M06E0004 ), for the field ( USRN1)

This has got user program ZXM06U22 in it. In this exit I get values from I_CEKKO , IT_BEKPO, IT_BEKET, IT_EKKNU

and I have to pass the PO value from these structures to E_CEKKO-USRN1 ( This field has set in SPRO setting ) .

I get the PO value as per standard calculation in the field IT_BEKPO-EFFWR , I also get a value in I_CEKKO-GNETW. However not one of both these values satisfy any one of my conditions. My document condition is defined in SPRO as ZVPA and values against it is calculated considering Taxes On PO. The fields EFFWR or GNETW does not include taxes. And my release startegy should get executed after considering the amount with taxes.

After debugging a lot I have found that the PO_AMOUNT can be obtained from the Internal Table TKOMV. In this it is stored at TKOMV-KAWRT. I can get the TKOMV values at the point where this user-exit is called.

i.e. in program MM06EF0S_STRATEGIE_CEKKO in the last you can see the call to user exit wriiten as below

CALL FUNCTION 'EXIT_SAPLEBND_002'

EXPORTING

i_cekko = cekko

it_bekpo = pot[]

it_beket = ett[]

it_ekknu = knt[]

IMPORTING

e_cekko = cekko.

If I put the debugger on CALL FUNCTION 'EXIT_SAPLEBND_002 and go to TABLES tab and enter there 'TKOMV'

I can get the table and it's values. However If I press F5 then I go inside my exit code i.e. ZXM06U22. But Here I Don't Get access to the internal table TKOMV , which is accessible from main calling program MM06EF0S_STRATEGIE_CEKKO.

My job can be done if I get value from TKOMV inside the code of ZXM06U22. However to get that code in ZXM06U22 what right now I can do is to get the access key of MM06EF0S_STRATEGIE_CEKKO and write code before exit Call and pass the ZVPA from TKOMV there. However many people here advised me not to do that since it is a STANDARD CODE.

So I would like to know your suggestion in this regard.

Amol

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,151

Try this out...

DATA: l_name(50).
DATA: my_tkomv TYPE TABLE OF komv.
DATA: itabref.


TYPES:
      itabtype TYPE STANDARD TABLE OF komv WITH DEFAULT KEY.


FIELD-SYMBOLS:
      <tkomv> TYPE itabtype.

l_name = '(SAPMMM06E)TKOMV[]'.
ASSIGN (l_name) TO <tkomv>.
my_tkomv[] = <tkomv>.

8 REPLIES 8
Read only

FredericGirod
Active Contributor
0 Likes
1,151

Hi Amol

try this : (MM06EF0S_STRATEGIE_CEKKO)tkomv, that will give you the value of the TKOMV table in the program MM06EF0S_STRATEGIE_CEKKO (must be in memory)

Rgd

Frédéric

(made an error : (program_name)table_name)

Read only

Former Member
0 Likes
1,151

in the customer function add the following code


DATA: l_name(50).
data: my_tkomv type table of komv.

  FIELD-SYMBOLS: <tkomv> TYPE table of komv.

  l_name = '(SAPMMM06E)TKOMV[]'.

  ASSIGN (l_name) TO <tkomv>.

  my_tkomv[] = <tkomv>.

I didnt tried this with table yet, but it worked for me with workareas. Try entering (SAPMMM06E)TKOMV[] while debugging also.

Read only

Former Member
0 Likes
1,151

Hi All

Thanks for your quick replies. I wrote code below in my exit. But I am getting Compilation error at following line ( In Bold )

DATA: l_name(50).

DATA: my_tkomv TYPE TABLE OF komv.

<b>FIELD-SYMBOLS: <tkomv> type standard table of komv.</b>l_name = '(SAPMMM06E)TKOMV[]'.

ASSIGN (l_name) TO <tkomv>.

my_tkomv[] = <tkomv>.

The error is below

"," expected after "TABLE".

I don't know whether TYPE TABLE OF is correct or not.

I will be glad If I get some further help.

Amol

Read only

0 Likes
1,151

sorry, my fault. try:

DATA: l_name(50).

DATA: my_tkomv TYPE TABLE OF komv.

FIELD-SYMBOLS: <tkomv> type table.

l_name = '(SAPMMM06E)TKOMV[]'.

ASSIGN (l_name) TO <tkomv>.

my_tkomv[] = <tkomv>.

But dont forget to check also, that (SAPMMM06E)TKOMV[] is accessible via debugger right before customer function call. Just to be sure that the access to TKOMV will work.

Read only

Former Member
0 Likes
1,152

Try this out...

DATA: l_name(50).
DATA: my_tkomv TYPE TABLE OF komv.
DATA: itabref.


TYPES:
      itabtype TYPE STANDARD TABLE OF komv WITH DEFAULT KEY.


FIELD-SYMBOLS:
      <tkomv> TYPE itabtype.

l_name = '(SAPMMM06E)TKOMV[]'.
ASSIGN (l_name) TO <tkomv>.
my_tkomv[] = <tkomv>.

Read only

Former Member
0 Likes
1,151

Thanks Rene, Wenceslaus

It is working fine. This syntax was absolutely new for me.

Especially lines below were something that I have never used uptil now.

<b> l_name = '(SAPLMEPO)TKOMV[]'.

ASSIGN (l_name) TO <tkomv>.</b>

Read only

Former Member
0 Likes
1,151

I wrong to post

Message was edited by: Fabrizio Ballante

Message was edited by: Fabrizio Ballante

Read only

0 Likes
1,151

I did not get what you say FAB