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

days

Former Member
0 Likes
1,154

Hi All,

i lke 2 knw no of dys bt a gvn dt's, is thr any fm or logic.

thanks and regards

Sharma

12 REPLIES 12
Read only

GauthamV
Active Contributor
0 Likes
1,132

hi,

use this func mod HR_SGPBS_YRS_MTHS_DAYS.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 4:08 PM

Read only

Former Member
0 Likes
1,132

do you mind asking your questions in english??

pk

Read only

Former Member
0 Likes
1,132

hi deepti,

declare a variable of type p (packed integers).

then do as folows

p = dt1 - dt2.

this will give the number of days between the 2 dates.

<REMOVED BY MODERATOR>

regards

Prem Sharma

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 4:09 PM

Read only

Former Member
0 Likes
1,132

Hi,

try this FM DAYS_BETWEEN_TWO_DATES

Regards,

Sriram

Read only

Former Member
0 Likes
1,132

Hi, Use following FM

CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

EXPORTING

i_date_from = fromdate

i_date_to = todate

IMPORTING

e_days = no_days.

Read only

Former Member
0 Likes
1,132

Hi,

You can try the below FM too.


report zastest.

Data: l_day type i.


start-of-selection.

CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
  EXPORTING
    i_datum_bis                   = sy-datum
    i_datum_von                   = '20080601'
*   I_KZ_EXCL_VON                 = '0'
*   I_KZ_INCL_BIS                 = '0'
*   I_KZ_ULT_BIS                  = ' '
*   I_KZ_ULT_VON                  = ' '
*   I_STGMETH                     = '0'
*   I_SZBMETH                     = '1'
 IMPORTING
   E_TAGE                        = l_day
* EXCEPTIONS
*   DAYS_METHOD_NOT_DEFINED       = 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.
else.

write : l_day.

ENDIF.

Read only

Former Member
0 Likes
1,132

Hi,

Use function module HR_SGPBS_YRS_MTHS_DAYS.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 4:09 PM

Read only

Former Member
0 Likes
1,132

Hi Sharma,

Try this FM's

date_convert_to_factorydate,

hr_hk_diff_bt_2_dates.

Regards

Adil

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,132

DAT3 = DAT2 - DAT1.

WRITE DAT3.

Read only

Former Member
0 Likes
1,132

Hi All,

i forgot 2 mention excluding holidays

thanks and regards

Sharma

Read only

0 Likes
1,132

i dont think you need a FM to do this:

no of days = ( date2 - date1 )

oh forgot to mention:

new no of days = ( no of days - holidays )

pk

Read only

Former Member
0 Likes
1,132

Hi,

thanks for ur replies.

points are awarded for appropriate answer.

thanks

D.Sharma