Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

data type miss match

Former Member
0 Likes
1,081

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.

7 REPLIES 7
Read only

Former Member
0 Likes
996

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.

Read only

Former Member
0 Likes
996

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

Read only

Former Member
0 Likes
996

Hi

t052-ztag1 is NUMC of 3

this is generating the problem

Change the same as

DAYS LIKE T5A4A-DLYDY

Regards

Shiva

Read only

Former Member
0 Likes
996

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

Read only

Former Member
0 Likes
996

Hi ,

Change the definition of t_days to

DATA : t_days ltypeT5A4A-DLYDY (like it is defined in the FM)

Regards,

Sowmya.

Read only

Former Member
0 Likes
996

Hi ,

t_days type t052-ztag1 is of num(3) here u can use

t_days type T5A4A-DLYDY ." which is num(2)

Read only

Former Member
0 Likes
996

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