Problem in use of  control statments

hii frds  i m new  in abap development
plz help me...
i m creating a classical report...i hav selected data in final internal table  i_final .
fields  are regio , werks 
let the data r following regio---werks
                                      019 ---1001
                                     019-----1081
                                     019------1081
                                   019-------1081
                                  030----
1015
                                  030-------1015
i want output  in this format   
               019-----1001
               019---1081
                          1081
                          1081
                 030----1015
                            1015
i m using following codes
FORM DISPLAY_DATA .
  SORT I_FINAL BY REGIO  WERKS .
    LOOP AT I_FINAL .
    AT NEW REGIO .
      WRITE : / I_FINAL-REGIO .
    ENDAT .
    WRITE : 5/  I_FINAL-WERKS .
ENDLOOP .
ENDFORM.
please tell me correct code............thanks in advance
  ENDFORM .
Edited by: vikram00797 on Sep 15, 2009 12:28 PM

>
vikram00797 wrote:
>  I know i m very close to solution ..i hav change it many times .but not getting correct output.can u tell me correct code......
Hello Vikram,
In the output are you getting '*' ? If yes, then take the contents of the header line in a dummy line & display the record :
FORM DISPLAY_DATA .
DATA: L_FINAL LIKE LINE OF I_FINAL.
SORT I_FINAL BY REGIO WERKS .
LOOP AT I_FINAL .
L_FINAL = I_FINAL.
AT NEW REGIO .
WRITE : / L_FINAL-REGIO .
ENDAT .
WRITE : 5/ L_FINAL-WERKS .
ENDLOOP .
ENDFORM.
Hope this helps.
BR,
Suhas

