on 11-21-2007 10:15 AM
Hi frnds,
I have a requirement like ,
Number of Days should be enterd in the Selection screen ,
If user enters 10 Days in selection screen, then it should bring the records like date from = sy date and date to = ( the date after ten days from today ) for a characteristic( validity ) which holds the dates ,
i believe that i can create one formula variable to enter the number of days and how do i relate this with the other variable in the char ( validity ) ,
Could you please guide and sample code would be a great help ,
thanks ,
sathy
Hello
Create a user input variable for getting no. of days in it
Create a customer exit and do following coding in cmod
WHEN 'CUST EXIT VAR NAME'.
v_beg = sy-datum.
CLEAR l_var_range.
READ TABLE i_t_var_range INTO l_var_range
WITH KEY vnam = 'user input variable'.
v_end = v_beg + l_var_range-low.
l_range-sign = I.
l_range-opt = 'BT'.
l_range-low = l_sales_beg.
l_range-high = l_sales_end.
APPEND l_range TO e_t_range.
Thanks
Tripple k
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Venkat / Tripple ,
With your code sample i have written a code like this but it does not seems to be working , Could you please help , ( 'ZQUOT_N' = Customer Exit variable and 'ZQUOTE_R' = formula variable to get the number of days )
Please guide me on what mistake i have done here , thanks for your help
WHEN 'ZQUOT_N'.
v_beg = sy-datum.
CLEAR l_var_range.
READ TABLE i_t_var_range INTO l_var_range
WITH KEY vnam = 'ZQUOTE_R'.
v_end = v_beg + l_var_range-low.
l_range-sign = 'I'.
l_range-opt = 'BT'.
l_range-low = v_beg.
l_range-high = v_end.
APPEND l_range TO e_t_range.
Try out the belwo and let me know:
WHEN 'ZQUOT_N'.
v_beg = sy-datum.
CLEAR l_var_range.
READ TABLE i_t_var_range INTO l_var_range
WITH KEY vnam = 'ZQUOTE_R'.
v_end = v_beg + l_var_range-low.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
l_S_range-low = v_beg.
l_s_range-high = v_end.
APPEND l_s_range TO e_t_range.
EXIT.
ENDCASE.
If it is not giving proper results for next month to date when added by the number of days, we just need to make small changes.
hi ,
its not working still, even i have tried with I_STEP = 2 after WHEN 'ZQUOT_N' ,
but it works if hardcode like
v_end = v_beg + 10 . ( instead of l_var_range-low ) , Appreciate your help on this thanks , sathy
WHEN 'ZQUOT_N'.
*I_STEP = 2.
v_beg = sy-datum.
CLEAR l_var_range.
READ TABLE i_t_var_range INTO l_var_range
WITH KEY vnam = 'ZQUOTE_R'.
v_end = v_beg + l_var_range-low.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
l_S_range-low = v_beg.
l_s_range-high = v_end.
APPEND l_s_range TO e_t_range.
EXIT.
ENDCASE.
Sathya,
Here you can go for another formula variable with processing type customet exit where you will be reading the days entered by the user(other variable with user input) and then populate the from date as sys date and to date as 10 plus. This should be a better solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.