2007 Jun 11 9:12 AM
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
2007 Jun 11 9:18 AM
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
2007 Jun 11 9:20 AM
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
2007 Jun 11 9:21 AM
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