Skip to Content
0
Former Member
Nov 08, 2011 at 01:27 PM

ABAP Routine for Calendar Year in Infopackage

282 Views

HI ALL,

I have searched in forum I am getting the code for CALMONTH but i need for CALYEAR.

i have written the ABAP routine in info-package level for below scenario.

once 2011 year data is completed it should get the 2012 year data my code is below.

data: l_idx like sy-tabix.

DATA: lv_year(4) type c.

read table l_t_range with key

fieldname = 'CALYEAR'.

l_idx = sy-tabix.

lv_year = sy-datum(4).

l_t_range-low = lv_year.

modify l_t_range index l_idx.

p_subrc = 0.

another info-package when 2010 is completed the below code need to get the 2011 year data the code is below.

data: l_idx like sy-tabix.

data: lv_year(4) TYPE c.

read table l_t_range with key

fieldname = 'CALYEAR'.

l_idx = sy-tabix.

lv_year = sy-datum(4).

lv_year = lv_year - 1.

l_t_range-low = lv_year.

modify l_t_range index l_idx.

p_subrc = 0.

But some who my code is not working in test system.

can any one correct me if I am wrong on my code.

Thanks,

kumar