‎2008 May 02 12:15 PM
hi,
i am making a report in which i am using function module and when it gets execute it gives runtime error and the error points to the function called.
so plz help me out as how to solve dis problem?
TABLES : CHVW.
SELECT-OPTIONS : PA_CHVW FOR CHVW-CHARG.
DATA : PA_AUFNR LIKE CHVW-AUFNR.
CALL FUNCTION 'ZFIND_ORDERS'
EXPORTING
QP_CHARG = PA_CHVW
P_MATNR =
IMPORTING
P_AUFNR = PA_AUFNR
‎2008 May 02 12:21 PM
Check the parameters of FM. You are directly passing select options variable. Might be this is the error or the error might be in FM 'ZFIND_ORDERS'. As this is a Z FM, you can check the coding done in FM and make changes where th error is coming by checking the description of the runtime error.
Let me know if any doubts.
Best Regards,
Vibha
Please mark all the helpful answers
‎2008 May 02 12:17 PM
Hi,
You cannot assign a select option to an /EXPORTINGimporting parameter.
EXPORTING/IMPORTING PARAMETERS are single fields
If you want to send multiple entries at a time you have to have TABLE PARAMETERS in the FM
santhosh
Edited by: Kaluvala Santhosh on May 2, 2008 4:47 PM
‎2008 May 02 12:17 PM
what's the description of the runtime error?
Call function type conflict?
‎2008 May 02 12:20 PM
Your PA_CHVW contains a range
u need to pass a single value
Wht u shld do is
loop at parameter
call FM
endloop.
‎2008 May 02 12:21 PM
Check the parameters of FM. You are directly passing select options variable. Might be this is the error or the error might be in FM 'ZFIND_ORDERS'. As this is a Z FM, you can check the coding done in FM and make changes where th error is coming by checking the description of the runtime error.
Let me know if any doubts.
Best Regards,
Vibha
Please mark all the helpful answers
‎2008 May 02 12:47 PM
HI,
the structure of the FM IS:-
FUNCTION ZFIND_PRDORD.
*"----
""Local Interface:
*" IMPORTING
*" VALUE(QP_CHARG) TYPE CHVW-CHARG OPTIONAL
*" VALUE(P_MATNR) TYPE CHVW-MATNR OPTIONAL
*" VALUE(P_AUFNR) TYPE CHVW-AUFNR OPTIONAL
*" EXPORTING
*" VALUE(AP_AUFNR) TYPE CHVW-AUFNR
*"----
DATA : BEGIN OF T_CHVW OCCURS 0,
XZUGA LIKE CHVW-XZUGA,
WERKS LIKE CHVW-WERKS,
MATNR LIKE CHVW-MATNR,
CHARG LIKE CHVW-CHARG,
AUFNR LIKE CHVW-AUFNR,
EBELN LIKE CHVW-EBELN,
MBLNR LIKE CHVW-MBLNR,
ZEILE LIKE CHVW-ZEILE,
BUDAT LIKE CHVW-BUDAT,
SHKZG LIKE CHVW-SHKZG,
BWART LIKE CHVW-BWART,
MENGE LIKE CHVW-MENGE,
MEINS LIKE CHVW-MEINS,
KZBEW LIKE CHVW-KZBEW,
END OF T_CHVW.
DATA : T1_CHVW LIKE T_CHVW OCCURS 0 WITH HEADER LINE.
*DATA : P_CHARG type CHVW-CHARG.
SELECT XZUGA WERKS MATNR CHARG AUFNR EBELN
MBLNR ZEILE BUDAT SHKZG BWART MENGE MEINS KZBEW
FROM CHVW INTO TABLE T_CHVW
WHERE
CHARG IN P_CHARG
XZUGA = ' '
AND BWART = '101'
AND KZBEW = 'F' .
ENDFUNCTION.
PLZZ TELL ME why it is giving error:-
Type conflict when calling a function module.
‎2008 May 02 12:52 PM
Hi,
Check the following code:
SELECT XZUGA WERKS MATNR CHARG AUFNR EBELN
MBLNR ZEILE BUDAT SHKZG BWART MENGE MEINS KZBEW
FROM CHVW INTO TABLE T_CHVW
WHERE CHARG EQ QP_CHARG
and XZUGA = ' '
AND BWART = '101'
and matnr eq p_matnr
and aufrn eq p_aufnr
AND KZBEW = 'F' .
Regards
Kannaiah
‎2008 May 02 1:01 PM
types: begin of st_chvw.
charg like chvw-charg,
aufnr like chvw-aufnr,
end of st_chvw.
data: it_chvw type table of st_chvw,
wa_chvw like line of it_chvw,
l_index type sy-index.
select CHARG from CHVW into corresponding fields of table it_chvw where charg in PA_CHVW.
if sy-subrc = 0.
loop at it_chvw into wa_chvw.
l_index = sy-index.
CALL FUNCTION 'ZFIND_ORDERS'
EXPORTING
QP_CHARG = wa_chvw-charg
P_MATNR =
IMPORTING
P_AUFNR = wa_chvw-aufnr.
modify it_chvw from wa_chvw index l_index.
endloop.
endif.
Let me know if any doubts.
Best Regards,
Vibha
Please mark all the helpful answers
‎2008 May 02 2:04 PM
Is your problem solved? Let me know if still there are any doubts.
Please close the thread if it is solved.