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: 

the FM not work whY?

Former Member
0 Kudos

concatenate '01' z_param5 z_param1(4) into z_date_m.

(z_date_m type sy-datum in the example is : 01092005)

CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'

EXPORTING

day_in = z_date_m

IMPORTING

LAST_DAY_OF_MONTH = z_date_ml.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

concatenate z_param1(4)z_param5 '01'into z_date_m.

(z_date_m type sy-datum in the example is : 20050901)

CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'

EXPORTING

day_in = z_date_m

IMPORTING

LAST_DAY_OF_MONTH = z_date_ml.

6 REPLIES 6

Former Member
0 Kudos

concatenate z_param1(4)z_param5 '01'into z_date_m.

(z_date_m type sy-datum in the example is : 20050901)

CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'

EXPORTING

day_in = z_date_m

IMPORTING

LAST_DAY_OF_MONTH = z_date_ml.

Former Member
0 Kudos

Hai Look at this code

The date format should be in 'YYYYMMDD'

data : v_last_day like sy-datum,

v_in_date like sy-datum.

v_in_date = '20050109'.

CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'

EXPORTING

DAY_IN = v_in_date

IMPORTING

LAST_DAY_OF_MONTH = v_last_day

  • 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.

write : / v_last_day.

Thanks & regards

Sreenivasulu P

Former Member
0 Kudos

Hi Liat,

Sy-datum will be stored as yyyymmdd but will be displayed on console as mmddyyyy format.

Just check the value of z_date_m once.

concatenatte z_param1(4) z-param5 '01' into z_date_m.

For proper values of z_date_m(01092005), the FM is giving exact results. I executed this FM, its working fine for value 01092005 as input.

CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'

EXPORTING

day_in = z_date_m

IMPORTING

LAST_DAY_OF_MONTH = z_date_ml.

Thanks,

Vinay

naimesh_patel
Active Contributor
0 Kudos

Transfer date in YYYYMMDD format.

Regards,

Naimesh

former_member184569
Active Contributor
0 Kudos

Hi Liat,

The day_in parameter is of the format yyyymmdd.

Pass the parameter in that format.

Thanks

Susmitha.

vinod_gunaware2
Active Contributor
0 Kudos

data: xt247 type t247.

parameters: s_date type sy-datum,

e_date type sy-datum,

monthn(30) type c.

at selection-screen.

call function 'RP_LAST_DAY_OF_MONTHS'

exporting

day_in = s_date

importing

last_day_of_month = e_date.

select single * from t247 into xt247

where spras = sy-langu

and mnr = e_date+4(2).

monthn = xt247-ltx.

regards

vinod