cancel
Showing results for 
Search instead for 
Did you mean: 

Customer Exit

Former Member
0 Kudos

Hi All,

I have a Field A with Numc 6 which is carrying data as 201101, 201102, 201001,201002 .....

In report i want to restrict it to the current year

ie: i want data of Field A (first 4 letters) equal to current year.

to achieve this i created a customer exit variable "VAR01"

Could any one please tell me the code to achieve this requirment.

Thanks you

Sandy

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

data: year(4) type c.

data: mth_min(6) type c.

data: mth_max(6) type c.

When 'VAR01'.

clear : l_s_range, year .

year = sy-datum+0(4).

concatenate year '01' into mth_min.

concatenate year '12' into mth_max.

l_s_range-low = mth_min.

l_s_range-high = mth_max.

l_s_range-sign = 'I'.

l_s_range-opt = 'BT'.

Append l_s_range to e_t_range.

Former Member
0 Kudos

Hi ,

If i got your requirement correctly then your code would be as follows :

The below code has to be written in i_step = 1 mode . If you dont want to display your variable in the selection screen then your ready for input checkbox should be deselected and make this variable as mandatory .



data: year(4) type c.
When 'VAR01'.

clear : l_s_range, year .

year = sy-datum+0(4).

l_s_range-low = year.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
Append l_s_range to e_t_range.

Or just clarify for me , do you have 0calyear with you or not . because the above code and the variable VAR01 is on 0calyear .

So kindly let me know about this . In that case we have to change the code

Hope the above reply was helpful.

Kind Regards,

Ashutosh Singh

Edited by: Ashutosh Singh on May 10, 2011 4:49 PM

Former Member
0 Kudos

I have a Field A with Numc 6 which is carrying data as 201101, 201102, 201001,201002 .....

In report i want to restrict it to the current year

ie: i want data of Field A (first 4 letters) equal to current year.

to achieve this i created a customer exit variable "VAR01"

data: A type char(4).

a = numc(4).

if you are getting data in the data source in to transformation or transfer rules, i recommended creating a infoobject for your data and do it in the transformation or transfer rules. as it wil be much faster and easier to use, rather then user exit.