on 04-21-2010 6:15 AM
Hi all :
I want to implement a field of type Date + time , for example 2008-12-12 12:30:00. for field of type Dats, we can select date via the standard function provided by sap, is there a similiar standard function for type Date + time?
Hi,
It would be good if you can create 2 different UI Input element one each for date and time.
For time you can bind it to data element of type TIMS.
Regards
Manas Dua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sony,
You can use the below code to get the output like this 2010:04:21 12:53:03
DATA: type TYPE STRING,
type1 TYPE STRING,
type2 TYPE STRING,
type3 TYPE STRING,
type4 TYPE STRING,
type5 TYPE STRING,
type6 TYPE STRING,
tims type sy-uzeit,
dats type sy-datum.
CALL FUNCTION 'OIL_GET_CURRENT_DATE_TIME'
EXPORTING
I_TZONE = 'INDIA'
IMPORTING
E_DATE = dats
E_TIME = tims.
CONCATENATE dats tims into type SEPARATED BY space.
type1 = type+0(4).
type2 = type+4(2).
type3 = type+6(2).
type4 = type+9(2).
type5 = type+11(2).
type6 = type+13(2).
clear type.
CONCATENATE type1 ':' type2 ':' type3 space
type4 ':' type5 ':' type6
into type.
data:
Elem_Context type ref to If_Wd_Context_Element,
Stru_Context type If_Test=>Element_Context ,
Item_TYPE like Stru_Context-TYPE.
get element via lead selection
Elem_Context = wd_Context->get_Element( ).
Set single attribute
Elem_Context->set_Attribute(
exporting
Name = `TYPE`
Value = Type ).
Hope it solves your problem.
Hi,
Has you ever tried with the FM
CONVERSION_EXIT_PDATE_INPUT Conversion Exit for Domain GBDAT: DD/MM/YYYY -> YYYYMMDD
CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY
CONVERT_DATE_FORMAT Convert date from yyyymmdd to ddmmyyyy format
and after concatenate this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can create a input field of type char or string and set the date and time by using these FM's provided by SAP:
1) MSS_GET_SY_DATE_TIME
2) OIL_GET_CURRENT_DATE_TIME
There are many FM's provided by SAP to get the data and time.
or use below code to set the value in input field:
DATA type TYPE STRING.
CONCATENATE sy-datum sy-uzeit into type SEPARATED BY space.
WRITE TYPE.
Hope it helps you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.