Application Development 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: 

making screen exit ML81N custom field ZINVDAT non editable

pashasapcha
Participant
0 Kudos
813

Hi, Gurus,

I am working on transaction ML81N and I could successfully managed to get value in the custom field which I have added using customer exit .

1. I want to make the custom field which I have added as non editable in display mode . You can see the order in the below which is standard is in non editable mode. But the field which I have added as part of screen exit , is in editable mode . I want to make it non editable as it is display mode.

The below is custom field added as part of screen exit is showing in editable mode as below.

I have used SRVEUSCR customer exit and I have tried the below code in the import function exit EXIT_SAPLMLSR_020 but it is not making the field non-editable.

It looks like it is getting faded for fraction of second the moment save button is clicked and then getting editable again while all other standard fields remain in non editable mode.

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos
745

Basically one of the function module of the exit, pass a flag 'editing mode' to the exit, save this value and use it in the PBO of your subscreen, not in the exit function module.

  • In global data of exit function group (menu: goto, global data) Include ZXMLUTOP create a field to save editing mode
  • In EXIT_SAPLMLSR_020, ZXMLUU27 save I_AKTYP value (read the parameter description)
  • In your custom exit subscreen, check this saved value in the LOOP AT SCREEN loop
  • The namespace to add fields to standard table/structure are ZZ and YY, not Z (ref)

0 Kudos
745

This is the first customer exit I am working with. Kindly make it as simple as possible.

As far the point 1 , which you have mentioned, I have made the changes as shown below

For the 2nd point , I have made the changes as below.

3rd point I could not able to make myself clear about it. However, I have created pbo of subscreen and added loop endloop in it. Kinldy can you please help me out with it.
*----------------------------------------------------------------------*
***INCLUDE ZXMLUO01.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module STATUS_0399 OUTPUT
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
MODULE status_0399 OUTPUT.
BREAK-POINT.

LOOP AT SCREEN.
if SCREEN-NAME = 'ESSR-ZINVDAT'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.

ENDLOOP.
ENDMODULE.

Thanks for your support and patience, Raymond.

0 Kudos
745

That's the correct part of code, try something such as

" I_AKTYP - 'X' in Editing Mode, Otherwise SPACE - saved in edits
LOOP AT SCREEN.
  IF edits NE abap_true.
    SCREEN-INPUT = '0'.
    MODIFY SCREEN.
  ENDIF.
ENDLOOP.

NB: In your first version, at the start of the PBO, Abap reset every field to its dynpro definition attributes, so the modification in the function module were rolled back. The code in the PBO will overwrite those values.

0 Kudos
745

Very sorry to ask this. If I use the code above which you have written in the pbo of subscreen , it should work. No need of the code which I have written in pbo . Correct me if I am wrong .

the code in both the exits are as follows.

0 Kudos
745

I can see the pbo module of subscreen is not getting triggered when I applied break point. Any idea why it is happening so.?

The requirement is to meet 2 things.

1. the added field on the subscreen should be faded (non editable ) in display mode.

2. In editable mode it should be mandatory field.

I have used loop at screen to control the field on the subscreen. The code is as below to achieve the 2 requirements.

Kindly, please suggest me how can I achieve these two functionalities.
Why is it the ML81N transaction this pbo event is not getting triggered in display mode.