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

Function Module

Former Member
0 Likes
481

Hi,

hello good afternoon. Can anyone help me to find a function module that automatically it subtract 1 month to my entered date. Please.

Thank you.

Regards,

JC

4 REPLIES 4
Read only

Former Member
0 Likes
412

Hi

Use FM /BEV4/PLPS__ADD_MONTH_TO_DATE to subract one month from the entered date.

Pass MONTHS as '-1'.

Thank you,

Ramu N.

Read only

0 Likes
412

Hi,

Can you give an example on how to use FM /BEV4/PLPS__ADD_MONTH_TO_DATE.

thanx,

JC

Read only

0 Likes
412

Hi

DATA : V_DATE LIKE SY-DATUM.

v_DATE = SY-DATUM.

CALL FUNCTION '/BEV4/PLPS__ADD_MONTH_TO_DATE'

EXPORTING

MONTHS = '-1'

OLDDATE = V_DATE

IMPORTING

NEWDATE = V_DATE.

WRITE : / V_DATE.

Thank you,

Ramu N.

Read only

0 Likes
412

Hi

There are quite a lot of FM's for the same. Below are few.

<b>SG_PS_ADD_MONTH_TO_DATE

BKK_ADD_MONTH_TO_DATE

HR_HCP_ADD_MONTH_TO_DATE

HR_BR_ADD_MONTH_TO_DATE

HR_PT_ADD_MONTH_TO_DATE</b>

Here is one simple example:

data: l_date type sy-datum value '20061031'.

CALL FUNCTION 'HR_PT_ADD_MONTH_TO_DATE'
  EXPORTING
    DMM_DATIN       = l_date
    DMM_COUNT       = '1'
    DMM_OPER        = '-'
    DMM_POS         = '1'
 IMPORTING
   DMM_DAOUT       = l_date
 EXCEPTIONS
   UNKNOWN         = 1
   OTHERS          = 2.

write:/ l_date.

Kind Regards

Eswar