cancel
Showing results for 
Search instead for 
Did you mean: 

Grey out the G/L Account in ME51N

former_member209770
Participant
0 Kudos

Dear Gurus,

how can I grey out the G/L account field if i choose the correct material group in ME51N?

i don't want the user change the field when they choose the correct material group is the reason why i do this.

is there any help?

i really appreciate it.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member361845
Participant
0 Kudos

Hi,

I have done same same for ML81n. see below:

*Enhancement for displaying GL Acc field Grey out on for this tcode

if sy-tcode = 'ML81N'.

LOOP AT SCREEN.

IF SCREEN-GROUP2 = '001'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

but i suggest you to find enhancement for (MEREQ001)

check for the method Modify screen and insert the logic using enhancement.

Hope this will help you!

former_member209770
Participant
0 Kudos

So i won't write IF SCREEN-NAME = 'MEACCT1100-SAKTO'. in the enhancement?

and i have some question...

1) What group2 = '001' mean?

2) How can i check for the method Modify screen?

Sorry for my stupid question...

but i really need your help : )

former_member361845
Participant
0 Kudos

Hi,

Please check the enhancement MEREQ001. you can take your ABAPER help and find the method modify as mentioned previously and apply the logic.

former_member209770
Participant
0 Kudos

Dear shahin11,

Now I wanna achieve the goal with BAdI, but I really have no idea why it couldn't be greyed out in ME51N.


method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM.

INCLUDE MM_MESSAGES_MAC.

DATA: I_ACT_ITEMS TYPE MEREQ_ITEM.

FIELD-SYMBOLS :<fs_sakto> type ANY.

DATA: STR TYPE STRING.

if I_ACT_ITEMS-MATKL ne 6299 AND SY-TCODE = 'ME51N' AND i_act_items-KNTTP = 'K'.

STR = '(SAPLMEACCTVI)MEACCT1100-SAKTO'.
ASSIGN (STR) TO <fs_sakto>.

IF SY-SUBRC = 0.

LOOP AT SCREEN.
IF SCREEN-NAME = <fs_sakto>.
SCREEN-INPUT = 0.   " grey out field - sakto
MODIFY SCREEN.
ENDIF.
ENDLOOP.

ENDIF.
endif.

endmethod.

Can you give me a hand?

Thanks a lot.