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

months display

Former Member
0 Likes
579

My issue is I am giving i/p 200609 as period.

Then I am giving month i/p as 4.

I am having o/p field startmonth and Endmonth.

In startmonth i should get 200606 &

In endmonth I will get obviously 200609.

How can I do this. Is there any fm for this.

Plz help me..

5 REPLIES 5
Read only

Former Member
0 Likes
544

DATA:

zlv_period TYPE N length 6.

zlv_period4(2) = zlv_period4(2) + <input>.

Regards,

John.

Read only

Former Member
0 Likes
544

Hello,

Use this FM - HR_PT_COMPUTE_MONTHS

set the modify_interval parameter to P, + or -

Or

Use F.M. HR_HK_DIFF_BT_2_DATES and put Output format as '04'.

Date 1 is the higher date and Date2 is Lower date.

Cheers,

Chandra Sekhar.

Read only

Former Member
0 Likes
544

Hi,

Data : st_month type month,

en_month type month.

st_month = <i/p month>

en_month = (<i/p period>(4)+2) + <i/p month>

Hope it works

Read only

Former Member
0 Likes
544

Hi,

Use the FM CCM_GO_BACK_MONTHS

  

data : gv_datum like sy-datum.

CALL FUNCTION 'CCM_GO_BACK_MONTHS'
    EXPORTING
      currdate   = p_date(6) "Selection screen parameter
      backmonths = '4' "Parameter for back months.
    IMPORTING
      newdate    = gv_datum.

write : 'start month' gv_datum(6),
          'End date' p_date(6) " Give selection parameter define to give date ex ; 200806.

Thanks,

Sriram Ponna.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
544

at selection-screen output.

cut the month part

then subtract it from 4.

check whether its negative value then add with 12

ans subtract 1 from year

then concatenate it and store in the startmonth field

rewad if usefull