cancel
Showing results for 
Search instead for 
Did you mean: 

populating a text variable via a customer exit

Former Member
0 Kudos
311

I need to populate a text variable with a date range which is based off a date that is entered by the user. the user enters the Quarter, like 4/2006 and the report shows a rolling 4 quarters. I need to display this range to the user in the title. so they would want to see 01/2006 through 04/2006. I tired to do this but it only allows for 01/2006 to be entered in the field. How do i get the whole thing? do i need to create 2 separate variables?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello ,

Create a text variable(Interval) with processing type as customer exit.

In zxrsru01 code write the code in such a way that get the user input value for isntance say 4/2006 and populate the value in the customer exit from 1/2006 to 4/2006, hope this is what you required.

hope it is clear

assign points if useful

Former Member
0 Kudos

It won't take the from and to. Do i use the typical code for ranges or is there soemthing esle I need to do with text varialbes.

Former Member
0 Kudos

Just change the variable name and try this code.

WHEN 'userexit'.

IF i_step = 2. "after the popup

LOOP AT i_t_var_range INTO loc_var_range

WHERE vnam = 'userinput'.

CLEAR l_s_range.

CONCATENATE loc_var_range-low+0(4)'01' INTO l_s_range-low.

l_s_range-HIGH = loc_var_range-low.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

EXIT.

ENDLOOP.

ENDIF.

Note : The userinput variable must be single value one.

The userexit variable of type text and processing type customer variable must be of interval option.

Former Member
0 Kudos

It won't let me pick Interval, it just has single. Do you have soem sample coe?

Former Member
0 Kudos

Hello ,

Theh have two text variables with procesing type as replacement path ,

first text variable for charac calquarter with processing type as replacement path, replace variable with external charac key value and interval use as from and same another text variable with interval use as To.

anyhow you might have had customer exit variable for rolling months calculation , so these two text variables replaces the value of the customer exit.

hope it is clear

assign points if helpful

Former Member
0 Kudos

I am not sure I follow. I tried via the user exit but it will not return the correct form date. If I put in 1/2007 and want to go back 3 quarters it should say 2/2006 - 01/2007. it doens't calcualte right. If i use replacemetn path can i use offsets?

Former Member
0 Kudos

what do I put in for the external charac key value

Former Member
0 Kudos

Hello,

When you create the text variable , there will be option called

Replace Variable With there you have to select the option External Characteristic key value.

If you need in the format Jan 2007, Feb 2007 ...etc like this then you have to select the option Name(text) option

hope it is clear

Former Member
0 Kudos

what I need though is it to be a range which is determined off the quarter entered minus 3