cancel
Showing results for 
Search instead for 
Did you mean: 

Selection criteria is fiscal year/period but need to restrict KF by date

Former Member
0 Kudos

Hi,

I have query where selection criteria is based on fiscalyear/period and in result I need to have Netvalue for all the sales order by created on date for that fiscal year/period.

For eg if I have entered fiscal year/period as 008.2007, I should get net value for all the orders that have created on date between 08/01/2007 to 08/31/2007.

Can anyone help me about this please.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello DV

Here is a tricky solution of this problem

1. Take user input variable based on fiscalyear period

2. Create a customer exit variable based on creation date

3. Write exit to get range from the fiscal year period, use standard FM to get first day and last day of period...

4. Restrict your created on characteristic by this exit variable

5. Now the tric comes here...you have used fiscal year period in filter which will restric the value based on that which u dont want...just exclude this user input selection--> right click on fiscal year period and you have option to exclude

Reward points if your issue is solved

Thanks

Tripple k

Former Member
0 Kudos

Can u show me how exactly this exit should look like

Former Member
0 Kudos

Hi DV

Here is the code

put it in I_STEP=2

WHEN 'EXIT NAME"

READ TABLE I_T_VAR_RANGE INTO loc_var_range with key vnam = 'userinput variable name'

v_fiscal_year = loc_var_range-low_0(4)

v_period = loc_var_range-low+4(3)

CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'

EXPORTING

i_gjahr = v_fiscal_year

  • I_MONMIT = 00

i_periv = Give your fiscal year variant name

i_poper = v_per

IMPORTING

e_date = v_date_beg

EXCEPTIONS

input_false = 1

t009_notfound = 2

t009b_notfound = 3

OTHERS = 4.

CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'

EXPORTING

i_gjahr = v_fiscal_year

  • I_MONMIT = 00

i_periv = Give your fiscal year variant name

i_poper = v_per

IMPORTING

e_date = v_date_end

EXCEPTIONS

input_false = 1

t009_notfound = 2

t009b_notfound = 3

OTHERS = 4.

CLEAR s_range.

MOVE:

v_date_beg TO loc_range-low,

v_date_end TO loc_range-high.

loc_range-sign = 'I'.

loc_range-opt = 'BT'.

APPEND s_range TO e_t_range.

Thanks

Tripple k