2

My task is to customize the Header Details Screen of the ME33K transaction, the goal is to add a box with new fields that should appear only if the Agreement type is the one I defined by using the transaction SPRO (ex: Agreement type ABC).

I started making an enhancement to that screen by using the CMOD transaction, I created a dummy box and field with some hard-coded input value and it's working fine.

My next step would be to make these new fields appear only if the Agreement is of type ABC, but I cannot find the correct approach.

I tried doing some Screen-Loop programming and deactivating the box and/or fields, but the only ones that get deactivated are the standard ones that exist already, the ones I added with the enhancement are not affected.

EDIT :

  • The enhancement I used was 'MM06E005'.
  • I wrote the following Screen-Loop code in the include provided in the 'EXIT_SAPMM06E_006' user exit :
    loop at screen.
      if screen-name = 'CUSTOM_FIELDS'.
        screen-active = 0.
        modify screen.
      endif.
    endloop.
    
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Mick
  • 111
  • 3
  • 11
  • Please add spaces in your question so that people can understand it more easily - I did it for you. Please provide the names of the standard enhancement you used, what exact code you did for "Screen-Loop" and at what place you did it. – Sandra Rossi Jun 26 '20 at 14:27

1 Answers1

1

The enhancement MM06E005 refers to the subscreen SAPLXM06 0101, that you have created with a box with all your custom screen fields.

To hide your custom screen fields, you must:

  1. Call a PBO (Process Before Output) module, to be done in the flow logic of your subscreen (the one which contains the screen fields):
PROCESS BEFORE OUTPUT.
  ...
  MODULE modify_screen_field_attributes.
  ...
PROCESS AFTER INPUT.
  ...
  1. In the include LXM06O01 (preferrably), do this:
MODULE modify_screen_field_attributes OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'CUSTOM_FIELDS'. " name of one screen field
      screen-active = 0.              " hide the screen field
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
ENDMODULE.
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • Sadly i have already done those steps and tried inputing that code in the PBO of the custom screen but nothing happens. – Mick Jun 29 '20 at 07:35
  • It's impossible that it doesn't work. Unless your condition is always wrong and MODIFY SCREEN is never done (easy to see with debug). – Sandra Rossi Jun 29 '20 at 07:48
  • In order to test it, i have changed to code to fully hide everything in the screen, the code now looks like this : ```loop at screen. screen-active = 0. modify screen. endloop.``` The problem is, all the elements in the screen disappear EXCEPT the ones added by the enhancement. – Mick Jun 29 '20 at 10:37
  • 1
    It means that you did it in the flow logic of the standard dynpro, not in the flow logic of the custom dynpro (the one which only contains your custom screen fields). See what I said: "*to be done in the flow logic of you subscreen*". – Sandra Rossi Jun 29 '20 at 12:49
  • I would like to ask where to find it, as i thought that the one i was writing in was the one for my custom screen. – Mick Jun 29 '20 at 15:25
  • Hmm I just see now that in your question, you said the "screen-loop" code was put in `EXIT_SAPMM06E_006`. It's a user exit, not the **flow logic of a dynpro**. Go to the custom subscreen `SAPLXM06 0101`, open the flow logic tab, and do as I said. – Sandra Rossi Jun 29 '20 at 16:19
  • I did it there as well, but nothing happens. – Mick Jun 30 '20 at 07:05
  • @Mick Did you use the debugger to find out if the fields you want to hide are actually iterated in that LOOP AT SCREEN? When they are not, then you put it into the PBO module of the wrong dynpro. – Philipp Jun 30 '20 at 09:32
  • Then you probably didn't compile/activate your screen or your code. – Sandra Rossi Jun 30 '20 at 11:33