Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 15, 2008 at 08:44 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 15, 2008 at 07:30 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 17, 2008 at 09:50 PM

    Hey, what was the solution? TNX.

    Regards,

    Clemens

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.