cancel
Showing results for 
Search instead for 
Did you mean: 

SMARTFORMS: Print preview not appearing in VF02.

Former Member
0 Kudos

Dear SDN users,

I have copied the standard invoice form to a Z invoice and modified it completely. I have also created my own driver/print program.

Then I created a Z output type in NACE (T-code) assigned the correct form name and program name to it.

But problem here is when I go to VF02 (T-code) and enter the document number and go to Issue output and select the Z output type and click on print preview, the pop up window just disappears without giving the print preview.

Where is the issue here ?

Please help !

Thanks in Advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186055
Active Participant
0 Kudos

Hi Harish,

That is due to Text element in Smartform. This happens when printing Text/Amount/Quantity fields are not fit into the text element. Check your Customizing changes in smartform and add (C) Compress to the fields which are used in Smartform Text element.

Regards,

Surya

Former Member
0 Kudos

Hi,

But im able to see the print preview, when I run the program from SE38. How is that possible.

Please help !

former_member186055
Active Participant
0 Kudos

Hi Harish,

When executing from T.code it will calls the Print Program and Smartform. But when calling from SE38 you are giving input to the Program. This is only happens for certain documents. check your smartform text elements of type INCLUDE TEXTs, If the space is not enough Print Preview not available.

regards,

Surya

Former Member
0 Kudos

Hi

you wrote:

In CONTROL_PARAMETERS-PREVIEW there is no value flowing at all. Its blank.

How do I proceed with this ?

That means the flag is not filled as soon as the printpreview option is selected: it should depend on how you're transfering the data in the entry routine set in NACE transaction.

In generally the interface of this routine is defined in this way:

FORM ENTRY USING RETURN_CODE US_SCREEN.
  ......
ENDFORM.

The system transfers the option of printpreview to the parameter US_SCREEN (or something like that), so thef code of that routine is:

FORM ENTRY USING RETURN_CODE US_SCREEN.
  DATA: LF_RETCODE TYPE SY-SUBRC.

  CLEAR RETCODE.
  XSCREEN = US_SCREEN. "<------ Flag for printpreview

  PERFORM PROCESSING    USING US_SCREEN  "<--- Process routine: here smartform is called
                     CHANGING LF_RETCODE.
  IF LF_RETCODE NE 0.
    RETURN_CODE = 1.
  ELSE.
    RETURN_CODE = 0.
  ENDIF.
ENDFORM.

Now in PROCESSING form you should have a point where XSCREEN value is transferred to CONTROL_PARAMETERS-PREVIEW before calling tha smartforms:

CS_CONTROL_PARAM-PREVIEW     = XSCREEN.

I don't know if ypur program has the same routines, but that's the logic

Max

Former Member
0 Kudos

Thank you so much Max.

Your answer was very helpful.

But I have another issue now. The Billing document number is not passed to the parameter in my driver program.

When I enter the value manually to the parameter in the debugging mode, I'm able to get the correct o/p.

Now my question is how to get the values from VF02 - billing document field and pass it to the parameter in my driver program.

please help !

Thanks in advance.

Former Member
0 Kudos

Hi

You need to get the value of number from the nast, it's in NAST-OBJKY,

NAST has to be defined by TABLES statament in your program, it's automatically filled by the system before calling the entry routine.

You can use the fm LB_BIL_INV_OUTP_READ_PRTDATA in order to get the bill data for the smartform, if you check a standard program you can see this routine:

FORM GET_DATA
        USING IS_PRINT_DATA_TO_READ TYPE LBBIL_PRINT_DATA_TO_READ
     CHANGING CS_BIL_INVOICE        TYPE LBBIL_INVOICE
              CF_RETCODE.

  IF NAST-OBJKY+10 NE SPACE.
    NAST-OBJKY = NAST-OBJKY+16(10).
  ELSE.
    NAST-OBJKY = NAST-OBJKY.         "<---- bill number
  ENDIF.

  CALL FUNCTION 'LB_BIL_INV_OUTP_READ_PRTDATA'
    EXPORTING
      IF_BIL_NUMBER         = NAST-OBJKY
      IF_PARVW              = NAST-PARVW
      IF_PARNR              = NAST-PARNR
      IF_LANGUAGE           = NAST-SPRAS
      IS_PRINT_DATA_TO_READ = IS_PRINT_DATA_TO_READ
    IMPORTING
      ES_BIL_INVOICE        = CS_BIL_INVOICE
    EXCEPTIONS
      RECORDS_NOT_FOUND     = 1
      RECORDS_NOT_REQUESTED = 2
      OTHERS                = 3.
  IF SY-SUBRC <> 0.
*  error handling
    CF_RETCODE = SY-SUBRC.
    PERFORM PROTOCOL_UPDATE.
  ENDIF.
ENDFORM.                    " GET_DATA

The form above is called in the process routine before calling the smartform:

