cancel
Showing results for 
Search instead for 
Did you mean: 

Text Variable with Customer Exit issue

former_member190390
Participant
0 Kudos

Hello Experts,

I have Fiscal Week and Fiscal Year in selections screen, both will be calculated using Customer Exit variable. My requirement is to display text for column(WK "Current Fiscal Week Text Variable" Sales).

By default Current Fiscal Week and Current Fiscal Year are calculated and displayed in selection screen. I can able to display the text variable value for default value but in my requirement USER can change the Fiscal Year or Fiscal Week or both.

For this i have to write I_STEP = 2. In code can i use the following condition or how to write this condition and how can i take the input values. In loop can i use the code as follows.

IF I_step = 2.

LOOP at I_T_VAR_RANGE INTO LOC_VAR_RANGE

WHERE VNAM = 'ZCURRENTWEEK' or 'ZCURRENTYEAR'.

CLEAR L_S_RANGE.

any help to get the logic will be appreciated.

Thanks in advance,

Venky

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If i am not wrong then you want text of the week, which is enter by user.

You can acheive this by using replacement path variable with 'ZCURRENTWEEK'.

just one question. if user change year with preveous year and don't change the week, kept it as current week. then what will happen to your query?

Regards,

former_member190390
Participant
0 Kudos

Hi,

If user changes only Fiscal Year I have written logic and it will take the current week and changed year from variable and display for that year, it's working fine, but in my reqwuirement user can change Fiscal Week or Fiscal Year or both, when i go for I_STEP = 2, what is the variable i have to take as input for this? I have to take Week from one variable and year from another variable.

Usually when we write code for I_STEP = 2, we can take one variable value as input and using that value we can calculate the customer exit.

In my requirement i have to display the Week value using user entry in format ARP/04/2009, for this i converted week value into text display using FM. So replacement path willnot work, it can display only Week value in Key/Label/Attribute/Hierarchy. So i am using Customer Exit.

Any help?

Thanks,

Venky

Former Member
0 Kudos

Hi,

you can use this code.

when 'Text variable'.

IF I_step = 2.

read table i_t_var_range into s_var_range

with key vnam = 'VAR_1'.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

write logic to get week from VAR_1.

l_s_range-low = l_date+0(6).

read table i_t_var_range into s_var_range

with key vnam = 'VAR_2'.

write logic to get year from VAR_2.

append l_s_range to e_t_range.

endif.

*****

Now according to me if you are restricting value to CALWEEK, then you don't need to go for year variable to derive year.

what i understand here is that 1st selection screen apear.

in that we can see current year 016.2009

year 2009.

Now if user will change the year from 2009 to 2008 and change week from 016.2009 to 010.2009.

then you will derive week from year and make it as 016.2008 as user has selected 2008. m i right?

then you just use calweek vaiable.

Regards,

former_member190390
Participant
0 Kudos

Hi Ashish,

thanks for quick reply.

In selection screen

1. Current Week 016

2. Current Year 2009

User can change Week from 016 to 014 or Year from 2009 to 2008 or can change both. Week will display individual value not concatenated with year. I think with your login i may get solution, i got idea to read two variables.

I have to read the week and year whatever entered and convert that into text link APR/04/2009 which i have written code for this.

Thanks,

Venky

Former Member
0 Kudos

hi,

oh i see... now i got your point. you are not using calweek but using Week number. then you can take reference of mine code.

Regards,