Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

system date

Former Member
0 Kudos
150

hi all..

i want to diaply sy-datum in format like 20 january 2000..

the month should be in like janu, Feb ...

any suggestion..

venakt

1 ACCEPTED SOLUTION

Former Member
0 Kudos
103

Hi ,

hard code the Months like this .

date = sy-datum+6(2).

month = sy-datum+4(2).

year = sy-datum+0(4).

if month = 01.

mon = 'JAN'

else if.

like that.

endif.

finally u can disply

date_final = 20 jan 200.by using concatenate command.

Regards

Prabhu

12 REPLIES 12

Former Member
0 Kudos
103

use table <b>t247</b>

or u can use fm...

<b>CONVERSION_EXIT_IDATE_OUTPUT</b>

Former Member
0 Kudos
104

Hi ,

hard code the Months like this .

date = sy-datum+6(2).

month = sy-datum+4(2).

year = sy-datum+0(4).

if month = 01.

mon = 'JAN'

else if.

like that.

endif.

finally u can disply

date_final = 20 jan 200.by using concatenate command.

Regards

Prabhu

0 Kudos
103

CAN U ELABORATE MORE

0 Kudos
103
just copy and  paste this program....


REPORT  ZNEGI3                                  .
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 = 'S'.
APPEND ITAB.
CONCATENATE DAY ITAB-LTX YEAR INTO FINAL SEPARATED BY '-'.
WRITE: FINAL.

or try with this fm...

<b>CONVERSION_EXIT_IDATE_OUTPUT</b>

data:lcdate(11).

call function
'converstion_exit_idate_output'
exporting
input = sy-datum
importing
output = lcdate.

concatenate lcdate(2) lcdate+2(3) lcdate+5(4) into lcdate seperated by '-'.

--lcdate is your required format.

sample data ..sy-datum = 20060830
lcdate = 30-AUG-2006

Message was edited by: kishan negi

Former Member
0 Kudos
103

Hi,

DATA:GD_DATE LIKE SY-DATUM, GD_STRING(20) TYPE C,

GD_DAYS(10) TYPE C,

GD_MONTH(10) TYPE C,

GD_YEAR(10) TYPE C,

GD_TEXT LIKE T247-LTX.

GD_DATE = SY-DATUM. <b><<giving the date here>></b>

CALL FUNCTION 'HR_IN_GET_DATE_COMPONENTS'

EXPORTING

IDATE = GD_DATE

IMPORTING

DAY = GD_DAYS

MONTH = GD_MONTH

YEAR = GD_YEAR

LTEXT = GD_TEXT

.

IF SY-SUBRC = 0.

CONCATENATE GD_DAYS GD_TEXT GD_YEAR INTO GD_STRING SEPARATED BY SPACE.

ENDIF.

WRITE:/ GD_STRING.

regards,

sowjanya

Message was edited by: sowjanya suggula

Former Member
0 Kudos
103

i am new to abap so

can u elaborate more on CONVERSION_EXIT_IDATE_INPUT

thank u..

Former Member
0 Kudos
103

Hi,

in the above function i gave,

you give the <b>date</b>,

and <b>get days,month,year,and text</b> if you need

long text(ltext)

gives the text as <b>SEPTEMBER</b>(month full name)

or short text(stext)gives the month in the shortcut like <b>SEP</b>.

then you concatenate the days text and year

to get the date in reqd format

hope this is clear to you.

Message was edited by: sowjanya suggula

Former Member
0 Kudos
103

tell me what u didn't understand

so that i can explain

0 Kudos
103

IT S NOT DISPLAYING ANY THING ....

I DONT HAVE AUTHORIZE TO ACCESS T247.. THATS THE REASON I AM NOT GETTING OUTPUT OR ....

VENKAT

Former Member
0 Kudos
103

Hi venkatesh,

1. 20060913

= 13.SEP.2006

2. just use the FM

<b>CONVERSION_EXIT_SDATE_OUTPUT</b>

regards,

amit m.

Former Member
0 Kudos
103

Hi Venkatesh,

Use the function month_names_get.

Regards,

Sunmit.

Please reward points if helpful

0 Kudos
103

Hi

You can use FM's: CONVERSION_EXIT_IDATE_OUTPUT &

CONVERSION_EXIT_IDATE_OUTPUT depending how you want to

have your output. Just pass the date for the input

parameter and you will have the result with month name

in output parameter.

Eg:


data: l_input like sy-datum value '20000120',
      l_output(20) type c.

CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
  EXPORTING
    INPUT         = l_input
 IMPORTING
   OUTPUT        = l_output.

write:/ l_output.

Try the above example for better understanding.

Kind Regards

Eswar