Mick
Mick

Reputation: 111

How to hide conditionally custom fields in screen exit?

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 :

Upvotes: 2

Views: 5346

Answers (1)

Sandra Rossi
Sandra Rossi

Reputation: 13638

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.

Upvotes: 1

Related Questions