cancel
Showing results for 
Search instead for 
Did you mean: 

Error while call SUBMIT RSTXPDFT4 to get Smartform in PDF

Former Member
0 Kudos

Hi All,

My codings below.....

data: op_option type SSFCTRLOP,

      job_output type SSFCRESCL.

      op_option-getotf = 'X'.



DATA: w_form_name type tdsfname, "Smartform name

r_options type ssfcompop, "Print option

r_control type ssfctrlop, "Print control

w_function type rs38l_fnam.



r_options-tddest = 'LOCL'. "Spool: Output device

r_options-tdimmed = 'X'. "Print Immediately

r_options-tddelete = space. "Delete After Printing

r_options-tdnewid = 'Xxxx'. "New Spool Request

r_control-device = 'PRINTER'.

r_control-no_dialog = 'X'.

r_control-langu = sy-langu.



  SELECT * FROM ZPAGE2 INTO TABLE LIT_ZPAGE2.



    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

      EXPORTING

        FORMNAME                 = 'ZSF05_EX4'

*       VARIANT                  = ' '

*       DIRECT_CALL              = ' '

     IMPORTING

       FM_NAME                  L_FORMNAME

     EXCEPTIONS

       NO_FORM                  = 1

       NO_FUNCTION_MODULE       = 2

       OTHERS                   = 3

              .

    IF SY-SUBRC <> 0.

* Implement suitable error handling here

    ENDIF.







    CALL FUNCTION L_FORMNAME

     EXPORTING

*       ARCHIVE_INDEX              =

*       ARCHIVE_INDEX_TAB          =

*       ARCHIVE_PARAMETERS         =

*       CONTROL_PARAMETERS         =

*       MAIL_APPL_OBJ              =

*       MAIL_RECIPIENT             =

*       MAIL_SENDER                =

       OUTPUT_OPTIONS             = R_options

*       USER_SETTINGS              = 'X'

*     IMPORTING

*       DOCUMENT_OUTPUT_INFO       =

*       JOB_OUTPUT_INFO            =



*       JOB_OUTPUT_OPTIONS         =

      TABLES

        LIT_PAGE2                  LIT_ZPAGE2

*     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.



      SUBMIT RSTXPDFT4

       with SPOOLNO r_options-tdnewid

       AND RETURN

While execute this, I got error like below....

What should i do to get spool id dynamically and save the form ..

Thanks in advance..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I hope this will help for dynamic pdf creation. Use TSP01 table.

It will contain all spool request number which created in SAP.

DATA : LT_INT TYPE TABLE OF TSP01,

             WA_INT TYPE TSP01.

SELECT RQIDENT FROM TSP01 INTO CORRESPONDING FIELDS OF TABLE LT_INT.

SORT LT_INT BY RQIDENT DESCENDING.

READ TABLE LT_INT INTO WA_INT INDEX 1.

SUBMIT  RSTXPDFT4 WITH SPOOLNO = WA_INT-RQIDENT AND RETURN.

Thanks,

Suresh

Former Member
0 Kudos

Thanks Suresh..

Thread closed...

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

TDNEWID is of length 1 char.So I think that does not give the spool request number.

Please check.

Better try this.....

To convert smartform output to pdf , after printpreview just type PDF! in the command bar gives u an option to save form as pdf.

Regards

Vamshi

Former Member
0 Kudos

Wow.. Its simply worked.

May i know , How to maintain the default spool id in RSTXPDFT4 by using latest data in TSP01 table..

Beginner.

Former Member
0 Kudos

Hi

Try passing SY-SPONO to spool number.

Regards

Vamshi

gouravkumar64
Active Contributor
0 Kudos

Hi,

If the data type is character  then X will be support that,otherwise for numeric it will give u ERROR.

Gourav.

Former Member
0 Kudos

Hi Gourav,

      Spool ID generated in 1.2902 this format.  How can i overcome this  error ??/

Beginner.

gouravkumar64
Active Contributor
0 Kudos

Hi,

at first for

r_options-tdnewid this one declare a N type variable.

then pass that N type variable name to

here

SUBMIT RSTXPDFT4

       with SPOOLNO r_options-tdnewid  "pass the n type variable name not directly this name....

       AND RETURN.

Thanks

Gourav.