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

validating date in module pool

Former Member
0 Likes
1,624

Hi

i have a screen that contains date filed , if the date is greater than present date i want to give message and if the user is giving the other than future date then only it will be processed .

in pai i write like this

if equi-MEASURED_DATE > sy-datum.

message E000(z01) with 'Date Cannot be the future date'.

endif.

but if i pressed save it is taking i dont want to take

Message was edited by:

kiran kumar

11 REPLIES 11
Read only

Former Member
0 Likes
1,204

Hello Kiran,

In the PAI do this.

CHAIN FIELD DATE MODULE VALIDATE.

In report

MODULE VALIDATE.

if data > sy-datum.

error message.

endif.

ENDMODULE VALIDATE.

IF useful reward and close the thread.

Vasanht

Read only

Former Member
0 Likes
1,204

Hi,

In PAI of the Screen write the Code:

Chain,

field <name>.

module <name> on chain-input.

endchain.

double click on module name and write the validation.

Regards,

Anji

Read only

0 Likes
1,204

MODULE USER_COMMAND_1000 INPUT.

CHAIN

FIELD EQUI-MEASURED_DATE.

MODULE CHECK_input ON CHAIN-INPUT.

ENDCHAIN.

*if equi-MEASURED_DATE > sy-datum.

*message E000(z01) with 'Date Cannot be the future date'.

*endif.

ENDMODULE. " USER_COMMAND_1000 INPUT

IT IS GIVING MESSAGE CHAAIN IS NOT DEFINED,CHECK U R SPELLING

Read only

0 Likes
1,204

OH SORRY TO ALL I MADE A BIG MISTAKE

I AM OT WRITEING AT FLOW LOGIC

SORRY GUYS

Read only

athavanraja
Active Contributor
0 Likes
1,204

in PAI write the following code.

process after input.

field equi-MEASURED_DATE module fm3 .

double click on fm3 and it would create module where you write the following code.

module fm3 input.

if equi-MEASURED_DATE > sy-datum.

message E000(z01) with 'Date Cannot be the future date'.

endif.

endmodule.

Regards

Raja

Read only

0 Likes
1,204

PAI IS NOT TRIGGERING

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

CHAIN.

field EQUI-MEASURED_DATE module CHECK_DATE.

ENDCHAIN.

MODULE CHECK_DATE INPUT.

BREAK-POINT.

if EQUI-MEASURED_DATE > sy-datum.

message E000(z01) with 'Date Cannot be the future date'.

endif.

ENDMODULE.

Read only

Former Member
0 Likes
1,204

Validation has to be done using FIELD statement in the PAI.

PAI

FIELD v_date MODULE Validate_data.

Module validata_date.

<perform Validation>

endmodule.

Read only

Former Member
0 Likes
1,204

Hi Kiran,

For this you have to use module In PAI in your screen

write it in this way


CHAIN FIELD DATE MODULE CHECK_VALIDATION

Under your module you ccan validate it in this way



MODULE CHECK_VALIDATION.
IF DATE GT SY-DATUM.
Message E-001.  " Date can not be greater than the current date.
ENDIF.
ENDMODULE VALIDATE.

Read only

Former Member
0 Likes
1,204

Hi Kiran

Try as follows it will be Work

Write following code in PAI.

PROCESS AFTER INPUT.

CHAIN.

FIELD p_datuv MODULE chain_module_1.

ENDCHAIN.

then Doble click and write following code with in module.

MODULE chain_module_1 INPUT.

if equi-MEASURED_DATE > sy-datum.

message E000(z01) with 'Date Cannot be the future date'.

endif.

ENDMODULE. " chain_module_1 INPUT

Thanks.

Jay

Read only

0 Likes
1,204

IF I WRITE CODE IN MODULE USER_COMMAND_1000.

IN THIS MODULE IS TRIGGERING

Read only

0 Likes
1,204

wirte the code in PAI.

see the following ex:

PROCESS AFTER INPUT.

CHAIN.

FIELD KONA-KNUMA.

MODULE MOD_CHECK_INPUT.

ENDCHAIN.

&----


*& Module m_comp INPUT

&----


  • text

----


MODULE MOD_CHECK_INPUT INPUT.

SELECT SINGLE * FROM KONA WHERE KNUMA = KONA-KNUMA.

IF SY-SUBRC <> 0.

MESSAGE E999 WITH 'Agreement No. ' KONA-KNUMA 'does not exists'.

ENDIF.

ENDMODULE. " m_comp INPUT