Skip to Content
0
Former Member
Oct 22, 2013 at 12:37 PM

Disable 'Account Assignment' tab in a PO (only for ME22N transaction) for a specific Account Assignment Category

556 Views

Hello All,


I have a requirement where-in I need to dis-able the Account Assignment tab (i.e make it Display only) for a specific Account Assignment Category (A/K/F) only during the transaction ME22N

I have achieved the functionality of disabling the fields using Implicit Enhancement.

Class: CL_MODEL_VIEW_MM
Method: MODIFY_SCREEN


The problem I am facing now is when viewing the same using the table control button under the Account Assignment tab (left-hand top most). I have written the logic in the PBO of the screen 1000, but the logic does not seem to work.

Program: SAPLMEACCTVI
Screen: 1000

Below is the snippet of the code:

l_tc = '(SAPLMEACCTVI)DYN_1000TC-COLS'.
ASSIGN (l_tc) TO <fs_tcdata>.


LOOP AT <fs_tcdata> ASSIGNING <fs_wa>.
l_tabix = sy-tabix.
ASSIGN COMPONENT 'INVISIBLE' OF STRUCTURE <fs_wa> TO <fs_lwa>.
ASSIGN COMPONENT 'SCREEN-NAME' OF STRUCTURE <fs_wa> TO <fs_screen>.
ASSIGN COMPONENT 'SCREEN-INPUT' OF STRUCTURE <fs_wa> TO <fs_input>.
ASSIGN COMPONENT 'SCREEN-ACTIVE' OF STRUCTURE <fs_wa> TO <fs_active>.
ASSIGN COMPONENT 'SCREEN-OUTPUT' OF STRUCTURE <fs_wa> TO <fs_output>.
IF <fs_lwa> = space.
CASE <fs_screen>.
WHEN 'MEACCT1000-MENGE'.
<fs_input> = '0'.
* <fs_active> = '0'.
<fs_output> = '1'.
WHEN 'MEACCT1000-VPROZ'.
<fs_input> = '0'.
* <fs_active> = '0'.
<fs_output> = '1'.
WHEN 'MEACCT1000-KOSTL'.
<fs_input> = '0'.
* <fs_active> = '0'.
<fs_output> = '1'.
WHEN 'MEACCT1000-SAKTO'.
<fs_input> = '0'.
<fs_active> = '0'.
<fs_output> = '1'.
WHEN 'MEACCT1000-AUFNR'.
<fs_input> = '0'.
* <fs_active> = '0'.
<fs_output> = '1'.
WHEN 'MEACCT1000-PSP_PNR'.
<fs_input> = '0'.
* <fs_active> = '0'.
<fs_output> = '1'.
WHEN 'MEACCT1000-ABLAD'.
<fs_input> = '0'.
* <fs_active> = '0'.
<fs_output> = '1'.
WHEN 'MEACCT1000-WEMPF'.
<fs_input> = '0'.
* <fs_active> = '0'.
<fs_output> = '1'.
WHEN 'MEACCT1000-LOEKZ'.
<fs_input> = '0'.
* <fs_active> = '0'.
<fs_output> = '1'.
ENDCASE.
ENDIF.
ENDLOOP.

Here: 'screen-input'(<fs_input>) is not helping to dis-able the table control fields. I need to use <fs_active> = 0 to disable the field.
But, the issue is that when I use <fs_active> = 0, the value in the table control gets cleared and becomes non-editable.
My requirement is to retain the value in display mode.

Please share your thoughts,

Thanks,

Attachments

TC.PNG (999 B)