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

re:problem with the driver program in smartform

Former Member
0 Likes
6,657

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,112

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

28 REPLIES 28
Read only

former_member209818
Active Contributor
0 Likes
6,112

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.

Read only

Former Member
0 Likes
6,112

Hi,

Could you please send me the code which you have written?

Read only

0 Likes
6,112

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.

Read only

0 Likes
6,112

please uncomment the control and output options and try again. Also remove user setting and try.

Read only

0 Likes
6,112

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.

Read only

0 Likes
6,112

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.

Read only

0 Likes
6,112

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

Read only

0 Likes
6,112

Hi,

Did you execute the smart form alone?Is it working fine?

Read only

0 Likes
6,112

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

Read only

0 Likes
6,112

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.

Read only

Former Member
0 Likes
6,112

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.

Read only

former_member213851
Active Contributor
0 Likes
6,112

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

Read only

0 Likes
6,112

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

Read only

0 Likes
6,112

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

Read only

Former Member
0 Likes
6,113

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

Read only

0 Likes
6,112

hi sumodh,

check my screen shots here, revert back to me if there is any problem

thanks.

Read only

0 Likes
6,112

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.

Read only

0 Likes
6,112

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

Read only

0 Likes
6,112

Hi ,

Thanks very much for the screen shot.

Please double click on the Table1 and put the screen shot.

Thanks & Regards,

Sumodh.P

Read only

0 Likes
6,112

hi,

this is the screen shot of table

Read only

0 Likes
6,112

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

Read only

0 Likes
6,112

hey,

check this out.

Read only

0 Likes
6,112

Now in the Row field  mention the range  '0' to '99999999'. and activate it

Read only

0 Likes
6,112

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

Read only

0 Likes
6,112

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

Read only

0 Likes
6,112

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.

Read only

Clemenss
Active Contributor
0 Likes
6,112

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

Read only

Former Member
0 Likes
6,112

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