03-09-2009 7:46 AM
<<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
03-09-2009 7:48 AM
What error it was throwing, can you check whether you are passing all required parameters or not?
~Satya
03-09-2009 7:48 AM
What error it was throwing, can you check whether you are passing all required parameters or not?
~Satya
03-09-2009 7:49 AM
03-09-2009 7:51 AM
how about quitting your job, goin back to the training center, learn some ABAP and then come back and try it??
pk
03-09-2009 7:54 AM
03-09-2009 7:57 AM
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?
03-09-2009 7:59 AM
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.
03-09-2009 8:06 AM
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.
03-09-2009 8:23 AM
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
03-09-2009 8:27 AM
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.