‎2008 Jan 31 12:05 PM
hi,
any can help me.
in screen i am having one field i.e numat.
for this validation required.
i used error msg type.
if u fill this field with any number or words and press enter its is showing error msg but field goning is disable.
how to clear that field automatically after clicking the enter.
Edited by: prs on Jan 31, 2008 5:45 PM
‎2008 Jan 31 12:08 PM
Hi,
Do like this
at selection-screen on field.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = X
IMPORTING
STRING_OUT = X
HTYPE = H_TYPE.
if h_type = 'CHAR'.
Message 'NOt Numeric' Type 'E'.
else.
write:/ 'Numeric'.
ENDIF.
Regards,
Satish
‎2008 Jan 31 12:09 PM
You need to use AT SELECTION-SCREEN ON <field> so that field is available for input after the error. e.g:
AT SELECTION-SCREEN ON numat.
IF numat IS INITIAL.
MESSAGE e055(00).
CLEAR numat. " To clear the field!
ENDIF.Reward if useful!
‎2008 Jan 31 12:09 PM
Hi,
Perform validation on this field in the following event
AT SELECTION-SCREEN ON <fieldname>
IF <check error condition>.
MESSAGE <ur error message>
ENDIF.
‎2008 Jan 31 12:17 PM
Hi,
User CLEAR <field> after using the message in IF and Endif statement.
if <condtion>
message <mesg>
clear <field>
endif.
regards,
sunil kairam.
‎2008 Jan 31 12:23 PM
hi,
i used like his.
if sy-subrc NQ 0.
message 'does not exist'. type 'E'.
clear filed.
endif.
after pressing the enter i am getting the error msg but that field is on disable mode only,
my question is how to make editable mode automatically.
‎2008 Jan 31 12:23 PM
‎2008 Jan 31 12:26 PM
‎2008 Jan 31 12:32 PM
If you are writing a report, do the validation as I told you. If it's a modul pool, in the code of the dynpro you are making, you should do:
CHAIN.
FIELD: your_field
MODULE validation.
ENDCHAIN.And then create a module called validation and do the validation and clear the variable there. The CHAIN statement will leave the field ready for input.
‎2008 Jan 31 12:35 PM
Hi,
use chain...
like:
CHAIN.
...
ENDCHAIN.
Effect
The statements CHAIN and ENDCHAIN of the dynpro flow logic define processing chains. Between CHAIN and ENDCHAIN, the statements FIELD and MODULE can be executed. The statements between CHAIN and ENDCHAIN form a processing chain. Processing chains cannot be nested. The CHAIN statement can be specified in the event blocks at PAI and PBO , however, in the event block at PBO it has no effect.
A processing chain allows the joint processing of all the screen fields stated between CHAIN and ENDCHAIN after FIELD statements:
The contents of all screen fields combined to a processing chain by the FIELD statements can be checked in the shared conditions ON CHAIN-INPUT and ON CHAIN-REQUEST of the MODULE statement.
A warning or error message in a module called within a processing chain resets all input fields whose screen fields are combined in this processing chain using FIELD statements to ready-for-input. After a user input, the PAI processing resumes at the CHAIN statement at the latest.
Example
Call dialog modules to check input values. The screen fields input1 and input2 are checked in individual dialog modules check_1 and check_2. The screen fields input3 to input5 are checked in a processing chain in a shared dialog module check_chain. Warning or error messages in the dialog modules either make only one input field input1 or input2 ready for input again or all three input fields input3 to input5.
PROCESS AFTER INPUT.
MODULE leave_dynpro AT EXIT-COMMAND.
FIELD input1 MODULE check_1 ON REQUEST.
FIELD input2 MODULE check_2 ON REQUEST.
CHAIN.
FIELD input3.
FIELD input4.
FIELD input5.
MODULE check_chain ON CHAIN-REQUEST.
ENDCHAIN.
MODULE handle_user_command.
Regards,
Renjith Michael.
‎2008 Jan 31 12:35 PM
Hi,
Try this piece of code in PAI of your screen:
CHAIN.
FIELD numat MODULE validate_numat ON CHAIN-INPUT.
ENDCHAIN.
If you have not created the module validate_numat, double click on it and create it in the F-include.
Within it, you can call a subroutine numat_val,
PERFORM numat_val.
Double click on numat_val and create it in the F include.
Write your logic within this subroutine.
Reward if helpful.
‎2008 Feb 01 5:47 AM
use this
process after input.
field <field-name as in screen>
module check_input.
module check_input input.
put ur validation here fort this field.
message e.
endmodule.
if an error or warning occurs during this module.
the system sends the screen again without processing pbo.
only the field to which check was applied will be ready for input again.