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: 

Re:i must send the last month data next month 10th

Former Member
0 Kudos
88

Hi,

can any one help me , i must send the last month data next month 10th

eg: jan data(jan 1st to jan 31st) must be sent on 10th feb,

can any one help me , what date functions to use and the logic behind tht

3 REPLIES 3

Former Member
0 Kudos
62

HI,

TRY THIS

*getting the last day of the month

CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'

EXPORTING

DAY_IN = G_LDATE

IMPORTING

LAST_DAY_OF_MONTH = G_TDATE

EXCEPTIONS

DAY_IN_NO_DATE = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

reward points if helpful

regards,

venkatesh

Former Member
0 Kudos
62

HI,

in the above code

G_LDATE for this

pass 20070101

you have subtract 1 from feb --- > 02

and get the last day of january

G_LDATE type sy-datum

regards,

venkatesh

Former Member
0 Kudos
62

Hello,

Try like this.



data: lv_final like sy-datum.
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = G_LDATE
IMPORTING
LAST_DAY_OF_MONTH = G_TDATE
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

lv_final = g_Tdate + 10. " Check here.
write: lv_final.

REgards,

Vasanth