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: 

Spool request not generated in quality and production

Former Member
0 Kudos

Hi experts....

there is problem in smartform for ZGRNTAG...it is working fine in development but

once transported to quality spool request is not getting generated for printout..

please provide the solution..

25 REPLIES 25

Former Member
0 Kudos

Hi Chandan,

Check  SAP Community Network Wiki - ABAP Development - Spool request generation.

Note : also check output device are same Dev/QA and any authorization is missing to particular user using SU53 T-code  . 

Regard's

Smruti

0 Kudos

sir..

there is no need of authorization in quality in our organisation...

outpput device are same in DEV/QA...

It is working fine in dev.

0 Kudos

CONTROL-PREVIEW = 'X'.

   CONTROL-NO_OPEN = 'X'.

   CONTROL-NO_CLOSE = 'X'.

   CONTROL-NO_DIALOG = SPACE.

   CONTROL-DEVICE = 'PRINTER'.

   CONTROL-LANGU = SY-LANGU.

   OUTPUT_OPTIONS-TDNEWID = 'X'.

   OUTPUT_OPTIONS-TDDEST = 'LOCL'.

   OUTPUT_OPTIONS-TDDELETE = SPACE.

*OUTPUT_OPTIONS-TDNOPRINT = ' '.

   OUTPUT_OPTIONS-TDIMMED = 'X'.

i am using the above parameters...this has been used in other smartforms also and is working fine in QA/PRD as well.

i am using 'SSF_OPEN' and 'SSF_CLOSE'.

CALL FUNCTION 'SSF_OPEN'

    EXPORTING

*   ARCHIVE_PARAMETERS       =

*   USER_SETTINGS            = 'X'

*   MAIL_SENDER              =

*   MAIL_RECIPIENT           =

*   MAIL_APPL_OBJ            =

      OUTPUT_OPTIONS           = OUTPUT_OPTIONS

      CONTROL_PARAMETERS       = CONTROL

* IMPORTING

*   JOB_OUTPUT_OPTIONS       =

    EXCEPTIONS

      FORMATTING_ERROR         = 1

      INTERNAL_ERROR           = 2

      SEND_ERROR               = 3

      USER_CANCELED            = 4

      OTHERS                   = 5

             .

   IF SY-SUBRC <> 0.

* Implement suitable error handling here

   ENDIF.


0 Kudos

Same SAP user id is used in QA/Prod for existing and current smartforms executing the Print program ?

Check with your sap basis team is any authorization missing ? , if user id is different , new user id used or check with other user id are you getting same problem ?

Regard's

Smruti

0 Kudos

Hi Smruti....

I have all authorization in QA/PRD...

Regards,

chandan sahu

0 Kudos

R u using Generated functional module inside any Loop  ?????

like below format ..

====

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

        EXPORTING

             FORMNAME           = 'ztest'

        IMPORTING

             FM_NAME            = FUNC_MOD_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.

CONTROL-PREVIEW = 'X'.

   CONTROL-NO_OPEN = 'X'.

   CONTROL-NO_CLOSE = 'X'.

   CONTROL-NO_DIALOG = SPACE.

   CONTROL-DEVICE = 'PRINTER'.

   CONTROL-LANGU = SY-LANGU.

   OUTPUT_OPTIONS-TDNEWID = 'X'.

   OUTPUT_OPTIONS-TDDEST = 'LOCL'.

   OUTPUT_OPTIONS-TDDELETE = SPACE.

*OUTPUT_OPTIONS-TDNOPRINT = ' '.

   OUTPUT_OPTIONS-TDIMMED = 'X'.

Loop at IT into WA .

CALL FUNCTION FUNC_MOD_NAME

        EXPORTING

             CONTROL_PARAMETERS = CONTROL

--------------------------------------

--------------------------------

END LOOP .

Regard's

Smruti


0 Kudos

yes i am using FM inside  loop.

Regards,

chandan sahu

0 Kudos

Check below code ..

 

LOOP AT IT_TAB  INTO WA.

 

* make sure only one spool request is used

    AT FIRST.

      CONTROL-NO_CLOSE = 'X'.

    ENDAT.

    AT LAST.

      CONTROL-NO_CLOSE = SPACE.

    ENDAT.

   

* call the generated function module

    CALL FUNCTION FUNC_MOD_NAME

       EXPORTING

            CONTROL_PARAMETERS = CONTROL

========================================

===============================

IF SY-SUBRC <> 0.

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

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

    ENDIF.

  

  CONTROL_PARAMETERS-NO_OPEN = 'X'.

  ENDLOOP.

Regard's

