How to generate spool request in sap script

Hi Experts !!
I had customized RFFCOUS_C -- > Include RFFORI01 for printing check and payment advise.
Now if we run standard print program, spool will be generated first
and then we can see the print prieview accordingly.
But after my customization, after seeing print prieview when am clicking print button , then only spool is getting generated....
i had checked everything...but not able to solve the issue.
Please help.
Regards
Saurabh goel

Hi,
Just use below logic for script
itcpo-tddest = p_print. " Printer name
itcpo-tdnewid = 'X'.
itcpo-tdimmed = 'X'.
itcpo-tdcopies = '1'.
call function 'OPEN_FORM'
exporting
device = 'PRINTER'
dialog = ' '
form = 'ZAUTO_REPLPRINT'
language = sy-langu
options = itcpo
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7a5f4061-0a01-0010-c9bc-a4e4cb100438#q-2
Regards,
Shiva(reward if helpful).

Similar Messages

  • How To Generate Spool request for a SAP-Script form

    How To Generate Spool request for a SAP-Script form

    Hai   Rahaman,
    After getting the print preview of the SCRIPT.
    Click On  PRINT.
    Buttom of the page one spool request will be generated by system.
    Go to  SP01.
    You Can Find  SPOOL Reqest Number.
    Regards.
    Eshwar.

  • How to convert spool request to pdf format (to send mail) - SAP 3.1H

    Hi,
       I am working in 3.1H version. How to convert spool request into pdf cormat to send a mail?. Spool request is in TEXT format.
    regards,
    sundaram J.

    Hi sundaram,
    1. I suppose u know how to send
        mail with attachment.
    2. If that is the case,
       then no need to do anything.
    3. Bcos
       There is setting in SCOT,
       for INTERNET
       ABAP List ---> PDF
       Raw TEXT  -
    PDF
      (Your basis team will help u)
    4.  text data will get automatically converted
       to pdf and get mailed.
    regards,
    amit m.

  • Is there any FM to generate spool request for error log of a background job

    Hi,
        I am going to create a program to create deliveries and do PGI. This program will be assigned to periodic background job.Now whatever  errors are generated in program i have to send the error log to spool request.Is there any FM for generating spool request with this error log  or how can this be done? Kindly provide sample code if possible.
    Thanks.
    Nimish Dongare.

    Hi Nimish,
    How are you doing, This is Shreekant working as ABAP developer, I sow your post in sdn forum, I have a similar requirement like I am changing the delivery taking some data from a flat file which is coming from other system and do PGI. If any error occurs during this process I need to capture it and present it as a report or create log file.. whichever is easier.
    Please can u help me how did u achieved this functionality for your requirement?.. pls. can u share some details.
    If u don mind, can u give me ur email id to communicate.
    Thanks,
    Shreekant

  • Generate spool request and PDF

    Hello Friends,
    I have the below requirement in Scripts.
    I need to generate spool request and also download the form as pdf simultaneously.
    I can able to generate spool request and able to download as PDF separately, but I want to do both in a single open_form is it possible?
    Regards.
    Krishna.

    Copy and Paste following code in a Z program type executable:
    REPORT ZRSTXPDFT4 LINE-SIZE 80.
    Read spool job contents (OTF or ABAP list) and convert
    to PDF, download PDF
    B20K8A0IKH replace WS_DOWNLOAD with GUI_DOWNLOAD
    SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-015.
    SELECTION-SCREEN SKIP.
    PARAMETERS:
      SPOOLNO LIKE TSP01-RQIDENT.
    SELECTION-SCREEN SKIP.
    PARAMETERS :  DOWNLOAD AS CHECKBOX DEFAULT 'X',
      P_FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\temp\file.pdf' NO-DISPLAY."#EC NOTEXT
    SELECTION-SCREEN END OF BLOCK B.
    DATA OTF LIKE ITCOO OCCURS 100 WITH HEADER LINE.
    DATA CANCEL.
    DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
    DATA DOCTAB LIKE DOCS OCCURS 1 WITH HEADER LINE.
    DATA: NUMBYTES TYPE I,
          ARC_IDX LIKE TOA_DARA,
          PDFSPOOLID LIKE TSP01-RQIDENT,
          JOBNAME LIKE TBTCJOB-JOBNAME,
          JOBCOUNT LIKE TBTCJOB-JOBCOUNT,
          IS_OTF.
    DATA: CLIENT LIKE TST01-DCLIENT,
          NAME LIKE TST01-DNAME,
          OBJTYPE LIKE RSTSTYPE-TYPE,
          TYPE LIKE RSTSTYPE-TYPE.
    TABLES: TSP01.
    DATA : RETFIELD TYPE DFIES-FIELDNAME.
    DATA : SPOOL TYPE HELP_INFO-DYNPROFLD.
    DATA : BEGIN OF ITAB OCCURS 0,
            SPOOL TYPE TSP01-RQIDENT,
           END OF ITAB.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SPOOLNO.
      RETFIELD = SPOOLNO.
      SPOOL = 'SPOOLNO'.
      SELECT RQIDENT FROM TSP01 INTO TABLE ITAB."#EC CI_NOWHERE
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
      DDIC_STRUCTURE         = ' '
          RETFIELD               = RETFIELD
      PVALKEY                = ' '
       DYNPPROG               = SY-REPID
       DYNPNR                 = SY-DYNNR
       DYNPROFIELD            = SPOOL
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
       CALLBACK_PROGRAM       = SY-CPROG
      CALLBACK_FORM          = ' '
      MARK_TAB               =
    IMPORTING
      USER_RESET             =
        TABLES
          VALUE_TAB              = ITAB[]
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
       PARAMETER_ERROR        = 1
       NO_VALUES_FOUND        = 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.
    START-OF-SELECTION.
      SELECT SINGLE * FROM TSP01 WHERE RQIDENT = SPOOLNO.
      IF SY-SUBRC <> 0.
        PERFORM BD_TEXTBOX_ERR(RSTXPDFT) USING 80
         'Spoolauftrag existiert nicht'(003).
        EXIT.
      ENDIF.
      CLIENT = TSP01-RQCLIENT.
      NAME   = TSP01-RQO1NAME.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
             EXPORTING
                  AUTHORITY     = 'SP01'
                  CLIENT        = CLIENT
                  NAME          = NAME
                  PART          = 1
             IMPORTING
              CHARCO        =
              CREATER       =
              CREDATE       =
              DELDATE       =
              MAX_CREDATE   =
              MAX_DELDATE   =
              NON_UNIQ      =
              NOOF_PARTS    =
              RECTYP        =
              SIZE          =
              STOTYP        =
                  TYPE          = TYPE
                  OBJTYPE       = OBJTYPE
             EXCEPTIONS
                  FB_ERROR      = 1
                  FB_RSTS_OTHER = 2
                  NO_OBJECT     = 3
                  NO_PERMISSION = 4.
      IF OBJTYPE(3) = 'OTF'.
        IS_OTF = 'X'.
      ELSE.
        IS_OTF = SPACE.
      ENDIF.
      IF IS_OTF = 'X'.
        CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
            EXPORTING
              SRC_SPOOLID                    = SPOOLNO
              NO_DIALOG                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
            IMPORTING
              PDF_BYTECOUNT                  = NUMBYTES
              PDF_SPOOLID                    = PDFSPOOLID
          OTF_PAGECOUNT                  =
              BTC_JOBNAME                    = JOBNAME
              BTC_JOBCOUNT                   = JOBCOUNT
            TABLES
              PDF                            = PDF
            EXCEPTIONS
              ERR_NO_OTF_SPOOLJOB            = 1
              ERR_NO_SPOOLJOB                = 2
              ERR_NO_PERMISSION              = 3
              ERR_CONV_NOT_POSSIBLE          = 4
              ERR_BAD_DSTDEVICE              = 5
              USER_CANCELLED                 = 6
              ERR_SPOOLERROR                 = 7
              ERR_TEMSEERROR                 = 8
              ERR_BTCJOB_OPEN_FAILED         = 9
              ERR_BTCJOB_SUBMIT_FAILED       = 10
              ERR_BTCJOB_CLOSE_FAILED        = 11.
        CASE SY-SUBRC.
          WHEN 0.
            PERFORM BD_TEXTBOX_MSG(RSTXPDFT) USING 80
             'Funktion CONVERT_OTFSPOOLJOB_2_PDF erfolgreich'(001).
          WHEN 1.
            PERFORM BD_TEXTBOX_ERR(RSTXPDFT) USING 80
             'Kein OTF- und kein ABAP-Spoolauftrag'(002).
            EXIT.
          WHEN 2.
            PERFORM BD_TEXTBOX_ERR(RSTXPDFT) USING 80
             'Spoolauftrag existiert nicht'(003).
            EXIT.
          WHEN 3.
            PERFORM BD_TEXTBOX_ERR(RSTXPDFT) USING 80
             'Keine Berechtigung zum Lesen Spoolauftrag'(004).
            EXIT.
          WHEN OTHERS.
            PERFORM BD_TEXTBOX_ERR(RSTXPDFT) USING 80
             'Fehler bei Funktion CONVERT_OTFSPOOLJOB_2_PDF'(005).
            EXIT.
        ENDCASE.
      ELSE.
        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
            EXPORTING
              SRC_SPOOLID                    = SPOOLNO
              NO_DIALOG                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
            IMPORTING
              PDF_BYTECOUNT                  = NUMBYTES
              PDF_SPOOLID                    = PDFSPOOLID
          LIST_PAGECOUNT                 =
              BTC_JOBNAME                    = JOBNAME
              BTC_JOBCOUNT                   = JOBCOUNT
            TABLES
              PDF                            = PDF
            EXCEPTIONS
              ERR_NO_ABAP_SPOOLJOB           = 1
              ERR_NO_SPOOLJOB                = 2
              ERR_NO_PERMISSION              = 3
              ERR_CONV_NOT_POSSIBLE          = 4
              ERR_BAD_DESTDEVICE             = 5
              USER_CANCELLED                 = 6
              ERR_SPOOLERROR                 = 7
              ERR_TEMSEERROR                 = 8
              ERR_BTCJOB_OPEN_FAILED         = 9
              ERR_BTCJOB_SUBMIT_FAILED       = 10
              ERR_BTCJOB_CLOSE_FAILED        = 11.
        CASE SY-SUBRC.
          WHEN 0.
            PERFORM BD_TEXTBOX_MSG(RSTXPDFT) USING 80
             'Funktion CONVERT_ABAPSPOOLJOB_2_PDF erfolgreich'(006).
          WHEN 1.
            PERFORM BD_TEXTBOX_ERR(RSTXPDFT) USING 80
             'Kein OTF- und kein ABAP-Spoolauftrag'(002).
            EXIT.
          WHEN 2.
            PERFORM BD_TEXTBOX_ERR(RSTXPDFT) USING 80
             'Spoolauftrag existiert nicht'(003).
            EXIT.
          WHEN 3.
            PERFORM BD_TEXTBOX_ERR(RSTXPDFT) USING 80
             'Keine Berechtigung zum Lesen Spoolauftrag'(004).
            EXIT.
          WHEN OTHERS.
            PERFORM BD_TEXTBOX_ERR(RSTXPDFT) USING 80
             'Fehler bei Funktion CONVERT_ABAPSPOOLJOB_2_PDF'(007).
            EXIT.
        ENDCASE.
      ENDIF.
    download PDF file ***********
      CHECK DOWNLOAD = 'X'.
      IF NOT ( JOBNAME IS INITIAL ).
        PERFORM BD_TEXTBOX_VAR2_MSG(RSTXPDFT) USING 80
         'Konvertierung per Hintergrundjob'(008)
         JOBNAME
         JOBCOUNT.
        EXIT.
      ENDIF.
      PERFORM DOWNLOAD_W_EXT(RSTXPDFT) TABLES PDF
                                       USING P_FILE
                                             '.pdf'
                                             'BIN'
                                             NUMBYTES
                                             CANCEL.
      IF CANCEL = SPACE.
        DATA: S(80).
        S = NUMBYTES. CONDENSE S.
        CONCATENATE S 'Bytes heruntergeladen in Datei'(009)
          INTO S SEPARATED BY SPACE.
        PERFORM BD_TEXTBOX_VAR1_MSG(RSTXPDFT) USING 80
                                          S
                                          P_FILE.
      ENDIF.
    Regards,
    Jeet K Bhatt

  • How to print last page in sap script in ladscape format?

    Hi all,
    can any 1 tell me How to print last page in sap script in ladscape format?
    Thanks In advance.
    Pravin

    Hi Pravin Sherkar,
    we can do this in SAP Scripts.
    we need to create two pages, one of landscape and another of potrait.
    now after filling the data at last we need to call the page which is of format landscape using START_FORM  function module.
    You can use condition &PAGE& = &FORMPAGES&.
    Please check this link
    Printing Portrait/Landscape in sapscript
    Re: Landscape and potrait in same layout?
    http://www.sap-img.com/ts013.htm
    Best regards,
    raam

  • How to print Special Characters in Sap-Scripts

    How to print Special Characters in Sap-Scripts
    Thanks,
    Ravi

    Hi
    if u want print special characters we can use hot codes i.e '  '  (single inverted commas). in between these hot codes insert u r special characters.
    write    '    !@#$%^&*( )  '.
    for the above write statement output is
    output is   !@#$%^&*( )

  • How to use IF Conditon in SAP Scripts?

    Hi Guys,
                   I am having adoubt how to use IF conditon with multiple variables in SAp Scripts
    for ex If a>b and a>c and a>d
             Elseif b>a and b>c and b> d.
             Elseif .....
              endif.
              How to use above example in SAP Scripts.
    thanks,
    Gopi.

    hi Gopi,
    it is almost the same as normal ABAP, you only have to use & before and after the variable and the variable has to be in capitals and you have to make the line as command ( /: before the line )
    IF &A& > &B& AND ...
    text to print
    ELSEIF ...
    text to print
    ENDIF.
    hope this helps
    ec

  • How to get the last page  SAP Script form

    How to get the last page  SAP Script form.
    I want to print a specific information in the last page of SAP form (Script). Please tell me how to get the last page number.
    Regards

    Hi
    You have to check the system variable &NEXTPAGE&, if it's 0 it means you're in the last page.
    From SAP Help:
    This symbol is used to print the number of the following page. The output format is the same as with &PAGE& .
    Note that on the last page of the output, in each window that is not of type MAIN, &NEXTPAGE& has the value 0.
    /: IF &NEXTPAGE& = '0'
       Last page
    /: ENDIF
    Max

  • How to print Vertical barcode in SAP script

    I want to print barcode related items in SAP script . can you plz tell me any one
    1.How to print vertical barcode in SAP script ?
    2.How to print vertical text in SAP script ?

    1.
    Create the character format in se71, in that select standard barcode. like
    Char.format: C1 Description: Barcode
    Barcode: BC_CD39 save the character format.
    you can select from the list.
    in the form coding, can you use barcode like
    <C1> program variablr <>.
    <C1> &itab-matnr <>.    "--->like this
    Then it shows the barcode in output.
    check this.
    2. for vertical text ..
    if this is a window text then its possible but
    like
    S
    H
    I
    P
    T
    O
    This is possible in giving the window name but in the layout i never tried this.
    If u can tell the scenario(with data reference) then may be i can try but not sure that this will give me hit.
    regards,
    vijay.

  • How to use perform statements in sap scripts

    how to use perform statements in sap scripts . and pls send me one progam for this
    thnaks
    raja

    Hi Raja,
    <b>PERFORM</b> key work is used to include subroutine in sapscript form...
    But the processing is lttle bit different form the one we use in ABAP.
    Here the paramters passed to form is stored in internal table of name-value table. there are two table one for inbound parameter and other for outbound parameters.
    Check out the example below to see how this is used..
    <b>Definition in the SAPscript form:</b>
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    <b>Coding of the calling ABAP program:</b>
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY ‘PAGE’.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE OUT_PAR WITH KEY ‘BARCODE’.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = ‘|’. "First page
    ELSE.
    OUT_PAR-VALUE = ‘||’. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = ‘L’. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    Hope this is clear to understand...
    Enjoy SAP.
    Pankaj Singh.

  • How to Avoid blank page in SAP Script

    I am working on a Script. My Script prints a check.
    This script is a copy of a std script.
    It has 3 pages - First Next Last
    My First page has all the required data.
    My second page is empty with out any values.
    I am getting the blank page as Page 2 when executing. How can we avoid it ?
    Senthil

    Hi Senthil,
    Please see the below points:
    1. Please check what have you defined as the NEXT PAGE for your first page. If so change it and make the first page itself as the next page.
    2. Check your main Window, may be there is blank line at the last of the main window, so check that abd remove that,so you won't get the blank page
    Please see the link which is similar to your problem:
    Re: How to remove blank page in sap script
    May it helps you.
    Regards.
    Deepak Sharma.

  • How to insert the style in sap-script? and in smart form?

    how to insert the style in sap-script? and in smart form?

    Hi..,
    For SAP scripts u need to create them in SE72 ...
    and u can include them in the script editor as..
    /: STYLE <STYLE-NAME>
    P1 text...............  (*** P1 is the Paragraph format created in SE72 )
    /: STYLE *
    For smartforms u need to go for the transaction (tcode) SMARTSTYLES... here u can create paragraph and character formats globally...
    <b>Sunil, plz do remember to close all your threads, when ur problem is solved !!</b>
    reward all helpful answers,
    sai ramesh

  • How to debugg particular statement in sap script

    hi friends,
    i want to know How to debugg particular statement in sap script.
    plz reply.
    thanks in advance,
    regards
    bhaskar

    hi
      execute rstxdbug to activate script debugger...once the driver program reaches open_form, a popup box will come where u can mention the name of a command, call functinon, text element, etc to place a break point...once it gets into the debugging mode, double click on any line to set a break point, after that pressing f8 will get you to that line
    if helpful, reward
    Sathish. R

  • HOW TO CREATE A VARIABLE IN SAP SCRIPT

    HI ALL,
    CAN ANYONE TELL ME HOW TO CREATE A VARIABLE IN SAP SCRIPT.
    THANK YOU,
    BYE
    TAKE CARE.

    Hi Ravi,
    You can use like this
    A text in the editor contains the following DEFINE commands:
    /: DEFINE &mysymbol& = 'xxx xxx xxxxx xxxx'
    &mysymbol&
    /: DEFINE &mysymbol& = 'yyyyy yyy yyyy'
    / &mysymbol&
    The printed text appears

