Handling text with ANSI codes in it

Now I don't think this should be as hard as I'm making it out to be. The idea here is to properly display MUD text that is sent back to the player. The screen width is 80 characters. So basically we should wind up doing this:
-Count all characters in this line of text (which can be very large mind you) and make a new line every 80 characters. Words must be kept whole. The ANSI escape codes are ignored.
I've come up with code to (attempt) to solve this problem. I know it's extremely[b] inefficient for the counting of the characters, but I'm not really interested in that. What I'm more interested in is why I'm getting extremely wacky displays compared to when I use another method (one that was already written in the class I'm playing around with--the method is a huge for loop by the way).
This is the code that I've come up with:
String data2 = data;
    data2 = data2.replace("[BLACK]", "");
    data2 = data2.replace("[BLUE]", "");
    data2 = data2.replace("[CYAN]", "");
    data2 = data2.replace("[GREEN]", "");
    data2 = data2.replace("[MAGENTA]", "");
    data2 = data2.replace("[RED]", "");
    data2 = data2.replace("[WHITE]", "");
    data2 = data2.replace("[YELLOW]", "");
    data2 = data2.replace("", "");
data2 = data2.replace("[R]", "");
//Black.
data = data.replace("[BLACK]", "\033[30m");
//Blue.
data = data.replace("[BLUE]", "\033[34m");
//Cyan.
data = data.replace("[CYAN]", "\033[36m");
//Green.
data = data.replace("[GREEN]", "\033[32m");
//Magenta.
data = data.replace("[MAGENTA]", "\033[35m");
//Red.
data = data.replace("[RED]", "\033[31m");
//White.
data = data.replace("[WHITE]", "\033[37m");
//Yellow.
data = data.replace("[YELLOW]", "\033[33m");
//Bold.
data = data.replace("[B]", "\033[1m");
//Regular.
data = data.replace("[R]", "\033[22m");
//Count the characters. If they're greater than SCREEN_WIDTH, the lines need to be return-
//spaced somehow.
String output = data;
String res = "";
int charactersOnLine = data2.length();
int inserts = (int)(charactersOnLine / SCREEN_WIDTH);
for (int c = 0; c < inserts; c++) {
System.out.println("output: " + output);
if (charactersOnLine > SCREEN_WIDTH) {
int charactersToGoBack = charactersOnLine - SCREEN_WIDTH;
int indexOfNewLine = output.lastIndexOf(" ", (charactersOnLine - charactersToGoBack));
String temp = output.substring(indexOfNewLine);
System.out.println("Inserting at: " + indexOfNewLine);
output = insert(output, "\r\n", indexOfNewLine);
res += output;
output = temp;
The insert method was devised to stick a character into the middle of the String:
  public static String insert(String theString, String stringToBeInserted,
                              int pos) {
    String beforeString = theString.substring(0, pos + 1);
    String endString = theString.substring(pos + 1, theString.length() - 1);
    beforeString += stringToBeInserted;
    beforeString += endString;
    return beforeString;
  }Yes, I know... no error checks or throwing of exceptions. That's not really what I'm after right now though. Those will be added later once the stuff is actually working...
Here's the output with the method I'm working on right now (This is in XP's telnet client). The ANSI parses fine... It's the text placement I'm concerned about.
The output with the new method:
Please select a race:
                      Dwarf
                           d) Half-Elf       j) Illithid
                                                        e) Gnome       k) Troll
                                                                               f
) Aasimar        l) Tiefling
                            >a
Choose a gender for your character (M/F):
                                         >m
Gender chosen: male
                   The MORTAL Human Lazerz has been created.
                                                             north up
                                                                      A Head Hel
m X90 lies here, gleaming.
                          HP: 5/5 MV: 0/0 ]>l
north up
          A Head Helm X90 lies here, gleaming.
                                              HP: 5/5 MV: 0/0 ]>l
north up
          A Head Helm X90 lies here, gleaming.
                                              HP: 5/5 MV: 0/0 ]>Here' s what it's supposed to look like (This is output from the old clunky gigantic for loop):
Please select a race:
a) Human          g) Drow Elf
b) Moon Elf       h) Ogre
c) Dwarf          i) Duergar Dwarf
d) Half-Elf       j) Illithid
e) Gnome       k) Troll
f) Aasimar        l) Tiefling
aChoose a gender for your character (M/F):
mGender chosen: male
The MORTAL Human Ao has been created.
Test Room
This is the room that all testing occurs in. Here is where the Lord Ao will
reside in the future as well.
Exits: north up
A Human Commoner is here.
A Head Helm X90 lies here, gleaming.As you can see... There's quite a difference when using the two methods. The goal here is to fix the method I'm trying to make work. :)
Also: No, this isn't homework. And I would put up Duke Dollars if I had any left to put up.

Eh.. Must of forgot . o_o

