09-09-2010 8:37 AM
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
09-09-2010 10:20 AM
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
09-09-2010 12:32 PM
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
09-09-2010 2:34 PM
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
09-09-2010 2:45 PM
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
09-09-2010 2:54 PM
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
09-09-2010 3:11 PM
Hi AMS,
Send me the sample code. it will be very helpful
Thanks,
Naveen
09-09-2010 3:22 PM
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
09-09-2010 4:00 PM
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
09-09-2010 4:20 PM
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
09-10-2010 7:01 AM
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
09-10-2010 12:41 PM
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