‎2008 Apr 22 7:06 AM
Hi,
I am uploading the excel file but in excel file i have date field.
if end user give the date format is YYYYMMDD.
No error.
Else.
Need to display the Error ''please give the date format must be YYYYMMDD".
endif.
Can you please help me the same.
Thanks & Regards,
Ram.
‎2008 Apr 22 7:07 AM
Hi,
1. You cannot assume different date format each time uploading the excel.
2. The date coming into sap from excel should be in one particular format.
3.Then we can assume that format and validate for correct or not.
4.You need to ask the end user as to what date format they are going to provide in the input excel file.
Reward if helpful,
Jagadish
‎2008 Apr 22 7:09 AM
Hi rams b
U cannot assume different date format each time uploading the excel. The date coming into sap from excel should be in one particular format. Then we can assume that format and validate for correct or not. U need to ask the end user as to what date format they are going to provide in the input excel file.
Thanks
Venkat
‎2008 Apr 22 7:16 AM
Hi,
End user will be provide the date format is YYYYMMDD in Excel file.
in case user given the wrong format i have to raise the exception "Please provode the date format must be YYYYMMDD".
Regards,
Ram.
‎2008 Apr 22 7:12 AM
hi,
you cannot validate while entering into the internal table,
you can do validations only at screen level
do validations in your modulepool program
regards
prasanth
‎2008 Apr 22 7:14 AM
Hi
Check this FM CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = l_f_datum
EXCEPTIONS
plausibility_check_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e002(0s) WITH p_datum.
ENDIF.
If u can use this.
Thanks
Praveen
‎2008 Apr 22 7:16 AM
Hi Rams,
This is the validation for date.
data : date1 type date.
v_day = v_invdat+6(2).
v_month = v_invdat+4(2).
v_year = v_invdat+0(4).
concatenate v_day v_month v_year into date1
SEPARATED BY '.'.
Useally we are using like this format.
you can change the format as u like using above example.
If useful plz give reward.
Thanks ,
Narasinmha