on 06-15-2012 8:18 AM
Hii while im displaying date and time it is showing without any seperators ??
is there any fm to convert or date from external format to internal format ?
the format which im getting is 121312 but i need with seperators ?
and the same for time also ?
Thanks in Advance
Hi Lokeswar,
Use this FM's
Date : FORMAT_DATE_4_OUTPUT [ gives date as MM/DD/YY format ]
Time : L_MC_TIME_DIFFERENCE [ Find the time difference between two date/time ]
and aslo check this link [ function modules related to date and time ]
http://wiki.sdn.sap.com/wiki/display/ABAP/Useful+ABAP+Function+Modules
Regards,
Sushiptha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
For date depending on your settings in su01 you can display date in the same format using below mentioned code:
select single datfm from usr01
into gdf_datfm
where bname = sy-uname.
if sy-subrc eq 0.
endif.
.........................................
case gdf_datfm.
when '1'.
concatenate ldf_field+6(2) lcf_dot ldf_field+4(2) lcf_dot ldf_field+0(4) into ldf_date.
condense ldf_date no-gaps.
when '2'.
concatenate ldf_field+4(2) lcf_slash ldf_field+6(2) lcf_slash ldf_field+0(4) into ldf_date.
condense ldf_date no-gaps.
when '3'.
concatenate ldf_field+4(2) lcf_dash ldf_field+6(2) lcf_dash ldf_field+0(4) into ldf_date.
condense ldf_date no-gaps.
when '4'.
concatenate ldf_field+0(4) lcf_dash ldf_field+4(2) lcf_dash ldf_field+6(2) into ldf_date.
condense ldf_date no-gaps.
when '5'.
concatenate ldf_field+0(4) lcf_slash ldf_field+4(2) lcf_slash ldf_field+6(2) into ldf_date.
condense ldf_date no-gaps.
endcase.
Thanks ,
Neha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not much detail as to where this is all taking place but since your topic is webdynpro, I gather we are talking about... web dynpro.
Well I have very little experience with webdynpro but it cannot be all that different from normal dynpro in these terms.
You need to define a date field or a time field and the system will do all the checking for you. In a normal dynpro, a date field also gets a calendar when you hit F4.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You must use data type DATS for the attribute in the context node. In this case, date will be displayed with seperators.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For displaying these in a message, you would not have a direct solution. For a message can only contain strings, You will have to use String operations.
They are very well exlained by Neha in her post below on how to concatenate your own seperator in a string to display it like a date or time.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.