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: 

About Dates

Former Member
0 Kudos
108

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

Former Member
0 Kudos
75

CHECK.

RP_LAST_DAY_OF_MONTHS

Former Member
0 Kudos
75

Use the FM <b>RE_LAST_DAY_OF_MONTH</b>

0 Kudos
75

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

I want to get 09302006.

0 Kudos
75

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

0 Kudos
75
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

Former Member
0 Kudos
75

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.

Former Member
0 Kudos
75
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.

Former Member
0 Kudos
75

hi pavan,

use the function module RP_LAST_DAY_OF_MONTHS.

that should help u

regards,

sudha.