2008 May 15 10:43 AM
when I raed the value from screen the date comes as say 04.05.2007.
but when i put the the same value it truncates to 8 since the work area field is of type dats and only 8 characters are accepted .
what should be the solution
should i take the work area field of length as 10 and declare as char,but i need to modify custom table with workarea values , in the cutsom table again the field is of tpe dats,
suggest something
when I raed the value from screen the date comes as say 04.05.2007.
but when i put the the same value it truncates to 8 since the work area field is of type dats and only 8 characters are accepted .
what should be the solution
should i take the work area field of length as 10 and declare as char,but i need to modify custom table with workarea values , in the cutsom table again the field is of tpe dats,
suggest something
2008 May 15 10:48 AM
2008 May 15 10:49 AM
Hi,
Inside the program it will be converted as YYYYMMDD format.
Do one thing take one variable of size 10.
if you want the format dd.mm.yyyy.
check the following code.
Think that p_date is your parameter date.
Data : v_date(10).
Concatenate p_date6(2) p_date2(2) p_date+0(4) into v_date separated by '.'.
2008 May 15 10:51 AM
Hope the custom table also having the data type as dats.So declare the field with type d.
Regards,
Madan.
2008 May 15 10:51 AM
If you are not doing any processing with the date field, you can change the workarea as well as table field to char 10 instead of dats.
2008 May 15 10:52 AM
If the Screen field from whic you are reading the date is a charater field, then you should use a conversion routine to convert the date to internal format. If the screen field is a date field, it will automatically convert the date to internal format.
To convert external date to inetrnal format:
DATA: date TYPE dats.
CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'
EXPORTING
datum = '14.12.2008'
dtype = 'DATS'
IMPORTING
idate = date.
2008 May 15 10:53 AM
Use Function modules
CONVERT_DATE_TO_EXTERNAL with appropriate variables
before displaying to screen and
CONVERT_DATE_TO_INTERNAL to update date from screent to your program
2008 May 15 11:10 AM
hi bro,
parameters : s_date type dats.
data: wa_date type dats.
wa_date = s_date.
write 😕 s_date,wa_date.
plz excecute tz code..am not seeing any difference...
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |