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: 

substring functions.

Former Member
0 Kudos

i have a date variable which has 21.03.2008 ie DD.MM.YYYY format.

i want to extract month and year separately into different variables.

wht is eh function or way to do it.

5 REPLIES 5

Former Member
0 Kudos

hi,

do this way ..


data : v_date(1) value '21.03.2008',
         v_month(2),
         v_year(2).

 v_month = v_date+3(2).
 v_year   =  v_date+6(4).
 

Regards,

Santosh

Former Member
0 Kudos

hi

try this function


USS_DATE_DECOMPOSITION

bye

peter_ruiz2
Active Contributor
0 Kudos

hi,

if your date is exactly the same with how you write it including the periods.

use this code

month = datum+3(2)

date = datum (2)

Former Member
0 Kudos

Hi

Check this simple program

DATA : date type string,

dd type char2,

mon type char2,

year type char4.

date = '21.04.2008'.

SPLIT date at '.' into dd mon year.

WRITE :

dd, mon, year.

HOPE IT HELPS.

Former Member
0 Kudos

Hi,

Use the below function module.

CACS_DATE_GET_YEAR_MONTH