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

General Ques

Former Member
0 Likes
371

Hello

Please can someone explain me what does this line mean

l_txt4 = syst-datum(4).

l_period = syst-datum+4(2).

Now what i want to understand is for eg.

i have a date 22.08.2008.this is the system date.

if i only want to pick up the period from this(08) or if i only want to pic up the year from this. How will i give the statement.

I hope it makes sense to you..

thanks

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
347

Well, that exactly what this statement does:

l_txt4 = syst-datum(4).

l_period = syst-datum+4(2).

The date is represented as follows in SAP: yyyymmd, for example: 21.08.2008 = 20080821.

So when you want to have the year use this:

lv_year = sy-datum+0(4).

Month:

lv_month = sy-datum+4(2).

etc.

1 REPLY 1
Read only

Sm1tje
Active Contributor
0 Likes
348

Well, that exactly what this statement does:

l_txt4 = syst-datum(4).

l_period = syst-datum+4(2).

The date is represented as follows in SAP: yyyymmd, for example: 21.08.2008 = 20080821.

So when you want to have the year use this:

lv_year = sy-datum+0(4).

Month:

lv_month = sy-datum+4(2).

etc.