Application Development 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: 

Autorization of release and derelease in ME29N in release strategy tab.

former_member288488
Participant
0 Kudos

Hello Experts,

I have a requirement where the authorization has to be given to a list of user maintained in my ztable for RELEASE CODE (T16FS-FRGCO = 01).

For rest of the release codes in release strategy it should work as the standard process. if the processor in release stategy tab and sy-uname are same then the system should allow to relase or derealse the PO and save it.

But for RELEASE C ODE 01 i'm maintaing the ztable and checking that if user name maintained in my ztable and sy-uname are same then system should allow to realse, derelase and save the PO.

I'm writing my code in EXIT_SAPMM06E_006 -- Include ZXM06U36 for this check but it is not working for me.

Please let me know the EXIT or the correct way of doing it.

Thanks,

Naveen

11 REPLIES 11

Former Member
0 Kudos

Hi Jai,

Try this exist:

Enhancement M06B0002 EXIT_SAPLEBND_001 ZXM06U13 Changes to comm. structure for purchase requisition release

Sample code:


*Check the authorization.
* This is to set the  e_cekko-usrc1 = 'Y'  be excluded from the Release Strategy check.
IF SY-SUBRC = 0.
   e_cekko = i_cekko.   
   e_cekko-usrc1 = 'Y'.
ENDIF.

Some alternative Exits:

Enhancement M06B0005 Changes to comm. structure for overall release of requisn.

Enhancement M06B0001 Role determination for purchase requisition release

i hope this may helpfull.

Thank you,

Thanks,

AMS

0 Kudos

Hi AMS,

I'm not able to achive the desired functionality through:-

Enhancement M06B0005 Changes to comm. structure for overall release of requisition.>>>> need to have EKKO type structure.

Enhancement M06B0001 Role determination for purchase requisition release ..>>>> need to have EKKO type structure

The custom code i'm using in include ZXM06U36 is

IF i_frgke = 'J'.

SELECT SINGLE FRGC2 FROM T16FS INTO i_frgco2 WHERE frggr = i_ekko-frggr AND

frgsx = i_ekko-frgsx.

if i_frgco2 = '01'.

if ( sy-uname Eq wa_cp_matrix-uname OR

sy-uname EQ wa_cp_matrix-uname1 OR

sy-uname EQ wa_cp_matrix-uname2 ).

ELSE.

MESSAGE 'You are not authorized to approve this document !' TYPE 'E'.

endif.

endif.

ENDIF.

Please let me know i need to go for some other exit or need to do some change with my code.

Thanks,

Naveen

0 Kudos

Hi Jai,

I do not have enough test data to check the exit.

can please place a break point in this exit and tell me whether the exit is triggering before release or not.

Enhancement M06B0002 EXIT_SAPLEBND_001 ZXM06U13 Changes to comm. structure for purchase requisition release

If it triggers I have a solution .

Thank you,

Thanks,

AMS

0 Kudos

Hi AMS,

when i put the break point in (Enhancement M06B0002 EXIT_SAPLEBND_001 ZXM06U13 Changes to comm. structure for purchase requisition release ) and then try to release or derelase my PO at release code '00' level then it does not stop at my break point.

Thanks,

naveen

0 Kudos

Naveen,

Use this enhancement

Enhancement M06E0004 Changes to communication structure for release purch. doc.

I checked it is triggering.

use assign to get EBELN value and use select to retrive the values from table EKKO.

If you want I will send a sample code.

Thanks,

AMS

0 Kudos

Hi AMS,

Send me the sample code. it will be very helpful

Thanks,

Naveen

0 Kudos

Naveen,

Sample code:



DATA : it_bekpo1 LIKE it_bekpo WITH HEADER LINE,
 it_bekpo1[] = it_bekpo[].
  CLEAR it_bekpo1.
data: v_frgke type frgke.
data: v_frggr  type frggr .
data: v_frgsx type frgsx.
data: i_frgco2 type frgco2 .


SELECT SINGLE frgke frggr frgsx    FROM ekko INTO (v_frgke , v_frggr , v_frgsx)  WHERE EBELN = it_bekpo1-ebeln.

IF v_frgke = 'J'.

SELECT SINGLE frggr FRGC2 FROM T16FS INTO i_frgco2 WHERE frggr = v_frggr AND
frgsx = v_frgsx.
if i_frgco2 = '01'.

if ( sy-uname Eq wa_cp_matrix-uname OR
sy-uname EQ wa_cp_matrix-uname1 OR
sy-uname EQ wa_cp_matrix-uname2 ).
ELSE.
MESSAGE 'You are not authorized to approve this document !' TYPE 'E'.

endif.
endif.


ENDIF.


Thanks,

AMS

0 Kudos

Hi ,

We have implemented it inour current assignment using user exit MM06E005 -->EXIT_SAPMM06E_012.Here you can do your allvalidations and throw error. Makesure toput a check of tcode and sy-ucomm MESAVE..

Let me know in csae you face any issue.

Regards

Nabheet

0 Kudos

Hi Nabheet,

Hope u are doing fine...... My requirement is that the exit should trigger whenever we press the icon for release and derelease.

when frgco = 01 then only i have to check my sy-uname wether it is maintained in my custom table.

when frgco = 00 then then release and derelease should happen if the name maintained in approvers list and sy-uname is same.

Thanks,

Naveen

0 Kudos

Hi Naveen,

Can I expect you problem is resolved.IF yes please mark it as solved and provide if you have any other solutions.It may helpfull to some other.

Thank you,

Thanks,

AMS

0 Kudos

Hi AMS,

As of now it seems that the problem is resolved by puuting checks for sy-ucomm = MESAVE and sy-tcode . Once it is tested by functional people i will update you if there is any further quey.

Thanks a lot,

Naveen