Application Development 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: 

Smart form not visible on execution of driver program

Former Member
0 Kudos

HI,

On exection of driver program, print preview is not appearing.All thta appears is selection screen.

I will be thankful for kind guidance.

Thanks.

22 REPLIES 22

Former Member
0 Kudos

Hi,

In the driver program, how are you calling the form?

What FM's have you used and what is the data you are passing?

0 Kudos

I am using SSF... funtion module for calling smart form.

Kindly help.

0 Kudos

Hi

SSF_FUNCTION_MODULE_NAME for this function module we need to pass the smart form name and it will give the function module name.

Ex:

DATA : ls_ctrl TYPE ssfctrlop.

Data: w_name TYPE  rs38l_fnam.


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = 'SMARTFROM NAME'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
       IMPORTING
         fm_name                  = w_name
* EXCEPTIONS
*   NO_FORM                  = 1
*   NO_FUNCTION_MODULE       = 2
*   OTHERS                   = 3
                .
after getting the function module we need to call that function module.

CLEAR ls_ctrl.
     ls_ctrl-no_dialog = '  '."Here we need to pass space
     ls_ctrl-preview = ' X'. " Here we need to pass 'X' for print preview



-> what are the exporting parameters we need to pass

     CALL FUNCTION w_name
       EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
        control_parameters         = ls_ctrl
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
      IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*        job_output_info            =
*   JOB_OUTPUT_OPTIONS         =
       TABLES
         it_final                   = it_final
* EXCEPTIONS
*   FORMATTING_ERROR           = 1
*   INTERNAL_ERROR             = 2
*   SEND_ERROR                 = 3
*   USER_CANCELED              = 4
*   OTHERS                     = 5
               .


0 Kudos

Hi San,

While calling the Function Module SSF...did you pass the form name correctly. Check whether the form is correct or not.

0 Kudos

Hi,

Have you called the FM generated for the Smartform(Which can be seen on executing the smartform)?.

With Regards,

Gurulakshmi

0 Kudos

try putting a breakpoint before SSF and just before you are calling the FM you get from SSF, and you can see if it is throwing an exception....

former_member349098
Participant
0 Kudos

hi

Have u call samrtform in  ur driver program

please go through this link given below

http://saptechnical.com/Tutorials/Smartforms/SimpleDriverProgram/Demo.htm

raymond_giuseppi
Active Contributor
0 Kudos

Did you

- Call FM SSF_FUNCTION_MODULE_NAME to get the generated FM name

- Call the returned FM with correct parameter values in control_parameters (and  output_options)

- Read some document like Integrating the Smart Form into the Application

Regards,

Raymond

0 Kudos

NO Solution till now....kindly help.

0 Kudos

Have you tried executing the function module of the smartform directly.

If FM SSF_FUNCTION_MODULE_NAME is called properly then smartform will be displayed as this FM only brings the smartform function module name and prints it.

0 Kudos

I think it was problem with size of main window. Decrease the size of main window and execute it once.

0 Kudos

May be you can put a breakpoint where you call your Smartform in printprogram and check what is the value of sy-subrc after the fm is executed.

Based on the value of sy-subrc, its easy to figure out the problem.

0 Kudos

Can you check your "CONTROL_PARAMETERS"  field's and it's value , may be you pass

CONTROL-NO_DIALOG = 'X', this is a reason you didn't find print preview .

Pass

CONTROL-NO_DIALOG = ' '  ,  "Space .

Regard's

Smruti

0 Kudos

I would go to tcode SFTRACE and switch on the smartform trace, and will try to run the driver program so that the trace is logged.

Now go again to SFTRACE and display log. It should display where the problem/error is.

Regards,

Karthik

Former Member
0 Kudos

Hi San,

Can you pls share the code where you are calling the form?

former_member209120
Active Contributor
0 Kudos

hi,

can you share your code and output screenshot?

raymond_giuseppi
Active Contributor
0 Kudos

You wont get many good answers with so few information, so can you

- elaborate on what you try to solve this problem (debug, etc.)

- post some part of the code (get FM name, parameters to drive the preview, etc.)

With the information provided the error (if any) can come anywhere from extraction of data to  smartform execution...

Regards,

Raymond

PS:  The quality of an answer depends significantly on the quality of the question (or: how to ask good q...

Former Member
0 Kudos

Hi!

FM used to call SmartForm in driver program is client-dependent. So in-case this SF was developed in 1 server and being executed elsewhere, you might get such problems.

To avoid this execute the SF (in tcode - SMARTFORMS), copy the system generated FM and call this FM in driver program.

And then do  this:

DATA : FM_NAM  TYPE RS38L_FNAM.

DATA: SFNAME TYPE TDSFNAME.

  SFNAME = 'Your Smartform Name'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

      EXPORTING

        FORMNAME                 = SFNAME

*      VARIANT                  = ' '

*      DIRECT_CALL              = ' '

     IMPORTING

        FM_NAME                  = FM_NAM

     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.

     EXIT.

   ENDIF.

=> Then go to "pattern" and call your system generated SF FM name.

So you might end up getting something like this:

CALL FUNCTION /1BCDWB/SF00000069

     EXPORTING

       CONTROL_PARAMETERS = CONTROL

       OUTPUT_OPTIONS     = OUTPUT_OPTIONS

       USER_SETTINGS      = SPACE

"Data Interface parameters

     TABLES

"Interface tables

     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.

Now replace ONLY "/1BCDWB/SF00000069" with "FM_NAM", and let rest of FM parameters be same.

So you will have something like this:

CALL FUNCTION FM_NAM

     EXPORTING

       CONTROL_PARAMETERS = CONTROL

       OUTPUT_OPTIONS     = OUTPUT_OPTIONS

       USER_SETTINGS      = SPACE

"Data Interface parameters

     TABLES

"Interface tables

     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,

KS

Former Member
0 Kudos

hiiii

Firstly execute  your desired smartforms under t code "SMARTFORMS"  as you that and see what message is throwing

Regards

As

former_member184958
Active Participant
0 Kudos

Hi San,

     Did you call the Function module which is created during the Smartform in your driver program.

If not it will not display the print preview.

OR

Check  whether the printer is configure in SAP or not.

OR

Check whether you pass correct printer name.

I hope this will help you.

Warm Regards,

John.

satyabrata_sahoo3
Contributor
0 Kudos

Try to test your Smartform without program. I mean directly from t-code SMARTFORM. There could be issue in the window sizes or formatting.. If this executes then recheck your program codes if the form is called in right way. Check the parameters passed as required.

Former Member