Creation of Spool from foreground

Hi Gurus,
From a program, I have to call another program that sends mail with a PDF attachment. The whole purpose is to generate a spool in foreground by the called program which could be mailed as an attachment to some IDs.
For that I have written the below code in my program:
        NEW-PAGE PRINT ON
        LINE-SIZE 220
        IMMEDIATELY 'X'
        KEEP IN SPOOL 'X'
        NEW LIST IDENTIFICATION 'X'
        NO DIALOG.
        PERFORM header.  "for the header part in the pdf file
        PERFORM output USING wa_final.  "for the pdf content
        NEW-PAGE PRINT OFF.
Then I have the Submit statement.
        SUBMIT  stmt...
The PERFORM header has the write statements for the header part of the pdf file and the PERFORM output has the write statements for the report data to be shown in the pdf file.
The spool # is being generated as shown by sy-spono field but the spool has contains no data. Think it's not able to read the data.
Please give some idea for what could be done for the data to be read in spool.
Its really urgent.
Regards,
Binay.
Edited by: binay shankar mohanty on Jul 7, 2008 8:25 AM

Hi,
It could be a number ranges issue, please check trx. SNRO and see if the number ranges are specified as correctly, otherwise please extend, And also check if the batch Job 'SAP_REORG_SPOOL' is running to clear the spool requests which are already being processed, Job 'SAP_REORG_SPOOL' has to run on daily basis. Hope this will solve the issue.

