Application Development and Automation 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: 
Read only

functin module

Former Member
0 Likes
587

is any method to change the date from 11-08-2008 to 11 september 2008.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
566

Hi,

your date is 11-08-2008, it means the month is August and you want to print September in the output ?

Sandeep Kaushik

Take the help from this code :

data : date(10),

text1(26),

num1(10),

test_day(15),

o_date(20),

idate type sy-datum.

data : Day(2), month(2), Year(4).

data : ODay(2), Omonth(2), OYear(4).

data : Ltext Type T247-LTX.

date = '11-08-2008'.

day = date+0(2).

month = date+3(2) + 1.

year = date+6(4).

concatenate year month day into idate.

CALL FUNCTION 'HR_IN_GET_DATE_COMPONENTS'

EXPORTING

idate = idate

IMPORTING

DAY = oday

MONTH = omonth

YEAR = oyear

LTEXT = ltext.

concatenate oday ltext oyear into o_date separated by SPACE.

write : O_date.

I hope, it can help you,

Please create one thread for one question,

Reward points, if helpful,

Message was edited by:

Sandeep Kaushik

4 REPLIES 4
Read only

Former Member
0 Likes
567

Hi,

your date is 11-08-2008, it means the month is August and you want to print September in the output ?

Sandeep Kaushik

Take the help from this code :

data : date(10),

text1(26),

num1(10),

test_day(15),

o_date(20),

idate type sy-datum.

data : Day(2), month(2), Year(4).

data : ODay(2), Omonth(2), OYear(4).

data : Ltext Type T247-LTX.

date = '11-08-2008'.

day = date+0(2).

month = date+3(2) + 1.

year = date+6(4).

concatenate year month day into idate.

CALL FUNCTION 'HR_IN_GET_DATE_COMPONENTS'

EXPORTING

idate = idate

IMPORTING

DAY = oday

MONTH = omonth

YEAR = oyear

LTEXT = ltext.

concatenate oday ltext oyear into o_date separated by SPACE.

write : O_date.

I hope, it can help you,

Please create one thread for one question,

Reward points, if helpful,

Message was edited by:

Sandeep Kaushik

Read only

Former Member
0 Likes
566

Hi,

Try with this code:

DATA: ZTEMP(9),zdd(2),zmmm(3),zyyyy(4),zfinal(12), v_date like sy-datum.

CLEAR: ZTEMP, ZDD, ZMMM, ZYYYY.

*v_date = '072307'. "mm/dd/yy

v_date = sy-datum.

CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'

EXPORTING

INPUT = v_date

IMPORTING

OUTPUT = ZTEMP.

write ztemp.

Regards,

Bhaskar

Read only

Former Member
0 Likes
566

You can use FM "CONVERSION_EXIT_IDATE_OUTPUT"

Read only

Former Member
0 Likes
566

HI,

see this simple code.

PARAMETERS:dat type sy-datum.

data:new_date(20).

data:mon(10).

SELECT single LTX FROM T247 INTO mon

WHERE SPRAS = sy-langu AND MNR = dat+4.

CONCATENATE dat+6 mon dat(4) into new_date SEPARATED BY space.

write:/ new_date.

<b>reward if helpful</b>

rgds,

bharat.