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

Date 15??

Former Member
0 Likes
1,157

Hello!

I need to write a simple program. The program has to check if 15th of month is.

IF lv_datum = 15 (of month)

do smth...

ENDIF.

Can anybody help me?

Thanks!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,131

hi,

do this way ..


IF lv_datum+6(2) = '15'.
do smth...
ENDIF.
 

8 REPLIES 8
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,131

hi Andrei,

IF lv_datum+6(2) EQ '15'.
...
ENDIF.

hope this helps

ec

Read only

Former Member
0 Likes
1,131

This is very simple. You have your date in a variable declared as type DATUM? DATUM fields are always stored as yyyymmdd so you just need to use offsets to get the last two digits out of your date field and then check if they equal 15.

Read only

Former Member
0 Likes
1,132

hi,

do this way ..


IF lv_datum+6(2) = '15'.
do smth...
ENDIF.
 

Read only

0 Likes
1,131

ok Thanks!

IF lv_datum+6(2) = '15'.

do last day of the month, but next month??

ENDIF.

e.g. 31.07.2008 and I need 31.08.2008??

Thanks!

Read only

0 Likes
1,131

use FM CALCULATE_DATE to add one month

Read only

0 Likes
1,131

IF lv_datum+6(2) = '15'.

Use FM BKK_ADD_MONTH_TO_DATE .. to get next month

ENDIF

Read only

0 Likes
1,131

hi,

Use RP_LAST_DAY_OF_MONTHS / LAST_DAY_OF_MONTHS for getting the last day of the month ..

Regards,

Santosh

Read only

Former Member
0 Likes
1,131

Hi,

you can code like this

if lv_datum+6(2) = '15'

*your logic

endif.

Cheers

Kothand