HI,
DATA: FLD LIKE SY-DATUM,
FLD1 LIKE SY-UZEIT,
F_TYPE(4),
F_TYPE1(4).
DESCRIBE FIELD FLD TYPE F_TYPE.
DESCRIBE FIELD FLD1 TYPE F_TYPE1.
WRITE: F_TYPE,F_TYPE1..
if f_type = 'D'
write 'date'.
elseif f_type = 'T'.
write 'time'.
endif.
Regards
amole
A formatted time field wil be of 8 characters(Along with separators).
A formatted date field wil be of 10 characters(Along with separators).
An unformatted time field wil be of 6 characters(Along with separators).
An unformatted date field wil be of 8 characters(Along with separators).
Find the length.
len = strlen( v_var ).
case len.
when 8.
Write:/ 'Its Time'.
when 10.
Write:/ 'Its Date'.
endcase.
Regards,
Ravi
Hi julian ,
just give the example for a string how u are storing the formats for date and time in ur system ,
i mean what is the length of the date field and time field in ur text format
will it be same ,,if so give us a value (or a set of values )to work on a specific logic
cause system takes 8 chars for date field and 6 chars for time field ,,
also ur requirement is asking for a date or time check on a specific string ,
but i cant put the same string for two fields check ...
???
if that is the scenario y dont u put
field string
DXXXXXX,
TXXXXXX,
DXXXXXX,
DXXXXXX,
TXXXXXX,
this way ..
differentiate with a tag
field string+0(1) = 'D', --->DATE FIELD
ELSE TIME FIELD.
regards,
vijay
data date type d value '20061014'.
DATA TIME TYPE T VALUE '154633'.
WRITE (8) TIME USING EDIT MASK '__:__:__'. "Output: 15:46:33
write (10) date using edit mask '__/__/____'.
write time using edit mask '______'.
*my logic is system uses internally 8 chars for date field and 6 chars
*for time field
Add a comment