‎2006 Sep 20 11:47 AM
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.
‎2006 Sep 20 2:25 PM
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.
‎2006 Sep 20 11:52 AM
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
‎2006 Sep 20 11:55 AM
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
‎2006 Sep 20 11:56 AM
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
‎2006 Sep 20 12:18 PM
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
‎2006 Sep 20 12:37 PM
hi all,
Thanks to ur replies but,
In the tables tab, what to declare in the associated type..i.e, its not accepting kunnr...
‎2006 Sep 20 12:52 PM
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
‎2006 Sep 20 1:15 PM
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.
‎2006 Sep 20 1:23 PM
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.
‎2006 Sep 20 2:04 PM
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
‎2006 Sep 20 2:25 PM
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.
‎2006 Sep 20 2:47 PM