Application Development and Automation 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: 
Read only

field validation in dialog programming

Former Member
0 Likes
2,390

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

11 REPLIES 11
Read only

Former Member
0 Likes
1,421

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

Read only

Former Member
0 Likes
1,421

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!

Read only

Former Member
0 Likes
1,421

Hi,

Perform validation on this field in the following event

AT SELECTION-SCREEN ON <fieldname>

IF <check error condition>.

MESSAGE <ur error message>

ENDIF.

Read only

Former Member
0 Likes
1,421

Hi,

User CLEAR <field> after using the message in IF and Endif statement.

if <condtion>

message <mesg>

clear <field>

endif.

regards,

sunil kairam.

Read only

0 Likes
1,421

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.

Read only

Former Member
0 Likes
1,421

hi,

do the field validation in between chain and end chain

Read only

0 Likes
1,421

hi,

pls explain how to do

Read only

0 Likes
1,421

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.

Read only

0 Likes
1,421

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.

Read only

Former Member
0 Likes
1,421

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.

Read only

Former Member
0 Likes
1,421

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.