cancel
Showing results for 
Search instead for 
Did you mean: 

"IS SUPPLIED" syntax not working in Method Pre-Exit

aaron_morden2
Contributor
0 Kudos

I am implementing a Pre-Exit Enhancement for a method in a standard SAP delivered Web Dynpro Component. The method has 3 importing parameter, all specified as Optional.

In the Pre-Exit of the method, I am coding the sytax like below.


  IF iv_suppress_warnings IS NOT SUPPLIED.
    iv_suppress_warnings = abap_true.
  ENDIF.

When I check the method, I am getting the syntax error:

The "IS SUPPLIED" query makes sense only for optional parameters.

Any idea why I am getting this error even though the parameter is marked as optional? Is this an SAP bug?

Thanks,

Aaron

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Not necessarily a bug, more likely a side effect of the fact that you are in a Pre-Exit. With the Pre- and Post- exits what happends behind the scenes is that your logic is placed into a separate method of a local class and called from the original method. Therefore the method signature is "copied" from the original method and all parameters must be passed into the exit method. We don't really have access to the original parameters as they are defined, but instead as they are passed into the exit method. All parameters of the original method are passed into the exit method regardless of if they were supplied to the original method or not. Therefore IS_SUPPLIED and optional parameters become meaningless within the exit methods.

aaron_morden2
Contributor
0 Kudos

Thanks Thomas. This same Component comes up every time we do SPAU bacause we changed the default value of the parameter to abap_true. I was hoping that I found away to get around the SAP modificaiton.

Answers (0)