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

simple query plz help

Former Member
0 Likes
533

hi experts

i have a variable in which i have stores a date

from that date i want to store only the month value in a seperate variable .

plz give me the code for this

thanks in advance .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
503

Here is the code:

data: l_datum like sy-datum.

data: l_month(2) type c.

  • Assign value to L_DATUM

l_month = l_datum+4(2).

Hope this helps.

ashish

4 REPLIES 4
Read only

Former Member
0 Likes
503

The example below gives you the month of the current date. You can use with any date variable to get the month.

DATA lc_month(2) TYPE c.

lc_month = sy-datum+4(2).

Read only

Former Member
0 Likes
503

Hi Anit,

l_date = '2006.05.24'. "YYYY.MM.DD

l_month = l_date+5(2).

Best regards,

Prashant

Read only

Former Member
0 Likes
504

Here is the code:

data: l_datum like sy-datum.

data: l_month(2) type c.

  • Assign value to L_DATUM

l_month = l_datum+4(2).

Hope this helps.

ashish

Read only

Former Member
0 Likes
503

DATA : date TYPE sy-datum VALUE '20071201'.

  • Format 'YYYYMMDD'

DATA: month TYPE char2.

month = date+4(2).

WRITE: month.

Rewards if useful.....................

Minal