2014 Nov 21 8:49 AM
Hello,
I need to control price fields in ME21N/ME22N/ME23N . I can create separate customized table with fields User,Plant, Document Group. Based on combination of this fields User should able to access PRICE field in Purchase Order, If the user details not maintained in customized field then system should popup ERROR message " not authorized to change price field".
Can anyone suggest how to do this..
BR,
Murali
2014 Nov 21 2:51 PM
2014 Nov 21 2:51 PM
2014 Dec 16 7:11 AM
Myself already tried with this Badi ME_PROCESS_PO_CUST (Method : FIELDSELECTION_ITEM ), here i am not able to capture the screen details . ie Screen 0014 in SAPLMEGUI (Field : MEPO1211-NETPR ), if i am able to capture the screen field. Then i can write the sample code as below (to make it display field). Previously i have mentioned that to trigger a error . Either i can make it as display field or trigger as error .
IF screen-name = MEPO1211-NETPR
screen-input = 0.
MODIFY SCREEN.
ENDIF.
When i search in google , i get some more information.
But net price field value is mentioned as 061 , myself checked in Debug mode ,it never returns 061, in internal table ch_fieldselection there is no meta field with value 061,
Can you please give some input to fix this issue.
Regards,
Murali
2014 Dec 16 7:32 AM
Hi Murali -
Put a break point in the Function Module : MEPOBADI_FS_ITEM and check if it is triggering or not.
If triggering, then as mentioned in my previous post follow the steps:
Create a implit enahcnement at the end of this function module MEPOBADI_FS_ITEM (just before ENDFUNCTION). Let me know if you need help on implicit enhancemnt.
1. declare data
DATA: , w_header TYPE mepoheader,
w_item TYPE mepoitem ,
w_fieldselection TYPE mmpur_fs.
CONSTANTS: c_61 TYPE mmpur_metafield VALUE '61',
2 . check header data
IF im_header IS NOT INITIAL.
CALL METHOD im_header->get_data
RECEIVING
re_data = w_header.
ENDIF.
Here you can take the document type from w_header
3. . check if im_item is not inintial. then take the item data
CALL METHOD im_item->get_data
RECEIVING
re_data = w_item.
Here you can check plant from w_item.
if your condition match.
4. LOOP AT ch_fieldselection INTO w_fieldselection
WHERE metafield = c_61.
w_fieldselection-fieldstatus = '*' .
MODIFY ch_fieldselection FROM w_fieldselection.
CLEAR w_fieldselection.
ENDLOOP.
Hope it helps.
To check the value of metafield, go to SE11 and type group - MMMFD
search : mmmfd_net_price TYPE mmpur_metafield VALUE 061, "Nettopreis
Regards,
Atul Mohanty
2014 Dec 17 3:27 AM
thanks Mohanty, As suggested created implementation at the end of this function module MEPOBADI_FS_ITEM . While executing ME22N , system stops at the break point , then added the remaining coding as noted. While compling , system throws error at point 4.
Function Module MEPOBADI_FS_ITEM
Field specfication missing.
Please help how to fix the above bug.
Then blocked the loop , tried to debug the function, at one point of time , i am able to see the metadata field value 61 , through change mode i change to * , if i execute Price field get disabled . =>This is the functionality required. but before that i need to fix the bug.
Can you suggest pl.
BR,
Murali
2014 Dec 17 4:18 AM
Hi Murali - Thanks for the details. Is the error a syntax or compilation error ?
If its a syntax error, then it something with declaration. Please check.
Let us if you have still issues.
Regards,
Atul Mohanty
2014 Dec 17 4:56 AM
Hi Mohanty,
While activating the Enhancement , i got the error.
Function Module MEPOBADI_FS_ITEM
Field specification missing.
in below lines
LOOP AT ch_fieldselection INTO w_fieldselection
WHERE metafield = c_61.
I tried to change few declaration able to resolve it . THANKS for your support.
Need one more help , i need to Header and Details of the Order in some internal table , how to achieve this.
Regards,
Murali
2014 Dec 17 6:27 AM
Hi Mohanty,
Thanks for your support , myself able to retrieve Header & Details into internal table.
Thanks to everyone. you can close this issue.
Regards,
Murali