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

About Dates

Former Member
0 Likes
946

Hi Everyone ,

I have to pass the Date and have to get the End of month

Ex : if I pass 09142006 as inputdate I need 09302006

as my Output date .

Is there any Function Module available or

what is the way to proceed ..

Thanks in Advance,

Regards,

PAVAn.

8 REPLIES 8
Read only

Former Member
0 Likes
913

CHECK.

RP_LAST_DAY_OF_MONTHS

Read only

Former Member
0 Likes
913

Use the FM <b>RE_LAST_DAY_OF_MONTH</b>

Read only

0 Likes
913

From that FM my Enddate will be in 09/30/2006

I want to get 09302006.

Read only

0 Likes
913

Lets day ldate is the output of the FM..after that use the below and it get you the date in required format.

Translate ldate using '/ '.

Condense ldate no-gaps.

OR

Write ldate to lfdate MMDDYYYY.

Message was edited by: Anurag Bankley

Read only

0 Likes
913
then go like this

REPORT  Z_TEST.

DATA : DATE1(10),
       LAST LIKE SY-DATUM.

CALL FUNCTION 'SG_PS_GET_LAST_DAY_OF_MONTH'
  EXPORTING
    DAY_IN            = SY-DATUM
  IMPORTING
    LAST_DAY_OF_MONTH = LAST.

WRITE : LAST to date1 MM/DD/YYYY.

REPLACE all occurrences of '/' IN date1 WITH SPACE.

CONDENSE date1.

WRITE : / date1.

Reward if helpful and close thread if solved

Message was edited by: Chandrasekhar Jagarlamudi

Read only

Former Member
0 Likes
913

u can use the simple logic...

ldate <= inputdate of type date.

lmon = ldate+4(2) + 1.

concatenate ldate(4) lmon '01' into ldm.

ldm = ldm - 1.

Read only

Former Member
0 Likes
913
REPORT  Z_TEST.

DATA : DATE1 LIKE SY-DATUM,
       LAST LIKE SY-DATUM.

CALL FUNCTION 'SG_PS_GET_LAST_DAY_OF_MONTH'
  EXPORTING
    DAY_IN            = SY-DATUM
  IMPORTING
    LAST_DAY_OF_MONTH = LAST.

WRITE : / LAST.
Read only

Former Member
0 Likes
913

hi pavan,

use the function module RP_LAST_DAY_OF_MONTHS.

that should help u

regards,

sudha.