Thunking Spooler APIS

I uninstall my old version of Adobe reader because I couln't open some pdf files and install the newest version. Now I can open and see all PDF file but now I cannot print them, this message appears: "Thunking Spooler APIS from 32 to 64 process has stopped working"
Need help ASAP

Seems to be an issue with the OS installation to me.
Can you please try and repair your Windows Installation files by running the following command on the Command Prompt (with Admin Privileges):
sfc /scannow
For more information on the same, please refer the following page:
http://answers.microsoft.com/en-us/windows/forum/windows_vista-hardware/thunking-spooler-a pis-from-32-to-64-process-has/749ccb56-e0ce-4624-91d3-71c4a53d4a17

Similar Messages

  • I got this message. Thunking spooler apis from 32 to 64 process has stopped working. This in Firefox4.0

    It happens when i start a speciall program. After a very long time it starts. A program with citrix. Problem started with Firefox.4.0.
    With Firefox 3.6 it worked normal.

    Hi @bembolroco
    I don't believe this is an HP issue, but I did find something that might help; Thunking Spooler APIS from 32 to 64 process has stopped working.
    I feel this is an issue with the operating system as it seems to be effecting many printer brands.
    If the issue persists, I suggest reaching out to the Microsoft Community for further assistance. I hope what I found helps you to resolve the issue.
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

  • Error message: thunking spooler APIS from 32 to 64 Process has stopped working

    Having this same problem with my HP ENVY 7645. Troubleshooter keeps telling me to uninstall and reinstall software. I've done this 3 times now and still get the error message. Any solutions?

    Hi @bembolroco
    I don't believe this is an HP issue, but I did find something that might help; Thunking Spooler APIS from 32 to 64 process has stopped working.
    I feel this is an issue with the operating system as it seems to be effecting many printer brands.
    If the issue persists, I suggest reaching out to the Microsoft Community for further assistance. I hope what I found helps you to resolve the issue.
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

  • Acrobat 9.1 "thunking spooler" crash on Vista 64

    I get the dreaded "32-bit thunking spooler" crash on certain MSWord 2003 documents on Vista Home Premium 64.  After much experimentation, I have determined that this crash happens when the MS Word "normal" style is set to a font that is listed as a printer (PS) font rather than an OpenType font.  Note that the printer font I'm trying to use is an Adobe font, so this isn't a third-party font compatibility problem. If I look at the log report under the Vista control panel it says the fault is in the pscript5.dll file. The version of the pscript5.dll file I have is dated 1/20/2008 and is in the C:\Windows\System32\spool\drivers\x64\3 directory.
    As a temporary workaround, I simply don't use the normal style.  Instead I start everything off as "body text".  But if I had a large library of existing documents this would be a killer.   If anyone has more information on this, including which version of the pscript5.dll is compatible with Acrobat (and where to get it), please let me know.
    --Rob

    A thunking spooler error means that the translation from the 64bit to 32 bit print process isn't working. Here is a link to correct a thunking spooler error:
    http://archi-tech2ra.blogspot.com/
    Hopefully that helps!

  • Crystal Report unable to print out throught Remote Desktop from server

    Dear All Expert,
    I am facing problem when print a crystal report layout from SAP B1 8.8 through Remote to Server, print to Client machine. It will promt out Error Message "thunking spooler apis from 32 to 64 process has stopped working fix", but if print PLD, then it is work. Any Idea? Client machine using Windows 7 facing this problems, earlier using windows XP is fine. Thanks a lot.

    Hi Gordon,
    fyi, I have Turn Off UAC for the client machine (Win 7 32 bit), do the checking from command prompt (srf/scannow), uninstall the printer driver and reinstall the correct printer driver for server (windows server 64 bit), client machine (win7 32 bit), reboot the machine. Do the setting from internet option > Advance> 
    1. Allow active content fro CDs to run on My Computer*
    2. Allow active content to run files on My Computer*
    3. Allow software to run or install even if the signature is invalid.
    But all of the above could not resolve the problem happen. It happen only print SAP B1 8.8 crystal report layout. Others PLD layout is able to print. Please Advice.

  • Printing from Windows 8

    HP LaserJet P1102w will not print from new Acer Aspire e 15.  Receive "Thunking Spooler" crash.  I have searched and downloaded the driver thinking that will correct.  My printer has been added and is the default but when selecting Print receive the "thunking spooler" error.  How can I correct this?  Is this a Windows 8, Acer or HP problem?
    The Acer Aspire E 15 brand is not listed as a brand when trying the "Device Detective". Thanks,

    Hi @RussianBlueMom1 ,
    I see that you are experiencing issues when trying to print, that spooler is crashing. I will certainly do my best to help you.
    Clear the Print Spooler Files and Enable the Spooler Service.
    In Desktop mode, press the Windows key and R at the same time, to show the run command line.
    Type Services.msc.
    Double-click Printer Spooler in the Services list.
    Click Stop and click OK.
    Press the Windows key and R at the same time, to show the run command line.
    Type in %WINDIR%\system32\spool\printer, right click on the document and left click to delete any print jobs.
    Press the Windows key and R at the same time, to show the run command line.
    Type in Services.msc. Double-click Printer Spooler in the Services list.
    Click on Start. In the Startup Type list, make sure that Automatic is selected and click OK.
    If there was any jobs stuck in the queue, after doing these steps, go back in the Print Queue and try deleting them again.
    Go to the Startup screen, (tiles menu) type in Devices and Printers, select settings, click on Devices and Printers.
    Right-click on the printer and then click See what's printing.
    Click Printer and then click Cancel All Documents.
    Click Yes to confirm the action.
    If documents remain in the print queue, restart the computer.
    If you are still having issues, download and run the Print and Scan Doctor. It will diagnose the issue and might automatically resolve it. Find and fix common printer problems using HP diagnostic tools for Windows?
    If you are still having issues, run the System File Checker: Run sfc /scannow & analyze its logs in Windows 7 | 8.
    What were the results when you ran the Print and Scan Doctor? (did it print or scan, any error messages)
    If you need further assistance, just let me know.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Problem with printing

    How can I detect printing from an external program? In simple, I want my java application to detect that printing has been submitted from a non-java application (say Microsoft Word). I should be able to know the following: the printer used and the number of pages submitted for printing.

    Thanks for the articles.
    Yes, I want to printing that occurs in the machine. The machine could be running MS Windows, Linux or any other OS.
    Let me see if the articles will be of help. I know that it is going to be very difficult. Keep in mind that I want to go by java's philosophy of WORA.
    Thanks
    You want to monitor all printing that occurs on a MS
    Windows machine? You will have to call routines that
    are not available to Java. You might be able to use
    JNI, but that would be difficult.
    It might be better to make two programs: A C/C++
    program that makes the calls to the MS Windows OS
    (this API is often called simply "Win32") and have it
    send a message to a Java program.
    Maybe you can start with this page:
    http://support.microsoft.com/support/kb/articles/q160/1
    29.asp
    but to create a program to recieve a notice when any
    program prints anything is even more difficult to
    write.
    Here is another good article:
    http://support.microsoft.com/support/kb/articles/Q196/8
    05.ASP
    but it says that you may only be able to poll, rather
    than get a notice message:
    This sample, Printmon.exe, demonstrates the use of the
    Win32 Spooler API to monitor print queues. The sample
    monitors the contents of a user-selected printer queue
    using two techniques. On Windows NT, the sample
    monitors a printer queue by polling or by change
    events generated by the printer queue. On Windows, it
    can only poll because the change notification
    interface is not implemented.

  • Attempting to install printer on USGCB Win7 image

    Hello everyone. I''m attempting to run the installation for a printer within the USGCB standards, also within a government network with policies and restrictions in place.
    On our Windows XP machines, this printer installs fine. On our Win7 machines, it does not. I right click, run as admin, and the program executes (procmon verifies this) but we don't end up with a printer in the printers control panel. The vendor is at a
    loss, as it works fine on other Win7 images. I am at a loss, after attempting tons of troubleshooting methods and not being able to even determine the root cause of the blocked installation.  
    Troubleshooting attempted: During installation, all logs, event monitor output, process monitor output, etc seem to indicate that the printer should be installing, however, the proper registry entries and files are not being created. There are no errors
    that pop up. We've had several IT and Security professionals, as well as ImageNow and PeerNet technicians review to no avail. We have dropped the machine from the GPO restrictions, verified valid certificates, and added administrator rights to the accounts,
    folders, and files, disabled UAC, DEP, and antivirus, and something is still blocking file creation, however, we can't find any indication of what might be doing the blocking. Other programs can write to the output folders (cutepdf installation is successful).
    I am running as Admin.
    Any tips, pointers, suggestions, or ways of identifying exactly what is blocking the installation would be greatly appreciated. I left out hundreds of pages of back and forth between me and other troubleshooters, so there's sure to be some things I know
    I have done and left out. Honestly, what I really need, is just to know WHICH setting (if it is a GPO setting, or if it's something else) that is blocking the installation, so that we can setup an exception or decide what our path will be. Thanks.

    I would guess the driver is not installing correctly, since there are no files placed in the "C:\WINDOWS\system32\spool\drivers\w32x86\3" directory as I am told i should expect, and as gets done on a non USCGB installation of win7. I would also guess it
    is packageware. I'm told it's digitally signed by our security professionals and the vendor, but never verified this myself. I'm not sure if it's calling spooler API's either. This is the first set of questions i've been asked in 6 months that seem to lead
    a direction other than the ones I've taken, so i greatly appreciate your time.
    Here's a code block of the OEMsetup.inf file, which i assume is the one that might answer your questions. If not, let me know and I will be happy to follow your instructions or google instructions on getting that info. I'm pretty good with computers and
    programming, but don't do much when it comes to printers. 
    ; Printer Installation File for use with the Add Printer Wizard or to install additonal drivers
    ; List of supported printers, manufacturers
    [Version]
    Signature="$Windows NT$"
    Provider=%PEERNET%
    ClassGUID={00000000-0000-0000-0000-000000000000}
    LayoutFile=layout.inf
    [ClassInstall32.NT]
    AddReg=printer_class_addreg
    [printer_class_addreg]
    HKR,,,,%PrinterClassName%
    HKR,,Icon,,"-4"
    HKR,,Installer32,,"ntprint.dll,ClassInstall32"
    HKR,,NoDisplayClass,,1
    [PEERNETInstall_x86]
    CopyFiles=PNTIF8I,PNFILES,UNIDRV,LIBS,PSI,PNWNPRT8
    PrinterName=ImageNow Printer
    DriverName=ImageNow Printer
    PrinterSection=PNTIF8_DATA_x86
    SetupTitle=TIFF Image Printer 8.0 Setup
    HardwareID=PEERNET_Inc.PEERNET.DBCD4
    [PEERNETInstall_amd64]
    CopyFiles=PNTIF8I,PNFILES,PNFILES_amd64,UNIDRV,LIBS,PSI,PNWNPRT8
    PrinterName=ImageNow Printer
    DriverName=ImageNow Printer
    PrinterSection=PNTIF8_DATA_amd64
    SetupTitle=TIFF Image Printer 8.0 Setup
    HardwareID=PEERNET_Inc.PEERNET.DBCD4
    [PEERNETInstall_x86_vista]
    CopyFiles=PNTIF8I,PNFILES,LIBS,PSI,PNWNPRT8
    PrinterName=ImageNow Printer
    DriverName=ImageNow Printer
    PrinterSection=PNTIF8_DATA_x86_vista
    SetupTitle=TIFF Image Printer 8.0 Setup
    HardwareID=PEERNET_Inc.PEERNET.DBCD4
    CoreDriverSections="{D20EA372-DD35-4950-9ED8-A6335AFE79F0},UNIDRV.OEM"
    [PEERNETInstall_amd64_vista]
    CopyFiles=PNTIF8I,PNFILES,PNFILES_amd64,LIBS,PSI,PNWNPRT8
    PrinterName=ImageNow Printer
    DriverName=ImageNow Printer
    PrinterSection=PNTIF8_DATA_amd64_vista
    SetupTitle=TIFF Image Printer 8.0 Setup
    HardwareID=PEERNET_Inc.PEERNET.DBCD4
    CoreDriverSections="{D20EA372-DD35-4950-9ED8-A6335AFE79F0},UNIDRV.OEM"
    ; Manufacturer section.
    ; This section lists all of the manufacturers
    ; that we will display in the Dialog box
    [Manufacturer]
    %PEERNET% = PEERNET, NTamd64
    ; Model Specifications Section
    [PEERNET]
    "TIFF Image Printer 8.0" = PNTIF8_DATA_x86,PEERNET_Inc.PEERNET.DBCD4,TIFF_Image_Printer_8.0
    [PEERNET.NTamd64]
    "TIFF Image Printer 8.0" = PNTIF8_DATA_amd64,PEERNET_Inc.PEERNET.DBCD4,TIFF_Image_Printer_8.0
    [OEM URLS]
    %PEERNET% = "http://www.peernet.com"
    ; Installer section(s) referenced above.
    [PNTIF8_DATA_x86]
    CopyFiles=PNTIF8I,PNFILES,UNIDRV,LIBS,PSI,PNWNPRT8
    DependentFiles=PNReg8.exe,emsmtp.dll,PNAuth8.exe,PNdrvCS.ocx,PNDRVUI.DLL,pnemail8.dll,PNMapi8.DLL,PNSvc8.exe,PNSrv8.exe,PNAdd8.exe,PNJob8.exe,PSITIF8.chm,PNTIF8I.DLL,PNTIF8I.INI,PSITIF8C.INI,PNTIF8j.DLL,PNTIF8R.DLL,PNTIF8u.DLL,PNTIF8u.GPD,PSITIF8L.INI,IM31bmp.dil,IM31jpg.dil,IM31png.dil,IM31tif.dil,STDNAMES.GPD,UNIDRV.DLL,UNIDRV.HLP,UNIDRVUI.DLL,UNIRES.DLL
    DataFile=PNTIF8u.GPD
    ConfigFile=PNDRVUI.DLL
    HelpFile=UNIDRV.HLP
    DriverFile=PNTIF8R.Dll
    DefaultDataType="NT EMF 1.008"
    DefaultPort=NUL
    Comment=Print to TIFF
    PrintProcessor=PNWnPrt8,PNWnPrt8.dll
    [PNTIF8_DATA_amd64]
    CopyFiles=PNTIF8I,PNFILES,PNFILES_amd64,UNIDRV,LIBS,PSI,PNWNPRT8
    DependentFiles=PNSvc8.exe,PNSrv8.exe,PNAdd8.exe,PNJob8.exe,PNReg8.exe,emsmtp.dll,PNAuth8.exe,PNMLX864.dll,pnem864.dll,PNdrvCS.ocx,PNDRVUI.DLL,pnemail8.dll,PNMapi8.DLL,PSITIF8.chm,PNTIF8I.DLL,PNTIF8I.INI,PSITIF8C.INI,PNTIF8j.DLL,PNTIF8R.DLL,PNTIF8u.DLL,PNTIF8u.GPD,PSITIF8L.INI,IM31bmp.dil,IM31jpg.dil,IM31png.dil,IM31tif.dil,STDNAMES.GPD,UNIDRV.DLL,UNIDRV.HLP,UNIDRVUI.DLL,UNIRES.DLL
    DataFile=PNTIF8u.GPD
    ConfigFile=PNDRVUI.DLL
    HelpFile=UNIDRV.HLP
    DriverFile=PNTIF8R.Dll
    DefaultDataType="NT EMF 1.008"
    DefaultPort=NUL
    Comment=Print to TIFF
    PrintProcessor=PNWnPrt8,PNWnPrt8.dll
    [PNTIF8_DATA_x86_vista]
    CopyFiles=PNTIF8I,PNFILES,LIBS,PSI,PNWNPRT8
    DependentFiles=PNReg8.exe,emsmtp.dll,PNAuth8.exe,PNdrvCS.ocx,PNDRVUI.DLL,pnemail8.dll,PNMapi8.DLL,PNSvc8.exe,PNSrv8.exe,PNAdd8.exe,PNJob8.exe,PSITIF8.chm,PNTIF8I.DLL,PNTIF8I.INI,PSITIF8C.INI,PNTIF8j.DLL,PNTIF8R.DLL,PNTIF8u.DLL,PNTIF8u.GPD,PSITIF8L.INI,IM31bmp.dil,IM31jpg.dil,IM31png.dil,IM31tif.dil,UNIDRV.DLL,UNIRES.DLL,UNIDRVUI.DLL,STDNAMES.GPD,STDDTYPE.GDL,STDSCHEM.GDL,STDSCHMX.GDL,UNIDRV.HLP
    DataFile=PNTIF8u.GPD
    ConfigFile=PNDRVUI.DLL
    HelpFile=UNIDRV.HLP
    DriverFile=PNTIF8R.Dll
    DefaultDataType="NT EMF 1.008"
    DefaultPort=NUL
    Comment=Print to TIFF
    PrintProcessor=PNWnPrt8,PNWnPrt8.dll
    [PNTIF8_DATA_amd64_vista]
    CopyFiles=PNTIF8I,PNFILES,PNFILES_amd64,UNIDRV,LIBS,PSI,PNWNPRT8
    DependentFiles=PNSvc8.exe,PNSrv8.exe,PNAdd8.exe,PNJob8.exe,PNReg8.exe,emsmtp.dll,PNAuth8.exe,PNMLX864.dll,pnem864.dll,PNdrvCS.ocx,PNDRVUI.DLL,pnemail8.dll,PNMapi8.DLL,PSITIF8.chm,PNTIF8I.DLL,PNTIF8I.INI,PSITIF8C.INI,PNTIF8j.DLL,PNTIF8R.DLL,PNTIF8u.DLL,PNTIF8u.GPD,PSITIF8L.INI,IM31bmp.dil,IM31jpg.dil,IM31png.dil,IM31tif.dil,UNIDRV.DLL,UNIRES.DLL,UNIDRVUI.DLL,STDNAMES.GPD,STDDTYPE.GDL,STDSCHEM.GDL,STDSCHMX.GDL,UNIDRV.HLP
    DataFile=PNTIF8u.GPD
    ConfigFile=PNDRVUI.DLL
    HelpFile=UNIDRV.HLP
    DriverFile=PNTIF8R.Dll
    DefaultDataType="NT EMF 1.008"
    DefaultPort=NUL
    Comment=Print to TIFF
    PrintProcessor=PNWnPrt8,PNWnPrt8.dll
    [PNWNPRT8]
    PNWNPRT8.dll
    [PNTIF8I]
    PNTIF8I.dll
    [PNFILES_amd64]
    pnem864.dll
    PNMLX864.dll,,,32
    [PNFILES]
    PNdrvCS.ocx
    PNSvc8.exe
    PNSrv8.exe
    PNAdd8.exe
    PNJob8.exe
    PNTIF8j.DLL
    pnemail8.dll
    PNMapi8.DLL,,,32
    emsmtp.dll
    PNTIF8I.INI
    PNTIF8R.DLL
    PNDRVUI.DLL
    PNTIF8u.GPD
    PNTIF8u.DLL
    PNAuth8.exe,,,32
    PNReg8.exe
    [UNIDRV]
    UNIDRV.DLL
    UNIRES.DLL
    UNIDRVUI.DLL
    STDNAMES.GPD
    UNIDRV.HLP
    [LIBS]
    IM31bmp.dil
    IM31jpg.dil
    IM31png.dil
    IM31tif.dil
    [OEM]
    OEMTIF8L.INI
    OEMTIF8C.INI
    OEMTIF8.chm
    [DestinationDirs]
    DefaultDestDir=66000
    PNWNPRT8=55
    [SourceDisksNames.x86]
    33 = %disk1%,,,
    34 = %disk1%,,,i386
    [SourceDisksNames.amd64]
    33 = %disk1%,,,
    34 = %disk1%,,,amd64
    [SourceDisksFiles]
    PNWNPRT8.dll=34
    PNTIF8U.Dll=34
    PNTIF8R.Dll=34
    PNTIF8u.GPD=34
    PNTIF8I.Dll=34
    PNTIF8I.INI=34
    PNDRVUI.Dll=34
    pnem864.dll=34
    PNMLX864.dll=34
    PNSvc8.exe=34
    PNAuth8.exe=33
    PNTIF8J.Dll=33
    PSITIF8C.INI=33
    PNSrv8.exe=33
    PNAdd8.exe=33
    PNJob8.exe=33
    PNdrvCS.ocx=33
    PSITIF8.chm=33
    pnemail8.dll=33
    PNMapi8.DLL=33
    emsmtp.dll=33
    PSITIF8L.INI=33
    PNReg8.exe=33
    IM31bmp.dil=33
    IM31jpg.dil=33
    IM31png.dil=33
    IM31tif.dil=33
    [Strings]
    PrinterClassName="Printers"
    PEERNET="PEERNET Inc."
    disk1="PEERNET Image Printer Setup Disk"
    [PSI]
    PSITIF8L.INI
    PSITIF8C.INI
    PSITIF8.chm

  • Crystal Report Runtime start splwow64.exe on windows 64 OS

    Hi,
    We are using the Crystal Reports runtime in our application. We are utilizing the runtime through the COM interface. Recently a client of us installed our application on windows 2003 64-bit. Now whenever a report is created windows starts splwow64.exe. As i understand this is a process started by windows to ensure compatibility with 32-bit. Normally this process is released when the job is done. However in our case the proces is never released and remains exclusively locked. Other application on the same machine also need this splwow64 process and this is now causing a problem.
    When the other applications on the server start splwow64 first it released when the job is done. It is only when creating a report (pdf) using the CR-runtime, it is never released.
    Any help would be very much appriciated!
    TIA
    Ronald

    Hi Ronald,
    XI is past it's end of life so nothing we can do to fix it now. Try CR XI R2 ( 11.5 ) with Service Pack 6, it has a better chance of working on 64 bit OS's.
    Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
    Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    Searching on this dll it appears to be the 32 to 64 bit Thunking spooler that converts 32 bit print jobs into 64 bit jobs ( or the other way around ). CR only supports 32 bit runtime so it may be that your print driver has issues. If you can find one that is 32 bit only but works on 64 bit OS then that will likely resolve the issue.
    Otherwise I suggest you contact the printer manufacture and ask them how to make their 64 bit driver work with a 32 bit app.
    Thank you
    Don

  • Report Print queue settings

    Hi all, 
    I am changing some settings on my print queues. The snmp community names is one of them (for bi-di purposes).
    I would to run a report/audit or simply display it somewhere.. on all print queues to show what community names they are configured with. this way I would able to check if changes have been applied to all or any has been forgotten.
    Servers are 2k3 and 2k8 OS.
    Thank you

    You can use powershell to get a list of WMI print class objects, then loop through the list to get the port name, and determine the SNMP information.   The WMI interface will only enumerate Standard TCP/IP ports.  For any other port types
    you would need to use the spooler API's
     powershell link
    http://technet.microsoft.com/en-us/library/dd347648.aspx
    Alan Morris Windows Printing Team

  • An error occurred during olap API metadata retrieval. This is probably caus

    this is what i have done so far. i really nead some help asap!!!
    1. Install Oracle 9i Release 2 (9.2.0.1) Enterprise Edition with the General purpose database configuration (Data warehouse works as well). At the end of the installation I chose the password management button to change passwords for the few necessary accounts: SYS, SYSTEM, OLAPSYS, SH.
    2. Download the p3948480_9206_WINNT.zip from metalink, the 9.2.0.6 patchset
    3. Shut down any existing Oracle9i database instances with normal or immediate priority. Stop all listener and other services running in the Oracle home directory where you want to install the patch set.
    4. unzip the content of thepatch to a temp directory
    5. start setup.exe under the temp directory (it will start the Oracle Universal installer 10.1.0.3)
    6. install the patchset to your Oracle home, selecting the source in the temp_dir\stage\products.jar file
    7. review carefully the post-installation tasks for the patchset:
    Review the following sections before upgrading a database (quote from the patchset html readme):
    8.2.1.1If JServer is part of the installation ensure that there is at least 10 MB of free space allocated to the SYSTEM tablespace.
    8.2.1.2 Check XDB Tablespace Size
    For RAC installations, ensure that there is at least 50 MB of free space allocated to the XDB tablespace.
    8.2.1.3 Set the SHARED_POOL_SIZE and JAVA_POOL_SIZE Initialization Parameters
    Set the value of the SHARED_POOL_SIZE and the JAVA_POOL_SIZE initialization parameters as follows:
    Start the database:
    SQL> STARTUP
    If necessary, enter the following command to determine whether the system uses an initialization parameter file (initsid.ora) or a server parameter file (spfiledbname.ora):
    SQL> SHOW PARAMETER PFILE;
    This command displays the name and location of the server parameter file or the initialization parameter file.
    Determine the current values of these parameters:
    SQL> SHOW PARAMETER SHARED_POOL_SIZE
    SQL> SHOW PARAMETER JAVA_POOL_SIZE
    If the system is using a server parameter file:
    If necessary, set the value of the SHARED_POOL_SIZE initialization parameter to at least 150 MB:
    SQL> ALTER SYSTEM SET SHARED_POOL_SIZE='150M' SCOPE=spfile;
    If necessary, set the value of the JAVA_POOL_SIZE initialization parameter to at least 150 MB:
    SQL> ALTER SYSTEM SET JAVA_POOL_SIZE='150M' SCOPE=spfile;
    If the system uses an initialization parameter file, if necessary, change the values of the SHARED_POOL_SIZE and the JAVA_POOL_SIZE initialization parameters to at least 150 MB in the initialization parameter file (initsid.ora).
    Shut down the database:
    SQL> SHUTDOWN
    8.2.2 Upgrade the Database
    After you install the patch set, you must complete the following steps on every database associated with the upgraded Oracle home:
    Log on as a member of the Administrators group to the computer where the Oracle components are installed.
    Use SQL*Plus to login to the database as the SYS user with SYSDBA privileges:
    sqlplus /NOLOG
    CONNECT SYS/password AS SYSDBA
    Enter the following SQL*Plus commands:
    SQL> STARTUP MIGRATE
    SQL> SPOOL patch.log
    SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\catpatch.sql
    SQL> SPOOL OFF
    Restart the database:
    SQL> SHUTDOWN
    SQL> STARTUP
    Run the utlrp.sql script to recompile all invalid PL/SQL packages now instead of when the packages are accessed for the first time. This step is optional but recommended.
    SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\utlrp.sql
    12. Install JDeveloper 9.0.4 (download it from OTN and just unzip it in a directory ... it doesn't require an oracle home)
    13. Install BI Beans 9.0.4 (download it from OTN as well), run the setup.exe that comes with it and in the destination oracle home select the directory where you installed JDeveloper and give an oracle home name to it)
    14. Install the BIBDEMO schema:
    Create a directory on the computer that is running the Oracle9i database. This install_home directory is the location to which you will upload the data files that are required to build the BIBDEMO schema.
    On the computer where BI Beans is installed, locate the bibeans_home\bibdemo_schema folder (where bibeans_home is the root folder of your BI Beans installation). Copy all of the files found in this folder to the install_home folder on your server machine.
    Open a DOS prompt and navigate to the install_home folder.
    Run bibdemo.bat to install the schema, using the following syntax:
    bibdemo.bat <path to Oracle database files >
    For example, for an instance named my9iService, enter the following:
    bibdemo.bat D:\OraHome1\oradata\my9iService
    You are prompted for the password for the sys as sysdba user.
    The script takes approximately 15 minutes to run, depending on the machine specifications. It is normal to see some error messages while the script is running. In addition, when materialized views are being created in the database, the script will appear to stop; this is also normal. A clear message will tell you when the script has completed.
    The log files (*.log) that are generated by the installation script are stored in the folder from which you ran the script.
    Here's what
    bi_checkconfig.bat -h ana -po 1521 -sid proiect -u bibdemo -p bibdemo -q
    returned:
    BI Beans Diagnostics(v1.0.2.0) 2/28/05
    ===============================================================================
    JDEV_ORACLE_HOME .......................... = E:\OraDS
    JAVA_HOME ................................. = E:\OraDS\jdk
    JDeveloper version ........................ = 9.0.4.1.1.1436
    BI Beans release description .............. = BI Beans 9.0.4 Production Release
    BI Beans component number ................. = 9.0.4.23.0
    BI Beans internal version ................. = 2.7.5.32
    Connect to database ....................... = Successful
    JDBC driver version ....................... = 9.2.0.4.0
    JDBC JAR file location .................... = E:\OraDS\jdev\lib\patches
    Database version .......................... = 9.2.0.6.0
    OLAP Catalog version ...................... = 9.2.0.1.0
    OLAP AW Engine version .................... = 9.2.0.1.0
    OLAP API Server version ................... = 9.2.0.1.0
    BI Beans Catalog version .................. = N/A; not installed in bibdemo
    OLAP API JAR file version ................. = 9.2
    OLAP API JAR file location ................ = E:\OraDS\jdev\lib\ext
    Load OLAP API metadata .................... = Successful
    Number of metadata folders ................ = 2
    Number of metadata measures ............... = 12
    Number of metadata dimensions ............. = 8
    Testing sample query for measures and dimensions
    (S=Schema, C=Cube, M=Measure, D=Dimension)
    1/21) Measure Budget ................... = Successful
    S=BIBDEMO, C=BIBDEMO_BUDGET_CUBE, M=BUDGET
    2/21) Measure Actual ................... = Successful
    S=BIBDEMO, C=BIBDEMO_ACTUAL_CUBE, M=ACTUAL
    3/21) Measure Close Price .............. = Successful
    S=BIBDEMO, C=BIBDEMO_STKPRICE_CUBE, M=STKPRICE_CLOSE
    4/21) Measure Open Price ............... = Successful
    S=BIBDEMO, C=BIBDEMO_STKPRICE_CUBE, M=STKPRICE_OPEN
    5/21) Measure Low Price ................ = Successful
    S=BIBDEMO, C=BIBDEMO_STKPRICE_CUBE, M=STKPRICE_LOW
    6/21) Measure High Price ............... = Successful
    S=BIBDEMO, C=BIBDEMO_STKPRICE_CUBE, M=STKPRICE_HIGH
    7/21) Measure Stock Volume ............. = Successful
    S=BIBDEMO, C=BIBDEMO_STKPRICE_CUBE, M=STKPRICE_VOLUME
    8/21) Dimension Division ............... = Successful
    S=BIBDEMO, D=DIVISION
    9/21) Dimension Line Items ............. = Successful
    S=BIBDEMO, D=LINE
    10/21) Dimension Time ................... = Successful
    S=BIBDEMO, D=TIME
    11/21) Dimension Day .................... = Successful
    S=BIBDEMO, D=DAY
    12/21) Dimension Stock .................. = Successful
    S=BIBDEMO, D=STOCK
    13/21) Measure Costs .................... = Successful
    S=BIBDEMO, C=ANALYTIC_CUBE, M=F.COSTS
    14/21) Measure Promotion ................ = Successful
    S=BIBDEMO, C=ANALYTIC_CUBE, M=F.PROMO
    15/21) Measure Quota .................... = Successful
    S=BIBDEMO, C=ANALYTIC_CUBE, M=F.QUOTA
    16/21) Measure Units .................... = Successful
    S=BIBDEMO, C=ANALYTIC_CUBE, M=F.UNITS
    17/21) Measure Sales .................... = Successful
    S=BIBDEMO, C=ANALYTIC_CUBE, M=F.SALES
    18/21) Dimension Channel ................ = Successful
    S=BIBDEMO, D=CHANNEL
    19/21) Dimension Geography .............. = Successful
    S=BIBDEMO, D=GEOGRAPHY
    20/21) Dimension Product ................ = Successful
    S=BIBDEMO, D=PRODUCT
    21/21) Dimension Time ................... = Successful
    S=BIBDEMO, D=TIME
    Metadata output location .................. = E:\OraDS\bibeans\bi_checkconfig\bi
    _metadata.txt
    To interpret this output, see the "Displaying Information about your Oracle9i Bu
    siness Intelligence Beans Client Configuration" technical note, whose file name
    is bi_checkconfig_tn.html
    These diagnostics are captured in: E:\OraDS\bibeans\bi_checkconfig\bi_checkconfi
    g.xml
    now: i have created some new stuff:
    1). user ana with roles:
    -dba
    -olap_dba
    -connect
    -resource
    (same roles as bibdemo)
    2).schema ana; tablespace ana (permanent), tablespace anatemp (temporary)
    3).i have created some relational tables and i have inserted some data in them:
    agent, aparat (cofee machines), beneficiar (clients), locatii (city), raport (REPORT), timp (time), tipaparat (types of cofee machines), tipbautura (products : types of cofee made by all the cofee machines), zone (state)
    4). one fact table with:
    - sold cantity (measure)
    - id_bautura (id_product) primary key
    - id_timp(id_time) primary key
    - id_beneficiar (id_client) primary key
    - id_agent primary key
    - id_locatie (id_city) primary key
    - id_aparat (id_cofee_machine)primary key
    i have inserted some data also
    5).dimensions:
    AGENT_DIM :levels: codag(id_agent), numeag (agent name), telefag (agent phone number)from relational table agent
    BENEFICIAR_DIM :levels: codben (id_client), denumire (client name), adresa (adress) ,codl (id_city) etc from relatinal table beneficiar (clients)
    TIMP_DIM :levels: id, year, month from relational table timp (time)
    TIPBAUTURA_DIM :levels: codbautura (id_product), numebautura (product name)from relational table tipbautura (products)
    ZONA_DIM :levels: codzona (id state), numezona (state name), codoras (id city), numeoras (city name) with ierarhy id_state---id_city FROM 2 RELATINAL TABLES CITY AND STATE!!!!!!!! AM I ALOUD TO DO THAT?????
    DO I NEED TO CREATE A DIMENSION FROM ONLY ONE TABLE???????
    APARAT_DIM :LEVELS: codben (id client), codtip (id machine type), denumireap (machine type name), matricolap ((machine id) (FROM 2 RELATIONAL TABLES ALSO!!!!!!! FROM TYPES OF COFEE MACHINES AND COFEE MACHINES!!!!!
    6). I HAVE NOW CREATED THE CUBE FROM THE FACT TABLE AND WITH ALL THE DIMENSIONS
    7). summary advisor wizard NOT WORKING! IT NEVER STOPS!
    8). I HAVE CREATED ALSO ONE materialized view FOR THE CUBE
    IF I COMPILE IT... NO ERRORS
    9). CUBE VIEWER NOT WORKING!!!!!!! IT ONLY APEARS A BELL!!!
    NOW IF I RUN BI_CHECK CONFIG ON ANA AND ALSO ON BIBDEMO!!!!!!!!!!!!
    IT SAYS:
    1) An error occurred during olap API metadata retrieval. This is probably caused by inconsistent metadata.
    ============================================================================
    oracle.express.ExpressServerExceptionError class: Unknown Error
    Server error descriptions:
    INI: System failure, Generic at TxsOqConnection::getDefaultDatabase
    at oracle.express.olapi.data.full.ExpressDataProvider.getMetadataProviderInterface(ExpressDataProvider.java:1003)
    at oracle.olapi.metadata.MetadataFetcher.initialize(MetadataFetcher.java:73)
    at oracle.olapi.metadata.MetadataFetcher.<init>(MetadataFetcher.java:45)
    at oracle.olapi.metadata.BaseMetadataProvider.<init>(BaseMetadataProvider.java:47)
    at oracle.olapi.metadata.mdm.MdmMetadataProvider.<init>(MdmMetadataProvider.java:130)
    at oracle.express.olapi.data.full.ExpressDataProvider.getDefaultMetadataProvider(ExpressDataProvider.java:964)
    at oracle.dss.metadataManager.server.drivers.mdm._92.MDMMetadataDriverImpl_92.getMdmMetadataProvider(MDMMetadataDriverImpl_92.java:1133)
    at oracle.dss.metadataManager.server.drivers.mdm._92.MDMMetadataDriverImpl_92.attach(MDMMetadataDriverImpl_92.java:810)
    at oracle.dss.metadataManager.server.drivers.mdm.MDMMetadataDriverImpl.attach(MDMMetadataDriverImpl.java:125)
    at oracle.dss.metadataManager.server.MetadataManagerImpl.buildObjectModel(MetadataManagerImpl.java:1092)
    at oracle.dss.metadataManager.server.MetadataManagerImpl.attach(MetadataManagerImpl.java:969)
    at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:876)
    at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:799)
    at BICheckConfig.checkConnection(BICheckConfig.java:277)
    at BICheckConfig.main(BICheckConfig.java:1348)
    I TRYED ALSO WITH USER ANA WITH ROLES:
    - DBA
    - CONNECT
    -RESOURCE
    - OLAP_USER
    NOT WORKING! AND ALSO BIBDEMO NOT WORKING!
    WHAT AM I MISSING? SHOULD I USE AW MANAGER? OR DO I NEED TO CREATE AN AMNALITIC WORKSPACE???
    WHAT ARE THE STEPS TO CREATE A GOOD METADATA????

    Hi,
    The issue here is if the whole catalog is corrupt or just one schema. So to try and determine the status of the catalog I would try:
    1) Using OEM remove all the objects you created
    2) I presume you created your database using the Database Configuration Assistant? You should have used the warehouse template
    3) Make sure the following accounts are unlocked and also not expired : SH, OLAPSYS
    4) Make sure the password for the SH schema is SH
    5) Make sure the password for the OLAPSYS account is manager
    6) Install the BIBDEMO schema that is shipped with BI Beans. This in the jdev_home/bibeans/bibdemo_schema
    The installation process will remove SH schema from the OLAP catalog.
    7)Once this is installed use JDeveloper to see if you can create a crosstab or graph.
    8) If the BIBDEMO schema works try creating your new schemas one at a time.
    9) Make sure the if you define the a dimension as type time it has END_DATE (column type DATE) and TIME_SPAN (column type number) defined. Otherwise don't define the dimension as type time.
    Hope this helps
    Keith Laker
    Product Manager
    Oracle Business Intelligence Beans

  • Javax.mail.MessagingException: 451 Error while writing spool file??

    Hi all friends,
    Can any one plz tell me why Iam getting below error when Iam trying to send mail with attachment.Iam using Java Mail API.
    javax.mail.MessagingException: 451 Error while writing spool file
    Plz tell me what are the reasons behind it.
    Regards
    Bikash

    The problem here is that the SMTP server was unable to write its spool file.
    The error is probably on the OS side of things and has nothing to do with email except that the lack of the system resource is causing email to fail.
    Have the server admin take a look at his error log to find out why the the user that smtp is running as could not write the file.

  • PDF file creation from spool

    Hi
    I amtrying to create  a spool request for the PDF file.
    Ihave Xstring type data in my program, which is input for PDF file.
    by using  RSPO_OPEN, RSPO_WRITE,RSPO_CLOSE function modules.. it is creating  a spool  with RAW data type.
    but I have to create SPOOL with PDF format.
    Can soemone help to generate PDF file from XML or RAW data format to PDF?

    I have a requirement to create a PDF file from the attachments on any business object (such as PO, Sales Order etc). In short, I need to create a PDF file out of fnd_lobs.file_data
    Any roadmap with example ?? Anybody ??Please see these docs.
    How to Load Attachments Via API into Service Requests? [ID 394811.1]
    Attaching A File To An Object via A Public API [ID 281130.1]
    Upload Image over 32k into PER_IMAGES from FND_LOBS as Blobs. [ID 462967.1]
    Thanks,
    Hussein

  • Convert spool to pdf

    Hi,
    How can i convert a spool into a pdf format and fill the atributes of the PDF document with title, author, subject and keywords from abap?
    Kind regards,
    H. Hendriks

    Check the Below code ......
    REPORT ZMAILOUTPUT
        MESSAGE-ID ZZ.
    *  CONSTANTS                                                           *
    CONSTANTS : C_X(1)      TYPE C VALUE 'X',      " For constant value
                C_OTF(3)    TYPE C VALUE 'OTF',    " For format
                C_U(1)      TYPE C VALUE 'U'.      " Mail Option
    *  VARIABLES                                                           *
    DATA : V_RQIDENT  TYPE TSP01-RQIDENT,  " For Spool Number
           V_RQCLIENT TYPE TSP01-RQCLIENT, " For Client
           V_RQO1NAME TYPE TSP01-RQO1NAME, " For Object name
           V_SPOOL    TYPE TSP01-RQIDENT,  " For Spool Number
           V_SPOOL1   TYPE TSP01-RQIDENT.  " For Spool Number
    *  FLAGS                                                               *
    DATA : F_SPOOL TYPE C.
    *   INTERNAL TABLES                                                    *
    * Internal table for sending mails
    DATA: IT_PDF          LIKE TLINE      OCCURS 10 WITH HEADER LINE,
          IT_XI_PDF       LIKE TLINE      OCCURS 0  WITH HEADER LINE,
          IT_HTML         LIKE SOLISTI1   OCCURS 0  WITH HEADER LINE,
          IT_XI_TEMP      LIKE BAPIQCMIME OCCURS 0  WITH HEADER LINE,
          IT_XI_MIME(255) TYPE C          OCCURS 0  WITH HEADER LINE.
    * For sending mail
    DATA: IT_OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
    * Internal table for Single List with Column Length 255
    DATA : IT_OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    * Internal table for Single List with Column Length 255
    DATA : IT_OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    * Internal table for Structure of the API Recipient List
    DATA : IT_RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
    * Structure of the API Recipient List
    DATA: X_DOC_CHNG LIKE SODOCCHGI1.
    * Internal table for storing the variants
    DATA : BEGIN OF IT_VARIANT1 OCCURS 0,
            VARIANT LIKE VARID-VARIANT,
           END   OF IT_VARIANT1.
    * Internal table to store variants for the programs
    DATA: IT_VARIANT2 LIKE IT_VARIANT1 OCCURS 0 WITH HEADER LINE.
    * Internal table for storing the selected values
    DATA IT_RETURN TYPE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
    * Internal table for storing the mail-ids
    DATA : BEGIN OF IT_MAILID OCCURS 0,
            KOKRS LIKE CSKS-KOKRS,
            KOSTL LIKE CSKS-KOSTL,
            DATBI LIKE CSKS-DATBI,
            TELX1 LIKE CSKS-TELX1,
           END   OF IT_MAILID.
    * Internal table for storing the mail-ids
    DATA : IT_MAILID1 LIKE IT_MAILID OCCURS 0 WITH HEADER LINE.
    *   SELECTION SCREEN                                                   *
    DATA : V_CHAR TYPE CHAR50.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_EMAIL FOR V_CHAR  NO INTERVALS
                    LOWER CASE
                    NO-DISPLAY.
    SELECT-OPTIONS: S_EMAIL1 FOR V_CHAR  NO INTERVALS
                    LOWER CASE
                    NO-DISPLAY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-028.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : P_C1 AS CHECKBOX.
    SELECTION-SCREEN COMMENT 3(66) TEXT-026 FOR FIELD P_C1.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS : P_SET LIKE TSP1D-PAPART MATCHCODE OBJECT ZH_TSP1D.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : P_VARA1 TYPE RS38M-SELSET.
    SELECTION-SCREEN END OF BLOCK A1.
    SELECTION-SCREEN BEGIN OF BLOCK A2 WITH FRAME TITLE TEXT-029.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : P_C2 AS CHECKBOX.
    SELECTION-SCREEN COMMENT 3(56) TEXT-027 FOR FIELD P_C1.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS : P_SET1 LIKE TSP1D-PAPART MATCHCODE OBJECT ZH_TSP1D.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : P_VARA2 TYPE RS38M-SELSET.
    SELECTION-SCREEN END OF BLOCK A2.
    * AT SELECTION SCREEN ON VALUE REQUEST
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARA1.
    * For fetching the variants available for the program
      PERFORM FETCH_VARIANTS.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARA2.
    * For fetching the variants available for the program
      PERFORM FETCH_VARIANTS1.
    * AT SELECTION SCREEN
    AT SELECTION-SCREEN.
    * For Validation
      PERFORM VALIDATION.
    *  START OF SELECTION                                                  *
    START-OF-SELECTION.
    * To get the output data and mail
      PERFORM FETCH_DATA.
    *  END OF SELECTION                                                    *
    END-OF-SELECTION.
      IF F_SPOOL = C_X.
        MESSAGE E000 WITH 'Spool Not Generated'(060).
      ENDIF.
    *&      Form  fetch_data
    *       To get the output data and mail
    FORM FETCH_DATA .
    * To send the output to spool
      PERFORM GENERATE_SPOOL.
    ENDFORM.                    " fetch_data
    *&      Form  generate_spool
    *       To send the output to spool
    FORM GENERATE_SPOOL .
      DATA: L_PARAMS LIKE PRI_PARAMS,
            L_DAYS(1)  TYPE N VALUE 2,
            L_COUNT(3) TYPE N VALUE 1,
            L_VALID    TYPE C,
            L_VALID1   TYPE C,
            L_PARAMS1  LIKE PRI_PARAMS.
      DATA: L_DEVICE TYPE USR01-SPLD.
    *Get the printer name for the user
      SELECT SINGLE SPLD INTO L_DEVICE FROM USR01 WHERE BNAME = SY-UNAME.
      IF L_DEVICE IS INITIAL.
        L_DEVICE = 'LOCL'.
      ENDIF.
    * For report-1
      IF P_C1 = 'X'.
    * Setting the print parameters
        CALL FUNCTION 'GET_PRINT_PARAMETERS'
          EXPORTING
            DESTINATION    = L_DEVICE
            COPIES         = L_COUNT
            LIST_NAME      = SY-UNAME
            LIST_TEXT      = 'SUBMIT ... TO SAP-SPOOL'(008)
            RELEASE        = C_X
            NEW_LIST_ID    = C_X
            EXPIRATION     = L_DAYS
    *        LINE_SIZE      = 255
    *        LINE_COUNT     = 65
            LAYOUT         = p_set
            SAP_COVER_PAGE = SPACE
            COVER_PAGE     = SPACE
            RECEIVER       = 'SAP*'(010)
            DEPARTMENT     = 'System'(011)
            NO_DIALOG      = C_X
          IMPORTING
            OUT_PARAMETERS = L_PARAMS
            VALID          = L_VALID.
        IF L_VALID <> SPACE.
          CLEAR V_SPOOL.
    * Fetch the spool number b4 submit
          PERFORM FETCH_RECENT_SPOOL USING V_SPOOL.
    * Submitting the program to spool
          SUBMIT RKAEP000 TO SAP-SPOOL
            USING SELECTION-SET P_VARA1
            SPOOL PARAMETERS L_PARAMS
            WITHOUT SPOOL DYNPRO
            AND RETURN.
          CLEAR V_SPOOL1.
    * Fetch the spool number after submit
          PERFORM FETCH_RECENT_SPOOL USING V_SPOOL1.
          IF V_SPOOL = V_SPOOL1.
            F_SPOOL = C_X.
            IF P_C2 IS INITIAL.
              STOP.
            ENDIF.
          ELSE.
    * Checking the format ( ABAP/OTF)
            PERFORM FORMAT_CHECK TABLES S_EMAIL.
          ENDIF.
        ELSE.
          MESSAGE E000 WITH 'Problem in print settings'(003).
          STOP.
        ENDIF.
      ENDIF.
    * For Report-2
      IF P_C2 = 'X'.
    * Setting the print parameters
        CALL FUNCTION 'GET_PRINT_PARAMETERS'
          EXPORTING
            DESTINATION    = L_DEVICE
            COPIES         = L_COUNT
            LIST_NAME      = SY-UNAME
            LIST_TEXT      = 'SUBMIT ... TO SAP-SPOOL'(008)
            RELEASE        = C_X
            NEW_LIST_ID    = C_X
            EXPIRATION     = L_DAYS
    *        LINE_SIZE      = 200
    *        LINE_COUNT     = 65
            LAYOUT         = p_set1
            SAP_COVER_PAGE = SPACE
            COVER_PAGE     = SPACE
            RECEIVER       = 'SAP*'(010)
            DEPARTMENT     = 'System'(011)
            NO_DIALOG      = C_X
          IMPORTING
            OUT_PARAMETERS = L_PARAMS1
            VALID          = L_VALID1.
        IF L_VALID1 <> SPACE.
          CLEAR V_SPOOL.
    * Fetch the spool number b4 submit
          PERFORM FETCH_RECENT_SPOOL USING V_SPOOL.
    * Submitting the program to spool
          SUBMIT GP3DIEHXY88SNFJ0391V7KF9EK7050 TO SAP-SPOOL
            USING SELECTION-SET P_VARA2
            SPOOL PARAMETERS L_PARAMS1
            WITHOUT SPOOL DYNPRO
            AND RETURN.
          CLEAR V_SPOOL1.
    * Fetch the spool number after submit
          PERFORM FETCH_RECENT_SPOOL USING V_SPOOL1.
          IF V_SPOOL = V_SPOOL1.
            MESSAGE E000 WITH 'Spool Not Generated'(060).
            STOP.
          ENDIF.
    * Checking the format ( ABAP/OTF)
          PERFORM FORMAT_CHECK TABLES S_EMAIL1.
        ELSE.
          MESSAGE E000 WITH 'Problem in print settings'(003).
          STOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    " generate_spool
    *&      Form  fetch_recent_spool
    *       Fetch the recent spool number generated
    FORM FETCH_RECENT_SPOOL USING P_V_SPOOL TYPE TSP01-RQIDENT .
      DATA:  L_USER LIKE TSP01-RQ2NAME.
      CLEAR : V_RQIDENT,
              V_RQCLIENT,
              V_RQO1NAME.
      L_USER = SY-UNAME.
    * Get latest Spool No
      SELECT SINGLE RQIDENT
                    RQCLIENT
                    RQO1NAME
             INTO (V_RQIDENT , V_RQCLIENT , V_RQO1NAME)
        FROM TSP01
       WHERE RQCRETIME =   ( SELECT MAX( RQCRETIME )
                                    FROM TSP01
                                   WHERE RQ2NAME EQ L_USER
                                     AND RQFINAL EQ '.' ).
      IF SY-SUBRC = 0 .
        P_V_SPOOL = V_RQIDENT.
      ENDIF.
    ENDFORM.                    " fetch_recent_spool
    *&      Form  format_check
    *       Checking the format ( ABAP/OTF)
    FORM FORMAT_CHECK TABLES P_S_EMAIL STRUCTURE S_EMAIL.
      DATA : L_OBJTYPE    LIKE RSTSTYPE-TYPE.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
        EXPORTING
          AUTHORITY     = 'SP01'(019)
          CLIENT        = V_RQCLIENT
          NAME          = V_RQO1NAME
          PART          = 1
        IMPORTING
          OBJTYPE       = L_OBJTYPE
        EXCEPTIONS
          FB_ERROR      = 1
          FB_RSTS_OTHER = 2
          NO_OBJECT     = 3
          NO_PERMISSION = 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.
      IF L_OBJTYPE(3) = C_OTF.
    * Convert OTF Spool to PDF
        PERFORM CONVERT_OTF2PDF TABLES P_S_EMAIL.
      ELSE.
    * Convert ABAP Spool to PDF
        PERFORM CONVERT_ABAP2PDF TABLES P_S_EMAIL.
      ENDIF.
    ENDFORM.                    " format_check
    *&      Form  convert_otf2pdf
    *       Convert OTF Spool to PDF
    FORM CONVERT_OTF2PDF TABLES P_P_S_EMAIL STRUCTURE S_EMAIL .
      CLEAR   IT_PDF.
      REFRESH IT_PDF.
      DATA : L_BYTECOUNT  TYPE I.
    * Fn. to get the PDF format
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = V_RQIDENT
          NO_DIALOG                = 'X'
        IMPORTING
          PDF_BYTECOUNT            = L_BYTECOUNT
        TABLES
          PDF                      = IT_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.
      IF SY-SUBRC = 0.
    * For page format
        PERFORM PAGE_FORMAT TABLES P_P_S_EMAIL.
      ELSE.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " convert_otf2pdf
    *&      Form  convert_abap2pdf
    *        Convert ABAP Spool to PDF
    FORM CONVERT_ABAP2PDF TABLES P_P_S_EMAIL STRUCTURE S_EMAIL.
      CLEAR   IT_PDF.
      REFRESH IT_PDF.
      DATA : L_BYTECOUNT  TYPE I.
    * Fn. to convert to PDF format
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = V_RQIDENT
          NO_DIALOG                = 'X'
        IMPORTING
          PDF_BYTECOUNT            = L_BYTECOUNT
        TABLES
          PDF                      = IT_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.
      IF SY-SUBRC = 0.
    * For page formatting
        PERFORM PAGE_FORMAT TABLES P_P_S_EMAIL.
      ELSE.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " convert_abap2pdf
    *&      Form  send_mail
    *       For sending mail
    FORM SEND_MAIL TABLES MAIL STRUCTURE S_EMAIL .
    * Structures and internal tables for the send data
      DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2  WITH HEADER LINE,
            OBJHEAD LIKE SOLISTI1   OCCURS 1  WITH HEADER LINE,
            OBJBIN  LIKE SOLISTI1   OCCURS 0  WITH HEADER LINE,
            OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE,
            RECLIST LIKE SOMLRECI1  OCCURS 5  WITH HEADER LINE.
      DATA: DOC_CHNG LIKE SODOCCHGI1,
            TAB_LINES LIKE SY-TABIX.
    * Data for the status output after sending
      DATA: SENT_TO_ALL LIKE SONV-FLAG.
      CLEAR: IT_RECLIST, IT_RECLIST[],
             IT_OBJTXT , IT_OBJTXT[],
             IT_OBJPACK, IT_OBJPACK[],
             IT_OBJBIN , IT_OBJBIN[],X_DOC_CHNG.
      LOOP AT IT_HTML.
        OBJBIN-LINE = IT_HTML-LINE.
        APPEND OBJBIN.
        CLEAR OBJBIN.
      ENDLOOP.
    * Create the document which is to be sent
      DOC_CHNG-OBJ_NAME  = 'List'(012).
      DOC_CHNG-OBJ_DESCR = 'Mail'(013).
    * Heading
      OBJTXT-LINE = 'Mail with pdf attachment'(014).
      APPEND OBJTXT.
      CLEAR OBJTXT.
    * Size
      DESCRIBE TABLE OBJTXT LINES TAB_LINES.
      READ TABLE OBJTXT INDEX TAB_LINES.
      DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    * Fill the fields of the packing_list for the main document:
      CLEAR OBJPACK-TRANSF_BIN.
    * The document needs no header (head_num = 0)
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 0.
    * Body
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = TAB_LINES.
      OBJPACK-DOC_TYPE = 'RAW'(015).
      APPEND OBJPACK.
    * Create the attachment (the list itself)
      DESCRIBE TABLE OBJBIN LINES TAB_LINES.
    * Fill the fields of the packing_list for the attachment:
      OBJPACK-TRANSF_BIN = 'X'.
    * Header
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 0.
    * Body
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = TAB_LINES.
      OBJPACK-DOC_TYPE = 'PDF'(016).
      OBJPACK-OBJ_NAME = 'Attachment'(017).
      OBJPACK-OBJ_DESCR = 'Mail with pdf Attachment'(018).
      OBJPACK-DOC_SIZE = TAB_LINES * 255.
      APPEND OBJPACK.
    *-Fill the mail recipient list
      LOOP AT MAIL.
        RECLIST-RECEIVER = MAIL-LOW.
        RECLIST-REC_TYPE = C_U.
        APPEND RECLIST.
        CLEAR: RECLIST,
               MAIL.
      ENDLOOP.
    *-Send the document by calling the SAPoffice API1 module for sending
    *-documents with attachments
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = DOC_CHNG
          PUT_IN_OUTBOX              = C_X
          COMMIT_WORK                = C_X
        IMPORTING
          SENT_TO_ALL                = SENT_TO_ALL
        TABLES
          PACKING_LIST               = OBJPACK
          OBJECT_HEADER              = OBJHEAD
          CONTENTS_BIN               = OBJBIN
          CONTENTS_TXT               = OBJTXT
          RECEIVERS                  = RECLIST
        EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          OPERATION_NO_AUTHORIZATION = 4
          OTHERS                     = 99.
      CASE SY-SUBRC .
        WHEN 0.
          MESSAGE I000 WITH 'Mail has been sent successfully'(006).
        WHEN OTHERS.
          MESSAGE E000 WITH 'Problem in sending the mail'(023).
      ENDCASE.
    ENDFORM.                    " send_mail
    *&      Form  page_format
    *        For page foramtting
    FORM PAGE_FORMAT TABLES EMAIL STRUCTURE S_EMAIL .
      DATA : L_LINES       TYPE I,
             L_TEMP(500)   TYPE C,
             L_OFFSET      TYPE P,
             L_LINESLEN(2) TYPE P,
             L_MIMELEN(2)  TYPE P,
             L_TABIX       LIKE SY-TABIX.
      CLEAR : IT_XI_PDF,
              IT_XI_TEMP.
      REFRESH : IT_XI_PDF,
                IT_XI_TEMP.
      IT_XI_PDF[] = IT_PDF[].
    * Reformat the line to 255 characters wide (--code from SAP--)
      CLEAR: L_TEMP, L_OFFSET, IT_XI_TEMP.
      DESCRIBE TABLE IT_XI_PDF   LINES  L_LINES.
      DESCRIBE FIELD IT_XI_PDF   LENGTH L_LINESLEN IN CHARACTER MODE.
      DESCRIBE FIELD IT_XI_TEMP  LENGTH L_MIMELEN IN CHARACTER MODE.
      LOOP AT IT_XI_PDF.
        L_TABIX = SY-TABIX.
        MOVE IT_XI_PDF TO L_TEMP+L_OFFSET.
        IF L_TABIX = L_LINES.
          L_LINESLEN = STRLEN( IT_XI_PDF ).
        ENDIF.
        L_OFFSET = L_OFFSET + L_LINESLEN.
        IF L_OFFSET GE L_MIMELEN.
          CLEAR IT_XI_TEMP.
          IT_XI_TEMP = L_TEMP(L_MIMELEN).
          APPEND IT_XI_TEMP.
          SHIFT L_TEMP BY L_MIMELEN PLACES.
          L_OFFSET = L_OFFSET - L_MIMELEN.
        ENDIF.
        IF L_TABIX = L_LINES.
          IF L_OFFSET GT 0.
            CLEAR IT_XI_TEMP.
            IT_XI_TEMP = L_TEMP(L_OFFSET).
            APPEND IT_XI_TEMP.
          ENDIF.
        ENDIF.
      ENDLOOP.
      CLEAR : IT_XI_MIME,
              IT_XI_MIME[].
      LOOP AT IT_XI_TEMP.
        IT_XI_MIME(255) = IT_XI_TEMP-LINE.
        APPEND IT_XI_MIME.
        CLEAR  IT_XI_MIME.
      ENDLOOP.
    * Final Data
      CLEAR : IT_HTML,
              IT_HTML[].
      IT_HTML[] = IT_XI_MIME[].
    * For sending mail
      PERFORM SEND_MAIL TABLES EMAIL.
    ENDFORM.                    " page_format
    *&      Form  fetch_variants
    *       For fetching the variants available for the program
    FORM FETCH_VARIANTS .
      DATA : L_PROGRAM LIKE RS38M-PROGRAMM VALUE 'RKAEP000',
             L_VARA1 TYPE DFIES-FIELDNAME VALUE 'P_VARA1'.
      CLEAR : IT_VARIANT1,
              IT_VARIANT1[].
    * Get variants
      PERFORM GET_VARIANTS TABLES IT_VARIANT1
                           USING L_PROGRAM.
    * F4 Help
      IF NOT IT_VARIANT1[] IS INITIAL.
        PERFORM GET_F4_HELP TABLES IT_VARIANT1
                             USING L_VARA1
                            CHANGING P_VARA1.
      ELSE.
        MESSAGE E000 WITH 'No variants available for report1'(054).
      ENDIF.
    ENDFORM.                    " fetch_variants
    *&      Form  validation
    *       For Validation
    FORM VALIDATION .
      DATA : L_PRO1 LIKE RS38M-PROGRAMM VALUE 'RKAEP000',
             L_PRO2 LIKE RS38M-PROGRAMM VALUE 'GP3DIEHXY88SNFJ0391V7KF9EK7050',
             L_C1,
             L_C2.
    * If both check-box are unchecked
      IF P_C1 IS INITIAL
    AND P_C2 IS INITIAL.
        MESSAGE E000 WITH 'Check any one check-box'(049).
      ENDIF.
    * If checked without varaint
      IF NOT P_C1 IS INITIAL AND P_VARA1 IS INITIAL.
        MESSAGE E000 WITH 'Please give any one of the variant for report1'(055).
      ENDIF.
    * If checked without varaint
      IF NOT P_C2 IS INITIAL AND P_VARA2 IS INITIAL.
        MESSAGE E000 WITH 'Please give any one of the variant for report2'(061).
      ENDIF.
    * Reading the variant and fetching the mail-ids
      IF P_C1 = C_X.
        L_C1 = '1'.
        CLEAR : S_EMAIL,
                S_EMAIL[].
        PERFORM READ_VARIANTS TABLES IT_MAILID
                                     S_EMAIL
                               USING P_VARA1
                                     L_PRO1
                                     L_C1.
        IF S_EMAIL[] IS INITIAL.
          MESSAGE E000 WITH 'No Id available for given Cost report1'(066).
        ELSE.
          SORT S_EMAIL BY LOW.
          DELETE ADJACENT DUPLICATES FROM S_EMAIL COMPARING LOW.
        ENDIF.
      ENDIF.
    * Reading the variant and fetching the mail-ids
      IF P_C2 = C_X.
        CLEAR : S_EMAIL1,
                S_EMAIL1[].
        L_C2 = '2'.
        PERFORM READ_VARIANTS TABLES IT_MAILID1
                                     S_EMAIL1
                               USING P_VARA2
                                     L_PRO2
                                     L_C2.
        IF S_EMAIL1[] IS INITIAL.
          MESSAGE E000 WITH 'No Id available for given Cost report2'(067).
        ELSE.
          SORT S_EMAIL1 BY LOW.
          DELETE ADJACENT DUPLICATES FROM S_EMAIL1 COMPARING LOW.
        ENDIF.
      ENDIF.
    ENDFORM.                    " validation
    *&      Form  GET_VARIANTS
    *       Fetching Variants
    FORM GET_VARIANTS  TABLES   P_IT_VARIANT STRUCTURE IT_VARIANT1
                       USING    P_V_PROGRAM  TYPE RS38M-PROGRAMM.
      SELECT VARIANT
             FROM VARID
             INTO TABLE P_IT_VARIANT
             WHERE REPORT = P_V_PROGRAM.
    ENDFORM.                    " GET_VARIANTS
    *&      Form  GET_F4_HELP
    *       text
    FORM GET_F4_HELP  TABLES   P_IT_VARIANT1 STRUCTURE IT_VARIANT1
                       USING   P_L_VARA1 LIKE DFIES-FIELDNAME
                      CHANGING P_P_VARA LIKE P_VARA1.
    * Fn. for Pop-Up
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD        = P_L_VARA1
          VALUE_ORG       = 'S'
          DISPLAY         = ' '
        TABLES
          VALUE_TAB       = P_IT_VARIANT1
          RETURN_TAB      = IT_RETURN
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2
          OTHERS          = 3.
      IF SY-SUBRC = 0.
        P_P_VARA = IT_RETURN-FIELDVAL.
      ELSE.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " GET_F4_HELP
    *&      Form  FETCH_VARIANTS1
    *       text
    FORM FETCH_VARIANTS1 .
      DATA : V_PROGRAM1 LIKE RS38M-PROGRAMM VALUE 'GP3DIEHXY88SNFJ0391V7KF9EK7050',
             L_VARA2  TYPE DFIES-FIELDNAME VALUE 'P_VARA2'.
      CLEAR : IT_VARIANT2,
              IT_VARIANT2[].
    * Get Variants
      PERFORM GET_VARIANTS TABLES IT_VARIANT2
                           USING V_PROGRAM1.
    * F4 Help
      IF NOT IT_VARIANT2[] IS INITIAL.
        PERFORM GET_F4_HELP TABLES IT_VARIANT2
                            USING  L_VARA2
                          CHANGING P_VARA2.
      ELSE.
        MESSAGE E000 WITH 'No variants available for report2'(050).
      ENDIF.
    ENDFORM.                    " FETCH_VARIANTS1
    *&      Form  read_variants
    *        Reading the variant and fetching the mail-ids
    FORM READ_VARIANTS TABLES P_IT_MAILID STRUCTURE IT_MAILID
                              P_S_EMAIL   STRUCTURE S_EMAIL
                       USING  P_P_VARA1   LIKE P_VARA1
                              P_L_PRO1    LIKE RS38M-PROGRAMM
                              P_L_C1      TYPE C.
      DATA : L_TEMP(44),
             IT_VALUTAB LIKE RSPARAMS OCCURS 0 WITH HEADER LINE.
      RANGES : R_COCEN FOR CSKS-KOSTL.
    * Function Module to get the variant contents
      CALL FUNCTION 'RS_VARIANT_CONTENTS'
        EXPORTING
          REPORT               = P_L_PRO1
          VARIANT              = P_P_VARA1
        TABLES
          VALUTAB              = IT_VALUTAB
        EXCEPTIONS
          VARIANT_NON_EXISTENT = 1
          VARIANT_OBSOLETE     = 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.
      CLEAR : R_COCEN,
              R_COCEN[].
      LOOP AT IT_VALUTAB WHERE SELNAME = 'KOSTL'
                            OR SELNAME = '_C-CCTR'.
    * Getting the range of cost centers
        IF IT_VALUTAB-OPTION = 'BT'.
          R_COCEN-LOW    = IT_VALUTAB-LOW.
    * For Conversion Routine
          PERFORM CONVERSION USING R_COCEN-LOW.
          R_COCEN-HIGH   = IT_VALUTAB-HIGH.
    * For Conversion Routine
          PERFORM CONVERSION USING R_COCEN-HIGH.
          R_COCEN-OPTION = 'BT'.
          R_COCEN-SIGN   = 'I'.
          APPEND R_COCEN.
          CLEAR  R_COCEN.
        ENDIF.
    * Getting the single cost centers
        IF IT_VALUTAB-OPTION = 'EQ'.
          R_COCEN-LOW    = IT_VALUTAB-LOW.
    * For Conversion Routine
          PERFORM CONVERSION USING R_COCEN-LOW.
          R_COCEN-OPTION = 'EQ'.
          R_COCEN-SIGN   = 'I'.
          APPEND R_COCEN.
          CLEAR  R_COCEN.
        ENDIF.
      ENDLOOP.
    * If no cost centers
      IF NOT R_COCEN[] IS INITIAL.
        SELECT KOKRS
               KOSTL
               DATBI
               TELX1
          FROM CSKS
               INTO TABLE P_IT_MAILID
         WHERE KOSTL IN R_COCEN.
        IF P_IT_MAILID[] IS INITIAL.
          IF P_L_C1 = '1'.
            MESSAGE E000 WITH 'No IDs available for report1'(059).
          ELSEIF P_L_C1 = '2'.
            MESSAGE E000 WITH 'No IDs available for report2'(062).
          ENDIF.
        ENDIF.
    * Deleting the blank entries
        DELETE P_IT_MAILID WHERE TELX1 = SPACE.
        CLEAR L_TEMP.
        READ TABLE P_IT_MAILID INDEX 1.
        L_TEMP = P_IT_MAILID-TELX1.
        DATA : L_CHECK.
        LOOP AT P_IT_MAILID WHERE TELX1 <> L_TEMP.
          L_CHECK = C_X.
        ENDLOOP.
    * For checking the unique ids
        IF L_CHECK = C_X.
          IF P_L_C1 = '1'.
            MESSAGE E000 WITH 'No unique mail-ids for  report1'(058).
          ELSEIF P_L_C1 = '2'.
            MESSAGE E000 WITH 'No unique mail-ids for  report2'(065).
          ENDIF.
        ENDIF.
    * Populating the IDs for the cost centers
        LOOP AT P_IT_MAILID.
          SET LOCALE LANGUAGE SY-LANGU.
          TRANSLATE P_IT_MAILID-TELX1 TO LOWER CASE.
          SET LOCALE LANGUAGE SPACE .
          CONCATENATE P_IT_MAILID-TELX1 '@allergan.com' INTO L_TEMP.
          P_S_EMAIL-LOW = L_TEMP.
          P_S_EMAIL-SIGN = 'I'.
          P_S_EMAIL-OPTION = 'EQ'.
          APPEND P_S_EMAIL.
          CLEAR  P_S_EMAIL.
        ENDLOOP.
      ELSE.
        IF P_L_C1 = '1'.
          MESSAGE E000 WITH 'No Cost Center Available for report1'(057).
        ELSEIF P_L_C1 = '2'.
          MESSAGE E000 WITH 'No Cost Center Available for report2'(063).
        ENDIF.
      ENDIF.
    ENDFORM.                    " read_variants
    *&      Form  CONVERSION
    *       For Conversion Routine
    FORM CONVERSION  USING    P_IT_VALUTAB_LOW TYPE C.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = P_IT_VALUTAB_LOW
        IMPORTING
          OUTPUT = P_IT_VALUTAB_LOW.
    ENDFORM.                    " CONVERSION

  • AS/400 connectivity using java by jt400 api

    I am making a project on Java Swing. I am having an AS/400 machine i am saving the spool files on AS/400 Machine as .txt and accessing it from a remote Windows Machine. I have made an UI to connect it to the AS/400 machine using JT400 API's. I am having 300 spool files(.txt) in the library on AS/400 machine. I m accessing this library to get the list of spool files basically .txt files. Now I am using JT400 OpenAsynchronously method but the program gets hanged over there and displays on 25 files. I don't know what to do please help
    Akhil
    Code:--------------------------------------------------
    public Vector listSpooledFiles()
    Vector rowData = new Vector();
    // this.printQue = printQue;
    try
    String strSpooledFileName;
    boolean fCompleted = false;
    int listed = 0, size;
    System.out.println(" inside method....1");
    //System.out.println("Now receiving all spool files synchrously");
    SpooledFileList splfList = new SpooledFileList(as400);
    splfList.setUserFilter(userId);
    //if((printQue.equalsIgnoreCase("*ALL"))||(printQue.equals("")))
    //if((printQue.equalsIgnoreCase("*ALL")))
    splfList.setQueueFilter("/QSYS.LIB/%ALL%.LIB/%ALL%.OUTQ");
    // else
    //splfList.setQueueFilter("/QSYS.LIB/%LIBL%.LIB/"+printQue+".OUTQ");
    //splfList.setQueueFilter("/QSYS.LIB/%LIBL%.LIB");
    // wait for the list to complete
    //splfList.waitForListToComplete();
    // add the listener.
    System.out.println(" inside method....2");
    splfList.addPrintObjectListListener(this);
    System.out.println(" inside method....3");
    // open the list, openAsynchronously returns immediately
    splfList.openAsynchronously();
    System.out.println(" inside method....4");
    do
    System.out.println(" inside do....1");
    // wait for the list to have at least 25 objects or to be done
    waitForWakeUp();
    System.out.println(" inside method....1.2");
    fCompleted = splfList.isCompleted();
    System.out.println(" inside method....1.3");
    size = splfList.size();
    System.out.println(" inside method....1.4");
    System.out.println(size+"::size of files");
    //System.out.println("sizeOfList......"+size);
    // output the names of all objects added to the list
    // since we last woke up
    while (listed < size)
    System.out.println(" inside method....1.5");
    if (fListError)
    System.out.println(" ..Exception on list - " + listException);
    break;
    System.out.println(" inside method....1.6");
    SpooledFile splf = (SpooledFile)splfList.getObject(listed++);
    } while (!fCompleted);
    System.out.println(size+"::Size");
    //splfList.removePrintObjectListListener(this);
    System.out.println(" inside method....1.7");
    Enumeration enum = splfList.getObjects();
    System.out.println(" inside method....1.8");
    while(enum.hasMoreElements())
    SpooledFile splf = (SpooledFile) enum.nextElement();
    if(splf != null)
    Vector tmp = new Vector();
    String fileName = splf.getStringAttribute(SpooledFile.ATTR_SPOOLFILE);
    int fileNo = splf.getNumber();
    String jobName = splf.getJobName();
    String jobUser = splf.getJobUser();
    String jobNo = splf.getJobNumber();
    Integer page =splf.getIntegerAttribute(SpooledFile.ATTR_PAGES);
    String date=splf.getStringAttribute(SpooledFile.ATTR_DATE);
    String time=splf.getStringAttribute(SpooledFile.ATTR_TIME);
    date=date.substring(1);
    StringBuffer sbdate= new StringBuffer(date);
    sbdate=sbdate.insert(2,"/");
    sbdate=sbdate.insert(5, "/");
    StringBuffer sbtime=new StringBuffer(time);
    sbtime=sbtime.insert(2,":");
    sbtime=sbtime.insert(5,":");
    date=sbdate.toString();
    time=sbtime.toString();
    if((!fileName.equals("QPJOBLOG")) && (!fileName.equals("QPDSPJOB")) && (!fileName.equals("QPSRVDMP")))
    // For the JCheckBox
    tmp.addElement(new Boolean(false));
    tmp.addElement(fileName);
    tmp.addElement(new Integer(fileNo));
    tmp.addElement(jobName);
    tmp.addElement(jobUser);
    tmp.addElement(jobNo);
    tmp.addElement(page);
    tmp.addElement(date);
    tmp.addElement(time);
    rowData.addElement(tmp);
    splfList.close();
    catch( ExtendedIllegalStateException ex )
    System.out.println(" The list was closed before it completed!");
    catch( Exception e )
    // ...handle any other exceptions...
    e.printStackTrace();
    return rowData;
    //return arrRowData;
    // This is where the foreground thread waits to be awaken by the
    // the background thread when the list is updated or it ends.
    private synchronized void waitForWakeUp()
    throws InterruptedException
    // don''t go back to sleep if the listener says the list is done
    if (!fListCompleted)
    wait();
    // The following methods implement the PrintObjectListListener interface
    // This method is invoked when the list is closed.
    public void listClosed(PrintObjectListEvent event)
    System.out.println("*****The list was closed*****");
    fListClosed = true;
    synchronized(this)
    // Set flag to indicate that the list has
    // completed and wake up foreground thread.
    fListCompleted = true;
    notifyAll();
    // This method is invoked when the list is completed.
    public void listCompleted(PrintObjectListEvent event)
    System.out.println("*****The list has completed*****");
    synchronized (this)
    // Set flag to indicate that the list has
    // completed and wake up foreground thread.
    fListCompleted = true;
    notifyAll();
    // This method is invoked if an error occurs while retrieving
    // the list.
    public void listErrorOccurred(PrintObjectListEvent event)
    System.out.println("*****The list had an error*****");
    fListError = true;
    listException = event.getException();
    synchronized(this)
    // Set flag to indicate that the list has
    // completed and wake up foreground thread.
    fListCompleted = true;
    notifyAll();
    // This method is invoked when the list is opened.
    public void listOpened(PrintObjectListEvent event)
    System.out.println("*****The list was opened*****");
    listObjectCount = 0;
    // This method is invoked when an object is added to the list.
    public void listObjectAdded(PrintObjectListEvent event)
    // every 25 objects we'll wake up the foreground
    // thread to get the latest objects...
    if( (++listObjectCount % 1) == 0 )
    //System.out.println("*****1 more objects added to the list*****");
    synchronized (this)
    // wake up foreground thread
    notifyAll();
    }

    Hi,
    You could try posting with the code tags (http://forum.java.sun.com/faq.jsp#format). Few people are prepared to read that much code without pretty formatting.
    Check out this forum aswell, it is dedicated to JT400: http://www-912.ibm.com/j_dir/JTOpen.nsf/By+Date?OpenView

Maybe you are looking for

  • Outlook 2013 signature issue

    Hello, I'd be very grateful if someone could help with the following query that I received from a colleague. This issue was raised after I asked all members of staff, to standardise their email signatures. "I followed your script for this: my image c

  • Database in AS?

    Hi, I want to develop a swf application like yahoo interactive stock chart as below http://finance.yahoo.com/echarts?s=ADBE+Interactive#chart1:symbol=adbe;range=1y;indicator= dividend+volume;charttype=line;crosshair=on;ohlcvalues=0;logscale=on;source

  • Oracle Business Intelligence ReportUI Portlet

    hi, I want to know "Oracle Business Intelligence ReportUI Portlet" , then how to integrate them with my Interanet.. how to configure and implement. what are the things require to do the same. i have refered the "Oracle Business Intelligence Presentat

  • Cisco 1310 point to point encryption?

    Howdy. We have two Cisco 1310 devices working currently in point to point mode. I have a couple of questions regards this.. 1. What is the best method to encrypt the point to point links between the two? We would like to use local passwords for this.

  • ALSA often doesn't produce sound anymore after suspend

    Hi, For some years this has been fine and pulseaudio worked fine after waking up from suspend. But for about one or two month it more and more often doesn't. After waking up from suspend I just don't hear sound anymore. I can't find any error message