Similar Messages

  • Problem in using database control in JPD.

    Hi All,
    I am developing a JPD which also involves using DB control. The connected DB is Oracle 9.2.
    I have created DB control with "insert" method and one with "update" method.
    When i call "insert" method in JPD by dynamically passing values, it works fine. I have a "task control" in a JPD and once the task is complted by a specific user, again I am calling "update" method.
    Here it fails to update the DB. The strange part is that the perform node executes after the control send node and there are no exceptions. Heres my update method
    * @jc:sql command-type="update" statement::
    * UPDATE PROPOSAL_INFO SET status = {status} WHERE track_num = {trackingNumber}
    * @common:message-buffer enable="false"
    void updateStatusAndDesc(String status,String trackingNumber);
    The strange part is that, If I hard code the "status" and "trackingNumber" value instead of passing dynalically by using (ie without using {}), then update happens.
    Can somebody suggest me the solution for this problem??
    Thanks in advance,
    Prashanth Bhat.

    Hello,
    I do not know the source of your problem, but
    a.) Check if the db colum types match the parameter types
    See http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conMappingDBFieldsToJavaTypesInTheDBCtrl.html for more info
    b.) command-type is only used for rowset controls.
    -Kai

  • Problem in using Office Control to launch ms word

    Hi Armin,
                   What u said is right, but the data type of both the attributes in view context and controller context are same (binary). I had placed all the code in component controller only and trying to assign the Byte array to controller context (binary) attribute only. I think there might be some problem with supplier function. Plse check it once...
    Regards
    Ramesh.k

    Hello,
    I do not know the source of your problem, but
    a.) Check if the db colum types match the parameter types
    See http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conMappingDBFieldsToJavaTypesInTheDBCtrl.html for more info
    b.) command-type is only used for rowset controls.
    -Kai

  • Problems to create data control in JDeveloper 11g

    Hi everybody , I´m having problems to use Data Control in Jdev 11 , I create an jpa , and with my entities I create the data control component , but when I try to create a JSF page I can´t use data control, where is data control component palette ?

    Please post JDev 11 questions on the JDev 11 forum
    JDeveloper and OC4J 11g Technology Preview
    Follow this tutorial to see the data control palette for EJB/JPA
    http://www.oracle.com/technology/obe/obe11jdev/11/ejb/ejb.html
    Here is how it will look like:
    http://www.oracle.com/technology/obe/obe11jdev/11/ejb/images/t50105.gif

  • Problems using access control in sender agreement for SOAP adapter 7.1

    I am trying to use Access Control Lists to restrict user access to web services/interfaces which are exposed via PI. This can be configured via the Integration Builder Directory using the u201CAssigned Usersu201D tab of both Communication Components (Business System) and Sender Agreements.
    The configuration is via the above mentioned components. However, I understand that itu2019s the adapters which at runtime are responsible for actually applying these checks.
    I have been having problems getting the access control to work using a setup involving a SOAP adapter of type SAP BASIS 7.10.
    The symptom of the problem is that although the access control works as expected at the Business System level, any settings at the Sender Agreement level appear to have absolutely no effect whatsoever.
    I have confirmed that I have no problems if I use an adapter of type SAP BASIS 7.00. However, I really need to get this working on 7.1.
    I have looked on the SAP support portal but can not find any notes that relate to this.
    Has anyone else had a similar problem? And have you found a fix for it?
    Any suggestions would be welcome.
    Edited by: Malcolm Dingle on Jun 17, 2009 1:08 PM

    Hi Shai,
    Please have a look at the following link and see if it helps you .
    It deals with SOAP adapter installation and activation 
    Re: SOAP adapter installation and activation
    Best Regards
    Edited by: Prakash Bhatia on May 8, 2009 11:51 AM

  • Problem in adding "TableLayoutPanel" control array type functionality on windows form dynamically using drag and drop

    Environment: -
     (Application Machine)
    OS Name             : -
    Microsoft Windows 7 Professional/XP SP2/SP3            
    OS Bit Version      : -
    32 Bit                     
    Application Name: - Designer.exe                                  
    IDE                  
        : - Visual Studio 2008                        
    EXE Application development: -
    VB. Net
    Application Type: -
    Application “Designer.exe” was designed in vb6.0 and now, it has been upgraded to Visual Studio 2008 and it works properly.
    Product Description: -
                 We have an application Designer.exe, which is used for designing “Forms”.
    It has menu option with following option like Panel, Text Box, Combo Box, Button etc. We drag any of this menu items and place it to form.
    Requirement: -
    We have
    critical requirement in product. In Designer.exe, we need to align form margin, while we increase or decrease window. And for that we have searched that 
     “TableLayoutPanel” components can be helpful.
    Problem description: -
    Earlier code was in vb6.0, now it has upgraded to Visual Studio 2008. In vb6.0, we have used control array for memory utilization with Combo Box, Group Box, and Text
    Box etc.
    But, for alignment we have to use “TableLayoutPanel”
    control array type functionality on form.
    Code Snippet: - For earlier designing component e.g. Frame
    'Required by the Windows Form Designer
    Public WithEvents Frame1 As Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container
    Me.Frame1 = New Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray(Me.components)
    CType(Me.Frame1, System.ComponentModel.ISupportInitialize).BeginInit()
    . Kindly suggest approach for implementing requirement.
    Kindly help us to complete the requirement. I will be really
    thankful for any assistance.

    Hi S.P Singh,
    Welcome to MSDN.
    I am afraid that as Renee Culver said, these forums donot support VB6, you could refer to this thread:
    Where to post your VB 6 questions
    You could consider posting this issue in these forums below:
    These forums do not support Visual Basic 6, however there are many third-party support sites that do. If you have a VB6-related question please visit these popular forums:
    VB Forums
    VB City
    Thanks for your understanding.
    Best Regards,
    Youjun Tang
    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.

  • Data Guard Summary problem using Grid Control.

    I setup data guard using Grid Control and after completion, the console of the standby database shows: "Unable to determine Data Guard information." under the Data Guard Summary section. The primary database is not showing the standby. I'm using Red Hat Linux Server 5.7 (64bit) and Oracle 10.2.0.5. This is a standalone (no RAC or ASM involved). When I run show configuration, the following comes up:
    DGMGRL> SHOW CONFIGURATION;
    Configuration
    Name: PRODDB_ghph@ora01
    Enabled: YES
    Protection Mode: MaxPerformance
    Fast-Start Failover: DISABLED
    Databases:
    ghph - Primary database
    gsbh - Physical standby database (disabled)
    Current status for "PRODDB_ghph@ora01":
    SUCCESS
    I tried searching online and metalink but nothing. Any help in solving this problem would be appreciated. TIA
    Edited by: Gensis2001 on Jan 8, 2013 3:08 PM

    Gensis2001 wrote:
    Does this make any sense?
    SYS@gsbh> SELECT * FROM V$ARCHIVE_GAP;
    no rows selected
    SYS@gsbh> select process, status, sequence# from v$managed_standby;
    PROCESS STATUS SEQUENCE#
    ARCH CLOSING 60353
    ARCH CLOSING 60352
    RFS IDLE 60354
    MR(fg) WAIT_FOR_GAP 58673
    4 rows selected.Currently standby is waiting for the sequence *58673* but the later on archives of series 60353... are already archived.
    Can you confirm that only archive sequence * 58673* is missing or any more? If you have less number of archives are missing then see how the parameters you configured. like FAL_SERVER, LOG_ARCHIVE_CONFIG, LOG_ARCHIVE_DEST_n so on.
    Check below command and see any errors with remote destinations
    select severity,error_code,to_char(timestamp,'DD-MON-YYYY HH24:MI:SS') "timestamp" , message from v$dataguard_status where dest_id=2;Source: http://www.oracle-ckpt.com/dataguard_troubleshoot_snapper/
    If the archives are missing so many and you do not have backup, then certainly you have to choose incremental roll forward to synchronize the primary database, then only you can see the configuration status of Broker as valid. You can refer this article to perform incremental roll forward http://www.oracle-ckpt.com/rman-incremental-backups-to-roll-forward-a-physical-standby-database-2/

  • Problems with using the singlewrite function (in the CWDIO control)

    Hi,
    I'm using an old nidaq card (PCI 1200) with nidaq 6.9 (the card is not supported after this version).
    I'm using a CWDIO control to send regularly orders to an other card (an order every 50 ms for example) using these lines of code :
    CWDIO1.Ports.Item(1).SingleWrite (128)
    CWDIO1.Ports.Item(1).SingleWrite (0)
    The problem is that I have blanks in the orders sent. During 2 or 3 seconds, the orders are sent, no error or warning are made by the code, but the orders don't appear at the output of the card. After this blank period, the orders reappear (as if they were queued somewhere) and during 2-3 seconds the orders are well sent in real-time and a new blank period begins again ...
    Where am I wrong in what I made ? I tried using CWDO control but I had some problems too (the Progress event doesn't raise)...
    Antoine

    Hello Antoine,
    Do you see the same behavior when you are testing the device from the test panels of MAX ?
    Do you have also try to test the examples for VB without Component Works "C:\Program Files\National Instruments\NI-DAQ\Examples\VBasic\Do" ?
    Do you have also the same behavior running the Measurement Studio examples "C:\Program Files\National Instruments\MeasurementStudio\VB\Samples\DAQ\Digital\Digital Output" ?
    Regards.
    Matthieu Gourssies
    National Instruments France

  • Problem when call rfc using function control

    i try to call rfc using functin control but error "wdtfuncs error '800a03eb' Fail to call Remote Function Module" be popuped.
    my code like that:
    Set objSAPFunction = Server.CreateObject("SAP.Functions")
              Set objSAPFunction.Connection = objSAPConn.NewConnection
              IsLogOnSAP = False
              If objSAPFunction.Connection.Logon(1, True) Then
                   IsLogOnSAP = True
                   'Upload Cancel Invoice
                  Set objFunc = objSAPFunction.Add("ZRFC_SD_BILLINGDOC_GET1")
                   Set objISGR1 = objFunc.exports("DOCUMENT")
                   Set objISGR2 = objFunc.exports("COMPANYCODE")
                   Set objISGR3 = objFunc.exports("YEAR")
                   set objOSGR1 = objFunc.imports("NETVALUE")
                   set objOSGR2 = objFunc.imports("CURRENCY")
                   set objOSGR3 = objFunc.imports("DATE")
                   set objOSGR4 = objFunc.imports("CUSTOMERCODE")
                   set objOSGR5 = objFunc.imports("CUSTOMERNAME")
                   objISGR1.value = cstr(doc)
                   objISGR2.value = cstr(companycode)
                   objISGR3.value = cstr(year)
                   bResult = objFunc.Call          <<<<< Error
                   GetDataFromSAP = Array(cstr(objOSGR1),cstr(objOSGR2),cstr(InvDateFormat(objOSGR3)),cstr(objOSGR4),cstr(objOSGR5))
                   If IsLogOnSAP Then
                             objSAPFunction.Connection.Logoff
                        End If
              End If
    These code can run on the A machine, but do not run on the B machine. And both two machines have been installed SAP FrontEnd.
    which problem about it?

    To change all definition of parameters of the function from type to like may be solution.

  • Problems using ActiveX controls

    Hello all,
    I bought a set of ActiveX controls provided with a installation routine.
    Using those controls within LabView after installing them were no
    problem, but for distribution purpose I have to install those ActiveX
    controls manually.
    So I tried to do it on a separate computer by registering the ActiveX
    controls with regsvr32 [regsvr32 ]. But the attempt to
    start a LabView program where these controls were embedded ended with
    the error message "error opening document" (ole_lv5container) and "error
    510 occurred while loading ActiveX control ..."
    I'm working with Windows NT 4.0 and LabView 5.0f2.
    Does anyone know, what I made wrong?
    Bye, Alexander
    Sent via Deja.com http://www.deja.com/
    Before you
    buy.

    Hello all,
    I bought a set of ActiveX controls provided with a installation routine.
    Using those controls within LabView after installing them were no
    problem, but for distribution purpose I have to install those ActiveX
    controls manually.
    So I tried to do it on a separate computer by registering the ActiveX
    controls with regsvr32 [regsvr32 ]. But the attempt to
    start a LabView program where these controls were embedded ended with
    the error message "error opening document" (ole_lv5container) and "error
    510 occurred while loading ActiveX control ..."
    I'm working with Windows NT 4.0 and LabView 5.0f2.
    Does anyone know, what I made wrong?
    Bye, Alexander
    Sent via Deja.com http://www.deja.com/
    Before you
    buy.

  • Problems connecting to a remote OPC server in write mode using CWDataSocket control

    Hi.
    I have been struggling with an odd feature when trying to connect to a remote OPC server using CWDataSocket control, though I'm not sure if it's a CWDataSocket related problem. But anyway, the following error occurs: "Active: Can't write data." Error number: "-2147467259". Now, when I connect to a local OPC server
    and write some data and then again connect to the remote server, no errors occure and reading and writing work fine. The same error occurs when I try the same in LabVIEW. What could be the problem?
    No errors occure when I connect to the server with some other OPC client application.
    Thanks in advance.
    - Asko -

    The ConnectTo operation (as are all DataSocket operations) is asynchronous. In order for it to complete, you must process Windows messages after calling it and before calling another operation. Is it possible that you are trying to write data before the connection operation is complete?
    One easy way to test this would be to put the ConnectTo and the Write in separate control callbacks, cause ConnectTo to be called, wait a while, then cause the Write to be called. Alternatively, you could do something like the following:
    dsWrite.ConnectTo txtUrl.Text, cwdsWrite
    While Not ((dsWrite.Status = cwdsConnectionActive) Or (dsWrite.Status = cwdsConnectionIdle))
    DoEvents
    Wend
    If this is the problem, then you'll probably want to go with the
    second option. In a production system, you should include a timeout in the While loop so that if the connection actually cannot be made, you are not stuck in an infinite loop.

  • Problem connecting using VB Oracle Data Control oradc.ocx but otherwise ok.

    I am trying to run one of the sample vb apps DataCtrl that uses the Oracle Data Control (oradc.ocx) to simplify connecting to a database and getting the data into a databound control. I have tried every combination of name/id/pw and get the same error - ORA-12154:TNS:could not resolve service name.
    I have 2 of the sample databases created - "employees" and "demo". Using XE, i can open and view both db's with no problem. Using the ODBC configuration dialog I can configure and test the connection to both and tests ok. I have used programs to convert Oracle to Excel and Excel to Oracle and both find the db with no problem either.
    If I tnsping to XE, employees or demo, the response is negative. The file tnsnames.ora exists in the /admin dir and lists only XE. The file sqlnet.ora has nothing (except comments) in it.
    I have read every bit of documentation on the internet and no help. I just opened "employees" and "demo" again with XE without a problem. However when I try to run the Oracle/Excel conversion programs now, they are now showing the 'name error also. I have tried both the sample VB app and the Oracle/Excel converter programs with XE/employees open and closed and it makes no difference.
    Everything that I have read indicates that you should be able to use the actual db name, ie; "employees". I have run out of combinations of names/ids/pws and hope I can get some help here. Thanks in advance.

    The firewall was blocking TNSLSNR.exe!

  • Problem  in using COLLECT statment

    Hi experts,
    getting problem in using COLLECT statement.  attaching my code below.
    LOOP AT it_final1 INTO wa_final1.
         LOOP AT it_final INTO wa_final WHERE vagrp = wa_final1-vagrp AND verwmerkm = wa_final1-verwmerkm.
           wa_final1-anzwertg = wa_final-anzwertg.
           COLLECT wa_final1 INTO it_final1.
         ENDLOOP.
         CLEAR: wa_final1, wa_final.
       ENDLOOP.
    here , i want to use collect statement only for  "anzwertg" field from internal table. but 2 more fields also getting  compressed .
    attaching screen shot
    here, original_input and max fields also getting compressed.
    could anybody please help me out in this.
    Thanks in advance.
    Regards
    satish

    Hi satish....
    collect statement works based on char fields..
    by default it will taken char fields as a key fields .........
    if any char field is repeated then corresponding numc values will be added....
    other wise it will act as a APPEND statement......
    Here in ur code there is no char field then how it will caliculate that values...
    just check it once..
    Regards,
    Vamsi....

  • Problem receiving email using database control

    Hi all,
    I'm new to using EM and trying to configure it so I can receive email notifications when tablespace is getting full. I'm only using "Database Control" not Grid control.
    Oracle Enterprise Manager Database Control     10.2.0.0     
    I was able to successfully receive email using "Test Mail Servers" in Notification Methods.
    I already defined my rule and was able to specify "Tablespace Used %" metrics.
    I already defined a schedule so that mails are sent to my email.
    To test, i created records on one table until it's 100%.
    I do get alerts with EM Database Control but no mail.
    I logged in as sysman into the database being monitored (there is no repository because this is database control), I don't see any rows in mgmg_notification_log.
    Does anybody know if email notification only works in "Grid Control" not "Database Control"?
    I'd appreciate any assistance.

    Grid Control has hundreds of email alerts already setup that you can use , but I pretty sure you need to buy
    that pack for email alerts to keep them in service after you evaluate.

  • Problem with using JMF audio over a network

    Hiya, I'm using IBM JMF code but I'm having problems trying to get it transmit data from the MediaTransmitter to the MediaPlayerFrame.
    I'm kinda new to JMF so I assume I'm missing something basis for why this doesn't work.
    Any help would be greatly appreciated.
    MediaPlayerFrame
    import javax.media.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    * An instance of the MediaPlayerFrame may be used to display any media
    * recognized * by JMF.  This is intended to be a very simple GUI example,
    * displaying all possible controls for the given media type.
    public class MediaPlayerFrame extends JFrame {
         * The frame title.
        private static final String FRAME_TITLE = "developerWorks JMF Tutorial " +
            "Media Player";
         * The panel title of the main control panel.
        private static final String CONTROL_PANEL_TITLE = "Control Panel";
        // location and size variables for the frame.
        private static final int LOC_X = 100;
        private static final int LOC_Y = 100;
        private static final int HEIGHT = 500;
        private static final int WIDTH = 500;
         private final static long serialVersionUID = 1;
         * The current player.
        private Player player = null;
         * The tabbed pane for displaying controls.
        private JTabbedPane tabPane = null;
         * Create an instance of the media frame.  No data will be displayed in the
         * frame until a player is set.
        public MediaPlayerFrame() {         
            super(FRAME_TITLE);
            System.out.println("MediaPlayerFrame");
            setLocation(LOC_X, LOC_Y);
            setSize(WIDTH, HEIGHT);
            tabPane = new JTabbedPane();
            getContentPane().add(tabPane);
            /* adds a window listener so that the player may be cleaned up before
               the frame actually closes.
            addWindowListener(new WindowAdapter() {
                                   * Invoked when the frame is being closed.
                                  public void windowClosing(WindowEvent e) {
                                      closeCurrentPlayer(); 
                                      /* Closing this frame will cause the entire
                                         application to exit.  When running this
                                         example as its own application, this is
                                         fine - but in general, a closing frame
                                         would not close the entire application. 
                                         If this behavior is not desired, comment
                                         out the following line:
                                      System.exit(0);
         * Creates the main panel.  This panel will contain the following if they
         * exist:
         * - The visual component: where any visual data is displayed, i.e. a
         * movie uses this control to display the video.
         * - The gain component:   where the gain/volume may be changed.  This
         * is often * contained in the control panel component (below.)
         * - The control panel component: time and some extra info regarding
         * the media.
        private JPanel createMainPanel() {
            System.out.println("createMainPanel");
            JPanel mainPanel = new JPanel();
            GridBagLayout gbl = new GridBagLayout();
            GridBagConstraints gbc = new GridBagConstraints();
            mainPanel.setLayout(gbl);
            boolean visualComponentExists = false;
            // if the visual component exists, add it to the newly created panel.
            if (player.getVisualComponent() != null) {
                visualComponentExists = true;
                gbc.gridx = 0;
                gbc.gridy = 0;
                gbc.weightx = 1;
                gbc.weighty = 1;
                gbc.fill = GridBagConstraints.BOTH;
                mainPanel.add(player.getVisualComponent(), gbc);
            // if the gain control component exists, add it to the new panel.
            if ((player.getGainControl() != null) &&
                (player.getGainControl().getControlComponent() != null)) {
                gbc.gridx = 1;
                gbc.gridy = 0;
                gbc.weightx = 0;
                gbc.weighty = 1;
                gbc.gridheight = 2;
                gbc.fill = GridBagConstraints.VERTICAL;
                mainPanel.add(player.getGainControl().getControlComponent(), gbc);
            // Add the control panel component if it exists (it should exists in
            // all cases.)
            if (player.getControlPanelComponent() != null) {
                gbc.gridx = 0;
                gbc.gridy = 1;
                gbc.weightx = 1;
                gbc.gridheight = 1;
                if (visualComponentExists) {
                    gbc.fill = GridBagConstraints.HORIZONTAL;
                    gbc.weighty = 0;
                } else {
                    gbc.fill = GridBagConstraints.BOTH;
                    gbc.weighty = 1;
                mainPanel.add(player.getControlPanelComponent(), gbc);
            return mainPanel;
         * Sets the media locator.  Setting this to a new value effectively
         * discards any Player which may have already existed.
         * @param locator the new MediaLocator object.
         * @throws IOException indicates an IO error in opening the media.
         * @throws NoPlayerException indicates no player was found for the
         * media type.
         * @throws CannotRealizeException indicates an error in realizing the
         * media file or stream.
        public void setMediaLocator(MediaLocator locator) throws IOException,
            NoPlayerException, CannotRealizeException {
              System.out.println("setMediaLocator: " +locator);
            // create a new player with the new locator.  This will effectively
            // stop and discard any current player.
            setPlayer(Manager.createRealizedPlayer(locator));       
         * Sets the player reference.  Setting this to a new value will discard
         * any Player which already exists.  It will also refresh the contents
         * of the pane with the components for the new player.  A null value will
         * stop the discard the current player and clear the contents of the
         * frame.
        public void setPlayer(Player newPlayer) {      
            System.out.println("setPlayer");
            // close the current player
            closeCurrentPlayer();          
            player = newPlayer;
            // refresh the tabbed pane.
            tabPane.removeAll();
            if (player == null) return;
            // add the new main panel
            tabPane.add(CONTROL_PANEL_TITLE, createMainPanel());
            // add any other controls which may exist in the player.  These
            // controls should already contain a name which is used in the
            // tabbed pane.
            Control[] controls = player.getControls();
            for (int i = 0; i < controls.length; i++) {
                if (controls.getControlComponent() != null) {
    tabPane.add(controls[i].getControlComponent());
    * Stops and closes the current player if one exists.
    private void closeCurrentPlayer() {
    if (player != null) {
    player.stop();
    player.close();
    * Prints a usage message to System.out for how to use this class
    * through the command line.
    public static void printUsage() {
    System.out.println("Usage: java MediaPlayerFrame mediaLocator");
    * Allows the user to run the class through the command line.
    * Only one argument is allowed, which is the media locator.
    public static void main(String[] args) {
    try {
    if (args.length == 1) {
    MediaPlayerFrame mpf = new MediaPlayerFrame();
    /* The following line creates a media locator using the String
    passed in through the command line. This version should
    be used when receiving media streamed over a network.
    mpf.setMediaLocator(new MediaLocator(args[0]));
    /* the following line may be used to create and set the media
    locator from a simple file name. This works fine when
    playing local media. To play media streamed over a
    network, you should use the previous setMediaLocator()
    line and comment this one out.
    //mpf.setMediaLocator(new MediaLocator(
    // new File(args[0]).toURL()));
    mpf.setVisible(true);
    } else {
    printUsage();
    } catch (Throwable t) {
    t.printStackTrace();
    MediaTransmitter
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import javax.media.format.*;
    import java.io.IOException;
    import java.io.File;
    * Creates a new media transmitter.  The media transmitter may be used to
    * transmit a data source over a network.
    public class MediaTransmitter {
         * Output locator - this is the broadcast address for the media.
        private MediaLocator mediaLocator = null;
         * The data sink object used to broadcast the results from the processor
         * to the network.
        private DataSink dataSink = null;
         * The processor used to read the media from a local file, and produce an
         * output stream which will be handed to the data sink object for
         * broadcast.
        private Processor mediaProcessor = null;
         * The track formats used for all data sources in this transmitter.  It is
         * assumed that this transmitter will always be associated with the same
         * RTP stream format, so this is made static.
        private static final Format[] FORMATS = new Format[] {
            new AudioFormat(AudioFormat.MPEG_RTP)};
         * The content descriptor for this transmitter.  It is assumed that this
         * transmitter always handles the same type of RTP content, so this is
         * made static.
        private static final ContentDescriptor CONTENT_DESCRIPTOR =
            new ContentDescriptor(ContentDescriptor.RAW_RTP);
         * Creates a new transmitter with the given outbound locator.
        public MediaTransmitter(MediaLocator locator) {
            mediaLocator = locator;
         * Starts transmitting the media.
        public void startTransmitting() throws IOException {
            // start the processor
            mediaProcessor.start();
            // open and start the data sink
            dataSink.open();
            dataSink.start();
         * Stops transmitting the media.
        public void stopTransmitting() throws IOException {
            // stop and close the data sink
            dataSink.stop();
            dataSink.close();
            // stop and close the processor
            mediaProcessor.stop();
            mediaProcessor.close();
         * Sets the data source.  This is where the transmitter will get the media
         * to transmit.
        public void setDataSource(DataSource ds) throws IOException,
            NoProcessorException, CannotRealizeException, NoDataSinkException {
            /* Create the realized processor.  By calling the
               createRealizedProcessor() method on the manager, we are guaranteed
               that the processor is both configured and realized already. 
               For this reason, this method will block until both of these
               conditions are true.  In general, the processor is responsible
               for reading the file from a file and converting it to
               an RTP stream.
            mediaProcessor = Manager.createRealizedProcessor(
                new ProcessorModel(ds, FORMATS, CONTENT_DESCRIPTOR));
            /* Create the data sink.  The data sink is used to do the actual work
               of broadcasting the RTP data over a network.
            dataSink = Manager.createDataSink(mediaProcessor.getDataOutput(),
                                              mediaLocator);
         * Prints a usage message to System.out for how to use this class
         * through the command line.
        public static void printUsage() {
            System.out.println("Usage: java MediaTransmitter mediaLocator " +
                               "mediaFile");
            System.out.println("  example: java MediaTransmitter " +
                "rtp://192.168.1.72:49150/audio mysong.mp3");
            System.out.println("  example: java MediaTransmitter " +
                "rtp://192.168.1.255:49150/audio mysong.mp3");
         * Allows the user to run the class through the command line.
         * Only two arguments are allowed; these are the output media
         * locator and the mp3 audio file which will be broadcast
         * in the order.
        public static void main(String[] args) {
            try {
                if (args.length == 2) {
                    MediaLocator locator = new MediaLocator(args[0]);
                    MediaTransmitter transmitter = new MediaTransmitter(locator);
                    System.out.println("-> Created media locator: '" +
                                       locator + "'");
                    /* Creates and uses a file reference for the audio file,
                       if a url or any other reference is desired, then this
                       line needs to change.
                    File mediaFile = new File(args[1]);
                    DataSource source = Manager.createDataSource(
                        new MediaLocator(mediaFile.toURL()));
                    System.out.println("-> Created data source: '" +
                                       mediaFile.getAbsolutePath() + "'");
                    // set the data source.
                    transmitter.setDataSource(source);
                    System.out.println("-> Set the data source on the transmitter");
                    // start transmitting the file over the network.
                    transmitter.startTransmitting();
                    System.out.println("-> Transmitting...");
                    System.out.println("   Press the Enter key to exit");
                    // wait for the user to press Enter to proceed and exit.
                    System.in.read();
                    System.out.println("-> Exiting");
                    transmitter.stopTransmitting();
                } else {
                    printUsage();
            } catch (Throwable t) {
                t.printStackTrace();
            System.exit(0);

    Okay, here's the it copied out.
    Media Transmitter
    C:\John\Masters Project\Java\jmf1\MediaPlayer>java MediaTransmitter rtp://127.0.
    0.1:2000/audio it-came-upon.mp3
    -> Created media locator: 'rtp://127.0.0.1:2000/audio'
    -> Created data source: 'C:\John\Masters Project\Java\jmf1\MediaPlayer\it-came-u
    pon.mp3'
    streams is [Lcom.sun.media.multiplexer.RawBufferMux$RawBufferSourceStream;@1decd
    ec : 1
    sink: setOutputLocator rtp://127.0.0.1:2000/audio
    -> Set the data source on the transmitter
    -> Transmitting...
       Press the Enter key to exit
    MediaPlayerFrame
    C:\John\Masters Project\Java\jmf1\MediaPlayer>java MediaPlayerFrame rtp://127.0.
    0.1:2000/audio
    MediaPlayerFrame
    setMediaLocator: rtp://127.0.0.1:2000/audioAs I said, it just kinda stops there, what it should be doing is opening the MediaPlayer.
    "MediaPlayerFrame" and "setMediaLocator: rtp://127.0.0.1:2000/audio" are just print outs I used to track here the code is getting to.

Maybe you are looking for