‎2008 Jan 22 1:29 PM
Hello Gurus,
I have problem with inserting date field in the database. date field has data types dats in the database. if i give the dates in the selection screen it insert properly without problem if user doesnt enetr value in the date field i have to insert default value. here i am not able to insert date formate properly.
here is the example :
PARAMETER : AEDATE TYPE DATS . ( WHICH IS SAME AS DATABASE DATA TYPE ).
If user doent enter the value default value i want to insert 01.01.1970.
DATA : BEGIN OF ITAB OCCURS 0,
ACS1 TYPE D,
END OF ITAB.
ACS1 = AEDAT.
INSERT DB FROM ITAB.
if user eneter in selection screen it works fine. if i want to give default value it wont insert properly.
Please help me. it is urgent.
Thanks in advance.
best regds,
zub
‎2008 Jan 23 3:29 AM
Hi,
If you want to give a default value( like 01.01.1970 ), you should use FM CONVERT_DATE_TO_INTERNAL to convert that default value to internal format(database format).
You can debug at code line ACS1 = AEDAT to see the value in 2 case (give default value & input from screen).
Regards,
Gy
‎2008 Jan 24 11:22 AM
Hello,
If u want to assign default value(date), date must be entered in the format YYYYMMDD
Example:
move '19700101' to fields-value