cancel
Showing results for 
Search instead for 
Did you mean: 

regarding print program in smartform

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member188685
Active Contributor
0 Kudos

>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..

Former Member
0 Kudos

lt_afko = lt_afko[] ......where i hav to mention this please

former_member188685
Active Contributor
0 Kudos

in your driver program, where you call the Dynamic function /1BCDWB/SF00000212' which is generated from the SSF_Function.

check you have some thing like this in the driver program..

call function v_functionname "<---some variable

or

call function '/1BCDWB/SF00000212'

Former Member
0 Kudos

hi vijay,

am getting the same problem..suggest me some other please

former_member188685
Active Contributor
0 Kudos

check their defintions

in the driver program check how you defined lt_afko

in the smartform interface how you defined lt_afko

definitely there is some difference in their definition.. check it once.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

former_member188685
Active Contributor
0 Kudos

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..

Former Member
0 Kudos

hai,

u r using standard structure so in form interface of smartform in tab tables u directly specify lt_afko like afko .

shan.

Former Member
0 Kudos

LT_AUFK TYPE AUFK

LT_AFKO TYPE AFKO

LT_AFPO TYPE AFPO

LT_AFVC TYPE AFVC

LT_CRHD TYPE CRHD

this one i used in smartform form interface in import tab.

i din t declare anything in form interface tables tab...

Former Member
0 Kudos

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.

former_member188685
Active Contributor
0 Kudos

Define them under tables , not under the importing parameter. how you are able to design the smartform.

atleast you should use table types if you want to continue with the importing option.

try to add them under tables tab.

Former Member
0 Kudos

hai,

u r passing internal table from driver program so declare

it in table tab and not in import tab.

if u r passing single record only u should use import tab

shan.

former_member188685
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Form Interface: Only table types may be used as the reference type for a table parameter

after tat this error am getting

Former Member
0 Kudos

ok sure

Former Member
0 Kudos

Form Interface: Only table types may be used as the reference type for a table parameter

after tat this error am getting

Former Member
0 Kudos

hai,

lt_afko like afko.

use like .

shan.

Former Member
0 Kudos

hi every thing corrected....no errors..thank you..

and one more problem now..data is not displayed in output now...simply it showing wat ever layout in smartform..

please guided me in this

Former Member
0 Kudos

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.

Former Member
0 Kudos

hi,

i have to write select query in smartform also???please inform ASAP......

Former Member
0 Kudos

hai,

in global definition --- initilization tab u can write code globally.

or

through right click in node ->create->program line.

shan.

former_member188685
Active Contributor
0 Kudos

you can use program lines and code what ever select you want.

create->flow logic -> program lines

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

Former Member
0 Kudos

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