Application Development and Automation 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: 
Read only

Error in smartforms.....

Former Member
0 Likes
1,882

Hi friends,

This is my program.....

tables : kna1.

*parameter : custno type kna1-kunnr.

SELECT-OPTIONS : CUSTNO FOR KNA1-KUNNR.

data : t_kna1 type kna1 occurs 0 with header line.

  • w_kna1 type kna1.

select land1 name1 from kna1 into corresponding fields of table t_kna1 where kunnr IN custno.

*

*loop at t_kna1.

*write : / t_kna1-land1, t_kna1-name1.

*endloop.

CALL FUNCTION '/1BCDWB/SF00000038'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

custno = custno

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

tables

t_kna1 = t_kna1

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

In this if i give parameter its working fine but if i go for select-options, its showing error..

the error is as follows..

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:

The call to the function module "/1BCDWB/SF00000038" is incorrect:

The function module interface allows you to specify only fields

of a particular type under "CUSTNO". The field "CUSTNO" specified here

has a different field type.

With Regards

Badri.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,341

Hi Badri,

check this....

tables: kna1.

select-options: s_kunnr for kna1-kunnr.

data: IT_SEL_TAB type table of rsparams.

*-To display the select-option screen

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'

EXPORTING

CURR_REPORT = sy-REPID

TABLES

SELECTION_TABLE = IT_SEL_TAB

EXCEPTIONS

NOT_FOUND = 1

NO_REPORT = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

now in the smartform give the associated type for this table as <b>RSPARAMS_TT</b> and then in the global definitions create a work area of type <b>RSPARAMS</b>

Now loop at the table and use the values.

calling the function module....

call function '/1BCDWB/SF00000156'

tables

sel_tab = <b>it_sel_tab</b>

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.

Regards,

Vidya.

11 REPLIES 11
Read only

Former Member
0 Likes
1,341

Please check this code it is working fine.

report z_example.

tables:kna1.

select-options:cust for kna1-kunnr.

data:begin of itab occurs 0,

kunnr like kna1-kunnr,

land1 like kna1-land1,

name1 like kna1-name1,

end of itab.

select kunnr land1 name1 from kna1 into table itab where kunnr in cust.

loop at itab.

CALL FUNCTION '/1BCDWB/SF00000168'

  • 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 =

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

endloop.

Check and let me know.

Regards

Read only

Former Member
0 Likes
1,341

Here you cannot use select-options customer under the exporting option.You have to use it in the tables tab of the form interface.

I think if you specify the following under the tables tab it should work fine.

so_cust like selopt.

now you can pass the customer values from the program to the tables tab of the smart form FM

Read only

Former Member
0 Likes
1,341

Hi,

When you declare CUSTNO as select-option, it creates a table to store the range. In your SF interface CUSTNO is delcared to accept only single value. Hence when you declare as parameter, SF accepts the value correctly.

if you want to pass the range the declare a table in SF interface and pass all the customer numbers in that range.

regards

Rahul

Read only

Former Member
0 Likes
1,341

Hi Badri,

You have declared CUSTNO as a Select Option. This can be passed to the Smartform only as a table and not as a variable. Pass it under Tables in the function module.

The corresponding table can be maintained in the Smartforms under Form Interface->Tables.

Hope this helps!

Regards,

Saurabh

Read only

0 Likes
1,341

hi all,

Thanks to ur replies but,

In the tables tab, what to declare in the associated type..i.e, its not accepting kunnr...

Read only

0 Likes
1,341

It is showing the following error...

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:

The call to the function module "/1BCDWB/SF00000038" is incorrect:

In the function module interface, you can specify only

fields of a specific type and length under "KUNNR".

Although the currently specified field

"CUSTNO" is the correct type, its length is incorrect.

Message was edited by: Badri Thiriveedhi

Read only

Former Member
0 Likes
1,341

Hi Badri,

Try putting it in the export parameters itself... in the smartform mention the type as RSPARAMS.

I guess this will work....

Regards,

Vidya.

Read only

Former Member
0 Likes
1,341

Hi Badri

Do like this in the smart form it is working fine for me. In smartform Form interface, tables parameter give ur internal table name like database table name. That is in ur case t_kna1 like kna1.

In the window where u want to display the data just Create a loop and in that in data tab give like t_kna1 into t_kna1.

In the loop create a text and write Like this:

&it_kna1-kunnr(15)& &it_kna1-name1(40)& &it_kna1-land1(5)&.

In the program in the function module which u called give in the tables parameter ur internal table name thats it. Do like this it is working very much fine for me. Dont mention anything in export parameter. Dont do anything, do like this it is working.

Hope this will help u.

Regards

Haritha.

Read only

0 Likes
1,341

hi haritha,

The problem is with the select-options in the program..i am using select-options in the program and i have to pass it to the smartform. But its not accepting if i pass it in the form interface. Some guys told me to pass it in the tables tab of form interface but its showing the above defined error....My doubt what is the associated type which we have to give in the tables tab.

( custno type .... )

Waiting for reply's any body there...

With regards

Badri

Read only

Former Member
0 Likes
1,342

Hi Badri,

check this....

tables: kna1.

select-options: s_kunnr for kna1-kunnr.

data: IT_SEL_TAB type table of rsparams.

*-To display the select-option screen

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'

EXPORTING

CURR_REPORT = sy-REPID

TABLES

SELECTION_TABLE = IT_SEL_TAB

EXCEPTIONS

NOT_FOUND = 1

NO_REPORT = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

now in the smartform give the associated type for this table as <b>RSPARAMS_TT</b> and then in the global definitions create a work area of type <b>RSPARAMS</b>

Now loop at the table and use the values.

calling the function module....

call function '/1BCDWB/SF00000156'

tables

sel_tab = <b>it_sel_tab</b>

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.

Regards,

Vidya.

Read only

0 Likes
1,341

Hi vidya chowdary,

Thanks for help. Problem solved