Application Development 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: 

problem with function module

Former Member
0 Kudos

<<Locked. This is not a training forum. A basic level of knowledge is expected>>

Hi,

In the below program function module is not working.Giving runtime errors.

tables : mseg.

types : begin of ty_mseg,

mblnr type mseg-mblnr,

mjahr type mseg-mjahr,

menge type mseg-menge,

end of ty_mseg.

data : menge type mseg-menge.

data : it_mseg type table of ty_mseg with header line.

select-options : s_mblnr for mseg-mblnr,

s_mjahr for mseg-mjahr.

select * from mseg into corresponding fields of table it_mseg

where mblnr in s_mblnr.

CALL FUNCTION 'CO_ZF_QUANTITY_ROUNDING'

EXPORTING

  • FLG_ERROR = ' '

FLG_ROUNDING = 'X'

QUANTITY = mseg-menge

T006WA = ' '

IMPORTING

QUANTITY = mseg-menge.

loop at it_mseg.

write : / it_mseg-mblnr,it_mseg-mjahr,it_mseg-menge.

endloop.

Edited by: Matt on Mar 9, 2009 10:07 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

What error it was throwing, can you check whether you are passing all required parameters or not?

~Satya

9 REPLIES 9

Former Member
0 Kudos

What error it was throwing, can you check whether you are passing all required parameters or not?

~Satya

0 Kudos

sorry i dont know how to pass parameters

0 Kudos

how about quitting your job, goin back to the training center, learn some ABAP and then come back and try it??

pk

0 Kudos

please tell some tips .

0 Kudos

I tend to agree with Kishan, but let me give you some help anyway.

What is the exact error message (short dump) from transaction ST22.

Is it something like TYPE CONFLICT?

0 Kudos

A type conflict occurred when structure parameters were passed in the.......

Error analysis

An exception occurred. This exception will be dealt with in more detail

below. The exception, assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught, which

led to a runtime error. The reason for this exception is:

In the function "CO_ZF_QUANTITY_ROUNDING" the STRUCTURE parameter "T006WA" is

typed in such a way

that actual parameters are not valid, unless they are compatible

according to the Unicode fragment view. The actual parameter "' '" does

not, however, have a compatible fragment view.

0 Kudos

When you want to use T006WA for rounding, pass it to the function module as well, otherwise do NOT pass it at all:


CALL FUNCTION 'CO_ZF_QUANTITY_ROUNDING'
  EXPORTING
    quantity           =
* IMPORTING
   QUANTITY           = 
          .

Only pass these parameters that you are actually filling, like in this case the quantity.

0 Kudos

sir,

if i pass only these parameters menge is not rounding off.

CALL FUNCTION 'CO_ZF_QUANTITY_ROUNDING'

EXPORTING

  • FLG_ERROR = ' '

FLG_ROUNDING = 'X'

QUANTITY = mseg-menge

0 Kudos

It should round off, but probably not the way you want it to. So, pass this parameter T006WA as well. You can retrieve these values from db table T006. Select it from there, and pass it to the import parameter.