Similar Messages

  • Handling texts with SMARTFORMS and SE63

    Hi all
    I am having a strange situation I cannot understand: I am working on a form on two side:
    1) changing aspects with smartforms
    2) handling texts translations with se63
    The problem is that now if I made some change on text in smartform, I cannot see on output. Say I put a text in the middle of the form with "Hello world!" in, I cannot see in its output. why? Is this because I am working also with se63? I tried to leave transaction se63 to avoid eventual conflict, but still ... if now I go in smartforms transaction and try to change the form I cannot see any changes and till yesterday I did not have this kind of problem.
    Any idea ?
    thanks
    Gabriele

    The problem was that modifying form modifies were not visible .. I don't know if was because I was using also se63 on same form ... Now I solved and all is turned normal and change are visible: I closed and restart everything handling in different moment se63 and smartforms .. very strange ...
    thank you anyway
    Gabriele

  • Why does my Web Handler work with Internet Explorer, but not with Firefox

    I am trying to develop a web page that uses the Simile Timeline (http://code.google.com/p/simile-widgets/wiki/Timeline) with data from SQL Server.
    In initial testing of my timeline I tested it with Example.xml, a static XML file in the correct format to be event data. I wrote the following in the appropriate place within mytimeline's Javascript: -
    var WebHandler = "Example.xml"
    tl.loadXML(WebHandler, function (xml, url) { eventSourceFamily.loadXML(xml, url) });
    This worked fine with both Firefox and Internet Explorer. I then changed the assignment to
    var WebHandler = "GDBTimeline.ashx?Type=Family&Userid=" + getControlValue("input", "hdnUser");
    so that invoked a web handler that could look up the SQL database and return the XML that I wanted, and wrote this web handler.
    This works perfectly with Internet Explorer, but with FireFox the timeline band is blank. Yet when I examine the http traffic with Fiddler2 (http://www.fiddler2.com/fiddler2/) I see that with either browser there is a response from URL
    /GDB_pages/GDBTimeline.ashx?Type=Family&Userid=robertb
    that returns the XML that it is supposed to.
    I have previously used web handlers with Firefox before, with no problems. The Fiddler results conclusively show that the web handler is invoked, and returns the appropriate XML, and this XML is identical to the XML from the static test with Example.xml.
    Where do I start looking for answers? I don't even know if this is a Simile problem, a Firefox problem, or an ASP.NET problem.
    Thank you, Robert.

    Problem solved. The issue: Content Type was not correct.
    Visual Studio creates the web handler with dummy code like this: -
    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
    context.Response.ContentType = "text/plain"
    context.Response.Write("Hello World")
    End Sub
    I wrote a database query that set a string variable to the XML I wanted: -
    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
    Dim Outstring as string
    ' my logic to fill Outstring with XML
    context.Response.ContentType = "text/plain"
    context.Response.Write(Outstring)
    End Sub
    This works with Internet Explorer. However it's not strictly correct: to make it work with other browsers as well,
    context.Response.ContentType = "text/plain"
    should be
    context.Response.ContentType = "text/xml"
    It now works with IE, FF, and Chrome, and presumably all others.

  • I can't figure out what's wrong with this code

    First i want this program to allow me to enter a number with the EasyReader class and depending on the number entered it will show that specific line of this peom:
    One two buckle your shoe
    Three four shut the door
    Five six pick up sticks
    Seven eight lay them straight
    Nine ten this is the end.
    The error message i got was an illegal start of expression. I can't figure out why it is giving me this error because i have if (n = 1) || (n = 2) statements. My code is:
    public class PoemSeventeen
    public static void main(String[] args)
    EasyReader console = new EasyReader();
    System.out.println("Enter a number for the poem (0 to quit): ");
    int n = console.readInt();
    if (n = 1) || (n = 2)
    System.out.println("One, two, buckle your shoe");
    else if (n = 3) || (n = 4)
    System.out.println("Three, four, shut the door");
    else if (n = 5) || (n = 6)
    System.out.println("Five, six, pick up sticks");
    else if (n = 7) || (n = 8)
    System.out.println("Seven, eight, lay them straight");
    else if (n = 9) || (n = 10)
    System.out.println("Nine, ten, this is the end");
    else if (n = 0)
    System.out.println("You may exit now");
    else
    System.out.println("Put in a number between 0 and 10");
    I messed around with a few other thing because i had some weird errors before but now i have narrowed it down to just this 1 error.
    The EasyReader class code:
    // package com.skylit.io;
    import java.io.*;
    * @author Gary Litvin
    * @version 1.2, 5/30/02
    * Written as part of
    * <i>Java Methods: An Introduction to Object-Oriented Programming</i>
    * (Skylight Publishing 2001, ISBN 0-9654853-7-4)
    * and
    * <i>Java Methods AB: Data Structures</i>
    * (Skylight Publishing 2003, ISBN 0-9654853-1-5)
    * EasyReader provides simple methods for reading the console and
    * for opening and reading text files. All exceptions are handled
    * inside the class and are hidden from the user.
    * <xmp>
    * Example:
    * =======
    * EasyReader console = new EasyReader();
    * System.out.print("Enter input file name: ");
    * String fileName = console.readLine();
    * EasyReader inFile = new EasyReader(fileName);
    * if (inFile.bad())
    * System.err.println("Can't open " + fileName);
    * System.exit(1);
    * String firstLine = inFile.readLine();
    * if (!inFile.eof()) // or: if (firstLine != null)
    * System.out.println("The first line is : " + firstLine);
    * System.out.print("Enter the maximum number of integers to read: ");
    * int maxCount = console.readInt();
    * int k, count = 0;
    * while (count < maxCount && !inFile.eof())
    * k = inFile.readInt();
    * if (!inFile.eof())
    * // process or store this number
    * count++;
    * inFile.close(); // optional
    * System.out.println(count + " numbers read");
    * </xmp>
    public class EasyReader
    protected String myFileName;
    protected BufferedReader myInFile;
    protected int myErrorFlags = 0;
    protected static final int OPENERROR = 0x0001;
    protected static final int CLOSEERROR = 0x0002;
    protected static final int READERROR = 0x0004;
    protected static final int EOF = 0x0100;
    * Constructor. Prepares console (System.in) for reading
    public EasyReader()
    myFileName = null;
    myErrorFlags = 0;
    myInFile = new BufferedReader(
    new InputStreamReader(System.in), 128);
    * Constructor. opens a file for reading
    * @param fileName the name or pathname of the file
    public EasyReader(String fileName)
    myFileName = fileName;
    myErrorFlags = 0;
    try
    myInFile = new BufferedReader(new FileReader(fileName), 1024);
    catch (FileNotFoundException e)
    myErrorFlags |= OPENERROR;
    myFileName = null;
    * Closes the file
    public void close()
    if (myFileName == null)
    return;
    try
    myInFile.close();
    catch (IOException e)
    System.err.println("Error closing " + myFileName + "\n");
    myErrorFlags |= CLOSEERROR;
    * Checks the status of the file
    * @return true if en error occurred opening or reading the file,
    * false otherwise
    public boolean bad()
    return myErrorFlags != 0;
    * Checks the EOF status of the file
    * @return true if EOF was encountered in the previous read
    * operation, false otherwise
    public boolean eof()
    return (myErrorFlags & EOF) != 0;
    private boolean ready() throws IOException
    return myFileName == null || myInFile.ready();
    * Reads the next character from a file (any character including
    * a space or a newline character).
    * @return character read or <code>null</code> character
    * (Unicode 0) if trying to read beyond the EOF
    public char readChar()
    char ch = '\u0000';
    try
    if (ready())
    ch = (char)myInFile.read();
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    if (ch == '\u0000')
    myErrorFlags |= EOF;
    return ch;
    * Reads from the current position in the file up to and including
    * the next newline character. The newline character is thrown away
    * @return the read string (excluding the newline character) or
    * null if trying to read beyond the EOF
    public String readLine()
    String s = null;
    try
    s = myInFile.readLine();
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    if (s == null)
    myErrorFlags |= EOF;
    return s;
    * Skips whitespace and reads the next word (a string of consecutive
    * non-whitespace characters (up to but excluding the next space,
    * newline, etc.)
    * @return the read string or null if trying to read beyond the EOF
    public String readWord()
    StringBuffer buffer = new StringBuffer(128);
    char ch = ' ';
    int count = 0;
    String s = null;
    try
    while (ready() && Character.isWhitespace(ch))
    ch = (char)myInFile.read();
    while (ready() && !Character.isWhitespace(ch))
    count++;
    buffer.append(ch);
    myInFile.mark(1);
    ch = (char)myInFile.read();
    if (count > 0)
    myInFile.reset();
    s = buffer.toString();
    else
    myErrorFlags |= EOF;
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    return s;
    * Reads the next integer (without validating its format)
    * @return the integer read or 0 if trying to read beyond the EOF
    public int readInt()
    String s = readWord();
    if (s != null)
    return Integer.parseInt(s);
    else
    return 0;
    * Reads the next double (without validating its format)
    * @return the number read or 0 if trying to read beyond the EOF
    public double readDouble()
    String s = readWord();
    if (s != null)
    return Double.parseDouble(s);
    // in Java 1, use: return Double.valueOf(s).doubleValue();
    else
    return 0.0;
    Can anybody please tell me what's wrong with this code? Thanks

    String[] message = {
        "One, two, buckle your shoe",
        "One, two, buckle your shoe",
        "Three, four, shut the door",
        "Three, four, shut the door",
        "Five, six, pick up sticks",
        "Five, six, pick up sticks",
        "Seven, eight, lay them straight",
        "Seven, eight, lay them straight",
        "Nine, ten, this is the end",
        "Nine, ten, this is the end"
    if(n>0)
        System.out.println(message[n]);
    else
        System.exit(0);

  • Transport control program tp ended with error code 0203

    when i import queue and transport queue from dev to prd ,error show:
    Transport control program tp ended with error code 0203
    Message no. XT200
    Diagnosis
    An error occurred when executing a tp command.
      Command: IMPORT DEVK900298 P01 clientP01 U0 pf=/usr/sap/tra
      Return code: 0203
      Error text: wrong syntax in tp call
      Request: DEVK900298
    System Response
    The function terminates.
    Procedure
    Correct the error and execute the command again if necessary.

    Dear Allen,
    The transport control program tp collects all return codes that occur when a tp command is executed. From all of these single return codes, a combined return code is calculated that tp outputs as a result at the end the command. During an import, for example, all return codes for individual import steps are handled. If a special return code does not occur, then the combined return code at the end is the maximum of individual return codes that occur. In addition to the value of the return code, tp also gives a short description of this return code. You can display this short description using the command explainrc.
    Normally, all return codes that occur originate from individual transport steps. Since these individual return codes can only have the following values 0, 4, 6, 8, 12, 13, 14, 16, the combined return code also has one of these values. However, if a general error occurs, a single return code over 200 is generated. For example, this could arise if tp cannot establish a connection to the database. The maximum return code for all single transport steps is output in a separate message before specifying the combined returned code. In this case, the combined return code is always the return code of the general error message.
    <b>tp Commands:</b>
    tp addtobuffer <request> <sapsid>
    As of Release 4.6A, an explicit addtobuffer command leaves the position of the entry unchanged, if the relevant transport request is already in the buffer. Only the status of the entry is changed:
    Unconditional modes appearing in the command line are added to the unconditional modes in the buffer.
    All the steps of the entry are re-initialized.
    If the entry found is not an initial entry, the import step for the command file is set to *4000 .
    Before you call this command and its options, consider the effects of changing the import sequence.
    tp cleanbuffer <sapsid>
    This deletes successfully imported change requests from the list of requests that are marked for import into the SAP System <SAPSID>. This function is contained in the commands tp import all <sapsid> and tp put <sapsid> .
    tp delfrombuffer <request> <sapsid>
    If the specified request is marked for import into the specified SAP System, this flag is deleted from the import list.
    Before you call this command, consider the effects of changing the import sequence.
    As of Release 4.6A: If a transport request was only partially imported, you can delete this type of transport request from the buffer. However, if a deleted transport request is placed in the buffer (without having been initially or completely imported), the attributes of the old entry are reactivated. This means the return codes, the unconditional modes and tags of the deleted entry appear in the new entry.
    tp delstopmark <sapsid>
    If the list of requests marked for import into the specified SAP System contains a STOP mark, the mark is deleted.
    tp export <request>
    This exports the complete request from the source system. This command starts the export of a request from the operating system level. Only use this command in exceptional cases. The SAP System uses the command expwbo to release requests from CTS transactions.
    tp reformatbuffer <sapsid> [options]
    This automatically reformats the entire buffer.
    As of Release 4.5A, there are 2 different formats for buffer entries. (As of Release 4.5A, tp can work with both formats, and with a puffer containing heterogeneous entries. As of Release 4.6A, tp can work with 3 formats.)
    However, in certain cases entries with the old formatting have to be reformatted during the normal run of tp . In this case, the entire buffer is automatically reformatted.
    If you use the options downtorelease and Iagree for command reformatbuffer , you can format the buffer so that its formatting is compatible with an older release:
    Option downtorelease <Release>
    The command reformatbuffer with this option formats the buffer so that the formatting corresponds to the one used in an old release. This is necessary if tp writes buffer entries to the buffer of another system, but uses a buffer format that the transport control programs does not understand in this system.
    Since older formats cannot store the same amount of information as the newer ones, some information contained in the original buffer may not be stored in the unformatted buffer. This may lead to data loss.
    To avoid data loss, the original buffer is stored. In addition, you have the following functions:
    Displaying the unformatted buffer (using showbuffer <SID> )
    Displaying the original buffer (using showbuffer buffer=<SID>SAV )
    Accepting the unformatted buffer (using reformatbuffer and the option Iagree yes )
    Resetting the changes (using reformatpuffer and the option Iagree no )
    If you call reformatpuffer using downtorelease , tp displays in detail if information was lost by reformatting, and what that information was. tp also names the commands that is has to execute to accept or reject the changes.
    If you use the option downtorelease , you must also specify the option Iagree with yes or no . You cannot use the transport system until you decide to accept or reject the changes.
    Option Iagree
    Here are the following values for this option:
    yes ( true )
    Accept the change made by tp reformatbuffer <SID> downtorelease <rel>
    In this case, tp deleted the buffer semaphore file that was lifted for security reasons at the first call of reformatbuffer
    no ( false )
    Reject the change made by tp reformatbuffer <SID> downtorelease <rel> In this case, tp copies the backup of the original buffer back and deletes the buffer semaphore file that was lifted for security reasons at the first call of reformatbuffer
    tp setstopmark <sapsid>
    A special STOP mark is added to the list of requests registered for import into the specified SAP System. The commands tp import all <sapsid> and tp put <sapsid> only process the requests in front of this stop mark.
    If there is no stop mark, it is automatically generated by the commands
    tp import all <sapsid> and tp put <sapsid> .
    When all the requests in front of the stop mark have been imported successfully, at the end of all the calls the related marks and the mark itself are deleted.
    A STOP mark can only be placed at the end of the change requests that have already been marked. In addition, it can only be set if no other mark of the same kind already exists.
    tp showparams <sapsid>
    This tp function displays which values the individual parameters of the transport profile have for the current SAP System.
    tp verse <request>
    This creates versions of the objects in the specified request. This transport step is contained in command export .
    As of Release 4.5A, more actions that prepare the export are performed in this step.
    Thanks and Regards,
    Naveen.

  • Transport Request Ended with return code:  === 12 ===

    Hi
    Good day to you.
    We are able to move Transport Request from Development BW Client (with respect to an SEM-BCS Configuration) to Quality BW Client smoothly.
    But when we move the same TR to Production client, we are getting the following error message. I would be very grateful if somebody could throw light on why it is happening, what could be its implications and what to do to avoid the same
      Execution of programs after import (XPRA)
      Transport request   : DBWK901288
      System              : PBW
      tp path             : tp
      Version and release: 340.16.37 640
      Post-import methods for change/transport request: DBWK901288
         on the application server: sapbwpd
      Post-import method FINB_TR_AFTER_IMP_METHOD started for UCREPGROUP T, date and time: 20081029144344
      Post-processing taking place in client 300
      Import carried out using RFC destination PBWCLNT300
      Communication error: Destination PBWCLNT300 -> long text
      Errors occurred during post-handling FINB_TR_AFTER_IMP_METHOD for UCREPGROUP T
      FINB_TR_AFTER_IMP_METHOD belongs to package FINB_TRANSPORT_TOOL
      The errors affect the following components:
         FIN-FB (Financials Basis)
      Post-import method FINB_TR_AFTER_IMP_METHOD completed for UCREPGROUP T, date and time: 20081029144351
      Post-import methods of change/transport request DBWK901288 completed
           Start of subsequent processing ... 20081029144344
           End of subsequent processing... 20081029144351
      Execute reports for change/transport request: DBWK901288
         on the application server: sapbwpd
      There are no reports to execute
      Execution of programs after import (XPRA)
      End date and time : 20081029144351
      Ended with return code:  ===> 12 <===
    Regards
    Siddique

    Hi Siddique,
    Looks like your RFC destination is wrong. The proper syntax is FINBTR@<system>CLNT <client>.
    See also the note 644610.

  • What's wrong with this code (AS3)?

    I want to publish a live stream and, when a button is pressed, publish the same stream for vod.  I haven't been able to get an answer as to whether I can do this...my code is below.  Can someone please tell me if I can do this, or what may be wrong with my code?
    The live stream and playback works fine; but the recording doesn't start.  Also, I want other objects on the client, such as the current camera and audio information, and the aspect ratio being used.  I havent' been able to get these to show up (i.e., the incomingLbl and outgoingLbl do not show up).
    Thank you,
    Phillip A
    My code:
    package {
        import flash.display.MovieClip;
        import flash.net.NetConnection;
        import flash.events.NetStatusEvent; 
        import flash.events.MouseEvent;
        import flash.events.AsyncErrorEvent;
        import flash.net.NetStream;
        import flash.media.Video;
        import flash.media.Camera;
        import flash.media.Microphone;
        import fl.controls.Button;
        import fl.controls.Label;
        import fl.controls.TextArea;
        import fl.controls.CheckBox;
        public class vodcast1 extends MovieClip {
            private var nc:NetConnection;
            private var nc2:NetConnection;
            private var ns:NetStream;
            private var ns2:NetStream;
            private var nsPlayer:NetStream;
            private var vid:Video;
            private var vidPlayer:Video;
            private var cam:Camera;
            private var mic:Microphone;
            private var camr:Camera;
            private var micr:Microphone;
            private var clearBtn:Button;
            private var startRecordBtn:Button;
            private var outgoingLbl:Label;
            private var incomingLbl:Label;
            private var myMetadata:Object;
            private var outputWindow:TextArea;
            private var cb1:CheckBox;
            public function vodcast1(){
                setupUI();
                nc = new NetConnection();
                nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
                nc.connect("rtmp://localhost/publishLive");
                nc2 = new NetConnection();
                nc2.connect("rtmp://localhost/vod/videos");
                nc2.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus2);
            private function startRecordHandler(event:MouseEvent):void {
                publishRecordStream();
            private function onNetStatus(event:NetStatusEvent):void {
                trace(event.target + ": " + event.info.code);
                switch (event.info.code)
                    case "NetConnection.Connect.Success":
                        trace("Congratulations! you're connected to live");
                        publishCamera();
                        displayPublishingVideo();
                        displayPlaybackVideo();
                        break;
                    case "NetStream.Publish.Start":
            // NetStatus handler for Record stream       
            private function onNetStatus2(event:NetStatusEvent):void {
                trace(event.target + ": " + event.info.code);
                switch (event.info.code)
                    case "NetConnection.Connect.Success":
                        trace("Congratulations! you're connected to vod");                   
                        break;
                    case "NetConnection.Connect.Rejected":
                    case "NetConnection.Connect.Failed":
                    trace ("Oops! the connection was rejected");
                        break;
                    case "NetStream.Publish.Start":
                        sendMetadata();
                        break;
            private function asyncErrorHandler(event:AsyncErrorEvent):void {
                trace(event.text);
            private function sendMetadata():void {
                trace("sendMetaData() called")
                myMetadata = new Object();
                myMetadata.customProp = "Recording in progress";
                ns.send("@setDataFrame", "onMetaData", myMetadata);
            private function publishRecordStream():void {
                camr = Camera.getCamera();
                micr = Microphone.getMicrophone();
                ns2 = new NetStream(nc2);
                ns2.client = new Object();
                ns2.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus2);
                ns2.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
                ns2.attachCamera(camr);
                ns2.attachAudio(micr);
                ns2.publish("vodstream", "record");           
            private function publishCamera():void {
                cam = Camera.getCamera();
                mic = Microphone.getMicrophone();
                ns = new NetStream(nc);
                ns.client = this;
                ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
                ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
                ns.attachCamera(cam);
                ns.attachAudio(mic);
                ns.publish("livestream", "live");
            private function displayPublishingVideo():void {
                vid = new Video(cam.width, cam.height);
                vid.x = 10;
                vid.y = 30;
                vid.attachCamera(cam);
                addChild(vid); 
            private function displayPlaybackVideo():void {
                nsPlayer = new NetStream(nc);
                nsPlayer.client = this;
                nsPlayer.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
                nsPlayer.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
                nsPlayer.play("livestream");
                vidPlayer = new Video(cam.width, cam.height);
                vidPlayer.x = cam.width + 100;
                vidPlayer.y = 30;
                vidPlayer.attachNetStream(nsPlayer);
                addChild(vidPlayer);
            private function setupUI():void {
                outputWindow = new TextArea();
                outputWindow.move(250, 175);
                outputWindow.width = 200;
                outputWindow.height = 50;
                outgoingLbl = new Label();
                incomingLbl = new Label();
                outgoingLbl.width = 100;
                incomingLbl.width = 100;
                outgoingLbl.text = "Publishing Stream";
                incomingLbl.text = "Playback Stream";
                outgoingLbl.move(20, 200);
                incomingLbl.move(300, 200);
                outgoingLbl.condenseWhite = true;
                incomingLbl.condenseWhite = true;
                startRecordBtn = new Button();
                startRecordBtn.width = 150;
                startRecordBtn.move(250, 345);
                startRecordBtn.label = "Start Recording";
                startRecordBtn.addEventListener(MouseEvent.CLICK, startRecordHandler);
                //cb1 = new CheckBox();
                //cb1.label = "Record";
                //cb1.move(135,300);
                //cb1.addEventListener(MouseEvent.CLICK,publishRecordStream);
                //clearBtn = new Button();
    //            clearBtn.width = 100;
    //            clearBtn.move(135,345);
    //            clearBtn.label = "Clear Metadata";
    //            clearBtn.addEventListener(MouseEvent.CLICK, clearHandler);
                addChild(outgoingLbl);
                addChild(incomingLbl);
    //            addChild(clearBtn);
                addChild(startRecordBtn);
    //            addChild(cb1);
                addChild(outputWindow);
            public function onMetaData(info:Object):void {
                outputWindow.appendText(info.customProp);

    use event.currentTarget (and you don't need to repeatedly define the same function):
    var c:int;
    var buttonName:String;
    for (c = 1;c < 5;c++) {
         buttonNum = "button"+c;
         this[buttonNum].addEventListener(MouseEvent.MOUSE_DOWN, pressStepButton);
    function pressStepButton(event:MouseEvent) {          trace(event.currentTarget,event.currentTarget.name);     }

  • How to get the ANSI codes in the program

    Hi,
    In my program, I have to get the ANSI codes 30 and 31 in the program. After getting those codes, I have to concatenate with some other text and display in the report.
    Can someone tell me how to get these ANSI codes in the program..?
    Is there any function module to get the ANSI codes in the program. or Is there any other way to get the ANSI codes in the program.
    Please help me. It is quite urgent.
    Thanks in advance,
    Best Regards,
    Pradeep.

    hi check this ....
    How can I get Ascii value of any letter
    How can I get Ascii value of any letter.  Is there any function?
    This is how you do it : 
    report demtest.
    data : c.
    field-symbols : <n> type x.
    data : rn type i.
    c = 'A'.
    assign c to <n> casting.
    move <n> to rn.
    write rn.
    This will convert 'A' to 65.
    Tom Demuyt
    How to convert ascii value to character.
    If I give input as 65 (ascill value) I want display 'A'.
    Below logic is for convert from character to ascii value , now I want to know how to convert ascii value to character.
    Naveen
    report demtest.
    *going from A to 65
    data : c value 'A'.
    field-symbols : <n> type x.
    data : rn type i.
    assign c to <n> casting.
    move <n> to rn.
    write rn.
    *going from 66 to B
    data : i type i value 66.
    data : x type x.
    field-symbols : <fc> type c.
    move i to x.
    assign x to <fc> casting type c.
    move <fc> to c.
    write c.
    regards,
    venkat.

  • Outbound call failing with cause code 57

    Hi,
    our outbound calls to some numbers getting failed with cause code 57 and in ccsip messages i am getting 403 forbidden.
    i tried to change the payload type to 97 which was 98 but no success.
    the called number is 9-8955900
    the calling number is 8062300
    can any one help me..
    the ccsip messages and ccapi inout debug is..
    509022: *Jan  8 14:23:20.513: :FEATURE_VSA attributes are: feature_name:0,featur                                                                                        e_time:1255632752,feature_id:53127
    509023: *Jan  8 14:23:20.513: //678454/xxxxxxxxxxxx/CCAPI/ccIFCallSetupRequestPr                                                                                        ivate:
       SPI Call Setup Request Is Success; Interface Type=9, FlowMode=1
    509024: *Jan  8 14:23:20.513: //678454/xxxxxxxxxxxx/CCAPI/ccCallSetContext:
       Context=0x4AC5D304
    509025: *Jan  8 14:23:20.517: //678454/xxxxxxxxxxxx/CCAPI/cc_api_call_connected:
       Interface=0x48D4E620, Data Bitmask=0x0, Progress Indication=NULL(0),
       Connection Handle=0
    509026: *Jan  8 14:23:20.517: //678454/xxxxxxxxxxxx/CCAPI/cc_api_call_connected:
       Call Entry(Connected=TRUE, Responsed=TRUE, Retry Count=0)
    509027: *Jan  8 14:23:20.537: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
    Received:
    INVITE sip:[email protected]:5060 SIP/2.0
    Via: SIP/2.0/TCP 192.168.12.190:5060;branch=z9hG4bK6aded64034252
    From: "Asif CIPC" <sip:[email protected]>;tag=2524413~70e9433b-1d79-44ae-9a16-                                                                                        09a52be377c5-22878662
    To: <sip:[email protected]>
    Date: Wed, 08 Jan 2014 14:02:15 GMT
    Call-ID: [email protected]
    Supported: timer,resource-priority,replaces
    Min-SE:  1800
    User-Agent: Cisco-CUCM8.6
    Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE,                                                                                         NOTIFY
    CSeq: 101 INVITE
    Expires: 180
    Allow-Events: presence
    Supported: X-cisco-srtp-fallback
    Supported: Geolocation
    Cisco-Guid: 2031538944-0000065536-0000027607-3188500672
    Session-Expires:  1800
    P-Asserted-Identity: "Asif CIPC" <sip:[email protected]>
    Remote-Party-ID: "Asif CIPC" <sip:[email protected]>;party=calling;screen=yes;                                                                                        privacy=off
    Contact: <sip:[email protected]:5060;transport=tcp>
    Max-Forwards: 70
    Content-Type: application/sdp
    Content-Length: 240
    v=0
    o=CiscoSystemsCCM-SIP 2524413 1 IN IP4 192.168.12.190
    s=SIP Call
    c=IN IP4 192.168.33.5
    t=0 0
    m=audio 17706 RTP/AVP 18 101
    a=rtpmap:18 G729/8000
    a=ptime:20
    a=fmtp:18 annexb=no
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    509028: *Jan  8 14:23:20.553: //-1/7916D3000000/CCAPI/cc_api_display_ie_subfield                                                                                        s:
       cc_api_call_setup_ind_common:
       cisco-username=3064
       ----- ccCallInfo IE subfields -----
       cisco-ani=3064
       cisco-anitype=0
       cisco-aniplan=0
       cisco-anipi=0
       cisco-anisi=1
       dest=8955900
       cisco-desttype=0
       cisco-destplan=0
       cisco-rdie=FFFFFFFF
       cisco-rdn=
       cisco-rdntype=0
       cisco-rdnplan=0
       cisco-rdnpi=-1
       cisco-rdnsi=-1
       cisco-redirectreason=-1   fwd_final_type =0
       final_redirectNumber =
       hunt_group_timeout =0
    509029: *Jan  8 14:23:20.553: /
    ASICO-DAM#/-1/7916D3000000/CCAPI/cc_api_call_setup_ind_common:
       Interface=0x48667600, Call Info(
       Calling Number=3064,(Calling Name=)(TON=Unknown, NPI=Unknown, Screening=User,                                                                                         Passed, Presentation=Allowed),
       Called Number=8955900(TON=Unknown, NPI=Unknown),
       Calling Translated=FALSE, Subscriber Type Str=Unknown, FinalDestinationFlag=T                                                                                        RUE,
       Incoming Dial-peer=1, Progress Indication=NULL(0), Calling IE Present=TRUE,
       Source Trkgrp Route Label=, Target Trkgrp Route Label=, CLID Transparent=FALS                                                                                        E), Call Id=678455
    509030: *Jan  8 14:23:20.553: //-1/7916D3000000/CCAPI/ccCheckClipClir:
       In: Calling Number=3064(TON=Unknown, NPI=Unknown, Screening=User, Passed, Pre                                                                                        sentation=Allowed)
    509031: *Jan  8 14:23:20.553: //-1/7916D3000000/CCAPI/ccCheckClipClir:
       Out: Calling Number=3064(TON=Unknown, NPI=Unknown, Screening=User, Passed, Pr                                                                                        esentation=Allowed)
    509032: *Jan  8 14:23:20.553: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509033: *Jan  8 14:23:20.553: :cc_get_feature_vsa malloc success
    509034: *Jan  8 14:23:20.553: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509035: *Jan  8 14:23:20.553:  cc_get_feature_vsa count is 13
    509036: *Jan  8 14:23:20.553: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509037: *Jan  8 14:23:20.553: :FEATURE_VSA attributes are: feature_name:0,featur                                                                                        e_time:1255634768,feature_id:53128
    509038: *Jan  8 14:23:20.553: //678455/7916D3000000/CCAPI/cc_api_call_setup_ind_                                                                                        common:
       Set Up Event Sent;
       Call Info(Calling Number=3064(TON=Unknown, NPI=Unknown, Screening=User, Passe                                                                                        d, Presentation=Allowed),
       Called Number=8955900(TON=Unknown, NPI=Unknown))
    509039: *Jan  8 14:23:20.557: //678455/7916D3000000/CCAPI/cc_process_call_setup_                                                                                        ind:
       Event=0x48EE6200
    509040: *Jan  8 14:23:20.557: //-1/xxxxxxxxxxxx/CCAPI/cc_setupind_match_search:
       Try with the demoted called number 8955900
    509041: *Jan  8 14:23:20.561: //678455/7916D3000000/CCAPI/ccCallSetContext:
       Context=0x476E35D0
    509042: *Jan  8 14:23:20.561: //678455/7916D3000000/CCAPI/cc_process_call_setup_                                                                                        ind:
       >>>>CCAPI handed cid 678455 with tag 1 to app "_ManagedAppProcess_Default"
    509043: *Jan  8 14:23:20.561: //678455/7916D3000000/CCAPI/ccCallProceeding:
       Progress Indication=NULL(0)
    509044: *Jan  8 14:23:20.565: //678455/7916D3000000/CCAPI/ccCallSetupRequest:
       Destination=, Calling IE Present=TRUE, Mode=0,
       Outgoing Dial-peer=20, Params=0x476E4AE0, Progress Indication=NULL(0)
    509045: *Jan  8 14:23:20.565: //678455/7916D3000000/CCAPI/ccCheckClipClir:
       In: Calling Number=8062301(TON=Unknown, NPI=Unknown, Screening=User, Passed,                                                                                         Presentation=Allowed)
    509046: *Jan  8 14:23:20.565: //678455/7916D3000000/CCAPI/ccCheckClipClir:
       Out: Calling Number=8062301(TON=Unknown, NPI=Unknown, Screening=User, Passed,                                                                                         Presentation=Allowed)
    509047: *Jan  8 14:23:20.565: //678455/7916D3000000/CCAPI/ccCallSetupRequest:
       Destination Pattern=.T, Called Number=8955900, Digit Strip=FALSE
    509048: *Jan  8 14:23:20.565: //678455/7916D3000000/CCAPI/ccCallSetupRequest:
       Calling Number=8062301(TON=Unknown, NPI=Unknown, Screening=User, Passed, Pres                                                                                        entation=Allowed),
       Called Number=8955900(TON=Unknown, NPI=Unknown),
       Redirect Number=, Display Info=Asif CIPC
       Account Number=3064, Final Destination Flag=TRUE,
       Guid=7916D300-0001-0000-0000-6BD7BE0CA8C0, Outgoing Dial-peer=20
    509049: *Jan  8 14:23:20.565: //678455/7916D3000000/CCAPI/cc_api_display_ie_subf                                                                                        ields:
       ccCallSetupRequest:
       cisco-username=3064
       ----- ccCallInfo IE subfields -----
       cisco-ani=8062301
       cisco-anitype=0
       cisco-aniplan=0
       cisco-anipi=0
       cisco-anisi=1
       dest=8955900
       cisco-desttype=0
       cisco-destplan=0
       cisco-rdie=FFFFFFFF
       cisco-rdn=
       cisco-rdntype=0
       cisco-rdnplan=0
       cisco-rdnpi=-1
       cisco-rdnsi=-1
       cisco-redirectreason=-1   fwd_final_type =0
       final_redirectNumber =
       hunt_group_timeout =0
    509050: *Jan  8 14:23:20.569: //678455/7916D3000000/CCAPI/ccIFCallSetupRequestPr                                                                                        ivate:
       Interface=0x48667600, Interface Type=3, Destination=, Mode=0x0,
       Call Params(Calling Number=8062301,(Calling Name=Asif CIPC)(TON=Unknown, NPI=                                                                                        Unknown, Screening=User, Passed, Presentation=Allowed),
       Called Number=8955900(TON=Unknown, NPI=Unknown), Calling Translated=FALSE,
       Subscriber Type Str=Unknown, FinalDestinationFlag=TRUE, Outgoing Dial-peer=20                                                                                        , Call Count On=FALSE,
       Source Trkgrp Route Label=, Target Trkgrp Route Label=, tg_label_flag=0, Appl                                                                                        ication Call Id=)
    509051: *Jan  8 14:23:20.569: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509052: *Jan  8 14:23:20.569: :cc_get_feature_vsa malloc success
    509053: *Jan  8 14:23:20.569: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509054: *Jan  8 14:23:20.569:  cc_get_feature_vsa count is 14
    509055: *Jan  8 14:23:20.569: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509056: *Jan  8 14:23:20.569: :FEATURE_VSA attributes are: feature_name:0,featur                                                                                        e_time:1255629840,feature_id:53129
    509057: *Jan  8 14:23:20.569: //678456/7916D3000000/CCAPI/ccIFCallSetupRequestPr                                                                                        ivate:
       SPI Call Setup Request Is Success; Interface Type=3, FlowMode=1
    509058: *Jan  8 14:23:20.573: //678456/7916D3000000/CCAPI/ccCallSetContext:
       Context=0x476E4A90
    509059: *Jan  8 14:23:20.573: //678455/7916D3000000/CCAPI/ccSaveDialpeerTag:
       Outgoing Dial-peer=20
    509060: *Jan  8 14:23:20.577: //678456/7916D3000000/CCAPI/cc_api_call_proceeding                                                                                        :
       Interface=0x48667600, Progress Indication=NULL(0)
    509061: *Jan  8 14:23:20.585: //678456/7916D3000000/SIP/Msg/ccsipDisplayMsg:
    Sent:
    INVITE sip:[email protected]:5060 SIP/2.0
    Via: SIP/2.0/UDP 172..XX.XX.XX:5060;branch=z9hG4bK67CD11AE
    Remote-Party-ID: "Asif CIPC" <sip:[email protected]>;party=calling;screen=ye                                                                                        s;privacy=off
    From: "Asif CIPC" <sip:[email protected]>;tag=EA475228-24AE
    To: <sip:[email protected]>
    Date: Wed, 08 Jan 2014 14:23:20 GMT
    Call-ID: [email protected]
    Supported: timer,resource-priority,replaces,sdp-anat
    Min-SE:  1800
    Cisco-Guid: 2031538944-0000065536-0000027607-3188500672
    User-Agent: Cisco-SIPGateway/IOS-12.x
    Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIF                                                                                        Y, INFO, REGISTER
    CSeq: 101 INVITE
    Timestamp: 1389191000
    Contact: <sip:[email protected]:5060>
    Expires: 180
    Allow-Events: telephone-event
    Max-Forwards: 69
    Session-Expires:  1800
    Content-Type: application/sdp
    Content-Disposition: session;handling=required
    Content-Length: 274
    v=0
    o=CiscoSystemsSIP-GW-UserAgent 5380 1731 IN IP4 172..XX.XX.XX
    s=SIP Call
    c=IN IP4 172..XX.XX.XX
    t=0 0
    m=audio 19502 RTP/AVP 18 101
    c=IN IP4 172..XX.XX.XX
    a=rtpmap:18 G729/8000
    a=fmtp:18 annexb=yes
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    a=ptime:20
    509062: *Jan  8 14:23:20.589: //678455/7916D3000000/SIP/Msg/ccsipDisplayMsg:
    Sent:
    SIP/2.0 100 Trying
    Via: SIP/2.0/TCP 192.168.12.190:5060;branch=z9hG4bK6aded64034252
    From: "Asif CIPC" <sip:[email protected]>;tag=2524413~70e9433b-1d79-44ae-9a16-                                                                                        09a52be377c5-22878662
    To: <sip:[email protected]>
    Date: Wed, 08 Jan 2014 14:23:20 GMT
    Call-ID: [email protected]
    CSeq: 101 INVITE
    Allow-Events: kpml, telephone-event
    Server: Cisco-SIPGateway/IOS-12.x
    Content-Length: 0
    509063: *Jan  8 14:23:20.605: //678456/7916D3000000/SIP/Msg/ccsipDisplayMsg:
    Received:
    SIP/2.0 100 Trying
    Via: SIP/2.0/UDP 172..XX.XX.XX:5060;branch=z9hG4bK67CD11AE
    Call-ID: [email protected]
    From: "Asif CIPC"<sip:[email protected]>;tag=EA475228-24AE
    To: <sip:[email protected]>
    CSeq: 101 INVITE
    Content-Length: 0
    509064: *Jan  8 14:23:20.677: //678456/7916D3000000/SIP/Msg/ccsipDisplayMsg:
    Received:
    SIP/2.0 403 Forbidden
    Via: SIP/2.0/UDP 172..XX.XX.XX:5060;branch=z9hG4bK67CD11AE
    Record-Route: <sip:10.205.20.50:5060;transport=udp;lr>
    Call-ID: [email protected]
    From: "Asif CIPC"<sip:[email protected]>;tag=EA475228-24AE
    To: <sip:[email protected]>;tag=sbc0804k7h28358
    CSeq: 101 INVITE
    Reason: Q.850;cause=57;text="bearer capability not authorized"
    Warning: 399 - "SoftX3000 R601-CCU Rel POS:[3103] Release from CR"
    Content-Length: 0
    509065: *Jan  8 14:23:20.677: //678456/7916D3000000/CCAPI/cc_api_call_disconnect                                                                                        ed:
       Cause Value=57, Interface=0x48667600, Call Id=678456
    509066: *Jan  8 14:23:20.677: //678456/7916D3000000/CCAPI/cc_api_call_disconnect                                                                                        ed:
       Call Entry(Responsed=TRUE, Cause Value=57, Retry Count=0)
    509067: *Jan  8 14:23:20.681: //678455/7916D3000000/CCAPI/ccCallReleaseResources                                                                                        :
       release reserved xcoding resource.
    509068: *Jan  8 14:23:20.681: //678456/7916D3000000/CCAPI/ccCallSetAAA_Accountin                                                                                        g:
       Accounting=0, Call Id=678456
    509069: *Jan  8 14:23:20.681: //678456/7916D3000000/CCAPI/ccCallDisconnect:
       Cause Value=57, Tag=0x0, Call Entry(Previous Disconnect Cause=0, Disconnect C                                                                                        ause=57)
    509070: *Jan  8 14:23:20.681: //678456/7916D3000000/CCAPI/ccCallDisconnect:
       Cause Value=57, Call Entry(Responsed=TRUE, Cause Value=57)
    509071: *Jan  8 14:23:20.681: //678456/7916D3000000/CCAPI/cc_api_call_disconnect                                                                                        _done:
       Disposition=0, Interface=0x48667600, Tag=0x0, Call Id=678456,
       Call Entry(Disconnect Cause=57, Voice Class Cause Code=0, Retry Count=0)
    509072: *Jan  8 14:23:20.685: //678456/7916D3000000/CCAPI/cc_api_call_disconnect                                                                                        _done:
       Call Disconnect Event Sent
    509073: *Jan  8 14:23:20.685: //-1/xxxxxxxxxxxx/CCAPI/cc_free_feature_vsa:
    509074: *Jan  8 14:23:20.685: :cc_free_feature_vsa freeing 4AD76408
    509075: *Jan  8 14:23:20.685: //-1/xxxxxxxxxxxx/CCAPI/cc_free_feature_vsa:
    509076: *Jan  8 14:23:20.685:  vsacount in free is 13
    509077: *Jan  8 14:23:20.685: //678455/7916D3000000/CCAPI/ccCallDisconnect:
       Cause Value=57, Tag=0x0, Call Entry(Previous Disconnect Cause=0, Disconnect C                                                                                        ause=0)
    509078: *Jan  8 14:23:20.689: //678455/7916D3000000/CCAPI/ccCallDisconnect:
       Cause Value=57, Call Entry(Responsed=TRUE, Cause Value=57)
    509079: *Jan  8 14:23:20.693: //678455/7916D3000000/SIP/Msg/ccsipDisplayMsg:
    Sent:
    SIP/2.0 403 Forbidden
    Via: SIP/2.0/TCP 192.168.12.190:5060;branch=z9hG4bK6aded64034252
    From: "Asif CIPC" <sip:[email protected]>;tag=2524413~70e9433b-1d79-44ae-9a16-                                                                                        09a52be377c5-22878662
    To: <sip:[email protected]>;tag=EA475298-106E
    Date: Wed, 08 Jan 2014 14:23:20 GMT
    Call-ID: [email protected]
    CSeq: 101 INVITE
    Allow-Events: kpml, telephone-event
    Server: Cisco-SIPGateway/IOS-12.x
    Reason: Q.850;cause=57
    Content-Length: 0
    509080: *Jan  8 14:23:20.693: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
    Sent:
    ACK sip:[email protected]:5060 SIP/2.0
    Via: SIP/2.0/UDP 172..XX.XX.XX:5060;branch=z9hG4bK67CD11AE
    From: "Asif CIPC" <sip:[email protected]>;tag=EA475228-24AE
    To: <sip:[email protected]>;tag=sbc0804k7h28358
    Date: Wed, 08 Jan 2014 14:23:20 GMT
    Call-ID: [email protected]
    Max-Forwards: 70
    CSeq: 101 ACK
    Allow-Events: telephone-event
    Content-Length: 0
    509081: *Jan  8 14:23:20.709: //678454/xxxxxxxxxxxx/CCAPI/ccCallDisconnect:
       Cause Value=0, Tag=0x0, Call Entry(Previous Disconnect Cause=0, Disconnect Ca                                                                                        use=0)
    509082: *Jan  8 14:23:20.709: //678454/xxxxxxxxxxxx/CCAPI/ccCallDisconnect:
       Cause Value=0, Call Entry(Responsed=TRUE, Cause Value=0)
    509083: *Jan  8 14:23:20.709: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
    Received:
    ACK sip:[email protected]:5060 SIP/2.0
    Via: SIP/2.0/TCP 192.168.12.190:5060;branch=z9hG4bK6aded64034252
    From: "Asif CIPC" <sip:[email protected]>;tag=2524413~70e9433b-1d79-44ae-9a16-                                                                                        09a52be377c5-22878662
    To: <sip:[email protected]>;tag=EA475298-106E
    Date: Wed, 08 Jan 2014 14:02:15 GMT
    Call-ID: [email protected]
    Max-Forwards: 70
    CSeq: 101 ACK
    Allow-Events: presence
    Content-Length: 0
    509084: *Jan  8 14:23:20.713: //678455/7916D3000000/CCAPI/cc_api_call_disconnect                                                                                        _done:
       Disposition=0, Interface=0x48667600, Tag=0x0, Call Id=678455,
       Call Entry(Disconnect Cause=57, Voice Class Cause Code=0, Retry Count=0)
    509085: *Jan  8 14:23:20.717: //678455/7916D3000000/CCAPI/cc_api_call_disconnect                                                                                        _done:
       Call Disconnect Event Sent
    509086: *Jan  8 14:23:20.717: //-1/xxxxxxxxxxxx/CCAPI/cc_free_feature_vsa:
    509087: *Jan  8 14:23:20.717: :cc_free_feature_vsa freeing 4AD77748
    509088: *Jan  8 14:23:20.717: //-1/xxxxxxxxxxxx/CCAPI/cc_free_feature_vsa:
    509089: *Jan  8 14:23:20.717:  vsacount in free is 12
    509090: *Jan  8 14:23:20.721: //678454/xxxxxxxxxxxx/CCAPI/cc_api_call_disconnect                                                                                        _done:
       Disposition=0, Interface=0x48D4E620, Tag=0x0, Call Id=678454,
       Call Entry(Disconnect Cause=0, Voice Class Cause Code=0, Retry Count=0)
    509091: *Jan  8 14:23:20.721: //678454/xxxxxxxxxxxx/CCAPI/cc_api_call_disconnect                                                                                        _done:
       Call Disconnect Event Sent
    509092: *Jan  8 14:23:20.721: //-1/xxxxxxxxxxxx/CCAPI/cc_free_feature_vsa:
    509093: *Jan  8 14:23:20.721: :cc_free_feature_vsa freeing 4AD76F68
    509094: *Jan  8 14:23:20.721: //-1/xxxxxxxxxxxx/CCAPI/cc_free_feature_vsa:
    509095: *Jan  8 14:23:20.721:  vsacount in free is 11
    509096: *Jan  8 14:23:20.725: //-1/xxxxxxxxxxxx/CCAPI/ccIFCallSetupRequestPrivat                                                                                        e:
       Interface=0x48D4E620, Interface Type=9, Destination=0.0.0.0, Mode=0x0,
       Call Params(Calling Number=,(Calling Name=)(TON=Unknown, NPI=Unknown, Screeni                                                                                        ng=Not Screened, Presentation=Allowed),
       Called Number=(TON=Unknown, NPI=Unknown), Calling Translated=FALSE,
       Subscriber Type Str=, FinalDestinationFlag=FALSE, Outgoing Dial-peer=0, Call                                                                                         Count On=FALSE,
       Source Trkgrp Route Label=, Target Trkgrp Route Label=, tg_label_flag=0, Appl                                                                                        ication Call Id=)
    509097: *Jan  8 14:23:20.725: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509098: *Jan  8 14:23:20.725: :cc_get_feature_vsa malloc success
    509099: *Jan  8 14:23:20.725: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509100: *Jan  8 14:23:20.729:  cc_get_feature_vsa count is 12
    509101: *Jan  8 14:23:20.729: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509102: *Jan  8 14:23:20.729: :FEATURE_VSA attributes are: feature_name:0,featur                                                                                        e_time:1255632752,feature_id:53130
    509103: *Jan  8 14:23:20.729: //678457/xxxxxxxxxxxx/CCAPI/ccIFCallSetupRequestPr                                                                                        ivate:
       SPI Call Setup Request Is Success; Interface Type=9, FlowMode=1
    509104: *Jan  8 14:23:20.729: //678457/xxxxxxxxxxxx/CCAPI/ccCallSetContext:
       Context=0x4AC5D1C4
    509105: *Jan  8 14:23:20.729: //678457/xxxxxxxxxxxx/CCAPI/cc_api_call_connected:
       Interface=0x48D4E620, Data Bitmask=0x0, Progress Indication=NULL(0),
       Connection Handle=0
    509106: *Jan  8 14:23:20.729: //678457/xxxxxxxxxxxx/CCAPI/cc_api_call_connected:
       Call Entry(Connected=TRUE, Responsed=TRUE, Retry Count=0)
    509107: *Jan  8 14:23:20.753: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
    Received:
    INVITE sip:[email protected]:5060 SIP/2.0
    Via: SIP/2.0/TCP 192.168.12.190:5060;branch=z9hG4bK6adee3e42a498
    From: "Asif CIPC" <sip:[email protected]>;tag=2524415~70e9433b-1d79-44ae-9a16-                                                                                        09a52be377c5-22878662
    To: <sip:[email protected]>
    Date: Wed, 08 Jan 2014 14:02:15 GMT
    Call-ID: [email protected]
    Supported: timer,resource-priority,replaces
    Min-SE:  1800
    User-Agent: Cisco-CUCM8.6
    Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE,                                                                                         NOTIFY
    CSeq: 101 INVITE
    Expires: 180
    Allow-Events: presence
    Supported: X-cisco-srtp-fallback
    Supported: Geolocation
    Cisco-Guid: 2031538944-0000065536-0000027608-3188500672
    Session-Expires:  1800
    P-Asserted-Identity: "Asif CIPC" <sip:[email protected]>
    Remote-Party-ID: "Asif CIPC" <sip:[email protected]>;party=calling;screen=yes;                                                                                        privacy=off
    Contact: <sip:[email protected]:5060;transport=tcp>
    Max-Forwards: 70
    Content-Type: application/sdp
    Content-Length: 240
    v=0
    o=CiscoSystemsCCM-SIP 2524415 1 IN IP4 192.168.12.190
    s=SIP Call
    c=IN IP4 192.168.33.5
    t=0 0
    m=audio 17932 RTP/AVP 18 101
    a=rtpmap:18 G729/8000
    a=ptime:20
    a=fmtp:18 annexb=no
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    509108: *Jan  8 14:23:20.769: //-1/7916D3000000/CCAPI/cc_api_display_ie_subfield                                                                                        s:
       cc_api_call_setup_ind_common:
       cisco-username=3064
       ----- ccCallInfo IE subfields -----
       cisco-ani=3064
       cisco-anitype=0
       cisco-aniplan=0
       cisco-anipi=0
       cisco-anisi=1
       dest=8955900
       cisco-desttype=0
       cisco-destplan=0
       cisco-rdie=FFFFFFFF
       cisco-rdn=
       cisco-rdntype=0
       cisco-rdnplan=0
       cisco-rdnpi=-1
       cisco-rdnsi=-1
       cisco-redirectreason=-1   fwd_final_type =0
       final_redirectNumber =
       hunt_group_timeout =0
    509109: *Jan  8 14:23:20.769: //-1/7916D3000000/CCAPI/cc_api_call_setup_ind_comm                                                                                        on:
       Interface=0x48667600, Call Info(
       Calling Number=3064,(Calling Name=)(TON=Unknown, NPI=Unknown, Screening=User,                                                                                         Passed, Presentation=Allowed),
       Called Number=8955900(TON=Unknown, NPI=Unknown),
       Calling Translated=FALSE, Subscriber Type Str=Unknown, FinalDestinationFlag=T                                                                                        RUE,
       Incoming Dial-peer=1, Progress Indication=NULL(0), Calling IE Present=TRUE,
       Source Trkgrp Route Label=, Target Trkgrp Route Label=, CLID Transparent=FALS                                                                                        E), Call Id=678458
    509110: *Jan  8 14:23:20.769: //-1/7916D3000000/CCAPI/ccCheckClipClir:
       In: Calling Number=3064(TON=Unknown, NPI=Unknown, Screening=User, Passed, Pre                                                                                        sentation=Allowed)
    509111: *Jan  8 14:23:20.773: //-1/7916D3000000/CCAPI/ccCheckClipClir:
       Out: Calling Number=3064(TON=Unknown, NPI=Unknown, Screening=User, Passed, Pr                                                                                        esentation=Allowed)
    509112: *Jan  8 14:23:20.773: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509113: *Jan  8 14:23:20.773: :cc_get_feature_vsa malloc success
    509114: *Jan  8 14:23:20.773: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509115: *Jan  8 14:23:20.773:  cc_get_feature_vsa count is 13
    509116: *Jan  8 14:23:20.773: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509117: *Jan  8 14:23:20.773: :FEATURE_VSA attributes are: feature_name:0,featur                                                                                        e_time:1255634768,feature_id:53131
    509118: *Jan  8 14:23:20.773: //678458/7916D3000000/CCAPI/cc_api_call_setup_ind_                                                                                        common:
       Set Up Event Sent;
       Call Info(Calling Number=3064(TON=Unknown, NPI=Unknown, Screening=User, Passe                                                                                        d, Presentation=Allowed),
       Called Number=8955900(TON=Unknown, NPI=Unknown))
    509119: *Jan  8 14:23:20.773: //678458/7916D3000000/CCAPI/cc_process_call_setup_                                                                                        ind:
       Event=0x48EE6200
    509120: *Jan  8 14:23:20.777: //-1/xxxxxxxxxxxx/CCAPI/cc_setupind_match_search:
       Try with the demoted called number 8955900
    509121: *Jan  8 14:23:20.777: //678458/7916D3000000/CCAPI/ccCallSetContext:
       Context=0x476D5190
    509122: *Jan  8 14:23:20.777: //678458/7916D3000000/CCAPI/cc_process_call_setup_                                                                                        ind:
       >>>>CCAPI handed cid 678458 with tag 1 to app "_ManagedAppProcess_Default"
    509123: *Jan  8 14:23:20.777: //678458/7916D3000000/CCAPI/ccCallProceeding:
       Progress Indication=NULL(0)
    509124: *Jan  8 14:23:20.781: //678458/7916D3000000/CCAPI/ccCallSetupRequest:
       Destination=, Calling IE Present=TRUE, Mode=0,
       Outgoing Dial-peer=20, Params=0x476DCE60, Progress Indication=NULL(0)
    509125: *Jan  8 14:23:20.781: //678458/7916D3000000/CCAPI/ccCheckClipClir:
       In: Calling Number=8062301(TON=Unknown, NPI=Unknown, Screening=User, Passed,                                                                                         Presentation=Allowed)
    509126: *Jan  8 14:23:20.781: //678458/7916D3000000/CCAPI/ccCheckClipClir:
       Out: Calling Number=8062301(TON=Unknown, NPI=Unknown, Screening=User, Passed,                                                                                         Presentation=Allowed)
    509127: *Jan  8 14:23:20.785: //678458/7916D3000000/CCAPI/ccCallSetupRequest:
       Destination Pattern=.T, Called Number=8955900, Digit Strip=FALSE
    509128: *Jan  8 14:23:20.785: //678458/7916D3000000/CCAPI/ccCallSetupRequest:
       Calling Number=8062301(TON=Unknown, NPI=Unknown, Screening=User, Passed, Pres                                                                                        entation=Allowed),
       Called Number=8955900(TON=Unknown, NPI=Unknown),
       Redirect Number=, Display Info=Asif CIPC
       Account Number=3064, Final Destination Flag=TRUE,
       Guid=7916D300-0001-0000-0000-6BD8BE0CA8C0, Outgoing Dial-peer=20
    509129: *Jan  8 14:23:20.785: //678458/7916D3000000/CCAPI/cc_api_display_ie_subf                                                                                        ields:
       ccCallSetupRequest:
       cisco-username=3064
       ----- ccCallInfo IE subfields -----
       cisco-ani=8062301
       cisco-anitype=0
       cisco-aniplan=0
       cisco-anipi=0
       cisco-anisi=1
       dest=8955900
       cisco-desttype=0
       cisco-destplan=0
       cisco-rdie=FFFFFFFF
       cisco-rdn=
       cisco-rdntype=0
       cisco-rdnplan=0
       cisco-rdnpi=-1
       cisco-rdnsi=-1
       cisco-redirectreason=-1   fwd_final_type =0
       final_redirectNumber =
       hunt_group_timeout =0
    509130: *Jan  8 14:23:20.785: //678458/7916D3000000/CCAPI/ccIFCallSetupRequestPr                                                                                        ivate:
       Interface=0x48667600, Interface Type=3, Destination=, Mode=0x0,
       Call Params(Calling Number=8062301,(Calling Name=Asif CIPC)(TON=Unknown, NPI=                                                                                        Unknown, Screening=User, Passed, Presentation=Allowed),
       Called Number=8955900(TON=Unknown, NPI=Unknown), Calling Translated=FALSE,
       Subscriber Type Str=Unknown, FinalDestinationFlag=TRUE, Outgoing Dial-peer=20                                                                                        , Call Count On=FALSE,
       Source Trkgrp Route Label=, Target Trkgrp Route Label=, tg_label_flag=0, Appl                                                                                        ication Call Id=)
    509131: *Jan  8 14:23:20.785: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509132: *Jan  8 14:23:20.785: :cc_get_feature_vsa malloc success
    509133: *Jan  8 14:23:20.785: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509134: *Jan  8 14:23:20.785:  cc_get_feature_vsa count is 14
    509135: *Jan  8 14:23:20.785: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
    509136: *Jan  8 14:23:20.785: :FEATURE_VSA attributes are: feature_name:0,featur                                                                                        e_time:1255629840,feature_id:53132
    509137: *Jan  8 14:23:20.789: //678459/7916D3000000/CCAPI/ccIFCallSetupRequestPr                                                                                        ivate:
       SPI Call Setup Request Is Success; Interface Type=3, FlowMode=1
    509138: *Jan  8 14:23:20.789: //678459/7916D3000000/CCAPI/ccCallSetContext:
       Context=0x476DCE10
    509139: *Jan  8 14:23:20.789: //678458/7916D3000000/CCAPI/ccSaveDialpeerTag:
       Outgoing Dial-peer=20
    509140: *Jan  8 14:23:20.793: //678459/7916D3000000/CCAPI/cc_api_call_proceeding                                                                                        :
       Interface=0x48667600, Progress Indication=NULL(0)
    509141: *Jan  8 14:23:20.801: //678459/7916D3000000/SIP/Msg/ccsipDisplayMsg:
    Sent:
    INVITE sip:[email protected]:5060 SIP/2.0
    Via: SIP/2.0/UDP 172..XX.XX.XX:5060;branch=z9hG4bK67CE197B
    Remote-Party-ID: "Asif CIPC" <sip:[email protected]>;party=calling;screen=ye                                                                                        s;privacy=off
    From: "Asif CIPC" <sip:[email protected]>;tag=EA475304-26C5
    To: <sip:[email protected]>
    Date: Wed, 08 Jan 2014 14:23:20 GMT
    Call-ID: [email protected]
    Supported: timer,resource-priority,replaces,sdp-anat
    Min-SE:  1800
    Cisco-Guid: 2031538944-0000065536-0000027608-3188500672
    User-Agent: Cisco-SIPGateway/IOS-12.x
    Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIF                                                                                        Y, INFO, REGISTER
    CSeq: 101 INVITE
    Timestamp: 1389191000
    Contact: <sip:[email protected]:5060>
    Expires: 180
    Allow-Events: telephone-event
    Max-Forwards: 69
    Session-Expires:  1800
    Content-Type: application/sdp
    Content-Disposition: session;handling=required
    Content-Length: 274
    v=0
    o=CiscoSystemsSIP-GW-UserAgent 9218 9584 IN IP4 172..XX.XX.XX
    s=SIP Call
    c=IN IP4 172..XX.XX.XX
    t=0 0
    m=audio 16868 RTP/AVP 18 101
    c=IN IP4 172..XX.XX.XX
    a=rtpmap:18 G729/8000
    a=fmtp:18 annexb=yes
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    a=ptime:20
    509142: *Jan  8 14:23:20.805: //678458/7916D3000000/SIP/Msg/ccsipDisplayMsg:
    Sent:
    509163: *Jan  8 14:23:20.945: //678458/7916D3000000/CCAPI/cc_api_call_disconnect                                                                                        _done:
       Call Disconnect Event Sent
    509164: *Jan  8 14:23:20.945: //-1/xxxxxxxxxxxx/CCAPI/cc_free_feature_vsa:
    509165: *Jan  8 14:23:20.945: :cc_free_feature_vsa freeing 4AD77748
    509166: *Jan  8 14:23:20.945: //-1/xxxxxxxxxxxx/CCAPI/cc_free_feature_vsa:
    509167: *Jan  8 14:23:20.945:  vsacount in free is 12
    509168: *Jan  8 14:23:32.517: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
    Received:
    OPTIONS sip:172..XX.XX.XX:5060 SIP/2.0
    Via: SIP/2.0/UDP 10.205.20.50:5060;branch=z9hG4bKhs8ak5845ch42p7cff35k1ap3T02677
    Call-ID: isbchh12748fcsk155w58p151kks36fww24s@SoftX3000
    From: <sip:172..XX.XX.XX:5060>;tag=sbc0806pa8fp7w7
    To: <sip:172..XX.XX.XX>
    CSeq: 1 OPTIONS
    Max-Forwards: 70
    Content-Length: 0
    509169: *Jan  8 14:23:32.525: //678460/495AB05FB187/SIP/Msg/ccsipDisplayMsg:
    Sent:
    SIP/2.0 200 OK
    Via: SIP/2.0/UDP 10.205.20.50:5060;branch=z9hG4bKhs8ak5845ch42p7cff35k1ap3T02677
    From: <sip:172..XX.XX.XX:5060>;tag=sbc0806pa8fp7w7
    To: <sip:172..XX.XX.XX>;tag=EA4780CC-582
    Date: Wed, 08 Jan 2014 14:23:32 GMT
    Call-ID: isbchh12748fcsk155w58p151kks36fww24s@SoftX3000
    Server: Cisco-SIPGateway/IOS-12.x
    CSeq: 1 OPTIONS
    Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIF                                                                                        Y, INFO, REGISTER
    Allow-Events: telephone-event
    Accept: application/sdp
    Supported: timer,resource-priority,replaces,sdp-anat
    Content-Type: application/sdp
    Content-Length: 170
    v=0
    o=CiscoSystemsSIP-GW-UserAgent 8937 2437 IN IP4 172..XX.XX.XX
    s=SIP Call
    c=IN IP4 192.168.33.5
    t=0 0
    m=audio 0 RTP/AVP 18 0 8 9 4 2 15 3
    c=IN IP4 192.168.33.5
    u all
    and the config is
    voice service voip
    ip address trusted list
      ipv4 172.XX.XX.XX 255.255.255.255
    dtmf-interworking rtp-nte
    allow-connections h323 to h323
    allow-connections h323 to sip
    allow-connections sip to h323
    allow-connections sip to sip
    no supplementary-service h450.2
    no supplementary-service h450.3
    no supplementary-service h225-notify cid-update
    redirect ip2ip
    h323
      session transport udp
      h245 tunnel disable
    sip
      session transport tcp
      rel1xx disable
      registrar server expires max 3600 min 3500
      transport switch udp tcp
      redirect contact order best-match
      asymmetric payload full
      g729 annexb-all
    voice class codec 1
    codec preference 1 g711alaw
    codec preference 2 g711ulaw
    codec preference 3 g729r8
    codec preference 4 g729br8
    and the dial-peer through the calls will go out is
    dial-peer voice 20 voip
    description ***TO-OUT***
    translation-profile outgoing OUT-SIP
    destination-pattern .T
    progress_ind progress enable 8
    rtp payload-type cisco-codec-fax-ack 112
    rtp payload-type nte 97
    session protocol sipv2
    session target ipv4:10.205.20.50:5060
    session transport udp
    voice-class codec 1
    voice-class sip bind control source-interface FastEthernet0/0
    voice-class sip bind media source-interface FastEthernet0/0
    dtmf-relay rtp-nte
    no vad

    Hi Nadeem,
    our setup is like
                                                                vpn link
    call manager ------head office(router)----------------------------------brach router(gateway)------------------ip phone(branch)
    The call flow is
                                                                                                                  sip
    IP Phone---->brach GW-------------->call manager------------------>branch GW------------------->ITSP
    there is no subscriber at branch side, so the outbound call should travel to call manager at head office and then get exit from branch gateway to ITSP through sip line.

  • Creating a long text using ABAP code.. fm SAVE_TEXT

    When you create an order via IW31 one of the options is to click on the text button and create a long text. I am basically trying to mimic this action from within my ABAP code.
    The text id details are as follows:
    Text Name       500000015000046  which is (5000000 + order number)
    Language        EN
    Text ID            KOPF         Order header text
    Text Object      AUFK       Order text
    If i manually create the text within the transaction i am then able to view and update it via function modules READ_TEXT and SAVE_TEXT. But if the text has not already been created READ_TEXT obviously returns nothing as it does not exist and SAVE_TEXT does not seem to created it!
    Anyone know how i would go about creating this text using ABAP code?
    Hope this make a bit of sense
    Thanks in advance
    Mart

    I have implemented the code as i think it should be. See below, can any see what is wrong. If i add init_text it makes no difference and adding the commit_text just makes it hang
    DATA: IT_TEXTS type standard table of TLINE,
           wa_texts like line of it_texts,
           wa_txtheader type THEAD.
    wa_txtheader-TDID     = 'KOPF'.
    wa_txtheader-TDSPRAS  = 'EN'.
    wa_txtheader-TDNAME   = '500000015000056'.
    wa_txtheader-TDOBJECT = 'AUFK'.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
      wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
      wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
        CLIENT                = SY-MANDT
        HEADER                = wa_txtheader
        INSERT                = 'X'
       SAVEMODE_DIRECT       = ' '
       OWNER_SPECIFIED       = 'X'
      LOCAL_CAT             = ' '
    IMPORTING
      FUNCTION              =
      NEWHEADER             =
      TABLES
        LINES                 = IT_TEXTS
    EXCEPTIONS
       ID                    = 1
       LANGUAGE              = 2
       NAME                  = 3
       OBJECT                = 4
       OTHERS                = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Failed to Open FR report With Error code 500 - 'unable to process request'

    I am running a load test against PBCS service. The service is load-balanced with 2 managed servers : EPMServer0 and EPMServer1
    When I put the loads with 60 VUs -- all visiting FR reports, the service runs without error. But when the VU# increased to 90, it began to respond with Error code 500  - 'unable to process request'.
    I tried to correlate the FRLogging logs to the errors, and found during the time those error happens, there are logs like this:
    >>>>>>>>>>>>>>>>>>>>>>>>>>
    [2013-09-27T05:21:29.325+00:00] [EPMServer0] [WARNING] [00365] [oracle.EPMFR.core] [tid: [ACTIVE].ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: sysname50134114.PerfUser0439] [ecid: 004tpQ^VFHT7m3RLIYDCif0007a30002bD,0:2:1:1] [APP: FINANCIALREPORTING#11.1.2.0] [SRC_CLASS: com.hyperion.reporting.connection.UserConnection] [SRC_METHOD: openConnection] User authentication information is invalid. Unable to connect to datasource.[[
    com.hyperion.reporting.util.HyperionReportException: Error connecting to database connection Vision:Plan1: Failed to sync with user provisioning.com.hyperion.planning.HspRuntimeException
            at com.hyperion.reporting.connection.UserConnection.openConnection(Unknown Source)
            at com.hyperion.reporting.connection.UserConnection.openConnection(Unknown Source)
            at com.hyperion.reporting.connection.UserConnection.<init>(Unknown Source)
            at com.hyperion.reporting.connection.ConnectionManager.getConnection(Unknown Source)
            at com.hyperion.reporting.connection.ConnectionManager.getCube(Unknown Source)
            at com.hyperion.reporting.connection.ConnectionManager.getCube(Unknown Source)
            at com.hyperion.reporting.webviewer.WebDynamicReport.validateDatasources(Unknown Source)
        at jsp_servlet._modules._com._hyperion._reporting._web._reportviewer.__hrhtmlreport._jspService(__hrhtmlreport.java:1999)
            at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
            at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
            at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
            at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
            at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at com.hyperion.reporting.webviewer.HRSecurePagesFilter.needAuthentication(Unknown Source)
            at com.hyperion.reporting.webviewer.HRSecurePagesFilter.doFilter(Unknown Source)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at com.hyperion.reporting.webviewer.FRClusterHelper.doFilter(Unknown Source)
    >>>>>>>>>>>>>>>>>>>>>>>>>
    It looks like the servlet failed to open the datasource connection while handling the FR requests. But there are several data sources. My questions are:
    1) Which datasource is corresponding to the issue? Is it EPMSystemRegistry?
    2) What is the recommended configuration for the connection pool max capacity setting? -- current setting for EPMSystemRegistry is 30
    3) Whether it could be a connection leak problem as only 90 concurrent end user is visiting and it failed to connect?
    Thanks,
    Ellick Lu
    Type
    JNDI Name
    Targets
    aif_datasource
    Generic
    jdbc/aif_datasource
    EPMServer
    calc_datasource
    Generic
    jdbc/calc_datasource
    EPMServer
    EPMSystemRegistry
    Generic
    jdbc/EPMSystemRegistry
    EPMServer
    odiMasterRepository
    Generic
    jdbc/odiMasterRepository
    EPMServer
    planning_datasource
    Generic
    jdbc/planning_datasource
    EPMServer
    raframework_datasource
    Generic
    jdbc/raframework_datasource
    EPMServer

    It is checking for Database connection in Workspace. Check Editing Database Connections
    Can those users login to Planning? Do they have correct security setup (I guess not)
    Regards
    Celvin
    http://www.orahyplabs.com

  • How can I export speech analysis text with imbedded timecodes for the creation of subtitle files?

    I found a script that allows you to export all your text layers with time codes as a .srt subtitle file. However, instead of multiple text layers, I have only one: essentially the meta data from Premiere speech analysis that with the aid of a different script, is being used at a "subtitle layer". Essentially, I'm trying to use this data to create a .srt file so I can create actual subtitles, not this hybrid animation/text layer.
    Here is the script I used to export the text layer to .srt:
    Subtitle Exporter v01  
    Script by Philipp Grolle
    www.display-artists.de
    Instructions:
    Select all the Text Layers you want to export, run the script, and save the file as .srt
    Attention: The Script has not been debugged or testet. Try it on your own risk!
    // get all the selected Layers
    var theComp = app.project.activeItem;
    var alleLayer = theComp.selectedLayers;
    // count how many layers are selected
    var anzahlLayer = alleLayer.length;
    // Enable the line below if you want to change the order of your text (ascending / descending)
    /* alleLayer.reverse(); */
       // prompt to save file
       var theFile = File.saveDialog("Save the text file.", "untitled.txt", "TEXT txt");
       // if user didn't cancel...
       if (theFile != null) {
          // open file for "w"riting,
          theFile.open("w","TEXT","????");
             // Do it for all the selected Layers
             for (x = 0; x < anzahlLayer; x++)
                 // get In- and Outpoint of the current Layer and convert to timecode (00:00:00:00)
                var timecodeIn = timeToCurrentFormat(alleLayer[x].inPoint, 25);
                var timecodeOut = timeToCurrentFormat(alleLayer[x].outPoint, 25);
               // split the value of the inPoint; converting last 2 characters  (frames) to milliseconds, and finally join it again with comma instead of colon
                var str_in= timecodeIn;
                var timeCodeAnfang_in=str_in.slice(0,8);
                var timeCodeEnde_in=str_in.slice(9,11);
                var millisek_in = timeCodeEnde_in*40; // 1000 milliseconds divided by 25 fps = 40
                var zusammen_in = timeCodeAnfang_in +"," + millisek_in;
                //split the value of the outPoint; converting last 2 characters  (frames) to milliseconds, and finally join it again with comma instead of colon
                var str_out= timecodeOut;
                var timeCodeAnfang_out=str_out.slice(0,8);
                var timeCodeEnde_out=str_out.slice(9,11);
                var millisek_out = timeCodeEnde_out*40;
                var zusammen_out = timeCodeAnfang_out +"," + millisek_out;
                //counter for the number above the timecode (in the results)
                var zaehler = x+1;
                //writing the results to file
                theFile.write(zaehler);
                theFile.write("\r\n");
                theFile.write(zusammen_in);
                theFile.write(" --> ");
                theFile.write(zusammen_out);
                theFile.write("\r\n");
                theFile.write(alleLayer[x].property("Source Text").value);          
                theFile.write("\r\n\n");
          // close the text file
          theFile.close();
          // open text file in default app
          theFile.execute();
    As I am only using one text layer, it shows me only one continious subtitle in the .srt file. Does anyone have any suggestions?

    I should add that I myself am not particularly familiar with scripts or scripting, I'm merely trying all possible solutions to my problem and this seems to be a good approach. Any help would be much appreciated.

  • Can anybody help me to build an interface that can work with this code

    please help me to build an interface that can work with this code
    import java.util.Map;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.FileReader;
    public class Translate
    public static void main(String [] args) throws IOException
    if (args.length != 2)
    System.err.println("usage: Translate wordmapfile textfile");
    System.exit(1);
    try
    HashMap words = ReadHashMapFromFile(args[0]);
    System.out.println(ProcessFile(words, args[1]));
    catch (Exception e)
    e.printStackTrace();
    // static helper methods
    * Reads a file into a HashMap. The file should contain lines of the format
    * "key\tvalue\n"
    * @returns a hashmap of the given file
    @SuppressWarnings("unchecked")
    private static HashMap ReadHashMapFromFile(String filename) throws FileNotFoundException, IOException
    BufferedReader in = null;
    HashMap map = null;
    try
    in = new BufferedReader(new FileReader(filename));
    String line;
    map = new HashMap();
    while ((line = in.readLine()) != null)
    String[] fields = line.split("
    t", 2);
    if (fields.length != 2) continue; //just ignore "invalid" lines
    map.put(fields[0], fields[1]);
    finally
    if(in!=null) in.close(); //may throw IOException
    return(map); //returning a reference to local variable is safe in java (unlike C/C++)
    * Process the given file
    * @returns String contains the whole file.
    private static String ProcessFile(Map words, String filename) throws FileNotFoundException, IOException
    BufferedReader in = null;
    StringBuffer out = null;
    try
    in = new BufferedReader(new FileReader(filename));
    out = new StringBuffer();
    String line = null;
    while( (line=in.readLine()) != null )
    out.append(SearchAndReplaceWordsInText(words, line)+"\n");
    finally
    if(in!=null) in.close(); //may throw IOException
    return out.toString();
    * Replaces all occurrences in text of each key in words with it's value.
    * @returns String
    private static String SearchAndReplaceWordsInText(Map words, String text)
    Iterator it = words.keySet().iterator();
    while( it.hasNext() )
    String key = (String)it.next();
    text = text.replaceAll("\\b"key"
    b", (String)words.get(key));
    return text;
    * @returns: s with the first letter capitalized
    String capitalize(String s)
    return s.substring(0,0).toUpperCase() + s.substring(1);
    }... here's the head of my pirate_words_map.txt
    hello               ahoy
    hi                    yo-ho-ho
    pardon me       avast
    excuse me       arrr
    yes                 aye
    my                 me
    friend             me bucko
    sir                  matey
    madam           proud beauty
    miss comely    wench
    where             whar
    is                    be
    are                  be
    am                  be
    the                  th'
    you                 ye
    your                yer
    tell                be tellin'

    please help me i don t know how to go about this.my teacher ask me to build an interface that work with the code .
    Here is the interface i just build
    import java.util.Map;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.awt.*;
    import javax.swing.*;
    public class boy extends JFrame
    JTextArea englishtxt;
    JLabel head,privatetxtwords;
    JButton translateengtoprivatewords;
    Container c1;
    public boy()
            super("HAKIMADE");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setBackground(Color.white);
            setLocationRelativeTo(null);
            c1 = getContentPane();
             head = new JLabel(" English to private talk Translator");
             englishtxt = new JTextArea("Type your text here", 10,50);
             translateengtoprivatewords = new JButton("Translate");
             privatetxtwords = new JLabel();
            JPanel headlabel = new JPanel();
            headlabel.setLayout(new FlowLayout(FlowLayout.CENTER));
            headlabel.add(head);
            JPanel englishtxtpanel = new JPanel();
            englishtxtpanel.setLayout(new FlowLayout(FlowLayout.CENTER,10,40));
            englishtxtpanel.add(englishtxt);
             JPanel panel1 = new JPanel();
             panel1.setLayout(new BorderLayout());
             panel1.add(headlabel,BorderLayout.NORTH);
             panel1.add(englishtxtpanel,BorderLayout.CENTER);
            JPanel translateengtoprivatewordspanel = new JPanel();
            translateengtoprivatewordspanel.setLayout(new FlowLayout(FlowLayout.CENTER,10,40));
            translateengtoprivatewordspanel.add(translateengtoprivatewords);
             JPanel panel2 = new JPanel();
             panel2.setLayout(new BorderLayout());
             panel2.add(translateengtoprivatewordspanel,BorderLayout.NORTH);
             panel2.add(privatetxtwords,BorderLayout.CENTER);
             JPanel mainpanel = new JPanel();
             mainpanel.setLayout(new BorderLayout());
             mainpanel.add(panel1,BorderLayout.NORTH);
             mainpanel.add(panel2,BorderLayout.CENTER);
             c1.add(panel1, BorderLayout.NORTH);
             c1.add(panel2);
    public static void main(final String args[])
            boy  mp = new boy();
             mp.setVisible(true);
    }..............here is the code,please make this interface work with the code
    public class Translate
    public static void main(String [] args) throws IOException
    if (args.length != 2)
    System.err.println("usage: Translate wordmapfile textfile");
    System.exit(1);
    try
    HashMap words = ReadHashMapFromFile(args[0]);
    System.out.println(ProcessFile(words, args[1]));
    catch (Exception e)
    e.printStackTrace();
    // static helper methods
    * Reads a file into a HashMap. The file should contain lines of the format
    * "key\tvalue\n"
    * @returns a hashmap of the given file
    @SuppressWarnings("unchecked")
    private static HashMap ReadHashMapFromFile(String filename) throws FileNotFoundException, IOException
    BufferedReader in = null;
    HashMap map = null;
    try
    in = new BufferedReader(new FileReader(filename));
    String line;
    map = new HashMap();
    while ((line = in.readLine()) != null)
    String[] fields = line.split("
    t", 2);
    if (fields.length != 2) continue; //just ignore "invalid" lines
    map.put(fields[0], fields[1]);
    finally
    if(in!=null) in.close(); //may throw IOException
    return(map); //returning a reference to local variable is safe in java (unlike C/C++)
    * Process the given file
    * @returns String contains the whole file.
    private static String ProcessFile(Map words, String filename) throws FileNotFoundException, IOException
    BufferedReader in = null;
    StringBuffer out = null;
    try
    in = new BufferedReader(new FileReader(filename));
    out = new StringBuffer();
    String line = null;
    while( (line=in.readLine()) != null )
    out.append(SearchAndReplaceWordsInText(words, line)+"\n");
    finally
    if(in!=null) in.close(); //may throw IOException
    return out.toString();
    * Replaces all occurrences in text of each key in words with it's value.
    * @returns String
    private static String SearchAndReplaceWordsInText(Map words, String text)
    Iterator it = words.keySet().iterator();
    while( it.hasNext() )
    String key = (String)it.next();
    text = text.replaceAll("\\b"key"
    b", (String)words.get(key));
    return text;
    * @returns: s with the first letter capitalized
    String capitalize(String s)
    return s.substring(0,0).toUpperCase() + s.substring(1);
    }... here's the head of my pirate_words_map.txt
    hello               ahoy
    hi                    yo-ho-ho
    pardon me       avast
    excuse me       arrr
    yes                 aye
    my                 me
    friend             me bucko
    sir                  matey
    madam           proud beauty
    miss comely    wench
    where             whar
    is                    be
    are                  be
    am                  be
    the                  th'
    you                 ye
    your                yer
    tell                be tellin'

  • Can someone help me with this code?

    Hi all,
    I have a Flash component that links to a gallery, and I
    understand that I can create buttons to point to multiple
    galleries. (waiting too long for support from the suppliers)
    The User Guide says that I can use the following to create
    the connection:
    myThumbnailer2.loadGallery(24);
    That won't work, and it says that I need to include it in an
    onclipevent. I have no idea what i am doing and I was hoping
    someone could tell me what to script to get the text button I
    created to run this.
    Help would really be appreciated.
    Hugh

    Hi Hugh,
    You are right in that you can link to other galleries using
    the ID number (but, I assume, only TN2Admin (fCMSPro gallery
    document) defined galleries) with the code supplied.
    I think this may help - I'm a newbie with actionscript and I
    know nothing about Flashloaded so I may be way off beam here,
    but....
    First define a variable, this will be used in the 'show'
    (that's show, not load) gallery element of your code:
    var galNum: Number;
    Make as many buttons as required to launch a gallery (you say
    "each button opening one of several galleries" so I assume you want
    1 gallery per button) and give each an instance name.
    You then write the relevant code for each button function
    (assuming once more that the buttons are in the same frame) using
    the instance name (I use a separate layer in the frame to write
    actionscript and try not to attach code directly to objects - which
    then leads me to say yes you can put all the different buttons code
    in one frame)....
    myLoadGalBtn1.onRelease = function () {
    myThumbnailer2.loadGallery(24);
    galNum = 24;
    myLoadGalBtn2.onRelease = function () {
    myThumbnailer2.loadGallery(25);
    galNum = 25;
    notice the buttons have different instance names (the 1 &
    2 at the end - but you can call them what you like).
    Then you can use other code supplied to actually show the
    gallery (using the variable generated in each button click). Some
    code from Flashloaded will be along the lines of:
    myThumbnailer2.showGallery(25);
    so my guess is you can replace the actual number with the
    variable galNum inside the brackets to use the number generated by
    whatever button was pressed, like:
    myThumbnailer2.showGallery(galNum);
    Cheers
    Kol

  • Can somebody help me with this code?

    Can anyone help me with this code? My problem is that i can't
    seem to position this form, i want to be able to center it
    vertically & horizontally in a div either using CSS or any
    other means.
    <div id="searchbar"><!--Search Bar -->
    <div id="searchcart">
    <div class="serchcartcont">
    <form action='
    http://www.romancart.com/search.asp'
    name="engine" target=searchwin id="engine">
    <input type=hidden value=????? name=storeid>
    <input type=text value='' name=searchterm>
    <input type=submit value='Go'> </form>
    </div>
    </div>
    <div class="searchcont">Search For
    Products:</div>
    </div><!-- End Search Bar -->
    Pleasssssseeeeeeee Help
    Thanks

    Hi,
    Your form is defined in a div named "serchcartcont", you can
    use attributes like position and align of the div to do what you
    want to do. But there are two more dives above this dive, you will
    have define the height width of these before you can center align
    the inner most div. If you are not defining the height & width
    then by default it decide it automatically to just fit the content
    in it.
    Hope this helps.
    Maneet
    LeXolution IT Services
    Web Development
    Company

Maybe you are looking for

  • Using TOPN reports in OBIEE 11g

    Hi , I am displaying TOP 4 products (dimension) with highest revenue (measure) in a bar chart . Used TOPN function in the revenue column . But, while displaying 4 bars , the top most product (ranked 1) bar is displayed with data but without any level

  • [Solved] GeForce FX 5200 @ 1024x768 :(

    I installed drivers as https://wiki.archlinux.org/index.php/Nouveau $ xrandr -q Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096 VGA-1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm    1024x768       6

  • HT5312 Changing Apple ID email

    Hey. I no longer use the email acount I put on Apple ID and Primary Email Address. I want to replace it to the one I put as rescue email, but the site won't allow me. How can I change it?

  • How to create search help on a parameter

    Hi all,           How to create search help on a parameter .Please tell me process . Regards,

  • Adobe AIR Alarm Services ANE for IOS and Android

    I want to make an Adobe AIR app for android and ios platforms and i should use alarm services of these platforms (ios & android) for several scheduled times in a day when app is not running. Could you suggest free or commercial ANE for this operation