2007 Feb 16 4:39 AM
hi all,
pls go through the below code,i m facing some problem when i pass the t_days in the function module. the run time error is some data type miss match.
plz help me.
data:
b_date type vbrk-fkdat ,
pay_date TYPE vbrk-fkdat ,
t_days type t052-ztag1.
***********************************
SELECT zterm
ztag1
FROM t052
INTO TABLE t_t052
FOR ALL ENTRIES IN t_vbrk
WHERE zterm = t_vbrk-zterm .
***************************************
***from t052-ztagi-> we get the no of days and we use the below function module to pass the t_days and b_date and the new date i.e pay_date is geting.
READ TABLE t_t052 INTO w_t052 WITH KEY zterm = w_vbrk-zterm.
IF sy-subrc = 0.
t_days = w_t052-ztag1.
b_date = w_vbrk-fkdat.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = b_date
days = t_days
months = 0
SIGNUM = '+'
years = 0
IMPORTING
CALC_DATE = pay_date
.
w_record-pdue_date = pay_date.
the run time error:
The function module interface allows you to specify only fields
of a particular type under "DAYS". The field "T_DAYS" specified here
has a different field type.
hi all,
pls go through the below code,i m facing some problem when i pass the t_days in the function module. the run time error is some data type miss match.
plz help me.
data:
b_date type vbrk-fkdat ,
pay_date TYPE vbrk-fkdat ,
t_days type t052-ztag1.
***********************************
SELECT zterm
ztag1
FROM t052
INTO TABLE t_t052
FOR ALL ENTRIES IN t_vbrk
WHERE zterm = t_vbrk-zterm .
***************************************
***from t052-ztagi-> we get the no of days and we use the below function module to pass the t_days and b_date and the new date i.e pay_date is geting.
READ TABLE t_t052 INTO w_t052 WITH KEY zterm = w_vbrk-zterm.
IF sy-subrc = 0.
t_days = w_t052-ztag1.
b_date = w_vbrk-fkdat.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = b_date
days = t_days
months = 0
SIGNUM = '+'
years = 0
IMPORTING
CALC_DATE = pay_date
.
w_record-pdue_date = pay_date.
the run time error:
The function module interface allows you to specify only fields
of a particular type under "DAYS". The field "T_DAYS" specified here
has a different field type.
2007 Feb 16 4:43 AM
Hi,
When u r using teh FM u have to refer the types only from the FM,
<b>use t_DAYS LIKE T5A4A-DLYDY.</b>
DATA: b_date LIKE P0001-BEGDA,
t_days LIKE T5A4A-DLYDY,
pay_DATE LIKE P0001-BEGDA.Sometimes it will dump when u refer wrong type.
Hope this solves ur query, please reward points and mark teh thread closed if this solves.
2007 Feb 16 4:44 AM
Hi,
you just change the type of "t_days" to the type specified for parameter "days" in the function module. Yoou will find the type of days in the import/export parameter of the function moduke
thanks
2007 Feb 16 4:45 AM
Hi
t052-ztag1 is NUMC of 3
this is generating the problem
Change the same as
DAYS LIKE T5A4A-DLYDY
Regards
Shiva
2007 Feb 16 4:45 AM
t_days should be type NUMC.
If it is not then declare a variable. pass this to function module.
data: g_days(2) type n.
g_days = t_days.
pass g_days to functin module
2007 Feb 16 4:54 AM
Hi ,
Change the definition of t_days to
DATA : t_days ltypeT5A4A-DLYDY (like it is defined in the FM)
Regards,
Sowmya.
2007 Feb 16 4:55 AM
Hi ,
t_days type t052-ztag1 is of num(3) here u can use
t_days type T5A4A-DLYDY ." which is num(2)
2007 Feb 16 4:57 AM
data : totaldays like T5A4A-DLYDY
READ TABLE t_t052 INTO w_t052 WITH KEY zterm = w_vbrk-zterm.
IF sy-subrc = 0.
totaldays = w_t052-ztag1.
b_date = w_vbrk-fkdat.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = b_date
days = totaldays
months = 0
SIGNUM = '+'
years = 0
IMPORTING
CALC_DATE = pay_date
.
regards
shiba dutta
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |