on 08-27-2014 1:51 PM
Hi all
I wanted to find out no. of days in a month in formula variable customer exit at bex. I did the following code, which returning X value. Can anybody helps here.
WHEN 'ZFV_NO_DAYS_MONTH'.
IF I_STEP = 2.
CLEAR L_S_RANGE.
READ TABLE I_T_VAR_RANGE INTO XTAB WITH KEY VNAM = 'zdate1'.
V_DATE = XTAB-LOW.
P_DATE = V_DATE+6(2).
CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'
EXPORTING
P_FECHA = V_DATE
IMPORTING
NUMBER_OF_DAYS = V_DATE1.
V_RES = V_DATE1 - P_DATE.
L_S_RANGE-LOW = V_RES.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
Regrds
swetha
Hi,
Instead of customer exit code, you can also try with standard variable 0NUMDAY ----Number of Days.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As you mentioned need to calculate no of days in a month thta'ts why i suggested 0NUMDAY ,
Refer below how to use that :
User is passing data through another variable i.e of which format either 0calday/0calmonth /Zdate
Also check like this Put Date field (created Customer Exit variable Reference field ) in rows .
Thanks.
Hi Swetha,
After reading the thread, just post here if you encountered any problem..
You may also try this if you want to know the number of days of a given month based on the entered date by the user (I revised your code):
NOTE: I assume that the user enters a DATE..
DATA: temp_month type i length 2,
temp_year type i length 4,
temp_day type i length 2.
WHEN 'ZFV_NO_DAYS_MONTH'.
IF I_STEP = 2.
CLEAR L_S_RANGE.
READ TABLE I_T_VAR_RANGE INTO XTAB WITH KEY VNAM = 'zdate1'.
temp_month = XTAB-LOW+4(2).
temp_year = XTAB-LOW(4).
CALL FUNCTION '/SDF/RBE_GET_DAYS_PER_MONTH'
EXPORTING
PAR_MONTH = temp_month
PAR_YEAR = temp_year
IMPORTING
PAR_DAYS = temp_day
***May I ask why did you subtract V_DATE1 and P_DATE in your code? Anyway, this revised code will only get the number of days in a month..
L_S_RANGE-LOW = temp_day.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
Regards,
Loed
Hi Swetha
in your code itself just change something as mentioned below
VDATE1 type as integer.
WHEN 'ZFV_NO_DAYS_MONTH'.
IF I_STEP = 2.
CLEAR L_S_RANGE.
READ TABLE I_T_VAR_RANGE INTO XTAB WITH KEY VNAM = 'zdate1'.
V_DATE = XTAB-LOW.
*Hide No need*** P_DATE = V_DATE+6(2).
CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'
EXPORTING
P_FECHA = V_DATE
IMPORTING
NUMBER_OF_DAYS = V_DATE1.
*hide** V_RES = V_DATE1 - P_DATE.
*hide** L_S_RANGE-LOW = V_RES.
*Add the below new line
L_S_RANGE-LOW = V_DATE1.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
Regards
Sureshkumar C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.