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

Need exit to control price field in ME21N/ME22N/ME23N

Former Member
0 Kudos
947

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

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Kudos
575

Did you look at method PROCESS_ITEM provided in BAdI ME_PROCESS_PO_CUST, and then at methods GET_DATA and GET_CONDITIONS execution on received parameter (PO item) ?

Regards,

Raymond

7 REPLIES 7
Read only

RaymondGiuseppi
Active Contributor
0 Kudos
576

Did you look at method PROCESS_ITEM provided in BAdI ME_PROCESS_PO_CUST, and then at methods GET_DATA and GET_CONDITIONS execution on received parameter (PO item) ?

Regards,

Raymond

Read only

0 Kudos
575

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

Read only

0 Kudos
575

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

Read only

0 Kudos
575

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

Read only

0 Kudos
575

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

Read only

0 Kudos
575

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


Read only

0 Kudos
575

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