‎2006 Jul 07 8:24 AM
Hi,
I want the date and time format as follows
15-SEP-2005 11:33:41
Thanks in advance
‎2006 Jul 07 8:26 AM
Hi vj,
1. For date in 15-SEP-2005 format,
just use the FM
CONVERSION_EXIT_SDATE_OUTPUT
2. Time will come in that format,
if u just use WRITE
data : myvar(8) type c.
write mytime into myvar.
regards,
amit m.
‎2006 Jul 07 8:26 AM
Hi vj,
1. For date in 15-SEP-2005 format,
just use the FM
CONVERSION_EXIT_SDATE_OUTPUT
2. Time will come in that format,
if u just use WRITE
data : myvar(8) type c.
write mytime into myvar.
regards,
amit m.
‎2006 Jul 07 8:28 AM
<b>1)</b> Have you tried
WRITE SY-DATUM DD/MMM/YYYY.
?
There are various conversion exits you can use, search SE37 with 'CONVERSION_EXIT_DAT_OUTPUT'.
<b>2)</b>
use table t247 with elect logic...
parameters: date like sy-datum.
data: begin of itab occurs 0,
SPRAS type SPRAS,
MNR LIKE T247-MNR,
KTX LIKE T247-KTX,
LTX LIKE T247-LTX,
end of itab.
DATA : month LIKE T247-MNR.
DATA: YEAR(4).
DATA: FINAL(18).
DATA: DAY(2).
DAY = DATE+6(2).
MONTH = DATE+4(2).
YEAR = DATE+0(4).
select SINGLE * from t247 into itab where mnr = month
AND SPRAS = 'E'.
APPEND ITAB.
CONCATENATE DAY ITAB-KTX YEAR INTO FINAL SEPARATED BY '-'.
WRITE: FINAL.
2)
‎2006 Jul 07 8:45 AM
hi,
try:
REPORT zforum93 .
TABLES t247.
DATA date(20).
DATA dt(20).
DATA time(8).
WRITE sy-datum TO date USING EDIT MASK '__-__ -____'.
WRITE sy-uzeit TO time USING EDIT MASK '__:__:__'.
SELECT SINGLE * FROM t247
WHERE spras = sy-langu
AND mnr = sy-datum+4(2).
move t247-ktx to date+3(3).
concatenate date time into dt separated by space.
write : / dt.A.
Message was edited by: Andreas Mann
‎2006 Jul 07 12:41 PM
Hi,
you can try this way...
data: date type sy-datum, text(20).
date = sy-datum.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
INPUT = date
IMPORTING
OUTPUT = text
.
<b>translate text using '.-'.</b>
write text.regards
vijay
‎2006 Jul 07 8:31 AM
go to
system -> user profile -> own data -> then select defaults (tab) . from here u can set the format as u require.
‎2006 Jul 07 9:06 AM
hi,
use the fm
CONVERSION_EXIT_SDATE_OUTPUT,
to this fm pass the date as <b>yyyymmdd</b>.and time as
data: time(8).
write sy-uzeit to time.
regards
vijay
‎2006 Jul 07 11:28 AM
TABLES t247.
DATA date(20).
DATA dt(20).
DATA time(8).
try this in report
WRITE sy-datum TO date USING EDIT MASK '__-__ -____'.
WRITE sy-uzeit TO time USING EDIT MASK '__:__:__'.
SELECT SINGLE * FROM t247
WHERE spras = sy-langu
AND mnr = sy-datum+4(2).
move t247-ktx to date+3(3).
concatenate date time into dt separated by space.
write : / dt.
‎2006 Jul 07 12:35 PM
Hi
If i use this FM CONVERSION_EXIT_SDATE_OUTPUT,
the o/p will be 07.JUL.2006
but i want 15-SEP-2005
not '.' but '-'
Thanks in advance
‎2006 Jul 07 12:37 PM
Hi again,
1. Simple
2. we can use REPLACE
3. just copy paste
4.
report abc.
data : mydate(11) type c.
parameters : dt type sy-datum default sy-datum.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
INPUT = dt
IMPORTING
OUTPUT = mydate
.
write 😕 mydate.
replace all occurences of '.' in mydate with '-'.
write 😕 mydate.
regards,
amit m.
‎2006 Jul 07 12:38 PM
Once you have the date in a string,
then do this:
replace all occurances of '.' with '-' in v_date.
Regards,
Ravi
‎2006 Jul 07 1:27 PM
hi,
You Can use following function Module
to convert it into desired format.
HRGPBS_HER_FORMAT_DATE.
regards
vikas
‎2006 Jul 07 2:18 PM
Hi ,
can use the following code :-
data : t_month_names TYPE STANDARD TABLE OF t247,
date type sy-datum,
year(4) type c,
mon(2) type c,
day(2) type c,
w_area like t247,
result(11) type c .
date = sy-datum.
year = date+0(4).
mon = date+4(2).
day = date+6(2).
refresh t_month_names.
clear w_area.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
language = sy-langu
TABLES
month_names = t_month_names.
loop at t_month_names into w_area.
if w_area-mnr eq mon.
concatenate day '-' w_area-ktx '-' year into result.
endif.
clear w_area.
endloop.
write : result , sy-uzeit.
Hope this solves your problem.
Cheers,
Anirban.