How to save contents of a structure into a field (of type LRAW) of a table?

Hi,
I've got a structure, with a few fields, some being char fields and some of type decimals and would like to save the contents into a field of a table, which is of type LRAW.
I know that I've got to also update the table with the correct length of the value stored in LRAW, and have done that, but it seems to have lost the end bits of the LRAW field.
Also, can I also find out how I can then retrieve the LRAW value after it's being saved? This needs to be done as later on, we would have to move the values from LRAW into the initial structure it came from.
Thanks for your help!
Regards,
Adeline.

Use MOVE command to move the contents of the stucture fields to the Wok area of the Internal table and then APPEND it to the Internal table

Similar Messages

  • How  to  save  content of a  whole  swing  page

    Hi everyone ..
    can any of u tell me ,how to save contents of a java swing page in a single file with all components viz . textfield,textarea,JTable,JPanel etc .. with their respective formatting ie.e Font,Color etc ..
    Plz let me know it soon .. its very urgent ..
    Can I save it as Screenshot or Jpeg Image .. or how to go about it .
    Mohit

    Sure: see below!
    WARNING: this code will not compile as is because it uses some other classes from my personal code library (FileUtil & StringUtil). The particular methods of those classes which are used below are trivial methods that anyone can write, which is is why I have not posted them as well. So, to get the code below to compile, you can
    a) write your own versions of these classes or
    b) simply add the necessary methods to this class or
    c) simply comment out their usage (in the case of StringUtil, which is just used for arg checking)
    But if you still want me to post them, then I can post the relevant fragments of those classes.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.*;
    import bb.io.FileUtil;
    import bb.util.StringUtil;
    * Class which supports taking screen shots of the entire desktop, AWT Components, or Swing JComponents.
    * This functionality is implemented in a series of <code>take</code> methods, each of which returns a BufferedImage.
    * This class also offers convenience <code>write</code> methods for storing BufferedImages to files.
    * <p>
    * The images taken by this class should be the precise images seen on the screen.
    * <b>However, the images written to files may deviate from the originals.</b>
    * One obvious cause is limitations of the chosen file format (especially with lossy formats like jpeg).
    * A subtle issue can occur, however, even when using lossless formats like png:
    * if the file is subsequently opened by another application,
    * that application may rescale the image, which can often cause visible artifacts.
    * <blockquote>
    *     To see this last problem on Windows XP,
    *     call {@link #take()} which returns an image of the entire desktop and write it to a file,
    *     and then open the file with XP's default graphics file viewer ("Windows Picture And Fax Viewer").
    *     This program shrinks the desktop image in order to fit it inside the program's window,
    *     and rescaling artifacts are readily seen, especially if the desktop image has any kind of text in it.
    *     If "Windows Picture And Fax Viewer" instead cropped the image or had a scroll pane, then this should not happen.
    * </blockquote>
    * <p>
    * Acknowledgement: this class was inspired by the program
    * <a href="http://www.discoverteenergy.com/files/ScreenImage.java">ScreenImage</a>.
    * Differences from the above program:
    * <ol>
    *  <li>this class uses {@link BufferedImage#TYPE_INT_ARGB} instead of {@link BufferedImage#TYPE_INT_RGB} in order to preserve alpha</li>
    *  <li>this class's {@link #formatNameDefault default image file format} is PNG instead of JPEG</li>
    *  <li>this class's <code>take</code> methods simply take snapshots and never have the side effect of writing image files</li>
    *  <li>this class added a version of <code>take</code> which can get a snapshot of a region of a Component</li>
    *  <li>
    *          when taking a snapshot of a region of a Component or JComponent,
    *          the Rectangle that specifies the region always has coordinates relative to the origin of the item
    *  </li>
    * </ol>
    * See also:
    * <a href="http://forum.java.sun.com/thread.jspa?forumID=57&threadID=597936">forum discussion #1 on screen shots</a>
    * <a href="http://forum.java.sun.com/thread.jspa?forumID=256&threadID=529933">forum discussion #2 on screen shots</a>
    * <a href="http://forum.java.sun.com/thread.jspa?forumID=57&threadID=622393">forum discussion #3 on screen shots</a>.
    * <p>
    * It might appear that this class is multithread safe
    * because it is immutable (both its immediate state, as well as the deep state of its fields).
    * However, typical Java gui code is not multithread safe, in particular, once a component has been realized
    * it should only be accessed by the event dispatch thread
    * (see <a href="http://java.sun.com/developer/JDCTechTips/2003/tt1208.html#1">Multithreading In Swing</a>
    * and <a href="http://java.sun.com/developer/JDCTechTips/2004/tt0611.html#1">More Multithreading In Swing</a>).
    * So, in order to enforce that requirement, all methods of this class which deal with components
    * require the calling thread to be the event dispatch thread.
    * See the javadocs of each method for its thread requirements.
    * <p>
    * @author bbatman
    public class ScreenShot {
         // -------------------- constants --------------------
         * Defines the image type for the BufferedImages that will create when taking snapshots.
         * The current value is {@link BufferedImage#TYPE_INT_ARGB}, which was chosen because
         * <ol>
         *  <li>the 'A' in its name means that it preserves any alpha in the image (cannot use the "non-A" types)</li>
         *  <li>the "_INT" types are the fastest types (the "BYTE" types are slower)
         * </ol>
         * @see <a href="http://forum.java.sun.com/thread.jspa?threadID=709109&tstart=0">this forum posting</a>
         private static final int imageType = BufferedImage.TYPE_INT_ARGB;
         * Default value for the graphics file format that will be written by this class.
         * The current value is "png" because the PNG format is by far the best lossless format currently available.
         * Furthermore, java cannot write to GIF anyways (only read).
         * <p>
         * @see <a href="http://www.w3.org/TR/PNG/">Portable Network Graphics (PNG) Specification (Second Edition)</a>
         * @see <a href="http://www.w3.org/QA/Tips/png-gif">GIF or PNG</a>
         * @see <a href="http://www.libpng.org/pub/png/">PNG Home Site</a>
         public static final String formatNameDefault = "png";
         // -------------------- take --------------------
         // desktop versions:
         * Takes a screen shot of the entire desktop.
         * <p>
         * Any thread may call this method.
         * <p>
         * @return a BufferedImage representing the entire screen
         * @throws AWTException if the platform configuration does not allow low-level input control. This exception is always thrown when GraphicsEnvironment.isHeadless() returns true
         * @throws SecurityException if createRobot permission is not granted
         public static BufferedImage take() throws AWTException, SecurityException {
              Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
              Rectangle region = new Rectangle(0, 0, d.width, d.height);
              return take(region);
         * Takes a screen shot of the specified region of the desktop.
         * <p>
         * Any thread may call this method.
         * <p>
         * @param region the Rectangle within the screen that will be captured
         * @return a BufferedImage representing the specified region within the screen
         * @throws IllegalArgumentException if region == null; region's width and height are not greater than zero
         * @throws AWTException if the platform configuration does not allow low-level input control. This exception is always thrown when GraphicsEnvironment.isHeadless() returns true
         * @throws SecurityException if createRobot permission is not granted
         public static BufferedImage take(Rectangle region) throws IllegalArgumentException, AWTException, SecurityException {
              if (region == null) throw new IllegalArgumentException("region == null");
              return new Robot().createScreenCapture( region );     // altho not currently mentioned in its javadocs, if you look at its source code, the Robot class is synchronized so it must be multithread safe, which is why any thread should be able to call this method
         // AWT Component versions:
         * Takes a screen shot of that part of the desktop whose area is where component lies.
         * Any other gui elements in this area, including ones which may lie on top of component,
         * will be included, since the result always reflects the current desktop view.
         * <p>
         * Only {@link EventQueue}'s {@link EventQueue#isDispatchThread dispatch thread} may call this method.
         * <p>
         * @param component AWT Component to take a screen shot of
         * @return a BufferedImage representing component
         * @throws IllegalArgumentException if component == null; component's width and height are not greater than zero
         * @throws IllegalStateException if calling thread is not EventQueue's dispatch thread
         * @throws AWTException if the platform configuration does not allow low-level input control. This exception is always thrown when GraphicsEnvironment.isHeadless() returns true
         * @throws SecurityException if createRobot permission is not granted
         public static BufferedImage take(Component component) throws IllegalArgumentException, IllegalStateException, AWTException, SecurityException {
              if (component == null) throw new IllegalArgumentException("component == null");
              if (!EventQueue.isDispatchThread()) throw new IllegalStateException("calling thread (" + Thread.currentThread().toString() + ") is not EventQueue's dispatch thread");
              Rectangle region = component.getBounds();
              region.x = 0;     // CRITICAL: this and the next line are what make region relative to component
              region.y = 0;
              return take(component, region);
         * Takes a screen shot of that part of the desktop whose area is the region relative to where component lies.
         * Any other gui elements in this area, including ones which may lie on top of component,
         * will be included, since the result always reflects the current desktop view.
         * <p>
         * Only {@link EventQueue}'s {@link EventQueue#isDispatchThread dispatch thread} may call this method.
         * <p>
         * @param component AWT Component to take a screen shot of
         * @param region the Rectangle <i>relative to</i> component that will be captured
         * @return a BufferedImage representing component
         * @throws IllegalArgumentException if component == null; component's width and height are not greater than zero; region == null
         * @throws IllegalStateException if calling thread is not EventQueue's dispatch thread
         * @throws AWTException if the platform configuration does not allow low-level input control. This exception is always thrown when GraphicsEnvironment.isHeadless() returns true
         * @throws SecurityException if createRobot permission is not granted
         public static BufferedImage take(Component component, Rectangle region) throws IllegalArgumentException, IllegalStateException, AWTException, SecurityException {
              if (component == null) throw new IllegalArgumentException("component == null");
              if (region == null) throw new IllegalArgumentException("region == null");
              if (!EventQueue.isDispatchThread()) throw new IllegalStateException("calling thread (" + Thread.currentThread().toString() + ") is not EventQueue's dispatch thread");
              Point p = new Point(0, 0);
              SwingUtilities.convertPointToScreen(p, component);
              region.x += p.x;
              region.y += p.y;
              return take(region);
         // Swing JComponent versions:
         * Takes a screen shot of <i>just</i> jcomponent
         * (no other gui elements will be present in the result).
         * <p>
         * Only {@link EventQueue}'s {@link EventQueue#isDispatchThread dispatch thread} may call this method.
         * <p>
         * @param jcomponent Swing JComponent to take a screen shot of
         * @return a BufferedImage representing jcomponent
         * @throws IllegalArgumentException if jcomponent == null
         * @throws IllegalStateException if calling thread is not EventQueue's dispatch thread
         public static BufferedImage take(JComponent jcomponent) throws IllegalArgumentException, IllegalStateException {
              if (jcomponent == null) throw new IllegalArgumentException("jcomponent == null");
              if (!EventQueue.isDispatchThread()) throw new IllegalStateException("calling thread (" + Thread.currentThread().toString() + ") is not EventQueue's dispatch thread");
              Dimension d = jcomponent.getSize();
              Rectangle region = new Rectangle(0, 0, d.width, d.height);
              return take(jcomponent, region);
         * Takes a screen shot of <i>just</i> the specified region of jcomponent
         * (no other gui elements will be present in the result).
         * <p>
         * Only {@link EventQueue}'s {@link EventQueue#isDispatchThread dispatch thread} may call this method.
         * <p>
         * @param jcomponent Swing JComponent to take a screen shot of
         * @param region the Rectangle <i>relative to</i> jcomponent that will be captured
         * @return a BufferedImage representing the region within jcomponent
         * @throws IllegalArgumentException if jcomponent == null; region == null
         * @throws IllegalStateException if calling thread is not EventQueue's dispatch thread
         public static BufferedImage take(JComponent jcomponent, Rectangle region) throws IllegalArgumentException, IllegalStateException {
              if (jcomponent == null) throw new IllegalArgumentException("jcomponent == null");
              if (region == null) throw new IllegalArgumentException("region == null");
              if (!EventQueue.isDispatchThread()) throw new IllegalStateException("calling thread (" + Thread.currentThread().toString() + ") is not EventQueue's dispatch thread");
              boolean opaquenessOriginal = jcomponent.isOpaque();
              Graphics2D g2d = null;
              try {
                   jcomponent.setOpaque( true );
                   BufferedImage image = new BufferedImage(region.width, region.height, imageType);
                   g2d = image.createGraphics();
                   g2d.translate(-region.x, -region.y) ;     // CRITICAL: this and the next line are what make region relative to component
                   g2d.setClip( region );
                   jcomponent.paint( g2d );
                   return image;
              finally {
                   jcomponent.setOpaque( opaquenessOriginal );
                   if (g2d != null) g2d.dispose();
         // -------------------- write --------------------
         * Writes image to a newly created File named fileName.
         * The graphics format will either be the extension found in fileName
         * or else {@link #formatNameDefault} if no extension exists.
         * <p>
         * Any thread may call this method.
         * <p>
         * @param image the BufferedImage to be written
         * @param fileName name of the File that will write image to
         * @throws IllegalArgumentException if image == null; fileName is blank
         * @throws IOException if an I/O problem occurs
         public static void write(BufferedImage image, String fileName) throws IllegalArgumentException, IOException {
              if (image == null) throw new IllegalArgumentException("image == null");
              if (StringUtil.isBlank(fileName)) throw new IllegalArgumentException("fileName is blank");
              File file = new File(fileName);
              String formatName = FileUtil.getExtension(file);
              if (formatName.length() == 0) formatName = formatNameDefault;
              write(image, formatName, file);
         * Writes image to file in the format specified by formatName.
         * <p>
         * Any thread may call this method.
         * <p>
         * @param image the BufferedImage to be written
         * @param formatName the graphics file format (e.g. "pnj", "jpeg", etc);
         * must be in the same set of values supported by the formatName arg of {@link ImageIO#write(RenderedImage, String, File)}
         * @param file the File that will write image to
         * @throws IllegalArgumentException if image == null; type is blank; file == null
         * @throws IOException if an I/O problem occurs
         public static void write(BufferedImage image, String formatName, File file) throws IllegalArgumentException, IOException {
              if (image == null) throw new IllegalArgumentException("image == null");
              if (StringUtil.isBlank(formatName)) throw new IllegalArgumentException("formatName is blank");
              if (file == null) throw new IllegalArgumentException("file == null");
              ImageIO.write(image, formatName, file);
         // -------------------- Test (inner class) --------------------
         * An inner class that consists solely of test code for the parent class.
         * <p>
         * Putting all the test code in this inner class (rather than a <code>main</code> method of the parent class) has the following benefits:
         * <ol>
         *  <li>test code is cleanly separated from working code</li>
         *  <li>any <code>main</code> method in the parent class is now reserved for a true program entry point</li>
         *  <li>test code may be easily excluded from the shipping product by removing all the Test class files (e.g. on Windoze, delete all files that end with <code>$Test.class</code>)</li>
         * </ol>
         * Putting all the test code in this inner class (rather than a shadow external class) has the following benefits:
         * <ol>
         *  <li>non-public members may be accessed</li>
         *  <li>the test code lives very close to (so is easy to find) yet is distinct from the working code</li>
         *  <li>there is no need to set up a test package structure</li>
         * </ol>
         public static class Test {
              public static void main(String[] args) throws Exception {
                   Gui gui = new Gui();
                   EventQueue.invokeLater( gui.getBuilder() );
                   new Timer(1000, gui.getTimerActionListener()).start();
              private static class Gui {
                   private Frame frame;
                   private TextField textField;
                   private JFrame jframe;
                   private JLabel jlabel;
                   private JPanel jpanel;
                   private int count = 0;
                   private Runnable getBuilder() {
                        return new Runnable() {
                             public void run() {
                                  System.out.println("Creating a Frame with AWT widgets inside...");
                                  frame = new Frame("ScreenShot.Test.main Frame");
                                  textField = new TextField();
                                  textField.setText( "Waiting for the screen shot process to automatically start..." );
                                  frame.add(textField);                              
                                  frame.pack();
                                  frame.setLocationRelativeTo(null);     // null will center it in the middle of the screen
                                  frame.setVisible(true);
                                  System.out.println("Creating a JFrame with Swing widgets inside...");
                                  jframe = new JFrame("ScreenShot.Test.main JFrame");
                                  jlabel = new JLabel(
                                       "<html>" +
                                            "To be, or not to be: that is the question:" + "<br>" +
                                            "Whether 'tis nobler in the mind to suffer" + "<br>" +
                                            "The slings and arrows of outrageous fortune," + "<br>" +
                                            "Or to take arms against a sea of troubles," + "<br>" +
                                            "And by opposing end them?" + "<br>" +
                                            "To die: to sleep; No more;" + "<br>" +
                                            "and by a sleep to say we end" + "<br>" +
                                            "The heart-ache and the thousand natural shocks" + "<br>" +
                                            "That flesh is heir to," + "<br>" +
                                            "'tis a consummation Devoutly to be wish'd." + "<br>" +
                                       "</html>"
                                  jpanel = new JPanel();
                                  jpanel.setBorder( BorderFactory.createEmptyBorder(20, 20, 20, 20) );
                                  jpanel.add(jlabel);
                                  jframe.getContentPane().add(jpanel);
                                  jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                                  jframe.pack();
                                  Point p = frame.getLocation();
                                  p.translate(0, frame.getSize().height  + 10);
                                  jframe.setLocation(p);
                                  jframe.setVisible(true);
                   private ActionListener getTimerActionListener() {
                        return new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  try {
                                       switch (count++) {
                                            case 0:
                                                 displayMessage("Taking a screen shot of the entire desktop...");
                                                 ScreenShot.write( ScreenShot.take(), "desktop.png" );
                                                 break;
                                            case 1:
                                                 displayMessage("Taking a screen shot of the central rectangle of the desktop...");
                                                 Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
                                                 Rectangle region = getCenteredRectangle(d);
                                                 ScreenShot.write( ScreenShot.take(region), "desktopCenteredRectangle.png" );
                                                 break;
                                            case 2:
                                                 displayMessage("Taking a screen shot of the TextField...");
                                                 ScreenShot.write( ScreenShot.take(textField), "textField.png" );
                                                 break;
                                            case 3:
                                                 displayMessage("Taking a screen shot of the central rectangle of the TextField...");
                                                 d = textField.getSize();
                                                 region = getCenteredRectangle(d);
                                                 ScreenShot.write( ScreenShot.take(textField, region), "textFieldCenteredRectangle.png" );
                                                 break;
                                            case 4:
                                                 displayMessage("Taking a screen shot of the JLabel...");
                                                 ScreenShot.write( ScreenShot.take(jlabel), "jlabel.png" );
                                                 break;
                                            case 5:
                                                 displayMessage("Taking a screen shot of the central rectangle of the JLabel...");
                                                 d = jpanel.getSize();
                                                 region = getCenteredRectangle(d);
                                                 ScreenShot.write( ScreenShot.take(jpanel, region), "jpanelCenteredRectangle.png" );
                                                 break;
                                            default:
                                                 System.exit(0);
                                                 break;
                                  catch (Throwable t) {
                                       t.printStackTrace(System.err);
                             private void displayMessage(String text) {
                                  System.out.println(text);
                                  textField.setText(text);
                                  frame.pack();
                                  frame.invalidate();
                             private Rectangle getCenteredRectangle(Dimension d) {
                                  int x = d.width / 4;
                                  int y = d.height / 4;
                                  int width = d.width / 2;
                                  int height = d.height / 2;
                                  return new Rectangle(x, y, width, height);
    }

  • How to save content typed in textfield only as lowercase in repository?

    How to save content typed in textfield only as lowercase in repository?
    Suppose we have a textfield in a component dialog. Irrespective of how enduser enters the data in the textfield, lower/mixed/upper case, it should always be saved as lowercase in the repository.

    You have 2 options:
    * Frontend: You adjust the javascript, so the user can only enter lowercase characters
    * Server-side: Implement a SlingPostProcessor to change the data to lowercase before it is persisted (see http://sling.apache.org/apidocs/sling6/org/apache/sling/servlets/post/SlingPostProcessor.h tml)
    Jörg

  • How to save xml output of fm into sap as xml

    how to save xml output of fm into sap as xml
    thank you,
    regards,
    Jagrut bharatkumar shukla

    Hi Jagrut
    The XML document can be stored in an ABAP variable rxml of the type STRING or XSTRING, or in an internal standard table sxml of the elementary line type C. Hence, I believe, your issue with the lenght can be resovled with this types.
    For rxml, you specify an interface reference variable of the type IF_IXML_OSTREAM that points to an IXML output stream.
    For rxml, you specify an interface reference variable of the type IF_IXML_DOCUMENT that points to an IXML document.
    With the stream factory you have several options. Before you call your CALL TRANSFORMATION, you setup your stream factory for these different options.
    1. You want to write the file to the application server file system. You want to create your OSTREAM as a binary string. In this example b_xml is an empty binary string. OSTEAM will be the reference variable of tyep IF_IXML_OSTREAM.
    ostream =
    streamfactory->create_ostream_xstring( b_xml ).
    You get the output lenght with the following:
    ressize = ostream->get_num_written_raw( ).
    You can then send the entire string to the file system with the following:
    transfer b_xml to filename1 length ressize.
    Also refer to this weblog:
    /people/tobias.trapp/blog/2005/05/04/xml-processing-in-abap-part-1
    Regards
    Ravish Garg
    <b>
    *Remember reward points is the best way to say thank you :)</b>

  • How can i validate input number into a Field of  type char in oracle form?

    hi.....
    can any one help me.....please...!!!?!!
    How can i validate input number into a Field of type char in oracle form?

    i have tried doing that, but still the field except numbersthere was an error in that code. it should have been
    var_num:=to_number(var_char);however, it appears that you want the entry NOT to be a number. if this is the case then try
    begin
      if to_number(:block.item) = 0 then null; end if;
      message('The entry cannot be numeric');
      raise form_trigger_failure
    exception
      when value_error then
       /* this is where you put the code you want to be run when the
          entry is non-numeric */
    end;

  • How to save the workbook's result into table ?

    Dear all:
    Now  I need to output the workbook's result into ta table ,what can i do now?
    If I save a query's result into a table use rscrm_bapi,if the query have two structures ,the result table looks not well, how can do do?

    Read the help files about APD

  • How to save the item without displaying into the Page

    hi
    I have the reqt to save the item without displaying into the Page.
    thanx

    In your yyy Table View Object create one attribute for BusinessGroupId as you want to save it in your yyy table VO.
    Now on click of save button capture this ViewObject and set this VO Attribute at run time. I am assuming that yyytableVO is EO based.
    Snippet
    Controller PFR Code
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    pageContext.getParameter("Save") != null)
      OAViewObject vo = (OAViewObject)am.findViewObject("yyyTableVO");
      if (vo != null)
         vo.getCurrentRow.setAttribute("BusinessGroupId", value);//value is what you have capture from pageContext.getparameter
    }Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Mapping complete input XML structure into one field on target

    Hi,
    I have a scenario where I need to map the complete input XML structure as it is, into one field on target side. so can we achieve this in Graphical Mapping? If yes, please share your valuable info.
    Regards,
    Shiva.

    Hello,
    this is the java map code.just compile it and made a .zip file import it and use it Interface Mapping.
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField1 implements StreamTransformation {
        String strXML = new String();
       //Declare the XML tag for your XML message
       String StartXMLTag = "<DocumentBody>";
       String EndXMLTag = "</DocumentBody>";
       //String StartXMLTag1 = "<Code>";
       //String EndXMLTag1 = "</Code>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            String outputPayload =
                StartXMLTag
             + "<![CDATA["
             + strXML
             + "]]>"
             + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
             trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;

  • Convert structure into single field in string  in unicode system .

    Hi all
    i need to convert whole structure in single fields which is string format
    plese refer this code .....this is structure which i want to use in concatenate statement
    statement is
    CONCATENATE EXPORTSTRING HFTP_ZSD_RKFR  CR_LF INTO EXPORTSTRING.
    where data are ...
    EXPORTSTRING type xstring
    CR_LF              type x
    structure HFTP_ZSD_RKFR having follwing fields
    MANDT     MANDT     CLNT     3     0
    VBELN_VL     VBELN_VL     CHAR     10     0
    LFDNUM     LFDNUM     NUMC     3     0
    VKORG     VKORG     CHAR     4     0
    VSTEL     VSTEL     CHAR     4     0
    VSBED     VSBED     CHAR     2     0
    KUNAG     KUNAG     CHAR     10     0
    KUNWE     KUNWE     CHAR     10     0
    SPDNR     SPDNR     CHAR     10     0
    LFDAT     LFDAT     DATS     8     0
    LFUHR     LFUHR     TIMS     6     0
    WADAT     WADAT     DATS     8     0
    TRAID     TRAID     CHAR     20     0
    ROUTE     ROUTE     CHAR     6     0
    WERKS     WERKS_D     CHAR     4     0
    MATNR     MATNR     CHAR     18     0
    LFIMG     LFIMG     QUAN     13     3
    MEINS     MEINS     UNIT     3     0
    ANZPK     ANZPK     NUMC     5     0
    ANZPK     ANZPK     NUMC     5
    KBETR     KBETR     CURR     11
    KPEIN     KPEIN     DEC     5
    KMEIN     KMEIN     UNIT     3
    KWAER     KWAER     CUKY     5
    KWERT     KWERT     CURR     13
    BELNR     BELNR_FI     CHAR     10
    GJAHR     GJAHR     NUMC     4
    MWSKZ     MWSKZ     CHAR     2
    SAKNR     SAKNR     CHAR     10
    BUKRS     BUKRS     CHAR     4
    BUDAT     BUDAT     DATS     8
    KOSTL     KOSTL     CHAR     10
    AUFNR     AUFNR     CHAR     12
    PRCTR     PRCTR     CHAR     10
    BRGEW     BRGEW     QUAN     13
    GEWEI     GEWEI     UNIT     3
    XBILL     ZSD_XBILL     CHAR     1
    XPARK     ZSD_XPARK     CHAR     1
    XPARK     ZSD_XPARK     CHAR     1
    XBLNR     XBLNR     CHAR     16
    KHERK     ZSD_KHERK     CHAR     1
    LIFEX     LIFEX     CHAR     35
    SDABW     SDABW     CHAR     4
    KBETR_MAUT     KBETR     CURR     11
    KPEIN_MAUT     KPEIN     DEC     5
    KMEIN_MAUT     KMEIN     UNIT     3
    KWERT_MAUT     KWERT     CURR     13
    KBETR_OEL     KBETR     CURR     11
    KPEIN_OEL     KPEIN     DEC     5
    KMEIN_OEL     KMEIN     UNIT     3
    KWERT_OEL     KWERT     CURR     13
    KBETR_PAL     KBETR     CURR     11
    KPEIN_PAL     KPEIN     DEC     5
    KMEIN_PAL     KMEIN     UNIT     3
    KWERT_PAL     KWERT     CURR     13
    KBETR_VAT     KBETR     CURR     11
    KPEIN_VAT     KPEIN     DEC     5
    KPEIN_VAT     KPEIN     DEC     5
    KMEIN_VAT     KMEIN     UNIT     3
    KWERT_VAT     KWERT     CURR     13
    BLDAT     BLDAT     DATS     8
    MWS_BETRG     WRBTR     CURR     13
    KURSF     KURSF     DEC     9
    UVK06          CHAR     1

    I have used this FM
    SAP_CONVERT_TO_TXT_FORMAT
    There's also a method in cl_abap_char_utilities to convert a structure to a C container, look for it, I only have 4.6C here and that class is only in ECC

  • How to save contents of two different rich edit box into single rtf file in windows 8.1 app

    Developer, I have requirement to save registration data into rtf file.. These can only be done by if I put rich edit box to fill the data.. Now if I am going to write the code for saving the data of different rich edit box into one particular file, it
    only saves the data of last rich edit box.. So plzz suggest that how can I save the contents of different rich edit box together into one rtf file.

    Ok Nishant, just did some quick research, since rtf file is unlike txt file, we cannot simply directly write some content to the rtf.
    You can try to find some third party code that can help you insert text into rtf file or you would like to load the content from rtf out to the richeditbox and merge them to one richeditbox and then save back to the file.
    You could like to see how to read/save rtf file sample from:
    RichEditBox class
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to save content of JPanel into jpeg or png file

    I have to independent classes: Class A and Class B. Each class constructs its own graphical objects:
    Class A {
    //do something
    public void paintComponent(Graphics g)
    int x = 0;
    int y = 0;
    int w = getSize().width;
    int h = getSize().height;
    bi = new BufferedImage(
    w,h,100,BufferedImage.TYPE_INT_RGB);
    g2d = bi.createGraphics();
    // draw lines
    g2d.drawImage(bi,0,0,ww,hh, this);
    Class B {
    int x = 0;
    int y = 0;
    int w = getSize().width;
    int h = getSize().height;
    bi = new BufferedImage(
    w,h,100,BufferedImage.TYPE_INT_RGB);
    g2d = bi.createGraphics();
    // draw lines
    g2d.drawImage(bi,0,0,ww,hh, this);
    Two buffered images get properly displayed within JPanel component. However, I need to save two those results into one file. If I add saving file routine into every class, at best I can only get them to be in two different files.
    Please let me know if anyone can help me with this problem.
    Thanks,
    Jack

    You didn't mention what should be the format of file that the combines the images. Here are two options:
    1. Create another BufferedImage, and draw the BufferedImages from class A and B over this BufferedImage and save it as JPEG or PNG.
    In each of the class, you can add a method like getBufferedImage(), which would return the local BufferedImage. A third class, say class C, needs to call this method in each of the classes, and then draw the BufferedImages returned by these methods over another BufferedImage. Save this BufferedImage as a JPEG or PNG.
    A disadvantage of this approach is that you can't easily retrieve the individual images from the resulting file.
    2. Create a single zip file by adding the individual JPEG/ PNG images created from the BufferedImage in class A and B.
    Here is an example that creates single zip file of JPEG images from an array of BufferedImageObjects:
    public static void zip(String outfile, BufferedImage bufimage[]){
         if(bufimage == null) return;
         try{
             File of = outfile.endsWith(".zip")? new File(outfile): new File(outfile+".zip");
             FileOutputStream fos = new FileOutputStream(of);
             ZipOutputStream zos = new ZipOutputStream(fos);
             for(int i=0;i<bufimage.length;i++){
                 try{
                    ByteArrayOutputStream boutstream = new ByteArrayOutputStream();
                    JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(boutstream);
                    enc.encode(bufimage);
    ZipEntry entry = new ZipEntry("bufimage"+(new Integer(i)).toString()+".jpg");
    entry.setMethod(ZipEntry.DEFLATED);
    zos.putNextEntry(entry);
    byte[] fileBuf = boutstream.toByteArray();
    zos.write(fileBuf,0,fileBuf.length);
    zos.closeEntry();
    } catch (Exception e){ e.printStackTrace();}
    zos.flush();
    zos.close();
    }catch(Exception e) {e.printStackTrace();}
    The above method uses the JPEG codec and the zip package, both of which available in J2SE. In other words, you need to import com.sun.image.codec.jpeg and java.util.zip packages.
    With this approach, you can easily retrieve the individual JPEGs using the java.util.zip package.

  • Save contents of editable alv into dbtable

    Hi All,
    I have an alv output with editable fields. This output has the contents some from an itab and some are hardcoded in the program. Now I have edited the contents in the alv o/p.
    Now I want to save the contents of the alv o/p fully into the dbtable.
    Please suggest how to do this.

    Hi,
    STEP :1.
    In the PBO of the Screen in Which you are  designed your container for output - SET the PF-STATUS.
    Example : SET PF-STATUS '1500'.
    In this PF Status you activate the SAVE Button.
    I think for SAVE Button the sy-ucomm = 'SPOS'.
    STEP 2:
    In the PAI of the Screen in Which you are  designed your container for output.
    Write the below code.
    IF SY-UCOMM = 'SPOS'.
        CALL METHOD G_GRID->CHECK_CHANGED_DATA
          IMPORTING
            E_VALID = L_VALID.
        IF L_VALID EQ 'X'.
          CALL METHOD G_GRID->GET_SELECTED_ROWS
            IMPORTING
              ET_ROW_NO = LT_ROW_NO[].
        ENDIF.
    At this Point your output table will have the modified values.
    Now you can proceed it to update the database table.
    ENDIF.
    Regards
    Amir

  • How to save contents of a JTable? Pls Help

    Can someone tell me how can I save the contents of a table in a file and load them back after I click a load file button in menuBar.
    Any help would be appriciated.

    Actually, I first wanted to get Window Pop-up asking for a file name and then after file name is entered user should click on save button and then all the data entered in the table should be saved.
    thanks

  • How to read IDOC in flafile structure into SAP to create PO

    HI,
    We have a requirement like, we will be provided with IDOC PO flatfile structures(Exactly same as IDOC,but in Dlafile format) .
    We have to read those flafiles and create POs in our SAP system.
    how can we do that?what are the necessary configuration required?
    please explian the different steps involved.
    thank you in advance.
    ...Sri

    Hi,
    Thank you for your reply.
    is there any other methods of processing the Flatfile IDOC into SAP.
    like through using file port with configuration done in Partner Profile , standard FM and report ?
    would this be different if we have customised IDOC?
    thank you,
    regards,
    .....Sri

  • How can i change the windows structure into mac structure

    Before i had a mac i used my iPod on a windows computer. When i connect my iPod to my mac i see that i can only repair my iPod. I can't update . It sais that only Ipods with a mac structure can be updated.
    So is there a way to change the windows structure to a mac structure?

    You cannot change a Windows iPod into a Mac iPod without restoring it, which erases its contents. To restore it, use the repair button you saw.
    (24236)

Maybe you are looking for

  • Data in a narrative view.

    Sorry if this is simple. Just want to display the multiple values from a report prompt, not dashboard prompt, in the report. My effort has taken me to the narrative view and am using @12 to display the values in the column which has been filtered. Bu

  • BPM RFC synch send step

    Hi I am using RFC synch send step with in parforeach block in BPM. do I need to activate correlation to correlate synchronous request and synchronous response for RFC synch send step ? Please let me know if you have any ideas on this. Thanks Anand

  • F4 Help for Presentation Server Folder Name .

    Hi Experts, I want show the F4 help on the presentation server. If the file is selected REquirement is that , on clicking the F4, the dialog box should open. If we choose the file , then file should be selected , but if we select the folder then fold

  • Korean Currency problem

    Hi All,     I am having peculiar problem with Korean currency.we use Fd32 for customer credit management.while we give the credit limit like ex : 50,000,000 KRW it stored in the table KNKK-KLIMK the value is  500,000.00 when i fetch the value from th

  • I cannot deactivate Adobe Photoshop Elements 10

    Ok, so I bought Adobe Photoshop Elements 10 and Adobe Premiere Elements 10 (both in the same case) from Fry's Electronics. I used to use another computer and so all my programs were there. But that was a shared computer, and now I have my own and red