03-29-2006 6:01 AM
Hi Experts,
Presently I am working with table control,I have got two date fields, I need to do the validation for the date fields,that can be done by me
But if the user enters the wrong date while entering multiple entries, how can we get the line number of the record in which wrong entry is being done.
Do I need to write this In the Screen PAI with CHAIN and ENDCHAIN statements for this table fields.
or in the PAI screen if ok code equal to save.
Thanks In Advance,
Regards,
Irfan Hussain
03-29-2006 6:12 AM
use
<b>DYNP_VALUES_READ</b> Reads a screen field
<b>DYNP_VALUES_UPDATE</b> Updates a screen field
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS .
READ TABLE DYFIELDS INDEX 1.
*--- get short text and update current field
regards
vinod
03-29-2006 6:16 AM
yes you will need to write this validation in the PAI.
what you can do is call a module in pai, and within this module you loop on the internal table which you want to process...this is the internal table underlying for the table control....you can simply display a message with the number of the erroneous row (sy-tabix) of the internal table....
this of course depends on when exactly you want to carry out the validation....catch the appropriate OK_CODE for this purpose and then process your internal table...
03-29-2006 6:42 AM
You can do it in a module in CHAIN.. ENDCHAIN in PAI. If an error is thrown at one particular table control line, the control stops and waits for a valid input for the further processing.
Ex:
PAI
loop at itab.
chain.
field SFLIGHT-CARRID.
field SFLIGHT-CONNID.
field SFLIGHT-FLDATE.
field SFLIGHT-PRICE.
module TABCON1_modify on chain-request.
endchain.
endloop.
Module pool program:
module TABCON1_modify input.
....
do certain validations of the field values entered
message e001 with 'Please enter valid data'.
endmodule.
Message was edited by: Sravanthi