Skip to Content
0

Customer Exit Logic based on Cal month to use as a prompt

Nov 01, 2016 at 08:08 PM

45

avatar image
Former Member

Hi Experts,

We have a current requirement where User will input a Cal month(05.2016) and the result should be in the range (01.2016 - 05.2016) ie. which ever month we are giving as a prompt..the result should be from that year first month to given month.

Please let me know whether this can be achieved through C.Exit or any alternative method.

It will be great if you are providing the code.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Lorenzo Te
Nov 23, 2016 at 08:04 AM
0

Hi Sarath,

Hope you are doing well.

I assume you are using BEx for this requirement?

This is possible by using the customer exit for the variables.

One thing to keep mind of is the step (I_STEP in the code) or level at which the exit code will run. In your case, this should be I_STEP = 2.

I assume you want the customer to always see only 1 input field (for calendar/month) and not a range.

Then you need 2 variables, both belonging to the infoobject (0CALMONTH)

1 variable should be user entry, ready for input, and a single value. Say this is ZV_CALMO_INP

The 2nd variable should be hidden (not ready for input), customer exit and interval. Say this is ZV_CALMO

The code should look something like this:

.

.

DATA: L_S_RANGE TYPE RSR_S_RANGESID,

LOC_VAR_RANGE LIKE RRANGEEXIT.

.

IF I_STEP = 2.

CASE I_VNAM.

WHEN 'ZV_CALMO'.

LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZV_CALMO_INP'. "This line is to look for the user input variable

clear: l_s_range.

IF loc_var_range-low IS NOT INITIAL.

"If the input variable is maintained, derive the range.

"l_s_range-low will contain the first month of the year,

"while l_s_range-high will contain the user input.

l_s_range-sign = 'I'.



l_s_range-opt = 'BT'.

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

"l_s_range-low = .

l_s_range-high = loc_var_range-low.

ENDIF.

APPEND l_s_range TO e_t_range.


ENDLOOP.

.

.

ENDCASE.

ENDIF.

.

.

Good luck with this!

Share
10 |10000 characters needed characters left characters exceeded