on 10-05-2008 2:50 AM
Type conflict when calling a function module.
Error in the ABAP Application Program
The current ABAP program "ZHOME_TEST_CNG" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
hi all,
am getting this when the print program is executed..please sugest me ASAP
A function module was called incorrectly.
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught in
procedure "%_SEL_SCREEN" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The call to the function module "/1BCDWB/SF00000212" is incorrect:
The function module interface allows you to specify only
fields of a particular type under "LT_AFKO".
The field "LT_AFKO" specified here is a different
>The call to the function module "/1BCDWB/SF00000212" is incorrect:
>The function module interface allows you to specify only
>fields of a particular type under "LT_AFKO".
>The field "LT_AFKO" specified here is a different
the error related to passing the incorrect parameters to the function module(smartform).
LT_AFKO defined differently than the interface parameter LT_AFKO, try to check it once.
LT_AFKO = LT_AFKO[] "<---try this also..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
data:lt_aufk like standard table of aufk,
lt_afko like standard table of afko,
lt_afpo like standard table of afpo,
lt_afvc like standard table of afvc,
lt_crhd like standard table of crhd,
lt_makt like standard table of makt.
i have declared in driver program like this and in smartform interface
LT_AUFK TYPE AUFK
LT_AFKO TYPE AFKO
LT_AFPO TYPE AFPO
LT_AFVC TYPE AFVC
LT_CRHD TYPE CRHD
in global definitions like this
WA_AUFK TYPE AUFK
WA_AFKO TYPE AFKO
WA_AFPO TYPE AFPO
WA_AFVC TYPE AFVC
WA_CRHD TYPE CRHD
please guided in this one...please
hai,
define a structure zakpo in se11
use same structure in se38 to create itab( lt_akpo).
and also use same structure in smartform(form interface).
_____________
u using standard structure so in form interface of smartform in tab tables u directly specify lt_afko like afko .
shan.
Edited by: shan palani on Oct 5, 2008 10:00 AM
try like this...
data:lt_aufk like standard table of aufk with header line, "use this
lt_afko like standard table of afko with header line,
lt_afpo like standard table of afpo with header line,
lt_afvc like standard table of afvc with header line,
lt_crhd like standard table of crhd with header line,
lt_makt like standard table of makt with header line.
are you using the below under the table tab..,
LT_AUFK TYPE AUFK
LT_AFKO TYPE AFKO
LT_AFPO TYPE AFPO
LT_AFVC TYPE AFVC
LT_CRHD TYPE CRHD
show the function calls also..
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST_HOME_CNG'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
*************call generated function module name.
CALL FUNCTION '/1BCDWB/SF00000212'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
LT_AUFK = lt_aufk
LT_AFKO = lt_afko
LT_AFPO = lt_afpo
LT_AFVC = lt_afvc
LT_CRHD = lt_crhd
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
after changing the parameters to tables in in the interface, change the code like this,,,
CALL FUNCTION '/1BCDWB/SF00000212'
EXPORTING
USER_SETTINGS = 'X'
TABLES
LT_AUFK = lt_aufk
LT_AFKO = lt_afko
LT_AFPO = lt_afpo
LT_AFVC = lt_afvc
LT_CRHD = lt_crhd
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
hai,
check weather there is any record in ur lt_afko[], it_akpo[].
or
in se38 while passing lnternal table check wheather u have passed like this or not lt_afko[] (content not header line) .
or
specify the name of lnternal table or workarea in text (text editor of s.form) is proper or not.
shan.
but wat my doubt is i wrote code in driver program....again i need to write in smartform????..this code i wrote it in driver program...which thing i hav to write in smartform...
&----
*& Report ZHOME_TEST
*&
&----
*&
*&
&----
REPORT ZHOME_TEST_CNG.
TABLES.
tables:aufk,afko,afpo,afvc,crhd,makt.
**********************INTERNAL TABLE DECLARATIONS.
*data:begin of lt_aufk occurs 0,
werks like aufk-werks,
auart like aufk-auart,
aufnr like aufk-aufnr,
autyp like aufk-autyp,
loekz like aufk-loekz,
ktext like aufk-ktext,
objnr like aufk-objnr,
status like BSVX-STTXT,
end of lt_aufk.
*
*data:begin of lt_afko occurs 0,
aufnr like afko-aufnr,
gstrp like afko-gstrp,
gltrp like afko-gltrp,
dispo like afko-dispo,
fevor like afko-fevor,
aufpl like afko-aufpl,
end of lt_afko.
*
*data:begin of lt_afpo occurs 0,
aufnr like afpo-aufnr,
matnr like afpo-matnr,
psmng like afpo-psmng,
projn like afpo-projn,
end of lt_afpo.
*
*
*data:begin of lt_afvc occurs 0,
aufpl like afvc-aufpl,
vornr like afvc-vornr,
ktsch like afvc-ktsch,
ltxa1 like afvc-ltxa1,
arbid like afvc-arbid,
werks like afvc-werks,
end of lt_afvc.
*
*data:begin of lt_crhd occurs 0,
objty like crhd-objty,
objid like crhd-objid,
werks like crhd-werks,
arbpl like crhd-arbpl,
end of lt_crhd.
data:lt_makt type makt.
data:lt_aufk like standard table of aufk with header line,
lt_afko like standard table of afko with header line,
lt_afpo like standard table of afpo with header line,
lt_afvc like standard table of afvc with header line,
lt_crhd like standard table of crhd with header line.
*lt_makt like standard table of makt with header line.
*
data: fs_aufk like line of lt_aufk,
fs_afko like line of lt_afko,
fs_afpo like line of lt_afpo,
fs_afvc like line of lt_afvc,
fs_crhd like line of lt_crhd.
*************DECLARING FUNCTIONAL MODULE NAME.
data:fm_name type rs38l_fnam.
data : get TYPE BSVX-STTXT.
****************************SELECTION-SCREEN.
selection-screen begin of block b1 with frame title text-001.
select-options:s_werks for aufk-werks no intervals NO-EXTENSION,
s_auart for aufk-auart,
s_aufnr for aufk-aufnr,
s_matnr for afpo-matnr,
s_dispo for afko-dispo,
s_fevor for afko-fevor,
s_gstrp for afko-gstrp,
s_gltrp for afko-gltrp.
selection-screen end of block b1.
**************VALIDATING THE SELECTION-SCREEN.
at selection-screen.
perform authorisation_check.
*perform validate_screen.
*************RETRIEVE THE DATA FROM AUFK TABLE.
select aufnr
auart
autyp
ktext
werks
loekz
objnr from aufk
into CORRESPONDING FIELDS OF TABLE lt_aufk
where werks in s_werks and auart in s_auart
and aufnr in s_aufnr and autyp = '10' and loekz = ''.
*loop at lt_aufk.
**************FUNCTIONAL MODULE FOR GETTING THE PRODUCTION STATUS.
CALL FUNCTION 'STATUS_TEXT_EDIT'
EXPORTING
CLIENT = SY-MANDT
FLG_USER_STAT = ''
OBJNR = aufk-objnr
ONLY_ACTIVE = 'X'
SPRAS = sy-langu
BYPASS_BUFFER = 'X'
IMPORTING
ANW_STAT_EXISTING =
E_STSMA =
LINE = get
USER_LINE =
STONR =
EXCEPTIONS
OBJECT_NOT_FOUND = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
move get to lt_aufk-status .
modify lt_aufk.
ENDIF.
*ENDLOOP.
RETRIEVE THE DATA FOR EACH SELECTED PRODUCTION ORDER.
*if lt_aufk[] is not initial.
select gstrp
gltrp
dispo from afko into CORRESPONDING FIELDS OF TABLE lt_afko
for all entries in lt_aufk
where aufnr = lt_aufk-aufnr
and gstrp in s_gstrp
and gltrp in s_gltrp
and dispo in s_dispo.
*endif.
*if not lt_afko[] is initial.
select matnr
psmng
projn from afpo into CORRESPONDING FIELDS OF TABLE lt_afpo
for all entries in lt_afko
where aufnr = lt_afko-aufnr
and matnr in s_matnr.
*endif.
if not lt_afko[] is initial.
select aufpl
vornr
ktsch
ltxa1
arbid from afvc into CORRESPONDING FIELDS OF TABLE lt_afvc
for all entries in lt_afko
where aufpl = lt_afko-aufpl.
endif.
****************GET THE WORK CENTRES FROM TABLES AFVC AND CRHD.
*if lt_afvc[] is not initial.
select objty
objid
werks from crhd into CORRESPONDING FIELDS OF TABLE lt_crhd
for all entries in lt_afvc
where objty = 'A'
and objid = lt_afvc-arbid
and werks = lt_afvc-werks.
*endif.
************************CALL FUNCTION MODULE FOR PRINTING DATA.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST_HOME_CNG'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
*************call generated function module name.
CALL FUNCTION '/1BCDWB/SF00000212'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
LT_AUFK = lt_aufk
LT_AFKO = lt_afko
LT_AFPO = lt_afpo
LT_AFVC = lt_afvc
LT_CRHD = lt_crhd
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
form authorisation_check.
AUTHORITY-CHECK OBJECT 'C_AFKO_AWA'
ID 'ACTVT' FIELD '03'
ID 'AUTYP' dummy
ID 'AUFART' dummy
ID 'WERKS' FIELD S_WERKS.
IF SY-SUBRC NE 0.
MESSAGE E000(8Z) WITH 'No authorization for the Plant entered'.
ENDIF.
endform. "authorisaion_check
&----
*& Form validate_screen
&----
text
----
form validate_screen.
if s_werks is not initial.
select single * from aufk into aufk where werks in s_werks.
if sy-subrc ne 0.
message e000(8z) with 'ENTER VALID PLANT NUMBER'.
endif.
endif.
endform.
and i have this function module...status_text_edit...if i call this i will get production order statusses....based on this i hav to select the status which are having 'REL' and not having 'LKD', 'DLFL', 'DLT', 'CRTD'....i hav to split the string...pls send me the code....check this one pls
data : get TYPE BSVX-STTXT.
CALL FUNCTION 'STATUS_TEXT_EDIT'
EXPORTING
CLIENT = SY-MANDT
FLG_USER_STAT = ''
OBJNR = aufk-objnr
ONLY_ACTIVE = 'X'
SPRAS = sy-langu
BYPASS_BUFFER = 'X'
IMPORTING
ANW_STAT_EXISTING =
E_STSMA =
LINE = get
USER_LINE =
STONR =
EXCEPTIONS
OBJECT_NOT_FOUND = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
hello,
There is some type mismatch in some variable that is the reason why you are getting this check your program and the variable you have used in the smartform and the table.
Regards,
Midhun Abraham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.