Maybe you are looking for

  • Adobe Photoshop CS6 will not install on my Mac.

    Adobe Photoshop CS6 will not install on my Mac. Adobe Application Manager is seeing the Beta version of Photoshop CS6 on my machine. I have unistalled/deleted any previous versions of the software, and used the Adobe Creative Suite Cleaner tool to fl

  • Tons of repeated windowserver log errors?

    Hi Everyone, I've noticed that my windowserver.log and windowserver_last.log are filled with these errors. Any idea what's going on? GErrorIllegalArgument: CGXSetTrackingAreaOption : Invalid tracking area kCGErrorIllegalArgument: CGXSetTrackingAreaEn

  • File Name Changes, Sorting Problem

    Hi, iTunes 10.5.1 MacBook Pro Snow Leopard I am attempting to add a series of lectures to iTunes. These number about 100 and are sequential over 3 volumes. I obtained them in simple forlders labeled vol1, vol2 and vol3 and each track is named with a

  • Solaris 10 zones network config using different IP address

    I have a Solaris 10 global zone with two networks 172.x.x.x and 192.x.x.x The zone loaded on this global zone has two networks 192.x.x.x and 144.x.x.x I have the 192 network working fine on both the global and non-global zones. I have aggr2 on the gl

  • Problems with producing PDFs via Adobe Acrobat Prof 11

    Hello we have the following problem: While producing several word documents via PDF Printer (we have insallted the latest version of Adobe Acrobat Professional 11) we receive error messages like %%[ ProductName: Distiller ]%% %%[ Error: /EMC pdfmark