2015 Aug 20 3:03 PM
Hi,
I have to make one column of the item details in ME52N, read only based on some conditions (for some specific plants). I tried analysing BADI(s) and user exits and even implicit enhancements, but I didn't got any succeed.
I don't want to chnage the code directly using the access key.
Can anyone suggest any possible way out?
2015 Aug 20 7:33 PM
2015 Aug 20 7:33 PM
2015 Aug 20 8:14 PM
Hi Richa and Manu
SHD0 probably won't fit the requirement that the column is read-only only in certain conditions. Check into badi ME_PROCESS_PO_CUST and the method FIELDSELECTION_ITEM. I think that will let you make the column read-only or not depending on the data of the PO.
Jim
2015 Aug 21 7:25 AM
Thanks but it won't work as:
1. We can not give check conditions.
2. We need to create new Z transaction which will not accpeted by user.
Thanks
Manu B
2015 Aug 21 7:30 AM
Hi Jim,
Can you provide some details, because when I try to debug after keeping breakpoint it at method FIELDSELECTION_ITEM, it does not stop here.
Whereas it stops at other method FIELDSELECTION_ITEM_REFKEYS, but it does not control the display properties of the table control of the item details of the purchase requisition.
Thanks
Manu B
2015 Aug 21 8:49 AM
Please check following, it may help you.
Create a implit enahcnement at the end of this function module MEREQBADI_FS_ITEM (just before ENDFUNCTION). Let us know if you need help on implicit enhancemnt.
1. declare data
DATA: lw_req_item TYPE mereq_item,
w_fieldselection TYPE mmpur_fs.
CONSTANTS: c_007 TYPE mmpur_metafield VALUE '007'. " Account assignment cat
Note : check the type group MMMFD in SE11 for all the list ,
2 . check Purchase req data
IF im_item IS NOT INITIAL.
CLEAR lw_req_item.
***Get item data
CALL METHOD im_item->get_data
RECEIVING
re_data = lw_req_item.
ENDIF.
* Here you can check the Purchase req data lw_req_item like plant etc
if your condition match.
3. LOOP AT ch_fieldselection INTO w_fieldselection
WHERE metafield = c_007.
w_fieldselection-fieldstatus = '*' . " Disable
* Similarly you can try code enable / required etc
MODIFY ch_fieldselection FROM w_fieldselection.
CLEAR w_fieldselection.
ENDLOOP.
Hope it helps.
Let us know, in case any further help.
2015 Aug 21 6:24 PM
Hi Manu,
I did a closer look and I see that the badi only allows control over customer fields at the item level. In my case the method does get called; but if you have no customer fields on the item it is not called.
Sorry for the wrong answer...