Smruti

Former Member
0 Kudos

Hi Chandan,

I hope you have used the FM 'SSF_FUNCTION_MODULE_NAME'.

Regards

Purnand

0 Kudos

yes purnand i am using the FM 'SSF_FUNCTION_MODULE_NAME'.

i am getting the print preview correctly but not able to take out the print from printer because

spool request is not getting generated in QA/PRD....


0 Kudos

Hi Chandan ,

For which tcode are you using this smartform ?

I mean are you taking printout through a standard tcode by assigning this smartform with a message type

or

Are you taking printout through your own Zprogram ?

If its through a standard tcode , then check the printer settings especially Print Immediately or any other such SPOOL options if available .

As per your statement,

.it is working fine in development but

If its so then I don't think there is any problem with your smartforms , I think there is no probability for Client level discrepancies with smartforms or any other  developments.

0 Kudos

Hi Sijin...

Its zprogram i have created.

I have checked print setting...it is correct..

i am able to take print out for other smartforms but i have problem with this only.

0 Kudos

Hi,

If I have understood your issue correctly, when you run the driver program, spool request number is generating but the printout is not coming.

http://help.sap.com/saphelp_nwpi711/helpdata/en/24/ece847a9d511d1a9e40020af00b7e5/content.htm

Please tell us the status of the spool request no. and do let us know if you are still facing any issue.

Regards

Purnand

Former Member
0 Kudos

Also Check this Screen what you select in Dev/QA/Prod ???? for Spool Control .

Regard's

Smruti

0 Kudos

hi smruti.

i am doing the above procedure...it gives the print preview..

but not able to take out printout..

0 Kudos

Hi Chandan ,

What is actually happening when you are giving the print command ?

Is it asking for Logical Printing device or not ?

If every settings have been maintained perfectly  , then I think its surely due to missing Printing authorizations you better discuss with your Basis team they might be doing some Experiments which you may not be aware of

0 Kudos

Can you Provide Ur Complete Code .

Regard's

Smruti

0 Kudos

TABLES : MSEG,MKPF.

DATA : IT_MSEG TYPE TABLE OF MSEG,

        WA_MSEG TYPE MSEG,

        WA_LFA1 TYPE LFA1,

        WA_MARD TYPE MARD.

DATA: FM_NAME TYPE RS38L_FNAM,

       CONTROL TYPE SSFCTRLOP,

       ERRTAB  TYPE TSFERROR.

DATA :OUTPUT_OPTIONS TYPE SSFCOMPOP.

SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : P_MBLNR FOR MSEG-MBLNR.

SELECTION-SCREEN : END OF BLOCK B1.

START-OF-SELECTION.

   PERFORM GET_DATA.

END-OF-SELECTION.

   PERFORM DISPLAY_DATA.

*&---------------------------------------------------------------------*

*&      Form  GET_DATA

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*---------------------------------------------------------------------*

FORM GET_DATA .

   SELECT * FROM MSEG INTO TABLE IT_MSEG

                           WHERE MBLNR IN P_MBLNR.

ENDFORM.                    " GET_DATA

*&---------------------------------------------------------------------*

*&      Form  DISPLAY_DATA

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM DISPLAY_DATA .

   CONTROL-PREVIEW = 'X'.

   CONTROL-NO_OPEN = 'X'.

   CONTROL-NO_CLOSE = 'X'.

   CONTROL-NO_DIALOG = SPACE.

   CONTROL-DEVICE = 'PRINTER'.

   CONTROL-LANGU = SY-LANGU.

   OUTPUT_OPTIONS-TDNEWID = 'X'.

   OUTPUT_OPTIONS-TDDEST = 'LOCL'.

   OUTPUT_OPTIONS-TDDELETE = SPACE.

*OUTPUT_OPTIONS-TDNOPRINT = ' '.

   OUTPUT_OPTIONS-TDIMMED = 'X'.

   CALL FUNCTION 'SSF_OPEN'

    EXPORTING

*   ARCHIVE_PARAMETERS       =

*   USER_SETTINGS            = 'X'

*   MAIL_SENDER              =

*   MAIL_RECIPIENT           =

*   MAIL_APPL_OBJ            =

      OUTPUT_OPTIONS           = OUTPUT_OPTIONS

      CONTROL_PARAMETERS       = CONTROL

* IMPORTING

*   JOB_OUTPUT_OPTIONS       =

    EXCEPTIONS

      FORMATTING_ERROR         = 1

      INTERNAL_ERROR           = 2

      SEND_ERROR               = 3

      USER_CANCELED            = 4

      OTHERS                   = 5

             .

   IF SY-SUBRC <> 0.