Similar Messages

  • Am unable to see all COLUMNS of my_ALV in SPOOL from a BACK GROUND JOB, Why

    hi experts,
    pls. clarify m ysimple doubt that,
    Am running a ALV report in my_BACK GROUND..........this ALV contains 16 comuns...........I ´got the SPOOL from the scheduled my_BACK GROUND.......I noticed that, ONLY 9 columns are showing up?????????????
    so,
    1 - If I take print, all the columns will come show up?
    2 - If I/user waanna to see totla columns, than How to get it done?
    3 - Why SAP is so?
    thanq

    Hi Srini,
      I do faced the same problem and struggle a lot. I have done two things and My problem is resolve .
    1. First my Report autom mail come in PDF format that we have change to HTML view. (Basis people can do it.)
    2. Page format previously it was X_44_120  we have change it to  X_58_170 and the problem is resolve.
    hope it will be help full for you.
    Regards
    Swati....

  • Mass creation of PO from excel sheet

    Dear all
           Kindly let me know the method for Mass creation of PO from excel sheet
    Regards
    Chandra mohan

    Hi, check these links....
    /people/hema.rao/blog/2006/09/14/lsmw--step-by-step
    http://www.sap-img.com/sap-data-migration.htm
    get more from first thread.........

  • Auto creation of po from shopping cart

    hai gurus
    Iam in SRM 5.o,CLASSIC Scenario.
    In configuration for "Auto creation of po from shopping cart"i  have given "purchase order if item data complete,otherwise PR"in  SPRO>SRM>srmserver>cross application basic settings>Define  objects in Backend(PR,PO,requisition)
    So shopping cart is been created with PUR org,PUR GROUP,Vendor tax code,account assignment etc,but  purchase requisition is created and not  purchase order.Is there any  settings left over
    Thanks in Advance
    chandra

    Hello Chandra,
    You also could use the PR (in ECC) and try to convert it into a PO (ME57). If it asks you for some additional data (e.g. vendor, price, ..) this might indicate, that it is missing in the SC.
    Also, you could try and debug transaction ME59 (auto PO creation) to see, what's missing/checked.
    Good luck.
    Franz

  • Automatic creation of PO from shipment cost document

    Dear Experts
    PLease let me know the settings with description to understand for the creation of PO from shipment cost document. It seems inegration with FI is also needed. Request your explanation with the settings in SPRO
    Thanks
    Ganesh

    For automatic Generation of Purchase Order
    SPRO > Logistics Execution > Transport > Shipment Costs > Shipment Cost Document > Shipment Cost Types and Item Categories > Define item Categories (T_56)
       In the Generate PO, Enter one of A, B, C.
           Do not generate purchase order
    A    Generate purchase order for validity period of 1 day
    B    Generate purchase order for validity period of 1 week
    C    Generate purchase order for validity period of 1 month
    For assigning posting in G/L Accounts
    SPRO > Logistics Execution > Transport > Shipment Costs > Shipment Cost Document > Shipment Cost Types and Item Categories > Assign shipment cost types and item categories
    Based on the item category created before, assign the valuation class.
    Assign the Valuation class to the Shipment header or leg (whichever is planned for ) and the item category you created before.
    Assigning the Shipment cost type to the shipment type
    SPRO > Logistics Execution > Transport > Shipment Costs > Shipment Cost Document > Shipment Cost Relevance and Default for Shipment Cost Type (T_57)
    Assign the Shipment cost type to the Shipment type and mark it as relevant for shipment cost.
    Checking the assignment of G/L Accounts to the Valuation Class
    SPRO > Logistics Execution > Transport > Shipment Costs > Settlement > Automatic G/L Account Determination
    Select the Account Assignment - GBB - Enter the Chart of Accounts - Check if VBR was assigned the G/L accounts for the Valuation class you specified before.

  • Creation of notification from warranty claim (wty tcode)

    Dear all ,
    i have the requirement , where in notification (say service notification) to be created from warranty claim document i.e.., created in wty transaction code.
    i captured all the data in warranty claim like equipment , customer , sales area , material and also entered relevant notification type i.e.,S3 , but still when i click on Create notification icon in the waranty claim document, system is  unable to create notification with out any error or warning messages .
    in the actions i assigned T205 (which is used to create quality or service notification) and i checked and saved the document , but still system is not generating the notification.
    whether i missed any configuration or any thing to do at the time of creating the warranty claim .... please suggest.
    awaiting for your quick response.

    [Duplicate thread|creation of notification from warranty claim (wty tcode);
    This one being locked

  • Automatic creation of project from Sales Order?

    hi..
    can someone guide me how to automatically generate PS Projects from SO USING TCODE HBS0?
    i have been able to generate projects automatically when i use tcode VA41 but my need is to do this for RE using sales browser and creation of Sales Order is by Tcode HBS0.
    when i save the sales order, no project is created. ( Note: Material i used is same one i used successfully in VA41+)
    thanks in advance..

    Hi Ramesh,
    Creation of project from sales order in SAP Project system is described as assembly processing.
    In the Project System only networks can be generated directly from a sales document during assembly processing. Indirectly the system can also generate work breakdown structures, when it creates the network.
    1.You start assembly processing by creating a sales document for a material. This sales
       document can be inquiry,quotation, sales order.
    2. The system then
        Configures the material, if necessary
        Creates a network using the standard network as a template
        Configures the network, if necessary
        Schedules the network backwards from the required delivery date
        Checks material availability
        Costs the network and transfers these costs to the sales document.
    3. When you save the sales document, the system saves the network together with the sales
        document. If applicable, it also generates a project definition and work breakdown structure.
        The project number is derived from the sales document number.
    Please refer link mentioned below to know more details
    http://help.sap.com/saphelp_47x200/helpdata/en/95/1613a8837b11d2b6700000e82d8bd1/frameset.htm
    Regards
    Tushar

  • Automatic creation of TO from TR

    Hi
    While doing automatic creation of TO from TR through SE38 through the programme       RLAUTA10  following error is getting thrown
    "Processing type is not maintained for automatic TO creation
    Message no. L3404"
    Diagnosis
    To process transfer requirements / posting changes during automatic transfer order creation, you require a processing type that is maintained in the Customizing appplication when you set the control for automatic TO creation.
    Procedure
    Maintain the processing type in the Customizing table specified above.
    Pls help me how to resolve this

    hi Kumar,
    you have to maintain automatic creation of TO in backround for your im movement type in OMKZ.
    also in backround you have to activate backround processing in OMKZ(it will go to SM36).There you have to give the job name and processing time(periodically,one time etc..)
    regards
    venkadesh

  • How to create automatic creation of BP from customer and vendor master data

    Hi gurus,
    can any one tell how to create automatic creation of BP from customer and vendor master data.
    Please give me the steps.
    Thanks
    Sasikanth.

    HI,
    Goto SPRO\ Cross application components \ Master data synchronization \ Synchronization control.
    Assign account groups of customer and vendors to respective BP grouping. This setting is enough to create BP in background while creating customer / vendor. But the fields groups are very much important, ensure mandatory fields should be sync.
    rgds,
    Srini

  • Creation of Material from SAP VIEW using CDESK.

    Hi  Experts,
    I have one question related to creation of Material from SAP View.
    CAD file created say SM1000.prt
    Create DIR in CAD View say SM1000
    Scenario 1 :   Create Material in Background from CAD VIEW or SAP VIEW from cad desktop, It creates material SM1000
                               in background.
    Scenario 2 : Open CDESK ( Transaction)
                            Click on OPEN,
                            Selecting the DIR created SM1000
                            Create the material in background in SAP View, it gives message " enter material number"
    Why am not able to create the material from SAP view using CAD Desktop. If any modifications needs to be done in CDESK CUS to solve this please let me know.
    Thanks,
    Sudharshan

    Hi Sudharshan,
    maybe the reason for this is that your CAD applications provides a special material number and the customizing in CDESK is defined to use this number. In this case the number or value can by provided from the CAD application only from the CAD View.
    In the SAP view the material gets created like in MM01 for example and so mabye you have to enter a material number.
    Best regards,
    Christoph

  • Creation of assets from PS

    Hi i have two question regarding creation of assets from PS
    1) Can the AUC be assigned to an network order or activity instead of WBSE
    1) Can multiple asset be created from a single AUD.
    Regards
    Suhail

    hi sarang,
    I am try to create asset using wbs element, but i am not finding menu path as given by you;
    edit>WBS element>investment program>create fixed asset,
    as of now we are creating assets thru as01 and creating distribution rule in project for wbs element and actual settlment document thru cj88.
    after reading your solution creating assets using wbs element, pl revert how this is possible for us,
    pl help
    regards
    srihari

  • Create Spool from Internal table & converrt the spool to PDF

    Hi All,
    My requirement is take data from a table and find amount specific to each Vendors . So I took all the data into ITAB and do all the calculation. Later after calculation I have to create a spool from this ITAB and this spool have to convert to PDF. Later this PDF have to seend via email.
    To convert the internal table to Spool , I used
    LOOP AT t_summ INTO wa_summ.
        w-amount = wa_summ-remittanceamount.
        CONCATENATE wa_summ-vendorcode
                    wa_summ-controlnum
                    w-amount INTO wa_textdata SEPARATED BY space.
        APPEND wa_textdata TO t_textdata.
      ENDLOOP.
      DESCRIBE TABLE t_textdata .
      w-file_length = syst-tfill * 1022.
      l_doctype = 'LIST'.
      l_layout = 'X_POSTSCRIPT'.
      CONCATENATE ' Listbill Summary Report for' syst-datum INTO
                          l_title SEPARATED BY space.
      l_receiver = syst-uname.
    * Create Spool
      CALL FUNCTION 'RSPO_SR_OPEN'
       EXPORTING
          dest                   = 'LOCL'
    *   LDEST                  =
          layout                 = l_layout
          name                   = 'SUMREP'
    *   SUFFIX1                =
    *   SUFFIX2                =
       copies                 = '1'
    *   PRIO                   =
    *      immediate_print        = ' '
    *   AUTO_DELETE            =
          titleline              = l_title
          receiver               = syst-uname           "
    *      division               = l_pri_params-prabt " abteilung
    *      authority              = l_pri_params-prber           "
    *   POSNAME                =
    *   ACTTIME                =
    *   LIFETIME               = '8'
    *   APPEND                 =
    *   COVERPAGE              =
    *   CODEPAGE               =
          doctype                = l_doctype
    *   ARCHMODE               =
    *   ARCHPARAMS             =
    *   TELELAND               =
    *   TELENUM                =
    *   TELENUME               =
         IMPORTING
          handle                 = l_spool_handle
          spoolid                = w-spoolid
    EXCEPTIONS
       device_missing         = 1
       name_twice             = 2
       no_such_device         = 3
       operation_failed       = 4
       OTHERS                 = 5
                .                                            "#EC DOM_EQUAL
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'SLVC_C1022_TO_C255'
        EXPORTING
          i_file_length = w-file_length
        TABLES
          it_c1022      = t_textdata
          et_c255       = lt_spool.
      l_length = w-file_length.
      LOOP AT lt_spool INTO ls_spool.
        l_length = l_length - 255.
        IF ( l_length > 0 ).
          l_line_length = 255.
        ELSE.
          l_line_length = l_length + 255.
        ENDIF.
    *   Write contents to spool
        CALL FUNCTION 'RSPO_SR_WRITE'
          EXPORTING
            handle = l_spool_handle
            text   = ls_spool
            length = l_line_length.
      ENDLOOP.
    * Close Spool
      CALL FUNCTION 'RSPO_SR_CLOSE'
        EXPORTING
          handle                 = l_spool_handle
         pages                  = 1
      FINAL                  = 'X'
       EXCEPTIONS
         handle_not_valid       = 1
         operation_failed       = 2
         OTHERS                 = 3
    By this I can see the spool with data in SP02.
    Then to conver to PDF, I used
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid                    = w-spoolid
          no_dialog                      = 'X'
          DST_DEVICE                     = 'LOCL'
    *      PDF_DESTINATION                =
        IMPORTING
    *      PDF_BYTECOUNT                  =
    *      PDF_SPOOLID                    =
          list_pagecount                 = list_pagecount
    *      BTC_JOBNAME                    =
    *      BTC_JOBCOUNT                   =
       TABLES
         pdf                            = t_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
         OTHERS                         = 12
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
        CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    *   BIN_FILESIZE                    =
          filename                        = 'D:\t\t.pdf'
         filetype                        = 'BIN'
        TABLES
          data_tab                        = t_pdf
    *   FIELDNAMES                      =
       EXCEPTIONS
         file_write_error                = 1
         no_batch                        = 2
         gui_refuse_filetransfer         = 3
         invalid_type                    = 4
         no_authority                    = 5
         unknown_error                   = 6
         header_not_allowed              = 7
         separator_not_allowed           = 8
         filesize_not_allowed            = 9
         header_too_long                 = 10
         dp_error_create                 = 11
         dp_error_send                   = 12
         dp_error_write                  = 13
         unknown_dp_error                = 14
         access_denied                   = 15
         dp_out_of_memory                = 16
         disk_full                       = 17
         dp_timeout                      = 18
         file_not_found                  = 19
         dataprovider_exception          = 20
         control_flush_error             = 21
         OTHERS                          = 22
    But later when I go and open the PDF, I am getting an error saying'Page cannot be open because it dont have any pages'
    Please help me
    Regards,
    Nikhil

    Hi Nikhil,
    <li>If you are still not able to find out the problem. You can an alternative way , which is used for the same purpose.
    <li>Try this way. It creates spool and and same CONVERT_ABAPSPOOLJOB_2_PDF fm is used to convert spool to PDF. It works. Test this test program.
       REPORT ztest_notepad.
       DATA:g_val         TYPE c,
            w_pripar      TYPE pri_params,
            w_arcpar      TYPE arc_params,
            i_pdf         TYPE TABLE OF tline,
            spoolid       LIKE tsp01-rqident,
            l_no_of_bytes TYPE i,
            l_pdf_spoolid LIKE tsp01-rqident,
            l_jobname     LIKE tbtcjob-jobname,
            l_jobcount    LIKE tbtcjob-jobcount.
       DATA:it_t001 TYPE TABLE OF t001 WITH HEADER LINE.
       START-OF-SELECTION.
         SELECT * FROM t001 INTO TABLE it_t001.
         "Read, determine, change spool print parameters and archive parameters
         CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
             in_archive_parameters  = w_arcpar
             in_parameters          = w_pripar
             layout                 = 'X_65_132'
             line_count             = 65
             line_size              = 132
             no_dialog              = 'X'
           IMPORTING
             out_archive_parameters = w_arcpar
             out_parameters         = w_pripar
             valid                  = g_val.
         IF g_val  NE space AND sy-subrc = 0.
           w_pripar-prrel = space.
           w_pripar-primm = space.
           NEW-PAGE PRINT ON  NEW-SECTION PARAMETERS w_pripar ARCHIVE PARAMETERS w_arcpar NO DIALOG.
         ENDIF.
         LOOP AT it_t001.
           WRITE:/ it_t001.
         ENDLOOP.
         NEW-PAGE PRINT OFF.
         CALL FUNCTION 'ABAP4_COMMIT_WORK'.
         spoolid = sy-spono.
         CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
             src_spoolid   = spoolid
             no_dialog     = ' '
           IMPORTING
             pdf_bytecount = l_no_of_bytes
             pdf_spoolid   = l_pdf_spoolid
             btc_jobname   = l_jobname
             btc_jobcount  = l_jobcount
           TABLES
             pdf           = i_pdf.
         CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
             filename = 'C:\temp\test.pdf'
             filetype = 'BIN'
           TABLES
             data_tab = i_pdf.
    Thanks
    Venkat.

  • Spooling from PL/SQL Block

    Hi,
    Is it possible to do spooling from a pl/sql block.The spool cannot be the first command because I want to give the spool file name in a loop and each time the spool name should change based on the value.
    I tried all possiblities,but I couldn't can anyone give me some idea on how to do this.
    I cannot use UTL_FILE option ,because the client agreed only for spooling.
    Is it possible to write the spool data is excel format..
    Please find below an example of my requirement..
    DECLARE
    CurSor Cur_Designation IS
    Select Designation from tbl_Designation;
    N_Desig Cur_Designation%RowType;
    Cursor Cur_Emp(Desig Number) IS
    Select Emp_no,Emp_name
    From Employee Where Emp_Designation = Desig;
    N_Emp Cur_Emp%RowType;
    BEGIN
    Open Cur_Designation ;
    Loop
    Fetch Cur_Designation INTO N_Desig;
    EXIT WHEN Cur_Designation %NOTFOUND;
    --Here I want to give the spool file name
    Spool --Should be designation name
    Open Cur_Emp(N_Desig.Designation);
    Loop
    Fetch Cur_Emp INTO N_Emp ;
    EXIT WHEN Cur_Emp %NOTFOUND;
    -- All employee details I need to come to log file
    End Loop;
    Close Cur_Emp;
    End Loop;
    Close Cur_Desingnation;
    End;
    Please advice me how to do this..
    Thanks,
    Bindu

    << I cannot use UTL_FILE option ,because the client agreed only for spooling. >>
    << I want to use it in a PL/SQL Block.I have some variables to declare and some cursors to be used.
    So where should I use the spool command.
    I tried to given after a fetch command ,but it is not working. >>
    you can't use SPOOL inside PLSQL
    you may use dbms_output calls in PLSQL
    so create a procedure test2 instead of sqlscript test2 and you will be fine
    rem =========== procedure test2 ================
    create or replace
    procedure test2 (p_param number) is
    begin
                 dbms_output.enable (1000000);
                 dbms_output.put_line('A' || chr(9) || 'B' || chr(9) || 'C' ) ;
                 FOR i_rec in (select a,b.c from xyz where a = p_param) LOOP
                     dbms_output.put_line (to_char(a) || chr(9) || b || chr(9) || c ) ;
                 END LOOP ;
    end ;
    REM ====================================================                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • PDF Creation with data from SAP system

    Hi All,
    I need to generate a PDF file using Adobe Document Service. The content of the PDF can be from any datasource (Oracle/ BW/ R3 ),  So I require Webdynpro code for pdf creation with data from any of the system

    Hi Deepak,
                     Before starting the code just like that,make sure u have configured all services in Visual Administrator.
    U can refer this:
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/95/5a08cd0e274a0bae559622d6670722/frameset.htm">Configuration Guide</a>
    regards
    Sumit

  • Generating a spool from module pool

    hi all,
      i have a requirement to directly send output to a spool. the program type is module pool. is it possible to write the output in spool from module pool. please explain how to do that.
    Thanks in advance.
    Regards,
    Lakshmi.

    What it the output of the program that needs to go to spool? Is it a list?
    If its a list, try to write that as separate report program and you can submit that in the dialog program and the spool will be created.
    SUBMIT report and RETURN.
    Regards,
    Ravi
    Note - Please mark all the helpful answers

Maybe you are looking for

  • Some pictures in iPhoto won't show or copy, but they're there

    I'm using iPhoto 9.2.2. Did an update from the App Store just last week but didn't notice if this problem had anything to do with that update. On some Events, some pictures seem to be missing. At first when I open the Event some of the thumbnails are

  • How to change default font in Photoshop CS5

    Is there a simple way to change the default font from Felix Tilting to Verdana in Photoshop CS5

  • Element has child ?

    Is there any way to determine if an element has child while using the SAX parser like in DOM ?

  • Solman project transport from one server to another

    Hi All, i have a small query , regarding project management . I have a Template project with some manually designed tamplate inside that. and test case created. Now i want to move this project with all config. , selected template and test case from o

  • Templates: how do I get rid of orphaned updates?

    I've made changes to my template, and then undone those changes.  However, the change still shows up in the child pages, greyed out, so I can't delete it.  This has to do with changes made outside <html> where I got the warning message: You have adde