‎2012 May 17 8:01 AM
hello everyone,
i have developed a custom program and a form to print the output of the program,
my problem is when try to run the program all the final data to be printed coming into
the final internal table and it is calling the form , print preview window is appearing there
i am selecting my device as default printer, after that form is not printing and it is coming
back to my selection screen.
i have checked the fm ssf_functionmodule_name, it is returning the correct fm,
and again i called the generated fm by passing the final internal table.
in form i have created table in main window and a template to print header in secondary window,
i have checked all the global params,interface params,quantity and currency fields , and data in table definition
every thing is fine but my driver prog is not calling the form.
can anybody pls help me regarding this.
thanks
babu
‎2012 May 17 9:44 AM
Hi,
When you execute the driver program and then its asking for the Printer name and all , that means the driver program is triggering your form.
Just check the smartform where you passed the internal table. .can u please provide the screen shot of that part in the smartform.
Thanks & Regards,
Sumodh.P
‎2012 May 17 8:07 AM
try putting breakpoint inside the smartform. You will come to know whether your Smartform is getting called or not.
If it's not reaching the smartform breakpoint, then there a problem with Driver program to while calling smartform.
‎2012 May 17 8:12 AM
Hi,
Could you please send me the code which you have written?
‎2012 May 17 8:49 AM
hi,
thanks for the help,
i have checked using break-point in form,
but it is not calling the form even
pls check my code for calling form.
pls help me.
*&---------------------------------------------------------------------*
*& Form GET_TOT_WDAYS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_G_BEGDA text
* <--P_G_ENDDA text
*----------------------------------------------------------------------*
FORM GET_TOT_WDAYS CHANGING P1 TYPE ANY
P2 TYPE ANY.
CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
EXPORTING
I_DATAB = P1
I_DATBI = P2
I_FACTID = LC_HOLIDAY_CAL_ID
TABLES
ETH_DATS = T_ETHS
* EXCEPTIONS
* DATE_CONVERSION_ERROR = 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.
ENDIF.
DESCRIBE TABLE T_ETHS LINES G_LIN.
ENDFORM. " GET_TOT_WDAYS
*&---------------------------------------------------------------------*
*& Form CALL_FUNCTION
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM CALL_FUNCTION .
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'YGRATUITYSTMT_FORM'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
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.
ENDFORM. " CALL_FUNCTION
*&---------------------------------------------------------------------*
*& Form CALL_FORM
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM CALL_FORM .
* CONTROL-PREVIEW = 'X'.
* CONTROL-NO_DIALOG = 'X'.
* CALL FUNCTION 'SSF_OPEN'.
*loop at t_ftab into w_ftab.
* SNO1 = SNO1 + 1 .
CALL FUNCTION FM_NAME "'/1BCDWB/SF00000470'
* EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS = control
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
* SNO = sno1
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
T_FTAB = T_FTAB
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.
* CALL FUNCTION 'SSF_CLOSE'.
ENDFORM.
‎2012 May 17 9:03 AM
please uncomment the control and output options and try again. Also remove user setting and try.
‎2012 May 17 9:13 AM
hi pratik,
thanks for the reply,
i have tried with control params,user settings,but what are the params i hv to pass for output options
i have ssfcomp but its pretty clumsy i didnt get that
pls help me.
‎2012 May 17 9:19 AM
Something like this. You may not need everything. I am not in front of the system so cannot tell you exactly.
For ONLY PREVIEW
ST_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
ST_CONTROL_PARAMETERS-PREVIEW = 'X'.
For PRINTING DIRECTLY
ST_CONTROL_PARAMETERS-PREVIEW = ' '.
ST_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
ST_OUTPUT_OPTIONS-TDIMMED = 'X'.
CALL FUNCTION v_fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = st_control_parameters
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = st_output_options
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO = st_document_output_info
JOB_OUTPUT_INFO = st_job_output_info
JOB_OUTPUT_OPTIONS = st_job_output_options
TABLES
IS_LABELS = IS_LABELS
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.
ELSE.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_SPDEV_INPUT'
EXPORTING
input = l_pdest
IMPORTING
output = l_output_option-tddest.
ENDIF.
SELECT SINGLE patype
FROM tsp03
INTO l_output_option-tdprinter
WHERE padest = l_output_option-tddest.
IF sy-subrc = 0.
* Do nothing
ENDIF.
* Populate output options
l_output_option-tdimmed = 'X'.
l_control-no_dialog = 'X'.
CALL FUNCTION v_form_fm
EXPORTING
control_parameters = l_control
output_options = l_output_option
user_settings = ''
p_first = p_first
p_title = v_title
p_prog = v_prog
p_system = v_system
p_date = v_date
p_time = v_time
p_user = v_user
p_plant = v_plant
TABLES
i_report = i_report
i_mat_zfg = i_mat_zfg
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
‎2012 May 17 9:28 AM
hi,
i have tried the options ,now its throwig the error like,
object pgmnm of class RE and language en does not exists.
any ideas
‎2012 May 17 9:36 AM
‎2012 May 17 10:01 AM
put a break point at
F SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
and check the sy-subrc value and see the error message. Also put your own error messages instead of the system message
‎2012 May 17 10:38 AM
also maybe,
somewhere in your smart form code, you might have used this statement:
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
remove this and give your custom message.
‎2012 May 17 8:33 AM
Hi, try to execute the smartform alone. I mean, use the execute button in the smartforms screen to execute the smartform and provide the input parameters to the smartform function module, it will give the exact error.
‎2012 May 17 9:30 AM
Hi ,
Please check if the height and width of the template . If it is too small , template won't be able to hold the all the Text Elememts defined inside it. So smartform will not Trigger any output after execution .
Also check if output type is assigned to form properly or not.
regards,
Sachin
‎2012 May 17 9:48 AM
hi sachin,
thanks for the very helpful answer , i am almost done, but i have developed a custom
prog and form where to assign output type for the form .
pls help me.
thanks
‎2012 May 17 9:56 AM
Hi ,
This thing needs to be updated by the Functional Consultant through customization.
For checking you can goto T-code 'NACE' and select the module and inside that enter the output type. There you can see the program and form which is assigned.
Thanks & Regards,
Sumodh.P
‎2012 May 17 9:44 AM
Hi,
When you execute the driver program and then its asking for the Printer name and all , that means the driver program is triggering your form.
Just check the smartform where you passed the internal table. .can u please provide the screen shot of that part in the smartform.
Thanks & Regards,
Sumodh.P
‎2012 May 17 10:07 AM
hi sumodh,
check my screen shots here, revert back to me if there is any problem
thanks.
‎2012 May 17 10:20 AM
Hi, cross check the window height and template height.
If the template height is more than the window height, the smartform does not return any output.
‎2012 May 17 10:30 AM
Hi ,
Please extend the height of the Template1 and check .
Regarding the output type assignment ,please check with your Functional consultant.
Please reward if helpful.
Regards.
Sachin
‎2012 May 17 10:34 AM
Hi ,
Thanks very much for the screen shot.
Please double click on the Table1 and put the screen shot.
Thanks & Regards,
Sumodh.P
‎2012 May 17 10:49 AM
‎2012 May 17 11:04 AM
Hi ,
Thanks Very much .
In the Data tab , you will mention your internal table and the work area .( You need to select the Check box).Next in the Row field did u mention '0' to '99999999'.
Thanks & Regards,
Sumodh.P
‎2012 May 17 11:28 AM
‎2012 May 17 11:40 AM
Now in the Row field mention the range '0' to '99999999'. and activate it
‎2012 May 17 12:02 PM
Hi,
Mention the Values ion Row '0' to '9999999' and activate the smartform. Once you mention the range in the row the data gets displayed. Please check this and let me know.
Thanks & Regards,
Sumodh.P
‎2012 May 17 12:59 PM
hi,
thanks for the help,
i am still struggling with the same problem,
i have 18 cols to print,i have selected page format as legal and whenevr i increase the size of
template ,they r printing but in narrow cells when i tried to increase the cell size i ended up with the
error table size doesnt fit into the window,even my window occupied the total sapce of pge in form painter, i tried to split those 18 cols into two templates 9 each they r not fit into the page, fingers crossed,still i am trying ,
any help will very useful for me.
thanks
‎2012 May 17 1:27 PM
Hi ,
In smartforms, Page size is fixed . If your width of table is more than Page then you will get error "Window is wider than Page" .So you have to dispaly only desired columnns in the output with proper width.
No matter how many columns are there, you should always check total width of all columns in table i.e table width and Page width and keep table width less than or equal to page width.
‎2012 May 17 2:03 PM
Hi Babu,
did you use transaction SMARTFORM_TRACE?
Here you can switch on trace and set a trace level. High level means more but sometimes hard to understand information, low trace level means you may not find your error.
Give it a try, it is more powerful as you may think.
Regards
Clemens
‎2012 May 18 6:43 AM
hello every one,
thanks to all, u r suggestions are really help full,
i have developed a new format which is working now ,
anyway thanks to all for the help,
i attached my modified screen shot have a look.
again thanks to all.
Regards
Babu