* Implement suitable error handling here

   ENDIF.

   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

     EXPORTING

       FORMNAME           = 'ZMM_GRNTAG'

*     VARIANT            = ' '

*     DIRECT_CALL        = ' '

     IMPORTING

       FM_NAME            = FM_NAME

     EXCEPTIONS

       NO_FORM            = 1

       NO_FUNCTION_MODULE = 2

       OTHERS             = 3.

   IF SY-SUBRC <> 0.

* Implement suitable error handling here

   ENDIF.

   LOOP AT IT_MSEG INTO WA_MSEG.

     SELECT SINGLE * FROM MARD INTO WA_MARD WHERE MATNR EQ WA_MSEG-MATNR.

     SELECT SINGLE * FROM LFA1 INTO WA_LFA1 WHERE LIFNR EQ WA_MSEG-LIFNR.

     TRANSLATE : WA_MSEG-MATNR TO UPPER CASE,

                 WA_MSEG-XBLNR_MKPF TO UPPER CASE,

                 WA_MSEG-SGTXT TO UPPER CASE,

                 WA_MSEG-MBLNR TO UPPER CASE,

                 WA_MARD-LGPBE TO UPPER CASE,

                 WA_LFA1-MCOD1 TO UPPER CASE.

     CALL FUNCTION FM_NAME       "'/1BCDWB/SF00000077'

       EXPORTING

*   ARCHIVE_INDEX              =

*   ARCHIVE_INDEX_TAB          =

*   ARCHIVE_PARAMETERS         =

    CONTROL_PARAMETERS         = CONTROL

*   MAIL_APPL_OBJ              =

*   MAIL_RECIPIENT             =

*   MAIL_SENDER                =

    OUTPUT_OPTIONS             = OUTPUT_OPTIONS

*   USER_SETTINGS              = 'X'

         WA_MSEG                    = WA_MSEG

         WA_LFA1                    = WA_LFA1

         WA_MARD                    = WA_MARD

* IMPORTING

*   DOCUMENT_OUTPUT_INFO       =

*   JOB_OUTPUT_INFO            =

*   JOB_OUTPUT_OPTIONS         =

  EXCEPTIONS

    FORMATTING_ERROR           = 1

    INTERNAL_ERROR             = 2

    SEND_ERROR                 = 3

    USER_CANCELED              = 4

    OTHERS                     = 5

               .

     IF SY-SUBRC <> 0.

* Implement suitable error handling here

     ENDIF.

   ENDLOOP.

   CALL FUNCTION 'SSF_CLOSE'

* IMPORTING

*   JOB_OUTPUT_INFO        =

    EXCEPTIONS

      FORMATTING_ERROR       = 1

      INTERNAL_ERROR         = 2

      SEND_ERROR             = 3

      OTHERS                 = 4

             .

   IF SY-SUBRC <> 0.

* Implement suitable error handling here

   ENDIF.

ENDFORM.                    " DISPLAY_DATA

0 Kudos

Hi Chandan,

As per your given program it is working fine , but if "IT_MSEG"  doesn't have any data then Spool Request not generate  , when data is available in "IT_MSEG" Internal table then Spool Request is generate Successfully . So, my point of view your data is not populated in Internal table in QA/Prod .

" SELECT * FROM MSEG INTO TABLE IT_MSEG

                            WHERE MBLNR IN P_MBLNR.  "

Choose Correct Data in QA/Prod . 

Regard's

Smruti

0 Kudos

It contains data and give the print preview also but while taking the printout it comes back to selection screen..

regards

chandan sahu

0 Kudos

if i am  trying to taking printout before pressing print preview button  or after print preview button as per your code only both the case i got spool request number generate no issue.

so, what is your actual issue ? Spool Number ? Selection Screen ?

Regard's

Smruti

0 Kudos

only the printout is the problem...spool request is not generated for printout..

i get the print preview but not able to take out the printout because the spool request

is not generated..

when i click on print it come back to selection screen without generating the spool..

0 Kudos

Hi Chandan ,

Check the version of your smartforms in QAS/PRD with that of in DEV ?

Are both same ?

0 Kudos

do as per above screen shot , and spool number generate or not ?? and check using SP01 T-code .

only "New Spool Request" checked .

Regard's

Smruti

0 Kudos

Can you check other smartform driver program which is working f9 in Dev/QA/Prod .

is "SSFCOMP_OPEN"  and "SSFCOMP_CLOSE"  Used in place of "SSF_OPEN" and "SSF_CLOSE"   ??

Regard's

Smruti