Reflection on J2ME

Hello to all!
I'm trying to write a java application for both J2ME and J2SE.
Im using some advanced features of J2ME like Connector, HttpConnection, Manager, Player, etc. which do not exist on the J2SE.
I was thinking about splitting my classes to a J2ME class and a J2SE class which both implement the same interface and dynamically construct an object acroding to the platform the application runs at runtime, however, I see that J2ME does not support reflection or any other type of dynamic method invokation.
Can you see any possible solution to my problem except making 2 types of the exact same class and recompiling it for each platform?
Thanks in advance!

At least some J2ME profiles (for example, CLDC 1.1) have reflective support for object creation. There are Class.forName(String) and Class.newInstance(). You can create instance via Class.forName("my.impClass").newInstance() and cast this instance to an interface.
But having 2 types of same class is also acceptable approach. Just create a "platform library", which will include all platform-specific classes. You will have several implementations of such library (one for J2SE, one for J@ME), but all these implementation will have same set of "public" classes and interfaces. During packaging process you will be able include proper "library implementation" in resulting package/distribution (add it's content to application jar, for example).
In any case, you should consider proper packaging, because usually J2ME devices is limited and having "J2SE classes" will be an extra burdern. For example, some mobile phones have jar size limit about 128Kb, and excluding 10Kb of "J2SE stuff" from distribution will give you sensible amount of extra "jar-size".

Similar Messages

  • Does J2ME support introspection?

    Does J2ME support introspection?

    J2ME CDC supports reflection. J2ME CDC + Personal
    Profile supports Javabeans. However, I've never tried
    that on CDC, so I can't say whether it works like in
    the J2SE world.Hm, AFAICT the support of javabeans is at most partial. The personal profile supports some classes of the package java.beans, however apparently not those related to introspection.
    E.g. IntrospectionException is missing (at least in the reference implementation). That's why log4j fails for me on CDC.
    The CDC whitepaper says "partial support", but doesn't go into detail.
    Does anybody know if any other CDC implementation supports introspection?

  • J2ME standalone AQ client

    hi all!
    i'm working on developing a standalone client for a handheld device running under a J2ME/PersonalJava 3.1 environment connecting to oracle 10.2.0.1.0
    my goal is to:
    # create a topic subscriber that will handle notifications broadcast on the topic (obviously many devices will be subscribing to the topic)
    # keep the client code as portable as possible by using JMS interfaces
    these are the classes that i have in my classpath:
    * $ORACLE_HOME/jdbc/lib/classes12.jar
    * $ORACLE_HOME/jdk/jre/lib/ext/jta.jar
    * $ORACLE_HOME/jlib/jndi.jar
    * $ORACLE_HOME/rdbms/jlib/aqapi12.jar
    * $ORACLE_HOME/rdbms/jlib/jmscommon.jar
    here is a sample class to listen to the topic:
    import oracle.jms.AQjmsOracleDebug;
    import oracle.jms.AQjmsSession;
    import oracle.jms.AQjmsTopicConnectionFactory;
    import oracle.AQ.AQDriverManager;
    import org.apache.log4j.Logger;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import javax.jms.ObjectMessage;
    import javax.jms.Session;
    import javax.jms.Topic;
    import javax.jms.TopicConnection;
    import javax.jms.TopicSession;
    import javax.jms.TopicSubscriber;
    import java.io.Serializable;
    import java.net.InetAddress;
    import java.sql.Connection;
    import java.sql.DriverManager;
    public class TopicAttachment implements MessageListener {
        private final Logger log = Logger.getLogger(getClass());
        private final Connection dbConnection;
        public TopicAttachment(Connection dbConnection) {
            this.dbConnection = dbConnection;
        public void attach() throws Exception {
            TopicConnection connection = AQjmsTopicConnectionFactory.createTopicConnection(dbConnection, true);
            connection.setClientID(InetAddress.getLocalHost().getHostAddress());
            TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
            Topic orderCounts = ((AQjmsSession) session).getTopic("STOREORD", "T_ORDER_COUNTS");
            TopicSubscriber subscriber = session.createSubscriber(orderCounts);
            subscriber.setMessageListener(this);
            connection.start();
        public void onMessage(Message message) {
            try {
                ObjectMessage om = (ObjectMessage) message;
                Serializable notification = om.getObject();
                log.info("Received notification: " + notification);
                // TODO: Handle notification in background thread
            } catch (Exception ex) {
                log.error("Failure processing notification", ex);
        public static void main(String[] args) throws Exception {
            System.setProperty("oracle.jms.useEmulatedXA", "false");
            System.setProperty("oracle.jms.useNativeXA", "false");
            AQDriverManager.disableOciAQ();
            AQjmsOracleDebug.setDebug(true);
            AQjmsOracleDebug.setTraceLevel(AQjmsOracleDebug.AQ_ORA_TR6);
            Class.forName("oracle.jdbc.driver.OracleDriver");
            TopicAttachment attachment = new TopicAttachment(DriverManager.getConnection(
                    "jdbc:oracle:thin:@localhost:1521:xxxx", "storeord", "xxxx"));
            attachment.attach();
    }there are two points where my portability constraints are violated, but that's ok for now.
    when i run the example, this is what i get:
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsDBConnMgr ctor (user jdbc conn):  connection: oracle.jdbc.driver.T4CConnection@d1fa5
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsDBConnMgr.extraInit:  enter
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsDBConnMgr.extraInit:  The connection class: oracle.jdbc.driver.T4CConnection
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsDBConnMgr.extraInit:  exit
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsDBConnMgr ctor (user jdbc conn):  exit
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsConnectionn ctor (user jdbc conn):  connection: oracle.jdbc.driver.T4CConnection@d1fa5 type: 20
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsConnection.setCompliant:  Current <compliant> is set to:true
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsDBConnMgr.getConnection:  use the external connection with usage check
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsDBConnMgr.getConnection:  passed usage check, creating from exteranl connection
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsSession.constructor:  dbversion=10201
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsSession.setDBRatio:  enter
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsSession.setRatio:  The DB csid = 178
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsSession.setRatio:  exit
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsSession.inGlobalTrans:  entry
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsSession.inGlobalTrans:  oracle.jms.useEmulatedXA is off
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsSession.inGlobalTrans:  exit
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsSession.constructor1:  oci enabled = false
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsConnection:createTopicSession:  Created session
    main  AQOracleSession.getQueue:  Secure queue table: NO
    main  AQOracleQueue.getProperty:  return cached prop
    main  AQOracleSession.getQueueTable:  Payload type: RAW
    main  AQOracleSession.getQueueTable:  Secure queue table: NO
    main [Mon Sep 08 15:12:57 CDT 2008] AQjmsSession.chopit:  TSUB_1_b2b5787a678d40f0a2e589f89e6348fc -> TSUB_1_b2b5787a678d40f0a2e589f
    java.lang.NullPointerException
    at oracle.jms.AQjmsSession.getAQJmsSelector(AQjmsSession.java:2550)
    at oracle.jms.AQjmsSession.createDurableSubscriber(AQjmsSession.java:2520)
    at oracle.jms.AQjmsSession.forceCreateOldSubscriber(AQjmsSession.java:2924)
    at oracle.jms.AQjmsSession.createSubscriber(AQjmsSession.java:2240)
    at com.containerstore.device.notification.TopicAttachment.attach(TopicAttachment.java:35)
    at com.containerstore.device.notification.TopicAttachment.main(TopicAttachment.java:64)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
    Exception in thread "main" i've tried many different incarnations of this basic setup with the same results. it always fails with a NPE when creating the subscriber. i've even used the more AQ specific classes/methods like TopicReceiver with the same results.
    is what i'm trying to accomplish even possible?
    thanks!

    Don't let the fact that I've been doing AQ for years and no one else has responded throw you. <g>
    When I see things like this:
    public static void main(String[] args) throws Exception {
            System.setProperty("oracle.jms.useEmulatedXA", "false");
            System.setProperty("oracle.jms.useNativeXA", "false");it is hard to not read it as Java.

  • Error - netbeans integrating with j2me polish- file connection api

    dear friends,
    can anyone help why this error is coming, while i run my existing mobile project in j2me polish
    J2ME Polish 2.0.7 (2008-11-24) (GPL License)
    Warning: unable to access system property javax.xml.parsers.SAXParserFactory: java.lang.SecurityException:
    Warning: unable to access system property javax.xml.parsers.DocumentBuilderFactory: java.lang.SecurityException:
    java.lang.NullPointerException
            at de.enough.polish.ant.PolishTask.initProject(PolishTask.java:959)
            at de.enough.polish.ant.PolishTask.execute(PolishTask.java:376)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
            at sun.reflect.GeneratedMethodAccessor196.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.Target.execute(Target.java:357)
            at org.apache.tools.ant.Target.performTasks(Target.java:385)
            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
            at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
            at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
            at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:481)
            at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
    D:\ProjectHome\MoBilal\build.xml:87: Unable to execute J2ME Polish task: java.lang.NullPointerException
    BUILD FAILED (total time: 5 seconds)thanks in advance

    thanks st3p3n for your valuable reply.
    i faced the above said problem when i tried to integrate with netbeans 6.0.1.
    but again i tried with netbeans 6.5 and there is no such an error.
    Thanks,
    Ramesh.P

  • J2ME Eclipse, midp.zip

    The Eclipse J2ME plug-in installation requires the file midp.zip from the J2ME Wireless Toolkit, but the file does not exist. How can I get this file (for MIDP2.0) ???
    thank you

    Well I downloaded it and tried to install it into Eclipse 3 M6, but Eclipse crashes after copying the pluginfiles:
    Problem during startup. Check ".log" file in the ".metadata" directory of your workspace.
    This log file doesn't hold something meaningfull to me:
    !SESSION ----------------------------------------------------------------------
    !ENTRY org.eclipse.core.launcher 4 0 Jan 26, 2004 16:16:30.580
    !MESSAGE Exception launching the Eclipse Platform:
    !STACK
    java.lang.NullPointerException
         at org.eclipse.ui.internal.registry.RegistryReader$1.compare(RegistryReader.java:102)
         at java.util.Arrays.mergeSort(Unknown Source)
         at java.util.Arrays.sort(Unknown Source)
         at java.util.Collections.sort(Unknown Source)
         at org.eclipse.ui.internal.registry.RegistryReader.orderExtensions(RegistryReader.java:107)
         at org.eclipse.ui.internal.registry.RegistryReader.readRegistry(RegistryReader.java:158)
         at org.eclipse.ui.internal.registry.WizardsRegistryReader.readWizards(WizardsRegistryReader.java:156)
         at org.eclipse.ui.internal.registry.NewWizardsRegistryReader.readWizards(NewWizardsRegistryReader.java:350)
         at org.eclipse.ui.internal.registry.NewWizardsRegistryReader.getWizardElements(NewWizardsRegistryReader.java:371)
         at org.eclipse.ui.actions.NewWizardMenu.hasExamples(NewWizardMenu.java:212)
         at org.eclipse.ui.actions.NewWizardMenu.fillMenu(NewWizardMenu.java:119)
         at org.eclipse.ui.actions.NewWizardMenu.fill(NewWizardMenu.java:196)
         at org.eclipse.jface.action.MenuManager.update(MenuManager.java:573)
         at org.eclipse.jface.action.MenuManager.update(MenuManager.java:462)
         at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:210)
         at org.eclipse.jface.action.MenuManager.update(MenuManager.java:573)
         at org.eclipse.jface.action.MenuManager.update(MenuManager.java:462)
         at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:210)
         at org.eclipse.jface.action.MenuManager.update(MenuManager.java:573)
         at org.eclipse.jface.action.MenuManager.update(MenuManager.java:462)
         at org.eclipse.jface.action.MenuManager.createMenuBar(MenuManager.java:147)
         at org.eclipse.jface.window.ApplicationWindow.configureShell(ApplicationWindow.java:294)
         at org.eclipse.ui.internal.WorkbenchWindow.configureShell(WorkbenchWindow.java:714)
         at org.eclipse.jface.window.Window.createShell(Window.java:353)
         at org.eclipse.jface.window.Window.create(Window.java:304)
         at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1136)
         at org.eclipse.ui.internal.Workbench.init(Workbench.java:875)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1459)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:246)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139)
         at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:47)
         at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.eclipse.core.launcher.Main.basicRun(Main.java:279)
         at org.eclipse.core.launcher.Main.run(Main.java:742)
         at org.eclipse.core.launcher.Main.main(Main.java:581)
    Any ideas, what went wrong? I have to delete the plugin directory, the workspace directory and .config in order to make eclipse to start again, deleting the plugin only won't help.

  • J2ME - palette corruption

    I used J2ME 3.0 EA. Graphics file (tried gif and png) contain pixels with 0xFF060606 (almost black) color. I load image using createImage(resource Name). Then I generate getRGB for the image, and black becomes 0xFF000400. Why?

    The explanation of issue is in the java documentation:
    "The returned values are not guaranteed to be identical to values from the original source, such as from createRGBImage or from a PNG image. Color values may be resampled to reflect the display capabilities of the device (for example, red, green or blue pixels may all be represented by the same gray value on a grayscale device)".
    Initial problem was that I had to change color of specific pixels in the image. As colors are "not guaranteed to be indentical", just taking predefined AARRGGBB did not work.
    I solved this issue by picking specific pixels from the image as sample color to look within the image.
    Good luck.

  • Compile-Time Reflection/Metadata access?

    Hey I hear for netbeans there is an extension (or maybe it is built in) to do reflection/access metadata at compile time.
    Anyone hear about this or know where I can find more info on this? Or maybe it is for a different IDE or a stand alone tool?
    compile-time access would be ideal since J2ME doesn't have run-time reflection/metadata access. A lot better than no access at all :)

    Ok everyone, if I was writing a java compiler, I'd for sure need compile-time reflection/metadata access right? And instead of writing the compiler from scratch and having to write those tools myself I can write a sub-compiler that runs within the existing java compilation process and accesses the tools and functionality of the compiler itself. So then I just proved it is not an irrelevant concept and that it is in-fact very important. The concept of a programming language is independent of the specific language.
    Yes well more specifically how about I say 'how do I get access to the compile-time reflection/metadata tools that are part of the NetBeans java compiler (or whatever compiler NetBeans uses)'?
    Ok DrClap. The mere fact that even a single programming language supports compile-time reflection/metadata access means it can be applied to java as well. And you also failed to mention that the Wikipedia article doesn't call out which specific languages support compile-time reflection/metadata access, because it is a language-independent concept. Java itself is considered 'higher-level' so I'm not sure why you want to claim compile-time anything is irrelevant.
    And my industry colleagues aren't hear because I'm the only one working the weekend. We talked about this before the weekend and I forgot to get further info or a link to a website.
    Thanks ejp!
    I gave ejp 5 points since I have to do a little bit of reading to see if those tools/apis are what I'm looking for (5 points left). Looks promising though. Either way if I don't get anything better by tomorrow I'll give ejp the other 5.
    And sorry everyone I'm not very subtle when it comes to forum conversation.

  • WML and J2ME

    hi,
    I have a WML page and have a midlet.
    Using the file connection API, i will request for the WML to my server.
    My midlet will get the WML response.
    But, the output of the WML should be reflected on my MIDLET, without the mobile browser.
    Have anyone tried this. Please help me out.
    with regards,
    Shirish.

    WML and J2ME are not directly related.
    1) If you want to download a WML page in your midlet you will need to use a HTTP connection. The downloaded WML markup can be displayed or processed in your midlet. To render the WML, you will need to write a parser and the rendering components.
    If you need to extract information from the WML document, I would suggest not using WML at all and starting with an XML document, tailored for your use.
    If you do not need to extract information from the WML document, consider using a PlatformRequest to launch the browser and render the WML document.
    2) You can host and create WML page similar to the methods you would use to create and host a HTML page. There are tools to help you author the pages, and emulators to help test your pages.
    I would suggest starting with one of the phone manufacturers developer groups, i.e. sony ericsson or Nokia. You can find support and tools on their sites.

  • ANY SY-INDEX REFLECT CHANGES WHEN CONTROL BREAK STATEMENT PROCESS

    Dear Guru's,
                     I have a requirement where i have to move the values to variable when control break (AT END OF) process. So i want to move the values according to the end of Vendor so for that  i want to know is there any sy-index available which reflects changes when Control break (AT end of) process.
    LIKE Sy-subrc = 0 when select statement fetches record or sy-tabix is like counter for loop.
    Hope to get reply soon.
    Regards,
    Himanshu Rangappa

    Hi,
    There is no system Fields for it.
    But your requirement can be done with 'AT NEW' and 'AT END' statement.
    Refer this sample example,
    loop at otab.
        at new module.
          move otab-module to otab2-module.
        ENDAT.
          at END OF effort.
          sum.               "Do your calculations here
          move otab-count to otab2-count.
          append otab2.
        endat.
      endloop.

  • List view web part not reflecting changes made to list view in SharePoint Designer

    Dear All,
    When adding a list view web part containing a view modified in SharePoint designer (e.g. conditional formatting applied, or group headers modified) I'm finding that the changes made in SPD are not reflected in the web part. 
    For example, I go into SPD edit a view, and the view appears correctly when I go back into SharePoint, however when I link to the view within a list view web part it results in losing the changes made in SPD. 
    Becasue it's a publishing page I'm unable to edit the contents of the web part in SPD.
    I'm sure this is expected behavior but how do I get around this?
    Thnaks,
    MDB

    Try below
    http://stackoverflow.com/questions/19533998/sharepoint-designer-doesnt-show-anything-in-list-and-libraries-link
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/a63a1894-6b1d-420a-95dd-b6c546eab34d/updates-made-to-sharepoint-designer-2010-workflow-do-not-show-up-on-the-server?forum=sharepointcustomizationprevious
    http://stackoverflow.com/questions/5959521/sharepoint-designer-saves-the-changes-but-it-does-not-affect
    http://social.technet.microsoft.com/Forums/en-US/1e9a8c27-bbc5-4a6f-8daf-4b243182f543/changes-in-sharepoint-designer-2010-not-showing-in-sharepoint-server-2010-page?forum=sharepointadminprevious

  • Poor reflective memory read performanc​e

    I'm having some trouble with the GE 5565 PIORC reflective memory set of VIs for use with our reflective memory setup. I need to copy a pretty sizable chunk of memory out of reflective memory and into a DLL I've written, but the performance on the "GE 5565 PIORC:GE5565 Read (Cluster).vi" is not where I need it. I need to copy somewhere in the realm of 12k out of reflective memory at a high frequency, but the call to read those 12k takes longer than the period I need to gather the data at. I apologize in advance for the image-heavy post, but I think it's worth it to show what I've got.
    Here's a picture of my setup to benchmark the Read call runtime: 
    Here's a graph of runtimes of that Read call, in microseconds:
    I need it to run in way less than 16 ms, which doesn't seem unreasonable to me for only 12k. I did fool around with the DMA version of the Read (which I don't really understand, and the documentation is nonexistent as far as I can tell). Here's my test setup:
    And here's a chart similar to the one above:
    Way better, though I have no idea if it even does what I think it should So, I have a few questions. First, is there any way to get better performance out of that Read VI? Some other library I should be using, some setting I should be setting, some other way I should be benchmarking its performance, maybe even some way of doing this with another DLL? Second, if the Read can't achieve the performance I need, what's up with the DMA version, and how would I use it properly? Is the performance advantage that it appears to be giving real, or just an artifact of some mistaken way in which I'm using it? Thanks!

    Hi dgoes
    Windows is not a deterministic operating system so the loop cycle time that you are getting might be the best time that the windows system can achieve. In order to benchmark your code you can also use the input node and the output node of the timed loop. Check the following link.
    Timed Loop
    But it will be nice to know if you are working on a real time operating system or windows? Because unfortunately the windows operating system is not a deterministic system so the time loop might not work as expected. Here are a couple of links with information about this.
    windows 1KHz time loop limitation reason
    What is a Real-Time Operating System (RTOS)?
    Which driver are you using for the GE 5565 PIORC? Is it this one?
    GE 5565 PIORC
    If it is, please notice that this driver is neither supported nor certified by National Instruments. This card is supported with NI VeriStand. Please check the information on the following links.
    Getting Started With the GE cPCI-5565PIORC Reflective Memory Module
    GE cPCI-5565PIORC
    I hope that this information answer your questions.
    Regards
    Esteban R.

  • Free goods not reflecting in PO from Info Record

    Hi,
    My requirement is , when ever i order 100 qty from a vendor 10 qty should be delivered free of cost.
    I am trying to maintain Info record for the same..
    Now when i created PO for the same...I entered 100 qty..it is not reflecting 10 qty in another line in PO..
    Where i am wrong?
    Uts

    HI,
    Have maintained the values in
    *Spro-Purchasing-Discount in kind-Define & assign discount in kind schema-Maintain free goods schema*
    It will be available in standard SAP if not do the following configuration
    Here
    Usage -N
    Application -M
    create procedure NR0001
    In control data
    step-10
    Cond Type-NR00
    Then save.
    Next
    Define free good schema
    Here assign ur schema grp of vendor
    Then assign the procedure created previously (i-e) NR001 & THEN SAVE.
    The above configuration is very important for the free goods scenario to work.
    Then go to MM and in purchasing view and give the value 2.
    Then in MBN1 create the condition record for the IR -0.
    Then create the PO it will work definetly.
    9884057038
    murugan
    Edited by: Murugan mgl on Jun 17, 2009 6:58 AM
    Edited by: Murugan mgl on Jun 17, 2009 6:59 AM

  • DataGrid not reflecting changes after INSERT into Table. Delete from Table does.

    Wow, it's been a while.
    Hope you guys can help.
    This is my DataGrid:
    <DataGrid DataContext="{StaticResource TableAssetsViewSource}" ItemsSource="{Binding}" x:Name="TableAssetsDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" Margin="15,10,10,10" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Column="1" HeadersVisibility="Column" CanUserResizeRows="False" IsReadOnly="True">
    <DataGrid.CellStyle>
    <Style TargetType="DataGridCell">
    <Setter Property="BorderThickness" Value="0"/>
    </Style>
    </DataGrid.CellStyle>
    <DataGrid.Columns>
    <DataGridTextColumn x:Name="NodeColumn" Binding="{Binding node}" Header="VS Number" Width="*"/>
    <DataGridTextColumn x:Name="SerialColumn" Binding="{Binding serial}" Header="Serial Number" Width="*"/>
    <DataGridTextColumn x:Name="NameColumn" Binding="{Binding name}" Header="Asset Name" Width="*"/>
    <DataGridTextColumn x:Name="TypeColumn" Binding="{Binding type}" Header="Asset Type" Width="*"/>
    <DataGridTextColumn x:Name="_dateColumn" Binding="{Binding date}" Header="Date Allocated" Width="*"/>
    <DataGridTextColumn x:Name="PoColumn" Binding="{Binding po}" Header="Purchase Order" Width="*"/>
    </DataGrid.Columns>
    </DataGrid>
    This is where I add a new Row to the Table:
    Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
    Dim cbblocation As ComboBox = Me.FindName("LocationComboBox")
    Dim row As DataRowView = DirectCast(cbblocation.SelectedItem, DataRowView)
    Dim cbbtext As String = row.Item("node")
    Dim cbbtype As ComboBox = Me.FindName("comboBoxType")
    Dim cbbtext2 As String = cbbtype.Text
    Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
    Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
    RETAILISOAMDDataSetTableAssetsTableAdapter.AddNewAsset(cbbtext, txbSerial.Text, txbName.Text, cbbtext2, Date.Today, txbPO.Text)
    node = cbbtext
    Dim mp As New MainPage
    mp.RefreshGrid(node)
    Me.Close()
    End Sub
    The RefreshGrid method:
    Public Sub RefreshGrid(node As String)
    Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
    Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
    RETAILISOAMDDataSetTableAssetsTableAdapter.FillByNode(RETAILISOAMDDataSet.tableAssets, node)
    Dim TableAssetsViewSource As System.Windows.Data.CollectionViewSource = CType(Me.FindResource("TableAssetsViewSource"), System.Windows.Data.CollectionViewSource)
    Dim be As BindingExpression = BindingOperations.GetBindingExpression(TableAssetsViewSource, CollectionViewSource.SourceProperty)
    be.UpdateTarget()
    End Sub
    And this is what I use to delete a row from the table (and without doing anything special, the DataGrid auto-updates with the changes):
    Private Sub Button_Click_4(sender As Object, e As RoutedEventArgs)
    If TableAssetsDataGrid.SelectedIndex = -1 Then
    MsgBox("You have selected nothing to Delete!", MsgBoxStyle.OkOnly, "Nothing Selected")
    Else
    Dim dgv As DataGridTextColumn = Me.FindName("NodeColumn")
    Dim row As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText As String = row.Item("node")
    Dim dgv2 As DataGridTextColumn = Me.FindName("SerialColumn")
    Dim row2 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText2 As String = row.Item("serial")
    Dim dgv3 As DataGridTextColumn = Me.FindName("NameColumn")
    Dim row3 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText3 As String = row.Item("name")
    Dim dgv4 As DataGridTextColumn = Me.FindName("TypeColumn")
    Dim row4 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText4 As String = row.Item("type")
    Dim dgv5 As DataGridTextColumn = Me.FindName("_dateColumn")
    Dim row5 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText5 As String = row.Item("date")
    Dim dgv6 As DataGridTextColumn = Me.FindName("POColumn")
    Dim row6 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText6 As String = row.Item("po")
    Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
    Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
    RETAILISOAMDDataSetTableAssetsTableAdapter.RemoveAsset(dgvText, dgvText2, dgvText3, dgvText4, dgvText5, dgvText6)
    Dim cbb As ComboBox = Me.FindName("cbbLocation")
    Dim row7 As DataRowView = DirectCast(cbb.SelectedItem, DataRowView)
    Dim cbbtext As String = row.Item("node")
    RefreshGrid(cbbtext)
    End If
    End Sub
    --------- End of Edit
    It is bound to a Dataset which gets it's data from a SQL Database.
    Loading the Data and Filtering the data based on certain conditions work 100%. The problem I am having is as follows:
    I have a form on the Page that takes input and inserts a row into the Database. When this happens, the DataGrid won't automatically reflect the changes (even if I recall the Fill Method of the Dataset). No matter what I do, I have to refresh the entire page
    and THEN Fill the Dataset to see any changes.
    This is what strikes me as odd...
    When I do a delete row operation on the Database (Custom Method on the Dataset with conditions), and just Fill the Dataset again (without doing anything special), the row deletes and the changes is reflected IMMEDIATELY.
    What am I doing wrong here? Why would Delete Row reflect the changes on the DataGrid but no Insert Row?
    Thanks in Advance.
    (P.S. I am very rusty with my developing skills, I haven't done this in YEARS)

    >>And what about the the most important question, how exactly is TableAssetsViewSource defined in the XAML markup and what is
    its Source property set or bound to? And what about the reproducable sample...?
    Here is the Markup of the TableAssetsViewSource:
    <Page.Resources>
    <local:RETAILISOAMDDataSet x:Key="RETAILISOAMDDataSet"/>
    <CollectionViewSource x:Key="TableRegionsViewSource" Source="{Binding tableRegions, Source={StaticResource RETAILISOAMDDataSet}}"/>
    <CollectionViewSource x:Key="TableLocationsViewSource" Source="{Binding tableLocations, Source={StaticResource RETAILISOAMDDataSet}}"/>
    <CollectionViewSource x:Key="TableAssetsViewSource" Source="{Binding tableAssets, Source={StaticResource RETAILISOAMDDataSet}}"/>
    </Page.Resources>
    The ItemsSource of the DataGrid is bound to the TableAssetsViewSource:
    <DataGrid DataContext="{StaticResource TableAssetsViewSource}" ItemsSource="{Binding}" x:Name="TableAssetsDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" Margin="15,10,10,10" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Column="1" HeadersVisibility="Column" CanUserResizeRows="False" IsReadOnly="True">
    Just remember, this code was auto-generated with the drag & drop onto the Page, so I did little in terms of setting the actual bindings.
    All in all, what I have done so far works as intended, except that when I want to add a row to the table it does not reflect, and that it only shows after refreshing/restarting the application.
    I will try and put together a reproducable sample.

  • How to reflect variable price in outline agreement

    We procure many very complex tools that have options which significantly affect the price of that tool.  We would like to be able to reflect those price differences in the outline agreement by option within the following boundary conditions.
    1. Do not want to create a new material master for each option
    2. Do not want to utilize BOM
    3. We are buying the tool so sales order solutions won't work for us
    I have looked at configurable materials where I set up characteristics to reflect the options but I have not been able to figure out a way to price those individual options.  I do see how I could create multiple line items on the outline agreement for the same material and put unique combinations of the option characteristics in individual lines but that means I have to create a line item per option combination permutation which is much more painful than simply pricing individual options.  I also haven't seen any way to get SAP to select the correct line item based on these characteristics when doing source selection on the PR or PO.   I have started looking at variant pricing but that is completely new to me and I am not sure if that is going to go in the direction I want.  My fear is that this just allows me to price a combination of characteristics vs. pricing individual characteristics then combining the prices at the time of purchase (no different that having to create an OA line item per option combination permutation).  My apologies in advance for the convoluted message but it is difficult to ask about solutions when you are not sure what functionality potentially exists.
    Thanks,
    Ben

    Hi
    Try to check with variant Configuraqtion may be upto some extent helpful
    Check the link
    http://help.sap.com/saphelp_erp2004/helpdata/EN/92/58d455417011d189ec0000e81ddfac/frameset.htm

  • Send email from j2me through servlet

    Hi people,
    i hope you can help me because i am new in network programming.
    I am trying to send email from j2me to googlemail account I have 2 classes EmailMidlet (which has been tested with wireless Toolkit 2.5.2 and it works) and the second class is the servlet-class named EmailServlet:
    when i call the EmailServlet, i get on the console:
    Server: 220 mx.google.com ESMTP g28sm19313024fkg.21
    Server: 250 mx.google.com at your service
    this is the code of my EmailServlet
    import java.io.*;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.text.*;
    import java.util.Date;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class EmailServlet extends HttpServlet {
       public void doPost(HttpServletRequest request, HttpServletResponse response)
             throws IOException, ServletException {
          System.out.println("____emailservlet.doPost");
          response.setContentType("text/plain");
          PrintWriter out = response.getWriter();
          System.out.println("______________________________");
          out.println();
          String to = request.getParameter("to");
          System.out.println("____________________________to" + to);
          String subject = request.getParameter("subject");
          String msg = request.getParameter("msg");
          // construct an instance of EmailSender
          System.out.println("servlet_to" + to);
          send("[email protected]", to, subject, msg);
          out.println("mail sent....");
       public void send(String from, String to, String subject, String msg) {
          Socket smtpSocket = null;
          DataOutputStream os = null;
          DataInputStream is = null;
          try {
             smtpSocket = new Socket("smtp.googlemail.com", 25);
             os = new DataOutputStream(smtpSocket.getOutputStream());
             is = new DataInputStream(smtpSocket.getInputStream());
          } catch (UnknownHostException e) {
             System.err.println("Don't know about host: hostname");
          } catch (IOException e) {
             System.err
                   .println("Couldn't get I/O for the connection to: hostname");
          if (smtpSocket != null && os != null && is != null) {
             try {
                os.writeBytes("HELO there" + "\r\n");
                os.writeBytes("MAIL FROM: " + from + "\r\n");
                os.writeBytes("RCPT TO: " + to + "\r\n");
                os.writeBytes("DATA\r\n");
                os.writeBytes("Date: " + new Date() + "\r\n"); // stamp the msg
                                                    // with date
                os.writeBytes("From: " + from + "\r\n");
                os.writeBytes("To: " + to + "\r\n");
                os.writeBytes("Subject: " + subject + "\r\n");
                os.writeBytes(msg + "\r\n"); // message body
                os.writeBytes(".\r\n");
                os.writeBytes("QUIT\r\n");
                // debugging
                String responseLine;
                while ((responseLine = is.readLine()) != null) {
                   System.out.println("Server: " + responseLine);
                   if (responseLine.indexOf("delivery") != -1) {
                      break;
                os.close();
                is.close();
                smtpSocket.close();
             } catch (UnknownHostException e) {
                System.err.println("Trying to connect to unknown host: " + e);
             } catch (IOException e) {
                System.err.println("IOException: " + e);
       } 1.when i print "to" in EmailServlet also:
      String to = request.getParameter("to");
          System.out.println("____________________________to" + to);  it show null on the console :confused:
    2. ist this right in case of googlemail.com?
      smtpSocket = new Socket("smtp.googlemail.com", 25);  I would be very grateful if somebody can help me.

    jackofall
    Please don't post in old threads that are long dead. When you have a question, please start a topic of your own. Feel free to provide a link to an old thread if relevant.
    I'm locking this thread now.
    db

Maybe you are looking for

  • Have Acrobat 5.0 AND Reader 8.1 installed.  Internet PDF files won't open. Uses 5.0 ?!

    How can I make sure that whenever I try to open a PDF file on the Internet the default application is Reader 8.1? The Acrobat 5.0 is old (I know), but I use it to create PDFs, but I want it to ignore the old 5.0 reader and use the new 8.1 reader. Any

  • Pricing condition on batch

    Dear all, I want to manage a pricing with conditions based on material master data and batch. Do I have the opportunity to do that in SAP? If yes, can you explain to me the customizing for that, regards, Julien

  • N8 - more clip art please?

    Anyone aware of any apps that add more clip art to the existing photo editing software? Thanks! V Nokia 3395 Nokia 6600 Nokia N95 8GB Nokia N8 (Anna) Nokia Lumia 930

  • Could not find resource 'ora.node2.vip'

    During the extention of node,I get message to run three scipts on nodes: 1 /opt/u01/app/oracle/oraInventory/orainstRoot.sh node2 2 /opt/u01/app/oracle/product/10.2.0/crs_1/install/rootaddnode.sh node3 3 /opt/u01/app/oracle/product/10.2.0/crs_1/root.s

  • Three questions about visual composer?

    Hi all, 1. what is the relationship between "visual composer and "visual composer BI kit"? what else elements do we need to add on top of visual composer in order to make visual composer BI kit? 2. If we only do visual composer, the only thing we can