cancel
Showing results for 
Search instead for 
Did you mean: 

Over riding the User entry using exit

shanthi_bhaskar
Active Contributor
0 Kudos

Hi,

In Bex selection screen user will give entry in Mandt field ZDAYS (No. Of days), In step = 2 of customer exit i am using this entry for calculating 2 dates which will be moved other varaible(ZEXIT) processed by customer exit.

ZDAYS infoobject is dummy object only used for BEx perspective to hold input value i.e No. odf days , it doesnt have any transaction data associated to it.

My hurdle is when i give some value to ZDAYS say 10.

It returns nothing as there is no data exists for ZDAYS field in data target.

But if i give <= 10 then my query will work, as it will fetch the data where ZDAYS will have blank.

My code will be like this..

IF I_STEP = 2.

READ TABLE I_T_VAR_RANGE INTO WA_I_T_VAR_RANGE WITH KEY VNAM = 'ZDAYS'.

w_der_date = sy-datum - WA_I_T_VAR_RANGE-LOW.

zdate = w_der_date.

CLEAR WA_I_T_VAR_RANGE.

IF I_VNAM = 'ZEXIT'.

CLEAR l_s_range.

l_s_range-low = zdate.

l_s_range-high = ZACT_GI_DTE.

l_s_range-sign = 'I'.

l_s_range-opt = 'BT'.

APPEND l_s_range TO e_t_range.

CLEAR l_s_range.

ENDIF.

ENDIF.

What are the options to resolve the issue.

i tried by adding below piece of code to override the user entry. But it didnt work...

IF I_VNAM = 'ZDAYS'.

CLEAR l_s_range.

l_s_range-low = space.

l_s_range-sign = 'I'.

APPEND l_s_range TO e_t_range.

CLEAR l_s_range.

ENDIF.

Thanks in advance.

bhaskar...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Try

l_s_range-low = '*'.

l_s_range-sign = 'I'.

l_s_range-opt = 'CP'.

Should force every values to be selected.

shanthi_bhaskar
Active Contributor
0 Kudos

Frédéric ,

Thanks for replying..

itried by adding the code as u suggested

IF I_VNAM = 'ZDAYS'.

l_s_range-low = '*'.

l_s_range-sign = 'I'.

l_s_range-opt = 'CP'.

APPEND l_s_range TO e_t_range.

CLEAR l_s_range.

ENDIF.

it didnt work i tried it in Step 2 and 3.

thanks

bhaskar

Former Member
0 Kudos

I guess you should empty the record in the I_T_VAR_RANGE table, since the variable ZDAYS is not defined as customer exit.

As you use it for a calculation, can't you instead of a variable on a characteristic, create a formula variable ?

shanthi_bhaskar
Active Contributor
0 Kudos

Hi Frédéric,

ZDAYS defined as customer exit..

Can i refresh the I_T_VAR_RANGE structure so that it will empty...does it will work..

IF I_STEP = 2.

  • BREAK SBHASKAR.

READ TABLE I_T_VAR_RANGE INTO WA_I_T_VAR_RANGE WITH KEY VNAM = 'ZCNBREXT'.

w_der_date = sy-datum - WA_I_T_VAR_RANGE-LOW.

zdate = w_der_date.

*refresh IT_VAR_RANGE.*_

CLEAR WA_I_T_VAR_RANGE.

IF I_VNAM = 'ZVAGIDEXIT'.

CLEAR l_s_range.

l_s_range-low = zdate.

l_s_range-high = ZACT_GI_DTE.

l_s_range-sign = 'I'.

l_s_range-opt = 'BT'.

APPEND l_s_range TO e_t_range.

CLEAR l_s_range.

ENDIF.

ENDIF.

thanks

bhaskar

Former Member
0 Kudos

Hi,

I would prefer to get this done by adding one "local formula" to columns instead of adding one dummy object in info provider.

If you want to achieve the same results by formula, do the following steps.

1. Create one new "Formula" in columns.

2. Inside that formula, create one New "Formula variable" for "Number of Days" with user input enabled & Number as dimension.

3. In customer exit read this formula variable and do your calculations like ZEXIT = System date - Formula variable value (No of days).

By this approach, at any time you will get result irrespective of user entry.

Hope it solves your issue.

Regards,

Arun Thangaraj.