Skip to Content
author's profile photo Former Member
Former Member

Regarding mode of process

hey guys,

I want my interface program to execute both in Foreground an background depends on mode of selection(foreground\background) by user.

however I need spool list creation for both the case.

could you please suggest me..how to go for this.

Regards

Ambichan.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:25 AM

    Hi Ambi

    Hope below code can lead you:

    FORM get_print_params  USING    p_prin LIKE tsp03-padest
                                    p_imm TYPE c
                                    p_text.
    
      DATA: val(1).
      DATA: pdest LIKE pri_params-pdest.
      DATA: l_list LIKE pri_params-plist.
    
      l_list = p_text.
      IF p_prin IS INITIAL.
        pdest = 'LOCL'.
      ELSE.
        pdest = p_prin.
      ENDIF.
    
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination            = pdest -> <b>Printer Name</b>
          no_dialog              = 'X'
          immediately            = p_imm -> <b>Flag for immediate printing</b>
        IMPORTING
          out_archive_parameters = arcpar -> <b>Return Printer paramters</b>
          out_parameters         = pripar -> <b>Return Printer paramters</b>
          valid                  = val
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
      IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    
      pripar-prdsn = 'IDEN'. -> Spool Request Name
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          in_archive_parameters  = arcpar -> Pass the same values which were returned above
          in_parameters          = pripar
          no_dialog              = 'X'
          list_name              = l_list 
        IMPORTING
          out_archive_parameters = arcpar
          out_parameters         = pripar
          valid                  = val
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
    
      IF sy-subrc EQ 0.
        NEW-PAGE PRINT ON
        NEW-SECTION
        PARAMETERS pripar
        ARCHIVE PARAMETERS arcpar
        NO DIALOG.
      ELSE.
        CLEAR: it_mess.
        CONCATENATE 'UNABLE TO GENERATE SPOOL:' l_list INTO it_mess-mesg.
        APPEND it_mess.
      ENDIF.
    
    ENDFORM.                    " GET_PRINT_PARAMS

    So the statments that are written after executing the above FM's will be under a spool.

    Please try to proceed with the above info.

    Kind Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Ambi

      Use the below steps after NEW-PAGE PRINT OFF for display the spool generated.

      CHECK SY-BATCH IS INITIAL.
      
      DATA: RQIDENT LIKE TSP01_SP0R-RQID_CHAR.    " S/G PARAMETER FOR ID
      DATA: GS_SPOOL LIKE SCHEDMAN_SPOOL.
      
      GS_SPOOL-SPOOLID = SY-SPONO.
      
      CALL FUNCTION 'MONI_CALL_SPOOLSHOW'
        EXPORTING
          LS_SPOOL    = GS_SPOOL
        EXCEPTIONS
          SPOOL_ERROR = 1
          OTHERS      = 2.
      IF SY-SUBRC <> 0.
      * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

      Itz infact referring to the spool generated.

      Kind Regards

      Eswar

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:15 AM

    hi ambi,

    u can check with SY-BATCH.

    IF SY-BATCH = 'X'.

    ---

    ELSE.

    -


    ENDIF.

    hope this helps,

    do reward if it helps,

    priya.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:21 AM

    Hi,

    For the Foreground mode if you want the spool list creation use the syntax NEW-PAGE PRINT ON with the print parameters in the PARAMETERS addition..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.