Write (char)147 to output file become (char)63 when read.

Hi,
I was doing an encryption for my assignment. And here I found a problem.
               FileWriter fstream = new FileWriter("output.out");
               BufferedWriter dos = new BufferedWriter(fstream);
dos.write((char)147);
dos.close(); fstream.close();
When I tried to read the output.out file using this function:
               File inputFile = new File(filename);
               FileInputStream fis = new FileInputStream(inputFile);
               BufferedInputStream bis = new BufferedInputStream(fis);
               BufferedReader dis = new BufferedReader(new InputStreamReader(bis));
char test = dis.read();
dis.close(); bis.close(); fis.close();
It shows that the test character is representing (char)63 (question mark). Any idea on how to solve this? I want to write (char)147 to the file and read it as (char)147, not as (char)63.
Thanks in advance,
Dennis A.

dennis_lin007 wrote:
Ok thanks a lot!!
I'm using RSA encryption, and if the mod is > 255, there are probabilities that its result may contain a value greater than 255. The implication of this is that you are encrypting byte-by-byte which does not make sense. Assuming that you are writing the RSA code from scratch and not using the JCE then consider using BigInteger. BigInteger has all the ancillary methods you will need to implement RSA.

Similar Messages

  • Adobe Media Encoder Could not write XMP data in output file.

    Hi there i have searched for this on the forums,
    if there is a Thread on it please Link:)
    This is my Encoding Log from Adobe Media ancoder,
    (se Below).
    im doing a projekt from Mts Files, in Premiere pro
    i have Checked the box that no Xmp Data needs to be added, to the left from the Queue button in the export window.
    Should i Delete all the Xmp in Bridge or somthing like that to Resolve this?
    Regards
    Jonas Dwight
    Encoding Log:
    - Source File: /Users/Blasuk/Library/Caches/TemporaryItems/Mogel_oe_2014_nyeste.prproj
    - Output File: /Users/Blasuk/Desktop/Video_Projekts/Fremkaldte/Moegeloe2014-hq.mp4
    - Preset Used: Custom
    - Video: 1920x1080 (1,0), 25 fps, Upper, 01:18:52:10
    - Audio: AAC, 320 kbps, 48 kHz, 5.1
    - Bitrate: VBR, 2 pass, Target 15.00 Mbps, Max 41.30 Mbps
    - Encoding Time: 11:05:14
    01/05/2015 07:35:01 PM : File Encoded with warning
    File importer detected an inconsistency in the file structure of Moegeloe2014-hq.mp4.  Reading and writing this file's metadata (XMP) has been disabled.
    Adobe Media Encoder
    Could not write XMP data in output file.

    Any help please?! Thank you!

  • Media Encoder "Could not write XMP data in output file." issue

    Greetings,
         We have invested a great deal of money and time into a brand new editting system and we need some help with adobe media encoder. We are trying to export some of our projects and we keep getting the same error. Here is the entire log of errors:
    Could not write XMP data in output file.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\Acura Spot 011410_CS4_1_6.prproj
    - Output File: M:\acura_rooftop_43_draft_1.avi
    - Preset Used: NTSC DV
    - Video: 720x480, 29.97 [fps], Lower, Quality 100
    - Audio: 48000 Hz, Stereo, 16 bit
    - Bitrate:
    - Encoding Time: 00:17:23
    2/4/2010 1:42:28 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\Acura Spot 011410_CS4_1_7.prproj
    - Output File: C:\Users\Ramius\Desktop\acura_rooftop_43draft_1.avi
    - Preset Used: NTSC DV
    - Video: 720x480, 29.97 [fps], Lower, Quality 100
    - Audio: 48000 Hz, Stereo, 16 bit
    - Bitrate:
    - Encoding Time: 00:02:09
    2/4/2010 1:54:21 PM : Encoding Failed
    The Operation was interrupted by user
    - Source File: C:\Users\Ramius\AppData\Local\Temp\Acura Spot 011410_CS4_1_9.prproj
    - Output File: C:\Users\Ramius\Desktop\acura_rooftop_43draft_1.avi
    - Preset Used: NTSC DV
    - Video: 720x480, 29.97 [fps], Lower, Quality 100
    - Audio: 48000 Hz, Stereo, 16 bit
    - Bitrate:
    - Encoding Time: 00:16:04
    2/4/2010 2:19:49 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\Acura Spot 011410_CS4_1_10.prproj
    - Output File: C:\Users\Ramius\Desktop\acura_rooftop_HD_draft_1.mp4
    - Preset Used: HDTV 1080p 29.97 High Quality
    - Video: NTSC, 1920x1080, 29.97 [fps], Progressive
    - Audio: AAC, 160 [kbps], 48 kHz, Stereo
    - Bitrate: VBR, 1 Pass, Target 32.00, Max 40.00 [Mbps]
    - Encoding Time: 00:01:38
    2/4/2010 2:30:31 PM : Encoding Failed
    The Operation was interrupted by user
    - Source File: C:\Users\Ramius\AppData\Local\Temp\Acura Spot 011410_CS4_1_11.prproj
    - Output File: C:\Users\Ramius\Desktop\acura_HD.mp4
    - Preset Used: HDTV 1080p 29.97 High Quality
    - Video: NTSC, 1920x1080, 29.97 [fps], Progressive
    - Audio: AAC, 160 [kbps], 48 kHz, Stereo
    - Bitrate: VBR, 1 Pass, Target 32.00, Max 40.00 [Mbps]
    - Encoding Time: 00:00:38
    2/4/2010 3:19:31 PM : Encoding Failed
    The Operation was interrupted by user
    - Source File: C:\Users\Ramius\AppData\Local\Temp\Acura Spot 011410_CS4_1_12.prproj
    - Output File: C:\Users\Ramius\Desktop\acura_HD.avi
    - Preset Used: NTSC DV
    - Video: 720x480, 29.97 [fps], Lower, Quality 100
    - Audio: 48000 Hz, Stereo, 16 bit
    - Bitrate:
    - Encoding Time: 00:01:08
    2/4/2010 3:31:37 PM : Encoding Failed
    The Operation was interrupted by user
    - Source File: C:\Users\Ramius\AppData\Local\Temp\Acura Spot 011410_CS4_1_17.prproj
    - Output File: C:\Users\Ramius\Desktop\acura_HD.avi
    - Preset Used: NTSC DV
    - Video: 720x480, 29.97 [fps], Lower, Quality 100
    - Audio: 48000 Hz, Stereo, 16 bit
    - Bitrate:
    - Encoding Time: 00:15:31
    2/4/2010 4:21:06 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\Acura Spot 011410_CS4_1_19.prproj
    - Output File: M:\GRAPHICS\cow_graphics\acura_HD.mp4
    - Preset Used: HDTV 1080p 29.97 High Quality
    - Video: NTSC, 1920x1080, 29.97 [fps], Progressive
    - Audio: AAC, 160 [kbps], 48 kHz, Stereo
    - Bitrate: VBR, 1 Pass, Target 32.00, Max 40.00 [Mbps]
    - Encoding Time: 00:00:24
    2/4/2010 5:16:54 PM : Encoding Failed
    The Operation was interrupted by user
    - Source File: C:\Users\Ramius\AppData\Local\Temp\ihigh_CS4_HD_16.prproj
    - Output File: C:\Users\Ramius\Desktop\mxf.mpg
    - Preset Used: 1440 x 1080i 29.97 High Quality
    - Video: NTSC, 1440x1080, 29.97 drop frame [fps], Upper, Quality 4.0
    - Audio: 384 [kbps], 48 kHz, 16 bit, Stereo, MPEG
    - Bitrate: VBR, 1 Pass, Min 4.00, Target 15.00, Max 18.50 [Mbps]
    - Encoding Time: 00:05:08
    2/23/2010 12:12:40 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\ihigh_CS4_HD_18.prproj
    - Output File: M:\AVI\ihigh_avi\GAR\Marines\marinespromo_2009.avi
    - Preset Used: NTSC DV
    - Video: 720x480, 29.97 [fps], Lower, Quality 100
    - Audio: 48000 Hz, Stereo, 16 bit
    - Bitrate:
    - Encoding Time: 00:04:00
    2/23/2010 12:26:54 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\ihigh_CS4_HD_19.prproj
    - Output File: M:\AVI\ihigh_avi\GAR\Marines\marinespromo_2009.avi
    - Preset Used: NTSC DV
    - Video: 720x480, 29.97 [fps], Lower, Quality 100
    - Audio: 48000 Hz, Stereo, 16 bit
    - Bitrate:
    - Encoding Time: 00:05:08
    2/23/2010 12:51:01 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\ihigh_CS4_HD_23.prproj
    - Output File: C:\Users\Ramius\Desktop\allhdtest2.mpg
    - Preset Used: 1440 x 1080i 29.97 High Quality
    - Video: NTSC, 1440x1080, 29.97 drop frame [fps], Upper, Quality 4.0
    - Audio: 384 [kbps], 48 kHz, 16 bit, Stereo, MPEG
    - Bitrate: VBR, 1 Pass, Min 4.00, Target 15.00, Max 18.50 [Mbps]
    - Encoding Time: 00:04:20
    2/23/2010 4:23:46 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\ihigh_CS4_HD_27.prproj
    - Output File: C:\Users\Ramius\Desktop\Sequence 07.mp4
    - Preset Used: HDTV 1080p 29.97 High Quality
    - Video: NTSC, 1920x1080, 29.97 [fps], Progressive
    - Audio: AAC, 160 [kbps], 48 kHz, Stereo
    - Bitrate: VBR, 1 Pass, Target 32.00, Max 40.00 [Mbps]
    - Encoding Time: 00:09:11
    3/2/2010 3:21:19 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\ihigh_CS4_HD_28.prproj
    - Output File: C:\Users\Ramius\Desktop\Sequence 07_1.mp4
    - Preset Used: HDTV 1080p 29.97 High Quality
    - Video: NTSC, 1920x1080, 29.97 [fps], Progressive
    - Audio: AAC, 160 [kbps], 48 kHz, Stereo
    - Bitrate: VBR, 1 Pass, Target 32.00, Max 40.00 [Mbps]
    - Encoding Time: 00:09:00
    3/2/2010 3:34:47 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    - Source File: C:\Users\Ramius\AppData\Local\Temp\ihigh_CS4_HD_29.prproj
    - Output File: C:\Users\Ramius\Desktop\Sequence 07_2.mp4
    - Preset Used: HDTV 1080p 29.97 High Quality
    - Video: NTSC, 1920x1080, 29.97 [fps], Progressive
    - Audio: AAC, 160 [kbps], 48 kHz, Stereo
    - Bitrate: VBR, 1 Pass, Target 32.00, Max 40.00 [Mbps]
    - Encoding Time: 00:10:22
    3/2/2010 4:41:03 PM : Encoding Failed
    Error compiling movie.
    Unknown error.
    We absolutely need to fix this issue ASAP, we are in a major bind until we can resolve this issue. Thanks a bunch.

    We are using Windows 7
    dual quadcore intel xeon processors 8gb ram
    10000rpm internal drives. quadroefx 1800 video card
    The drive is 4tb
    We have tried exporting to many different locations with no luck
    Its a very nice video editting system. We just need to figure out this exporter

  • How to avoid output file and error lines when condition does not match

    Hi Experts
    A customer want to send purchase order files to several vendors and each vendor has their own requirement to content and file format. I have prepared scenarios for each vendor and a template is (conditionally) called when CardCode matches. It works fine, - PO file is generated when CardCode matches, but error lines are written to SAP B1 Control Center each time CardCode does not match the one defined in a scenario (100 or more times per day). Problem is that these error lines does not get automatic deleted. Conditional processing are made in this way:
    Result Message in SAP B1 Control Center when CardCode does not match:
    I tried to avoid an error line in SAP B1 Control Center when CardCode does not match in this way:
    Then no error lines are written to SAP B1 Control Center, but an output file is generated each time (order file when CardCode matches and an empty file when CardCode does not match).
    Any suggestions on how to avoid both errors types (error lines in SAP B1 Control Center and empty output files)?
    Or - can lines in SAP B1 Control Center be automatic deleted?
    Regards
    Steen

    Hi Steen,
    using <b1im_skip> should be the right approach, if you're working with B1 OUTBOUND.
    Following extract form the B1i help describes the usage to skip the outbound processing:
    1.1 Skipping Outbound Processing
    If you do not want to hand over the message to the receiver system, the scenario step can create a special tag that indicates to generic processing in the integration framework to skip the message processing.
    Add the following to the final transformation atom (atom0):
    <b1im_skip xmlns= ”” info=”my info” msglog=”true” msgout="yes">
    If the integration framework skips the message, it puts the message log information to the Filtered section, if the message log is switched on. The result message contains the Message skipped by vBIU logic information.
    info
    To display an individual message, define it using the info attribute.
    msglog
    If you want to avoid an entry in the message log, introduce the msglog attribute and set it to false.
    msgout
    To display the skip information in the Success section of the message log, use the msgout attribute and set it to yes.
    In case you don't want any MsgLogEntry in case of a skipped message, please enter the following in final atom0:
    <xsl:template name="transform">
    <xsl:attribute name="pltype">xml</xsl:attribute>
    <xsl:choose>
    <xsl:when test="$msg/BOM/BO/Documents/row/CardCode=&apos;C20000&apos;">
    <xsl:call-template name="transform2"/>
    </xsl:when>
    <xsl:otherwise>
    <b1im_skip info="skipped" msglog="false"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    Best regards
    Bastian

  • Some files become 0 KB when a get latest is done from RoboSource

    Hi,
    Now whenever I do a get latest from RoboSource, some or all of the files become 0KB both in local and in the server. History of the all these files are also lost.
    What could be the problem?
    I have placed my online help in RoboSource Control Server that came with RH 7.
    I have recently upgraded client from RH7 to RH8. I am using the Source Control Explorer that has come with RH8 but using the Source Control Server that has come with RH7.
    Is this a compatibility issue?
    Regards,
    Saj

    Hi Saj and Peter. The word "server" may be confusing the issue here. If I'm not mistaken, Saj is not using RoboHelp Server. Rather, it's RoboSource Control "Server". If that's the case, there was no change in the version of RoboSource Control between RH 7 and RH 8.
    Both are RoboSource Control 3.1 so there should be no compatibility problem there.
    However, I wonder if there is an issue of how Saj initially upgraded the RH 7 project that was in RSC in RH 8 so that all the project files become compatible with the new RH 8 file formats? Did he open the entire project, so that it could be converted at once, or was it piecemeal? Also, Saj, have you made sure to install all the latest critical updates (8.0.1 and 8.0.2)?
    http://www.adobe.com/support/robohelp/downloads.html
    I only rarely use RSC, so rather than my speculating, perhaps Peter could move this post to the Source Control sub-Forum and let folks like Gravenstein, Elisa, MergeThis, take a look at it and offer some suggestions for best practices when upgrading from RH 7 to RH 8 when using RSC.
    Meanwhile, I found this post by Amebr which speaks (somewhat) to the issue of upgrading which you may find useful.
    http://forums.adobe.com/message/2591895#2591895
    It's post #9  toward the bottom of the thread.
    Thanks.
    John

  • Why the output file invisible from JCreator??

    i developed a program with JCreator. with the program, i intend to write something to an output file with the codes like:
    FileOutputStream fos = new FileOutputStream("output.txt");
    DataOutputStream dos = new DataOutputStream(fos);
    for(int i=0; i<10; i++){       
    String s = i+" ";           dos.writeChars(s);
    fos.close(); dos.close();
    how come when i open the output file from JCreator, i can not see anything there? yet, when i directly open the file "output.txt" from the directory storing the program source codes in the operating system, the output string "0 1 2... 9" is visible.
    quite confused! could you please illumine?

    I am not sure of my facts but I think the problem is as follows. DataOutputStream writes bytes of primitive information. You can use the method .writeUTF() which is an ASCII-compatible encoding, instead of .write().
    However textual output should be done with PrintWriter (or PrintStream in Java 1.0). JCreator is expecting ASCII or text to read.

  • Report output file permission

    We are running Reports on Solaris and the report output
    files are owned by oracle. Is there any way we can set
    up the Report Server to allow read/write permission of
    the output files to specific users?
    Thanks,
    Alex

    Not sure if this is what you want but you can set the umask property in the shell that the reports server is running in. This should set the appropriate permissions for all files created by the Reports Server process.

  • JOb is not crating output files in background

    hello experts,
    Developer has developed one program & output of which is stored in some shared location.
    when the program is ran from SE38/SA38, the output file is created
    But when this program is scheduled as background job, the output is not creatd
    PLease suggeest

    Dear Rai,
    Do you mean to say,when you try to execute the same using SE38->Execute in Background->Schedule immedietly---->check &
    Save,you are not able to see the message as "Background job was scheduled for program  XXXXXX"?
    or after checking in SM37 for the finished job,you are not able to see any output lists?
    Please explain when and where you are not able to see any output lists?
    Regards
    Mangalraj.S

  • Excel files become mime-attachments. Why?

    My excel files become mime-attachments when I send them. My clients cannot open those mime-attachments. What happened? I used to be able to send excel files without any problem. Do I have a virus?

    You posted this in the iPhone forum... is this actually a problem involving the MacBook Pro listed in your profile, or are you somehow getting Excel files on your iPhone and sending them from there?

  • How do i prevent [] from appearing in output when reading vector data?

    Here's the code:
    public void saveFile(File file)
    try
    PrintWriter out = new PrintWriter(new FileOutputStream(file),true);
    Vector line = null;
    int i =0;
    while (i < data.size())
    line = (Vector)data.get(i);
    System.out.println("What is line ? " +line);
    i++;
    Sysem.out.println("Before write ");
    out.println(line);
    System.out.println("After write ");
    out.close();
    Here is the result of the line:System.out.println("What is line ? " +line);
    [Name ,  adres ,  Zip code,  City ,  Phone ,  email]
    I do not want to write the [  ] to my output file, because they appear in my table when i read the file again.
    Thanks in advance.
    regards,
    Barry

    Hi Chuck,
    Thanks for your answer but I do not know what you mean.
    I assume you mean that I have to change something in the next line:
    line = (Vector)data.get(i);
    But I have no clue how to do that. So "simply examine the contents and print each of them how you want them to appear." sounds good but I do not know how to do that.
    Could you please be a litlle more specific?
    Thanks.
    Barry

  • Spool List output display 255 char when the rpt is run in Background

    Hi Friends,
    I tried executing a program in Background.. The report output has more than 64 columns ( more than 255 char ) ..
    Iam using "REUSE_ALV_GRID_DISPLAY" for displaying the list.
    My Problem:
    1. The spool list is truncated after 255 characters when i run in background.
    2. Th output in Spool List is coming in 2 rows ... not very clear ... becoz of that the grid lines are not getting displayed.
    3. I ve not used any Standard - line size for dislaying ..
    4. In foreground i am able to display all the 64 columns... Y not in Background......
    5. My Printer setting is ..X_255 .... only ...
    Requirement:
    1. What should i do to increase the spool list display to more than 255 characters
    2. Or how to save the background run reports output to an excel sheet as how we 'll take the from the foreground.
    Expecting your answers,
    Thanks in Advance...
    Cheers,
    R.Kripa .........
    Enjoy ABAPing ..........
    new upcoming Abaper ....

    Hello Kripa,
    You need to perform two actions.
    1. set an appropriate format for the printer you are using. As explained from the previous messages you go to: SPAD -> output devives (type the printer you are using) -> from the menu ..-> goto -> device type -> formats. In there create a new format like Z_65_650
    or Z_65_xxxx where xxxx could be up to 1065. This is the length of your report.
    When you give your report in background, do not forget to choose the new format you created.
    2. After the spool request is created, you take its number and use it ar a parameter in the following report.
    Please copy and paste it in a new program, maybe called ZRSPOSHOWSPOOLLIST.
    It should work then.
    roxani
    Display spool list > 255 columns
    This is a SAP utility report to allow display of
    spool request lists with line size more than 255 characters in
    releases 4.6B and 4.6C (4.6D kernel must be used)
    REPORT ZRSPOSHOWLIST LINE-SIZE 80.
    PARAMETERS: RQIDENT LIKE TSP01-RQIDENT,
    FIRSTL TYPE I DEFAULT 0,
    LASTL TYPE I DEFAULT 0.
    global data from LSPOXTOP
    DATA: RC(10) TYPE C,
    ERRMSG(100) TYPE C,
    STATUS LIKE SY-SUBRC,
    DSN_TYPE(8) TYPE C.
    DATA: BEGIN OF DATA_SET_LINE,
    DATA_LENGTH(5),
    PRECOL(1),
    DATA_LINE(1000),
    DATA_LINE(5000), "MODAB
    END OF DATA_SET_LINE,
    DATA_SET_LENGTH(5) TYPE C.
    TABLES: TSP01, TST05, TSPOPTIONS.
    DATA: TEMSE_NAME LIKE TST01-DNAME,
    TEMSE_CLIENT LIKE TST01-DCLIENT,
    TEMSE_HANDLE LIKE RSTSTYPE-HANDLE,
    TEMSE_PART LIKE TST01-DPART,
    TEMSE_OBJTYP LIKE TST01-DTYPE,
    TEMSE_RECTYP LIKE RSTSTYPE-RECTYP,
    TEMSE_CHARCO LIKE TST01-DCHARCOD.
    DATA: IS_OTF.
    global data from LSPOCTOP
    DATA: BEGIN OF SPOC
    , escape
    , prtctrl
    , FIRST_BYTES(4) " collection of the first bytes of the
    " escape sequences, which I am searching for.
    , PRTCTRL_START_LENGTH TYPE I
    , PRTCTRL_TOTAL_LENGTH TYPE I
    , PRTCTRL_START(10)
    , SYMBOL_LOW_START(10)
    , SYMBOL_HGH_START(10)
    , SYMBOL_START_LENGTH TYPE I
    , ICON_START(10)
    , ICON_START_LENGTH TYPE I
    , ICON_SEL TYPE I VALUE 1
    , FRAME_START(10)
    , FRAME_START_LENGTH TYPE I
    , END OF SPOC.
    FIELD-SYMBOLS: <SPOC_PRTCTRL> TYPE C
    , <SPOC_FRAME> TYPE C
    , <SPOC_ICON> TYPE C
    , <SPOC_SYMBOL_LOW> TYPE C
    , <SPOC_SYMBOL_HGH> TYPE C
    copied from RSPO_DISPLAY_ABAP_SPOOLJOB
    DATA: BUFFER LIKE DATA_SET_LINE OCCURS 1000.
    TABLES: TSP02L.
    SELECT SINGLE * FROM TSP01 WHERE RQIDENT = RQIDENT.
    IF SY-SUBRC <> 0.
    WRITE: / 'Spool request does not exist:'(001), RQIDENT.
    EXIT.
    ENDIF.
    CALL FUNCTION 'RSPO_CHECK_JOB_PERMISSION'
    EXPORTING
    ACCESS = 'DISP'
    SPOOLREQ = TSP01
    EXCEPTIONS
    NO_PERMISSION = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
    WRITE: / 'No authorization to display'(002).
    EXIT.
    ENDIF.
    PERFORM READ_DATA TABLES BUFFER
    USING TSP01 FIRSTL LASTL.
    IF SY-SUBRC <> 0.
    WRITE: / 'Error reading spoolo request'(003).
    EXIT.
    ENDIF.
    IF IS_OTF = 'X'.
    WRITE: / 'This spool request is not an ABAP list'(004).
    EXIT.
    ENDIF.
    PERFORM DISPLAY_DATA TABLES BUFFER USING TSP01-RQPAPER TSP01-RQIDENT.
    FORM GET_SPOOL_LINE.
    DO.
    IF TEMSE_RECTYP+1(1) = 'Y'.
    CALL 'C_RSTS_READ'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'BUFF' FIELD DATA_SET_LINE
    ID 'BUFFLG' FIELD 1006
    ID 'BUFFLG' FIELD 5006 "MODAB
    ID 'ALLINE' FIELD 'X'
    ID 'BINARY' FIELD ' '
    ID 'SHOWLG' FIELD 'X'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    ELSE.
    CALL 'C_RSTS_READ'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'BUFF' FIELD DATA_SET_LINE+1
    ID 'BUFFLG' FIELD 1005
    ID 'BUFFLG' FIELD 5005 "MODAB
    ID 'ALLINE' FIELD 'X'
    ID 'BINARY' FIELD ' '
    ID 'SHOWLG' FIELD 'X'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    DATA_SET_LINE(5) = DATA_SET_LINE+1(5).
    DATA_SET_LINE-PRECOL = ' '.
    ADD 1 TO DATA_SET_LINE-DATA_LENGTH.
    ENDIF.
    STATUS = SY-SUBRC.
    IF STATUS <> 6. " EOF, error condition, or got data
    EXIT.
    ENDIF.
    end of this part, try to open next part
    ADD 1 TO TEMSE_PART.
    CALL 'C_RSTS_CLOSE'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS = 0.
    CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
    AUTHORITY = 'SP01'
    CLIENT = TEMSE_CLIENT "hjl
    NAME = TEMSE_NAME
    PART = TEMSE_PART
    IMPORTING
    CHARCO = TEMSE_CHARCO
    CREATER =
    CREDATE =
    DELDATE =
    MAX_CREDATE =
    MAX_DELDATE =
    NON_UNIQ =
    NOOF_PARTS =
    RECTYP = TEMSE_RECTYP
    SIZE =
    STOTYP =
    type =
    OBJTYPE = TEMSE_OBJTYP
    EXCEPTIONS
    FB_ERROR = 1
    FB_RSTS_OTHER = 2
    NO_OBJECT = 3
    NO_PERMISSION = 4
    OTHERS = 5.
    STATUS = SY-SUBRC.
    ENDIF.
    IF STATUS = 0.
    CALL 'C_RSTS_OPEN_READ'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'CLIENT' FIELD TEMSE_CLIENT "hjl
    ID 'NAME' FIELD TEMSE_NAME
    ID 'PART' FIELD TEMSE_PART
    ID 'TYPE' FIELD TEMSE_OBJTYP
    ID 'CONV' FIELD ' '
    ID 'ALLINE' FIELD 'X'
    ID 'BINARY' FIELD ' '
    ID 'RECTYP' FIELD TEMSE_RECTYP
    ID 'CHARCO' FIELD TEMSE_CHARCO
    ID 'PROM' FIELD 'I'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    ENDIF.
    ENDDO.
    IF STATUS = 4.
    STATUS = 12. "EOF
    ENDIF.
    IF STATUS = 8.
    STATUS = 40. "Line too long
    ENDIF.
    DATA_SET_LENGTH = DATA_SET_LINE-DATA_LENGTH.
    ENDFORM.
    FORM READ_DATA TABLES BUFFER
    USING TSP01 LIKE TSP01 VALUE(FIRST) TYPE I
    VALUE(LAST) TYPE I.
    DATA: LINES TYPE I.
    REFRESH BUFFER.
    CLEAR IS_OTF.
    TEMSE_CLIENT = TSP01-RQCLIENT.
    TEMSE_NAME = TSP01-RQO1NAME.
    TEMSE_PART = 1.
    CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
    AUTHORITY = 'SP01'
    CLIENT = TEMSE_CLIENT
    NAME = TEMSE_NAME
    PART = TEMSE_PART
    IMPORTING
    CHARCO = TEMSE_CHARCO
    CREATER =
    CREDATE =
    DELDATE =
    MAX_CREDATE =
    MAX_DELDATE =
    NON_UNIQ =
    NOOF_PARTS =
    RECTYP = TEMSE_RECTYP
    SIZE =
    STOTYP =
    type =
    OBJTYPE = TEMSE_OBJTYP
    EXCEPTIONS
    FB_ERROR = 1
    FB_RSTS_OTHER = 2
    NO_OBJECT = 3
    NO_PERMISSION = 4
    OTHERS = 5.
    IF SY-SUBRC = 0.
    IF TEMSE_OBJTYP(3) = 'OTF'.
    IS_OTF = 'X'.
    ENDIF.
    ELSE.
    EXIT.
    ENDIF.
    CLEAR TEMSE_HANDLE.
    CALL 'C_RSTS_OPEN_READ'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'CLIENT' FIELD TEMSE_CLIENT "hjl
    ID 'NAME' FIELD TEMSE_NAME
    ID 'PART' FIELD TEMSE_PART
    ID 'TYPE' FIELD TEMSE_OBJTYP
    ID 'CONV' FIELD ' '
    ID 'ALLINE' FIELD 'X'
    ID 'BINARY' FIELD ' '
    ID 'RECTYP' FIELD TEMSE_RECTYP
    ID 'CHARCO' FIELD TEMSE_CHARCO
    ID 'PROM' FIELD 'I'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS = 0.
    DO.
    PERFORM GET_SPOOL_LINE.
    IF STATUS <> 0 AND STATUS <> 40 AND STATUS <> 12.
    PERFORM CLOSE_JOB.
    EXIT.
    ENDIF.
    IF STATUS <> 12. " 12 = End
    IF NOT ( DATA_SET_LENGTH IS INITIAL ).
    DATA_SET_LINE-DATA_LENGTH = DATA_SET_LENGTH - 1.
    ENDIF.
    ADD 1 TO LINES.
    IF LINES >= FIRST.
    APPEND DATA_SET_LINE TO BUFFER.
    ENDIF.
    IF ( NOT LAST IS INITIAL ) AND ( LINES >= LAST ).
    EXIT.
    ENDIF.
    ELSE.
    IF LINES = 0.
    PERFORM CLOSE_JOB.
    EXIT.
    ENDIF.
    IF LINES < FIRST .
    PERFORM CLOSE_JOB.
    EXIT.
    ENDIF.
    EXIT.
    ENDIF.
    ENDDO.
    PERFORM CLOSE_JOB.
    ENDIF.
    ENDFORM.
    FORM CLOSE_JOB *
    FORM CLOSE_JOB.
    IF STATUS <> 0 AND STATUS <> 12.
    CALL 'C_RSTS_CLOSE'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    MESSAGE E112(PO) WITH STATUS RC ERRMSG RAISING READ_ERROR.
    ENDIF.
    CALL 'C_RSTS_CLOSE'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS <> 0.
    MESSAGE E112(PO) WITH STATUS RC ERRMSG RAISING READ_ERROR.
    ENDIF.
    ENDFORM.
    FORM DISPLAY_DATA TABLES BUFFER USING RQPAPER LIKE TSP01-RQPAPER
    RQID LIKE TSP01-RQIDENT.
    DATA: LINE_LENGTH TYPE I, GCOL TYPE I, GLINES TYPE I,
    LINE_LENGTH2 LIKE RSTSTYPE-LINELENGTH,
    V, V2.
    CALL FUNCTION 'RSPO_SPOOLDATA_WRITE_INIT'.
    PERFORM SPOOLDATA_WRITE_INIT. "MODAB
    select single * from tspoptions where spoption = 'REALWIDTH'.
    if sy-subrc = 0.
    V = 'X'.
    endif.
    select single * from tspoptions where spoption = 'REALHEIGHT'.
    if sy-subrc = 0.
    V2 = 'X'.
    endif.
    IF NOT V IS INITIAL OR NOT V2 IS INITIAL.
    GCOL = 0.
    GLINES = 0.
    SELECT SINGLE * FROM TSP02L WHERE PJIDENT = RQID
    AND PJNUMMER = 0.
    IF SY-SUBRC = 0.
    GCOL = TSP02L-COLUMNS.
    GLINES = TSP02L-LINES.
    ELSE.
    CALL FUNCTION 'RSPO_GET_SIZE_OF_LAYOUT'
    EXPORTING
    LAYOUT = RQPAPER
    IMPORTING
    ANSWER =
    COLUMNS = GCOL
    LINES = GLINES
    PFORMAT =
    ENDIF.
    ENDIF.
    IF GCOL < 80 OR V IS INITIAL.
    GCOL = 255.
    ENDIF.
    IF GLINES < 5 OR V2 IS INITIAL.
    GLINES = 0.
    ENDIF.
    IF GCOL >= 1024. "MODAB
    GCOL = 1023.
    ENDIF.
    NEW-PAGE NO-HEADING NO-TITLE LINE-SIZE GCOL
    LINE-COUNT GLINES. " make a wide list
    SET BLANK LINES ON.
    LOOP AT BUFFER.
    DATA_SET_LINE = BUFFER.
    IF DATA_SET_LINE-PRECOL = 'P'.
    IF DATA_SET_LINE(1) = ' '. " Echter Vorschub ?"
    NEW-PAGE.
    ENDIF.
    CONTINUE.
    ENDIF.
    Zeilenlange berechnen, falls unbekannt.
    IF DATA_SET_LINE-DATA_LENGTH IS INITIAL.
    LINE_LENGTH = STRLEN( DATA_SET_LINE-DATA_LINE ).
    ELSE.
    LINE_LENGTH = DATA_SET_LINE-DATA_LENGTH.
    ENDIF.
    IF LINE_LENGTH > 0.
    LINE_LENGTH2 = LINE_LENGTH.
    PERFORM SPOOLDATA_WRITE USING DATA_SET_LINE-DATA_LINE "MODAB
    LINE_LENGTH2
    1.
    ELSE.
    " Leerzeile
    SKIP.
    ENDIF.
    ENDLOOP.
    ENDFORM.
    copied from RSPO_SPOOLDATA_WRITE
    FORM SPOOLDATA_WRITE USING VALUE(SPOOL_DATA)
    VALUE(DATA_LENGTH) LIKE RSTSTYPE-LINELENGTH
    VALUE(START_POS) LIKE SY-COLNO.
    function globals
    DATA: LPOS LIKE SY-COLNO
    , REST_LEN TYPE I
    , AREA_LEN TYPE I
    , NEXT_HOT TYPE I " offset of next special character
    , COLS TYPE I " columns used by special character
    , BYTES TYPE I " bytes used by special character
    , HOT2
    , HOT3
    , HOT4
    , HOT5
    , HOT6
    , HOT7
    , BEGIN OF ESCAPE_TRICK
    , X1(1) TYPE X
    , END OF ESCAPE_TRICK
    , THE_PRTCTRL(5) TYPE C
    Because of a problem within the ABAP listprocessing, I shall
    never output the same icon side by side with the same color
    and without a gap.
    As I don't know the data, I will use two different variables
    alternatively.
    , ICON_ID1 LIKE ICONS-L4
    , ICON_ID2 LIKE ICONS-L4.
    FIELD-SYMBOLS: <LDATA>
    , <PLAIN_TEXT>
    , <PRTCTRL>
    , <HOT_PRTCTRL>
    , <HOT_FRAME>
    , <HOT_ICON>
    , <HOT_SYMBOL>
    IF START_POS < 2.
    write at / ' ' no-gap.
    NEW-LINE.
    LPOS = 1.
    ELSE.
    LPOS = START_POS.
    ENDIF.
    REST_LEN = STRLEN( SPOOL_DATA ).
    DESCRIBE FIELD SPOOL_DATA LENGTH AREA_LEN.
    IF DATA_LENGTH = 0.
    " fine.
    ELSEIF DATA_LENGTH <= AREA_LEN.
    REST_LEN = DATA_LENGTH.
    ELSE.
    WRITE: / 'Fehler beim Decodieren der Listendaten'(005).
    STOP.
    ENDIF.
    CHECK REST_LEN > 0.
    ASSIGN SPOOL_DATA(REST_LEN) TO <LDATA>.
    WHILE <LDATA> CA SPOC-FIRST_BYTES.
    NEXT_HOT = SY-FDPOS.
    IF NEXT_HOT > 0.
    ASSIGN <LDATA>(NEXT_HOT) TO <PLAIN_TEXT>.
    MODAB
    PERFORM WRITE_BIGFIELD USING <PLAIN_TEXT>
    NEXT_HOT
    LPOS.
    WRITE AT LPOS <PLAIN_TEXT> NO-GAP.
    ADD NEXT_HOT TO LPOS.
    SUBTRACT NEXT_HOT FROM REST_LEN.
    ASSIGN <LDATA>+NEXT_HOT(REST_LEN) TO <LDATA>.
    ENDIF.
    IF REST_LEN >= SPOC-PRTCTRL_START_LENGTH.
    ASSIGN <LDATA>(SPOC-PRTCTRL_START_LENGTH) TO <HOT_PRTCTRL>.
    ELSE.
    ASSIGN 'too_short' TO <HOT_PRTCTRL>.
    ENDIF.
    IF REST_LEN >= SPOC-FRAME_START_LENGTH.
    ASSIGN <LDATA>(SPOC-FRAME_START_LENGTH) TO <HOT_FRAME>.
    ELSE.
    ASSIGN 'too_short' TO <HOT_FRAME>.
    ENDIF.
    IF REST_LEN >= SPOC-ICON_START_LENGTH.
    ASSIGN <LDATA>(SPOC-ICON_START_LENGTH) TO <HOT_ICON>.
    ELSE.
    ASSIGN 'too_short' TO <HOT_ICON>.
    ENDIF.
    IF REST_LEN >= SPOC-SYMBOL_START_LENGTH.
    ASSIGN <LDATA>(SPOC-SYMBOL_START_LENGTH) TO <HOT_SYMBOL>.
    ELSE.
    ASSIGN 'too_short' TO <HOT_SYMBOL>.
    ENDIF.
    IF REST_LEN > 1.
    HOT2 = <LDATA>+1(1).
    IF REST_LEN > 2.
    HOT3 = <LDATA>+2(1).
    IF REST_LEN > 3.
    HOT4 = <LDATA>+3(1).
    ELSE.
    HOT4 = '?'.
    ENDIF.
    ELSE.
    HOT3 = '?'.
    ENDIF.
    ELSE.
    HOT2 = '?'.
    ENDIF.
    IF <HOT_FRAME> = <SPOC_FRAME>.
    COLS = 1. " in most cases.
    BYTES = 2. " in most cases.
    CASE HOT2.
    WHEN '0'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '1'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '2'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '3'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '4'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '5'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '6'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '7'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '8'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '9'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN ':'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN ';'. " box_drawings_light_left
    WRITE AT LPOS '4' AS LINE NO-GAP.
    WHEN '<'. " box_drawings_light_up
    WRITE AT LPOS '5' AS LINE NO-GAP.
    WHEN '='. " box_drawings_light_right
    WRITE AT LPOS '4' AS LINE NO-GAP.
    WHEN '>'. " box_drawings_light_down
    WRITE AT LPOS '5' AS LINE NO-GAP.
    WHEN '?'. " drawings_checkbox_off
    WRITE AT LPOS ' ' AS CHECKBOX INPUT OFF NO-GAP.
    WHEN '@'. " drawings_checkbox_on
    WRITE AT LPOS 'X' AS CHECKBOX INPUT OFF NO-GAP.
    WHEN OTHERS.
    BYTES = 0.
    ENDCASE.
    ENDIF.
    IF <HOT_SYMBOL> = <SPOC_SYMBOL_LOW>.
    ESCAPE_TRICK = HOT3.
    SUBTRACT 32 FROM ESCAPE_TRICK-X1.
    IF HOT4 = SPACE.
    WRITE AT LPOS(2) ESCAPE_TRICK AS SYMBOL NO-GAP.
    COLS = 2.
    BYTES = 4.
    ELSE.
    WRITE AT LPOS(1) ESCAPE_TRICK AS SYMBOL NO-GAP.
    BYTES = 3.
    ENDIF.
    ENDIF.
    IF <HOT_SYMBOL> = <SPOC_SYMBOL_HGH>.
    ESCAPE_TRICK = HOT3.
    ADD 32 TO ESCAPE_TRICK-X1.
    IF HOT4 = SPACE.
    WRITE AT LPOS(2) ESCAPE_TRICK AS SYMBOL NO-GAP.
    COLS = 2.
    BYTES = 4.
    ELSE.
    WRITE AT LPOS(1) ESCAPE_TRICK AS SYMBOL NO-GAP.
    BYTES = 3.
    ENDIF.
    ENDIF.
    IF <HOT_ICON> = <SPOC_ICON>.
    IF SPOC-ICON_SEL >< 1.
    SPOC-ICON_SEL = 1.
    ICON_ID1 = '@00@'.
    ICON_ID1+1(1) = HOT3.
    ICON_ID1+2(1) = HOT4.
    ELSE.
    SPOC-ICON_SEL = 2.
    ICON_ID2 = '@00@'.
    ICON_ID2+1(1) = HOT3.
    ICON_ID2+2(1) = HOT4.
    ENDIF.
    IF REST_LEN > 4.
    HOT5 = <LDATA>+4(1).
    IF REST_LEN > 5.
    HOT6 = <LDATA>+5(1).
    IF REST_LEN > 6.
    HOT7 = <LDATA>+6(1).
    ELSE.
    HOT7 = '?'.
    ENDIF.
    ELSE.
    HOT6 = '?'.
    ENDIF.
    ELSE.
    HOT5 = '?'.
    ENDIF.
    IF HOT5 = SPACE.
    IF HOT6 = SPACE.
    IF HOT7 = SPACE.
    IF SPOC-ICON_SEL = 1.
    WRITE AT LPOS(4) ICON_ID1 AS ICON.
    write at lpos icon_id1 as icon no-gap.
    ELSE.
    WRITE AT LPOS(4) ICON_ID2 AS ICON.
    write at lpos icon_id2 as icon no-gap.
    ENDIF.
    COLS = 4.
    BYTES = 7.
    ELSE.
    IF SPOC-ICON_SEL = 1.
    WRITE AT LPOS(3) ICON_ID1 AS ICON.
    write at lpos icon_id1 as icon no-gap.
    ELSE.
    WRITE AT LPOS(3) ICON_ID2 AS ICON.
    write at lpos icon_id2 as icon no-gap.
    ENDIF.
    COLS = 3.
    BYTES = 6.
    ENDIF.
    ELSE.
    IF SPOC-ICON_SEL = 1.
    WRITE AT LPOS(2) ICON_ID1 AS ICON.
    write at lpos icon_id1 as icon no-gap.
    ELSE.
    WRITE AT LPOS(2) ICON_ID2 AS ICON.
    write at lpos icon_id2 as icon no-gap.
    ENDIF.
    COLS = 2.
    BYTES = 5.
    ENDIF.
    ELSE.
    "rite at lpos(1) icon_id as icon.
    WRITE AT LPOS(1) '#' NO-GAP. " Not enough space for any icon.
    COLS = 1.
    BYTES = 4.
    ENDIF.
    ENDIF.
    IF <HOT_PRTCTRL> = <SPOC_PRTCTRL>.
    COLS = 0. " in most cases.
    BYTES = 6. " in most cases.
    IF REST_LEN >= SPOC-PRTCTRL_TOTAL_LENGTH.
    THE_PRTCTRL = <LDATA>+SPOC-PRTCTRL_START_LENGTH(5).
    IF THE_PRTCTRL = 'SABLD'.
    FORMAT INTENSIFIED ON.
    "no 3.0 'SAULN'.
    "no 3.0 FORMAT UNDERSCORED ON.
    ELSEIF THE_PRTCTRL = 'SAOFF'.
    FORMAT INTENSIFIED OFF.
    "no 3.0 FORMAT UNDERSCORED OFF.
    ELSEIF THE_PRTCTRL(3) = 'COL'.
    CASE THE_PRTCTRL+3(1).
    WHEN '0'.
    FORMAT COLOR OFF.
    WHEN '1'.
    FORMAT COLOR 1.
    WHEN '2'.
    FORMAT COLOR 2.
    WHEN '3'.
    FORMAT COLOR 3.
    WHEN '4'.
    FORMAT COLOR 4.
    WHEN '5'.
    FORMAT COLOR 5.
    WHEN '6'.
    FORMAT COLOR 6.
    WHEN '7'.
    FORMAT COLOR 7.
    ENDCASE.
    CASE THE_PRTCTRL+4(1).
    WHEN 'N'.
    FORMAT INTENSIFIED OFF INVERSE OFF.
    WHEN 'H'.
    FORMAT INTENSIFIED ON INVERSE OFF.
    WHEN 'V'.
    FORMAT INTENSIFIED ON INVERSE ON.
    ENDCASE.
    ENDIF. "printcontrol
    ELSE. "??
    ENDIF.
    ENDIF.
    IF BYTES = 0.
    BYTES = 1.
    WRITE AT LPOS(1) '#'.
    COLS = 1.
    ENDIF.
    ADD COLS TO LPOS.
    SUBTRACT BYTES FROM REST_LEN.
    IF REST_LEN > 0.
    ASSIGN <LDATA>+BYTES(REST_LEN) TO <LDATA>.
    ELSE.
    EXIT.
    ENDIF.
    ENDWHILE.
    MODAB
    IF REST_LEN > 0.
    ASSIGN <LDATA>(REST_LEN) TO <PLAIN_TEXT>.
    PERFORM WRITE_BIGFIELD USING <PLAIN_TEXT>
    REST_LEN
    LPOS.
    ENDIF.
    ENDFORM.
    FORM WRITE_BIGFIELD USING VALUE(FIELD) TYPE C
    VALUE(LEN)
    VALUE(POS).
    FIELD-SYMBOLS <P>.
    DATA: CHUNK TYPE I.
    WHILE LEN > 0.
    IF LEN > 255.
    CHUNK = 255.
    ELSE.
    CHUNK = LEN.
    ENDIF.
    WRITE AT POS FIELD(CHUNK) NO-GAP.
    ADD CHUNK TO POS.
    LEN = LEN - CHUNK.
    IF LEN > 0.
    FIELD = FIELD+CHUNK.
    ENDIF.
    ENDWHILE.
    ENDFORM.
    FORM SPOOLDATA_WRITE_INIT.
    DATA: BEGIN OF ESCAPE_TRICK
    , X1(1) TYPE X
    , END OF ESCAPE_TRICK
    FIELD-SYMBOLS: <LDATA>
    , <PLAIN_TEXT>
    , <PRTCTRL>
    ESCAPE_TRICK-X1 = '1C'.
    SPOC-PRTCTRL_START = ESCAPE_TRICK.
    SPOC-PRTCTRL_START_LENGTH = 1.
    SPOC-PRTCTRL_TOTAL_LENGTH = SPOC-PRTCTRL_START_LENGTH + 5.
    ASSIGN SPOC-PRTCTRL_START(SPOC-PRTCTRL_START_LENGTH) TO <SPOC_PRTCTRL>.
    ESCAPE_TRICK-X1 = '1B'.
    SPOC-FRAME_START = ESCAPE_TRICK.
    SPOC-FRAME_START_LENGTH = 1.
    ASSIGN SPOC-FRAME_START(SPOC-FRAME_START_LENGTH) TO <SPOC_FRAME>.
    ESCAPE_TRICK-X1 = '1B'.
    SPOC-ICON_START = ESCAPE_TRICK.
    SPOC-ICON_START+1 = ','.
    SPOC-ICON_START_LENGTH = 2.
    ASSIGN SPOC-ICON_START(SPOC-ICON_START_LENGTH) TO <SPOC_ICON>.
    ESCAPE_TRICK-X1 = '1B'.
    SPOC-SYMBOL_LOW_START = ESCAPE_TRICK.
    SPOC-SYMBOL_LOW_START+1 = '('.
    SPOC-SYMBOL_HGH_START = ESCAPE_TRICK.
    SPOC-SYMBOL_HGH_START+1 = ')'.
    SPOC-SYMBOL_START_LENGTH = 2.
    ASSIGN SPOC-SYMBOL_LOW_START(SPOC-SYMBOL_START_LENGTH)
    TO <SPOC_SYMBOL_LOW>.
    ASSIGN SPOC-SYMBOL_HGH_START(SPOC-SYMBOL_START_LENGTH)
    TO <SPOC_SYMBOL_HGH>.
    SPOC-FIRST_BYTES+0(1) = SPOC-PRTCTRL_START(1).
    SPOC-FIRST_BYTES+1(1) = SPOC-FRAME_START(1).
    SPOC-FIRST_BYTES+2(1) = SPOC-ICON_START(1).
    SPOC-FIRST_BYTES+3(1) = SPOC-SYMBOL_LOW_START(1).
    ENDFORM.

  • Read txt file 1 char @ time cnvrt to uppercase problem

    I am trying to get the following 2 problems solved. My input file is below and my output is below along with the code.
    Can anyone fix this and explain what I am doing wrong? Thank You in advance!
    (1) Any string of two or more blanks symbols is replaced by a single blanks.
    (2) All sentences start with an upper case letter.
    Input A://DataIn.txt = How me? you good.
    Output A://DataOut.txt = H o w m e Y U G O . ��
    import java.io.*;
    public class NumberFormat
    private DataInputStream inputStream = null;
    private DataOutputStream outputStream = null;
    *(1) Any string of two or more blanks symbols is replaced by a single blanks.
    (2) All sentences start with an upper case letter.
    public static void main(String[] args) throws java.io.IOException
    NumberFormat twoTimer = new NumberFormat();
    twoTimer.connectToInputFile();
    twoTimer.connectToOutputFile();
    twoTimer.readInput();
    twoTimer.closeFiles();
    System.out.println("Check A:/DataOut.txt Now");
    public void connectToInputFile()
    String inputFileName = getFileName("Enter input file name: A://DataIn.txt");
    try
    inputStream =
    new DataInputStream(
    new FileInputStream(inputFileName));
    catch(FileNotFoundException e)
    System.out.println("File " + inputFileName
    + " not found.");
    System.exit(0);
    public void connectToOutputFile()
    String outputFileName = getFileName("Enter output file name: A://DataOut.txt");
    try
    outputStream = new DataOutputStream(
    new FileOutputStream(outputFileName));
    catch(FileNotFoundException e)
    System.out.println("Error opening output file "
    + outputFileName);
    System.out.println(e.getMessage());
    System.exit(0);
    private String getFileName(String prompt)
    String fileName = null;
    System.out.println(prompt);
    fileName = SavitchIn.readLineWord();
    return fileName;
    //===========================================================================
    public void readInput()
    char prevChar = ' ';
    try
    char nextChar;
    String result = "";
    boolean done1 = false;
    boolean done2 = false;
    char next;
    do
    next = (char) (inputStream.read()); // <== Read input 1 Character @ time
    if (next == '\n')
    done1 = true;
    if (next == ' ' && next == prevChar)
    prevChar = next;
    else
    if (next == '.' || next == '!' || next == '?')// <== Capitalize next input Character
    do
    next = ' ';
    outputStream.writeChar(next);
    next = (char) (inputStream.read());
    if (next == '\n')
    done2 = true;
    next = (char) (inputStream.read());
    // next = (char) (inputStream.readNonwhiteChar()); ?????????????
    if (next == '\n')// <== never gets to end of file
    done2 = true;
    outputStream.writeChar(Character.toUpperCase (next));
    prevChar = next;
    while (!done2);
    else
    outputStream.writeChar(next);
    prevChar = next;
    while (!done1);
    catch(EOFException e)
    //Do nothing. This just ends the loop.
    System.out.println("Do Nothing Here");
    catch(IOException e)
    System.out.println(
    "Error: reading or writing files.");
    System.out.println(e.getMessage());
    System.exit(0);
    public void closeFiles()
    try
    inputStream.close();
    outputStream.close();
    catch(IOException e)
    System.out.println("Error closing files "
    + e.getMessage());
    System.exit(0);

    This line looks fishy:
    if (next == ' ' && next == prevChar)
    prevChar = next;Try:
    if (next == ' ' && next == prevChar)
    next = "";That should take care of the extra blanks, though I didn't test it myself, and could very well be wrong.
    Not sure about the uppercase, though I imagine it must be reading the ToUpperCase every time after the first period.

  • How to remove a char in the  Input file?

    Hi All,
    I need to remove a particular char in the input file
    before it is read into an Internal table.
    Is there any way to do such processing in file?
    Plz guide me reg this.
    Thanks,
    albert.

    Hi albert,
    1. We cannot do directly.
    2. we can do this logic
      a) make another extra internal table
         of just one field say abc(250) type c.
      b) read the full file in binay format,
        in this internal table,
        using gui_upload
      c) then LOOP at the internal table,
        and replace the char.
      d) AGAIN write this internal table using
       GUI_DOWNLOAD.
    2. Then we can use norma gui_upload
       for our final table.
    regards,
    amit m.

  • How to change the layout of an input file and write to an output file

    Hi
    I have a .csv file which has a layout as schoolNo. , county1,county2,county3,county4,county5
    It will need to go into an output file as schoolNo. repeated and a county on each record .
    ie., schoolNo.,county1
    schoolNo.,county2
    schoolNo.,county3
    schoolNo.,county4
    schoolNo.,county5
    I wrote the java program as follows ..which results in this error
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
    BECAUSE :--
    i know bec., the first record doesnot have county3,county4,county5 . So when the if loop for county3 lenght is checked it gives this exception .
    Pls help me write this program ..thanks in advance .
    /Here I open the input file and read in record by record                                                                                                                        
              BufferedReader readin;
              try {
                   readin = new BufferedReader(new FileReader(InFile));
                   String firstLine = readin.readLine();
                   String[] headers = firstLine.split(",");
                   columnCount = headers.length;
                   System.out.println("Columns in ZIP Master File: "+columnCount);
                   for(String input ;(input = readin.readLine()) != null; ){
                        recCount++;
                        input = input.substring(1);               
                        String[] column = input.split(",");
                        if(columnCount == 10){
                             eachIP++;
    //                               OUTPUT FILE
                                    if(column[1].length()> 0) {
                                       String mainStr = column[0] + "," + column[1] ; 
                                       Count++;
                                       totalcolumns++;
                                       writeOutFile.write(mainStr);
                                       writeOutFile.newLine();
                                  else{
                                  bypassedCount++;
                                    if(column[2].length()>0){
                                         String mainStr = column[0]+ "," + column[2];
                                         Count++;
                                         totalcolumns++;
                                       writeOutFile.write(mainStr);
                                       writeOutFile.newLine();
                                  else{
                                  bypassedCount++;
                                    if(column[3]..length()>0){
                                         String mainStr = column[0]+ "," + column[3];
                                         Count++;
                                         totalcolumns++;
                                       writeOutFile.write(mainStr);
                                       writeOutFile.newLine();
                                  else{
                                  bypassedCount++;
                                 }

    There are two split( ... ) methods; check the other one (the one with two arguments), it allows for empty entries to be counted, i.e. split(inputString, -1) gives you the wanted results.

  • By default where does report write output files on web server

    I am running forms and reports over web. I am running a form which on the click of a button runs a report. Using the
    Orarrp utility (I already have) I want to print this report.
    In my form trigger I am using the run_report_object and I set report parameters DESTYPE to File, and I set
    DESNAME giving it a file name. When report finishes, I use Show_Document('http://server:domain/filename.ext','_blank'),
    it returns the 404 error, The requested URL /receipt.rrpa was not found on this server.
    Can anyone tell me, by default where the server writes the file output? I have checked under
    $ORACLE_HOME/reports60/server/cache but did not find my output file.
    Is there a way to specifically direct the output file to a directory, and have the reports server recognize the path?
    Perhaps using some sort of 'Virtual Path' in the server configuration, but where?
    Any help is appreciated?
    Regards
    Mark

    Hi,
    destype file writes the file to wherever you send it to.
    destype=file desname = c:\temp\myRep.html
    creates the file myRep.html in the temp directory on the server. Destype 'cache' only writes to the Cache directory you mention. normally, if not giving any directory information, it's the working directory that the file gets created in. Do a seacrh for your file and I am sure that you'll find it.
    regards Frank

Maybe you are looking for