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: 

In ME51N, I have to make one column of item details table read-only.

former_member209920
Active Participant
0 Kudos
1,049

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?

1 ACCEPTED SOLUTION

Richa_Gupta
Contributor
0 Kudos
795

Hi Manu,

The simplest way to do it is use SHD0 and create a screen variant for the same. There select the required field as read-only.

Below link should help you :

Regards,

Richa

6 REPLIES 6

Richa_Gupta
Contributor
0 Kudos
796

Hi Manu,

The simplest way to do it is use SHD0 and create a screen variant for the same. There select the required field as read-only.

Below link should help you :

Regards,

Richa

0 Kudos
795

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

0 Kudos
795

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

0 Kudos
795

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

0 Kudos
795

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.

0 Kudos
795

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...