04-17-2006 9:08 AM
Hi all,
The issue is as follows:
We have a custom designed Smart form. Whenever I execute that form generated FM, it gets executed and shows the print preview. But once if I use this FM in any other custom FM as shown below, it gives error message and gets terminated. The error text I get is An SQL error occurred while accessing a table. When I execute it via a Break Point, it gets terminated just at the call of the FM /1BCDWB/SF00000357. I have included the code for reference, below. Pls give me your valuable ideas.
data: l_pdf_xstring type xstring,
lt_lines type table of tline,
ls_line type tline,
l_pdf_len type i.
data: output_options type ssfcompop,
control_parameters type ssfctrlop,
output_data type ssfcrescl,
devtype type rspoptype.
data: lt_sys type table of ZHEADER1.
control_parameters-langu = sy-langu.
control_parameters-no_dialog = 'X'.
control_parameters-getotf = 'X'.
select VBELN
AUART
VKORG
VTWEG
SPART from vbak into table lt_sys.
call function 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = sy-langu
IMPORTING
e_devtype = devtype
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
others = 5.
* set device type in output options
output_options-tdprinter = devtype.
call function '/1BCDWB/SF00000357'
EXPORTING
user_settings = space
control_parameters = control_parameters
output_options = output_options
IMPORTING
job_output_info = output_data
TABLES
zsystems = lt_sys
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = l_pdf_len
bin_file = l_pdf_xstring
TABLES
OTF = OUTPUT_DATA-OTFDATA
LINES = LT_LINES
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
others = 5.
if sy-subrc EQ 0.
l_pdf_len = xstrlen( l_pdf_xstring ).
write:/ l_pdf_len.
ENDIF.
Thanks & Regards,
Ravikiran.C
04-17-2006 9:17 AM
Ravi,
First get the function of the SMART FOrm using the function SSF_FUNCTION_MODULE_NAME by passing the name of the SMART For. and then replace the /1BCDWB/SF00000357 with the out of the function SSF_FUNCTION_MODULE_NAME.
It will work.
Regards,
Ravi
Note : Please mark the helpful answers
04-17-2006 9:17 AM
Ravi,
First get the function of the SMART FOrm using the function SSF_FUNCTION_MODULE_NAME by passing the name of the SMART For. and then replace the /1BCDWB/SF00000357 with the out of the function SSF_FUNCTION_MODULE_NAME.
It will work.
Regards,
Ravi
Note : Please mark the helpful answers
04-17-2006 9:26 AM
Hi Ravi,
First in your program you should call the Fm
SSF_FUNCTION_MODULE_NAME
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZP_SMARTFORM1'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = V_FNAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 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.
where V_FNAME is TYPE RS38L_FNAM.
then call function '/1BCDWB/SF00000357'
hope this helps,
priya
04-17-2006 9:32 AM
04-17-2006 10:45 AM
@Ravi & @Priya
I have implemented your suggestion, but invain, still it is giving me the same dump.
@Raja
This is the dump i get:
"An SQL error occurred when accessing a table."
Missing RAISING Clause in Interface
Program SAPMS380
Include MS380F10
Row 1.020
Module Name DELETE_OLD_SNAP_RECORDS
The same problem, persists even when I do the same with standard Smart Forms also. I feel, some problem in settings. All of your valuable suggestions are awaited.
Thanks & Regards,
Ravikiran.
04-17-2006 10:47 AM
Ravi,
Are you sure the Module where there is a dump, is a part of the SMART Form, to me it looks like coming from a different place.
Can you post the code where the dump is happening?
Regards,
Ravi
04-17-2006 10:54 AM
this is what Source Code Extract of the dump looks like:
transporting no fields.
if sy-subrc = 0.
p_result = 'X'.
else.
p_result = ' '.
endif.
endform. "check_var
*---------------------------------------------------------------------*
* FORM DELETE_OLD_SNAP_RECORDS *
*---------------------------------------------------------------------*
form delete_old_snap_records.
data: reorg_date type d.
data: begin of delt occurs 20.
include structure snap_beg.
data: end of delt.
reorg_date = sy-datum - 7.
select * from snap_beg
up to 20 rows
into table delt
where datum lt reorg_date
and seqno = '000'
and xhold <> 'X'
%_hints oracle 'INDEX("&TABLE&" "SNAP~DSX")'.
loop at delt.
delete from snap
where datum = delt-datum
and seqno = '000'
and xhold <> 'X'
%_hints oracle 'INDEX("&TABLE&" "SNAP~DSX")'.
loop at delt.
delete from snap
where datum = delt-datum
and uzeit = delt-uzeit
and ahost = delt-ahost
and uname = delt-uname
and modno = delt-modno
and mandt = delt-mandt.
commit work.
endloop.
endform. "delete_old_snap_records
*&---------------------------------------------------------------------*
*& Form OVERVIEW
*&---------------------------------------------------------------------*
form overview.
data:
begin of fcc,
id type c length 2,
ll type c length 3,
errid type snapt-errid,
04-17-2006 10:56 AM
Hi
I think you have some problem on SNAP table, you should advise your basis and/or see some notes.
Max
04-17-2006 11:00 AM
Looks like there is a problem the SQL statements.
select * from snap_beg
up to 20 rows
into table delt
where datum lt reorg_date
and seqno = '000'
and xhold <> 'X'
%_hints oracle 'INDEX("&TABLE&" "SNAP~DSX")'.
loop at delt.
delete from snap
where datum = delt-datum
and seqno = '000'
and xhold <> 'X'
%_hints oracle 'INDEX("&TABLE&" "SNAP~DSX")'.
loop at delt.
delete from snap
where datum = delt-datum
and uzeit = delt-uzeit
and ahost = delt-ahost
and uname = delt-uname
and modno = delt-modno
and mandt = delt-mandt.
Is this standard code?
You should NOT SMART Forms directly as well.
Regards,
Ravi
04-17-2006 11:03 AM
04-17-2006 11:05 AM
Ravi,
guess you will have search for OSS note as it is standard code.
Regards,
Ravi
04-17-2006 11:06 AM
Hi Ravi
Yes it's std code, I think the system run it when ABAP error occurs to store the data for the DUMP they can be listed by ST22.
Max
04-17-2006 11:40 AM
Hi,
Have u checked whether u are passing the correct inputs to the smartforms.
With the std function module
regards,
Bala
04-17-2006 11:41 AM
HI!
As you explain about error, I think you access the table with many lines. And so its gives this error.
So you check in your FM about same.
Regards,
Priyank