FORM PROCESSING USING    PROC_SCREEN
                CHANGING CF_RETCODE.

  DATA: LS_PRINT_DATA_TO_READ TYPE LBBIL_PRINT_DATA_TO_READ.
  DATA: LS_BIL_INVOICE        TYPE LBBIL_INVOICE.
  DATA: LS_CONTROL_PARAM      TYPE SSFCTRLOP.
  DATA: LS_COMPOSER_PARAM     TYPE SSFCOMPOP.
  DATA: LS_RECIPIENT          TYPE SWOTOBJID.
  DATA: LS_SENDER             TYPE SWOTOBJID.
  DATA: LS_JOB_INFO           TYPE SSFCRESCL.

  DATA: SF_NAME TYPE TDSFNAME,
        FM_NAME TYPE RS38L_FNAM.

  DATA: L_BELNR TYPE BKPF-BELNR,                            "Tk 3875
        L_LAND1 TYPE KNA1-LAND1,                            "Tk 3875
        L_TPDIC(7) TYPE C,                                  "Tk 3875
        F_NRGRU,                                            "Tk 3875
        L_NRGRU LIKE ZSD_DDT_FATT-NRGRU,                    "Tk 3875
        L_DEL   TYPE LBBIL_IT_REFDLV.                       "Tk 3875

  DATA: L_PDF    TYPE FLAG.                     "Gestione Archiviazione
  DATA: L_OK_PDF TYPE FLAG.
  DATA: NAST_PDF TYPE I.

* determine print data
  SF_NAME = TNAPR-SFORM.

  PERFORM SET_PRINT_DATA_TO_READ USING    SF_NAME
                                 CHANGING LS_PRINT_DATA_TO_READ
                                          CF_RETCODE.

  IF CF_RETCODE = 0.
    PERFORM GET_DATA USING    LS_PRINT_DATA_TO_READ "<---- Get bill data
                     CHANGING LS_BIL_INVOICE
                              CF_RETCODE. 

Max

Former Member
0 Kudos

Thanks a lot Max.

Issue resolved.

I really appreciate your help.

Thanks again.

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi

Whether issue is resolved or not .

Which enviromnet are you checking in PRD or DEV .

If is in PRD check whether all your customized Objects are moved to production

Ex : Styles Logo page format . if any of these is not available the print preview will disppear once you click on the print preview button.

Logo and Page format is very much important as we dont move in TR . We need to do manually in PRD.

Thanks

Hariharan

Former Member
0 Kudos

Dear All,

The issue is still not resolved.

I'm working on Dev server itself. According to my onsite Functional Consultant, The printer configuration is correct.

I'm still able to see the print preview if I run the program through SE38.

Please Help me.

Thanks in advance.

Former Member
0 Kudos

In your driver Program, after the call of the FM that represents your smartform, call following FM:

SSF_READ_ERRORS.

And see if there were some errors processing the form.

Also set a breakpoint BEFORE the call of the SMARTFORM in your driver program. Then check if Parameter CONTROL_PARAMETERS-PREVIEW is tagged.

Former Member
0 Kudos

Thanks for your reply.

I'm not getting any errors in SSF_READ_ERRORS.

But I don't know how to check for Parameter preview is tagged or not while calling the smartform.

I'm executing it through SE38. Its looks absolutely fine. But in VF02 i'm not able to see the preview.

Is there any configuration in NACE I have to check ?

Please help.

Former Member
0 Kudos

Can u please explain me how to check whether the parameter preview is tagged to the form ?

Edited by: HarishMS on Sep 7, 2011 7:35 AM

Former Member
0 Kudos

well, in your driver program you are calling the smartform.

The call whereunder you added the SSF_READ_ERRORS i suppose.

Just put a break point there and see what you got in your parameter CONTROL_PARAMETERS-PREVIEW.

you could as well code a break-point in the initialisation routine of your smartform, and check it there, if thats easier for you.

Former Member
0 Kudos

Hi,

Thank you so much for your reply.

In CONTROL_PARAMETERS-PREVIEW there is no value flowing at all. Its blank.

How do I proceed with this ?

Former Member
0 Kudos

Hello,

Plz maintain your condition type seperately, throughly & completely. May possible that your condition type has left something. So in my opinion, I suggest you to plz delete that condition type and again create the new condition type for the same which should be complete and confirmed, Plz make and check. I am sure your problem gets solved by that way.

Thanks & Regards,

Akg

Former Member
0 Kudos

Hello,

Please check the printer setting options also, may be some lucone has been left by you after coping & develovping the new caller program for that. If not plz convey the issue to the Basis team.

Regards,

Akg

Former Member
0 Kudos

Hi,

Please check the function module of the Smartform. In the Export/Import parameter tables, we have options for print preview. Please check if this has been correctly set in your program.

Regards

Jaspreet

Former Member
0 Kudos

Hi Harish,

This situation arises mostly when currency or quantity fields are used in smartforms, but not assigned under Global Definitions -> Currency / Quantity Fields -> Reference.

Hope this will help you to solve the problem.

BR,

Vinit

Former Member
0 Kudos

Hi HarishMS ,

The problem is Table/template is not fit into windows,

Please place break point in each window , check one by one windows,

if does not trigger in first window itself than problem is in first window only.

Thanks

Surendra

Former Member
0 Kudos

Hi,

Thank you all for your replies.

Sy-subrc is 0.

And

I am able to see the output if I run through SE38, I don't think there is any problem with the window size.

Former Member
0 Kudos

Hi

Probably an error occyrs while printing

You should check the value of sy-subrc after calling funcyion module of smartform and use the function SSF_READ_ERRORS in order to get the error

Max

Former Member
0 Kudos

Hi,

Thanks for your reply.

But when I run it from SE38 - driver program. Its executing correctly.

But the print preview is not appearing.

Former Member
0 Kudos

Hi

have you checked it by debug?

Check if have all data to be printed have been selected and if any errors occur

Max

Former Member
0 Kudos

Hi,

Thanks again.

Ya I have checked in debugging mode,.. Data is available in internal table also.

Please help me !

Former Member
0 Kudos

Hi

Have you checked the SY-SUBRC returned by function of smartform?

Max