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: 

How can I clear a field after show a message type e using field exit?

Former Member
0 Kudos

Hi all

I need to clear a field after validation in a field exit .

My code like this:


if lc_field is not initial.
clear output.
message e398(00) with 'this number already is registeres...'
endif.

endif.

My output field isn't empty after execution. I can´t use message type i or type w because a dump is thrown.

What can I do to clear this field using my field exit?

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi..

I am not sure if this is possible in field exit, but i know it workd in ABAP report.

Instead of displaying error in type E, display it as shown below:

if lc_field is not initial.

clear output.

message text-001 type 'S' display like 'E' .

LEAVE LIST-PROCESSING.

endif.

Leave list processing or any such command which will take you back on screen should be used here..

text-001 = this number already is registeres...

Hope this helps!

Ags.

3 REPLIES 3

Clemenss
Active Contributor
0 Kudos

Hi Natali,

I think you can't access the values in a field exit because this is processed in screen processing between PBO and PAI. We solved an issue like this by dynamically assigning the calling programs variable


FUNCTION FIELD_EXIT_ZLSPR.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"       IMPORTING
*"             VALUE(INPUT)
*"       EXPORTING
*"             VALUE(OUTPUT)
*"----------------------------------------------------------------------
*-----------------------------------------------------------------------
* 17.02.2000 CLi Field-Exit for payment lock on invoice acreen
* Transaction F-43
*-----------------------------------------------------------------------

CONSTANTS: BSL(20) VALUE '(SAPMF05A)BSEG-BSCHL'.

FIELD-SYMBOLS: <BSL>.

ASSIGN (BSL) TO <BSL>.
IF SY-SUBRC = 0.
   IF INPUT  = ' '  AND
*     <BSL> <> '37' AND
      <BSL> <> '27'.
      OUTPUT = 'A'.
      MESSAGE S002(ZF) WITH 'Payment lock "A" was set'.
   ELSE.
      OUTPUT = INPUT.
   ENDIF.
ELSE.
   OUTPUT = INPUT.
ENDIF.
ENDFUNCTION.

As you see, we could issue a success message.

I don't know if this helps you - it is 8 years ago and field-exits like this may not be supported any longer. Anyway: Try to find out what the calling programs field name is, do a dynamic assign as seen in the code and change the value as required.

Regards,

Clemens

Former Member
0 Kudos

Hi..

I am not sure if this is possible in field exit, but i know it workd in ABAP report.

Instead of displaying error in type E, display it as shown below:

if lc_field is not initial.

clear output.

message text-001 type 'S' display like 'E' .

LEAVE LIST-PROCESSING.

endif.

Leave list processing or any such command which will take you back on screen should be used here..

text-001 = this number already is registeres...

Hope this helps!

Ags.

Clemenss
Active Contributor
0 Kudos

Hey, what was the solution? TNX.

Regards,

Clemens