cancel
Showing results for 
Search instead for 
Did you mean: 

smartforms is not displayed after click Print Preview

Former Member
0 Kudos

I've created a smartform which is called from abap program. It is working properly in development server and is shown with result after clicking Print Preview or Print button. But in production server, it does nothing after clickingthe Print Preview button and it returns me sy-subrc = 1 which indicates formatting_error. Anyone encountered this and have any solutions? Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

hi,

U use the function module directly in Print program, that is reason u are getting the error.

Instead of using that function module directly, Use the SSF_FUNCTION_MODULE_NAME. with this function module u will get the function module name. call that function module.

use following code.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = your form name

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

if sy-subrc <> 0.

WRITE: / 'ERROR 1'.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

call function FM_NAME

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

GS_MKPF = ur table name

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.

Former Member
0 Kudos

Thanks for your prompt reply and help. But in fact,I am using the function module u told in my program before it was transported to production. I also use this method to get the function module name of the smartforms before calling it in other programs and they are worked.The only difference of these 2 programs are the page layout. I set it as landscape for the smartforms which has formatting error. Will the page layout be the root caused?

Former Member
0 Kudos

Hi Chiew Ngee Ho,

If you change the page format, you have to resize the main window in that page. Otherwise the window is not fit for landscape page format. Please check your form layout in that smartform.

Pranav

Former Member
0 Kudos

Thanks for your reply.

However, I've done everything correctly. It is shown in development server. However, it returns me sy-subrc = 1 in production server.

Former Member
0 Kudos

Hi

Try to use th fm SSF_READ_ERRORS in order to get the error:

CALL FUNCTION FM_NAME
    EXPORTING
        ............................................
    EXCEPTIONS
        FORMATTING_ERROR        = 1
        INTERNAL_ERROR             = 2
        SEND_ERROR                    = 3
        USER_CANCELED              = 4
        OTHERS                             = 5.

 IF SY-SUBRC <> 0.
    CALL FUNCTION 'SSF_READ_ERRORS'
         IMPORTING
              ERRORTAB = WA_ERRORLIST.
    APPEND LINES OF WA_ERRORLIST TO IT_ERRORLIST.
ENDIF.

After closing the smartform u can write the error:

CALL FUNCTION 'SSF_CLOSE'.

LOOP AT IT_ERRORLIST INTO WA.
    CALL FUNCTION 'WRITE_MESSAGE'
         EXPORTING
              MSGID   = WA-MSGID
              MSGNO = WA-MSGNO
              MSGTY = WA-MSGTY
              MSGV1 = WA-MSGV1
              MSGV2 = WA-MSGV2
              MSGV3 = WA-MSGV3
              MSGV4 = WA-MSGV4
         IMPORTING
              MESSG = WA_MESSAGE.

    WRITE: / SY-VLINE NO-GAP.
    WRITE: AT 8 SY-VLINE NO-GAP, WA-MSGTY    NO-GAP,
                        SY-VLINE NO-GAP, WA-MSGID(5) NO-GAP,
                        SY-VLINE NO-GAP, WA-MSGNO   NO-GAP,
                        SY-VLINE NO-GAP, WA_MESSAGE-MSGTX(100) NO-GAP,
                        SY-VLINE NO-GAP.
  ENDLOOP.

Max

Former Member
0 Kudos

HI Max,

The folllowing is the returned message :

ERRNUMBER = 20001

MSGID = SMARTFORMS

MSGTY = E

MSGNO = 400

MSGV1 = my program name

How could I know what is the problem actually that raises formatting error when opening the smartforms? Any idea? This problem is only encountered at QA and production server.

Former Member
0 Kudos

Goto SE91 to see this message

400 Style & does not exist

the error message is very clear.

Please transfer your smartstyle which used by your smartform to product server at first, then you can run it.

Other object such as structure which used by your smartform must transfer too.

And the MSGV1 i think is not your program.That is your smartstyle used in develop server.You need transfer it to product server.

Former Member
0 Kudos

Thank you. The problem is solved now. The smartstyles that is no longer being used is included in my Smartforms. Thank for kindly help from all of u.