Help with dynamic playlist for mpd

Hi guys,
I use mpd with sonata for playing my music, and after trying exaile there is one thing id really like for mpd, and that is the dynamic playlist function.
When you're playing a song in exaile with dynamic playlist enabled, it queries audioscrobbler and automatically adds similar artists/songs to your playlist (if you have them on your pc).
I dont want to use exaile as it just feels too big and slow and bloated (not KISS ), i know a little bit of python so i thought i'll try and make my own little script/program as Sonata has audioscrobbler support, but i dont think there is anyway to query similar artists.
I think im going to try and make this as a daemon type program that will run in the background adding songs to the playlist.
Ive found the code from the exaile source (audioscrobbler.py) which queries lastfm e.g.
>>> lips = AudioScrobblerQuery(artist='The Flaming Lips')
>>> for artist in lips.similar():
... print artist.name, artist.mbid
This will print a list of similar artists to the flaming lips.
I've not done much with python so i thought this would be a good way to try and improve.
Does anyone have any suggestions as to what the best way to go about searching and comparing the results to my mpd database, would the best way just to be to search the mpd.db?
And if anyone else has any ideas/comments id like to hear them.
Edit:
I just found this too, so i may only need to change some things to integrate it with mpd rather than amarok
http://www.kde-apps.org/content/show.php?content=31920
Thanks
Last edited by Kane (2008-06-05 13:24:33)

well i just modified the patch into a little script, it does what i need
its here if anyone wants it
import audioscrobbler
import mpd
import random
import time
lastsong = {}
def timer_control():
get_similar()
time.sleep(10)
timer_control()
def get_similar():
audioscrobbler
client = mpd.MPDClient()
client.connect("localhost", 6600)
mpdstatus = client.status()
prevsonginfo = client.currentsong()
global lastsong
if mpdstatus['state'] == "stop": return
if prevsonginfo == lastsong: return
lastsong = prevsonginfo
similarartists = ""
song = prevsonginfo
#if not song: break #No song, do nothing
prevartist = song['artist']
# Is the info already cached?
similar_cache = {}
if similar_cache.has_key(prevartist):
similarartists = similar_cache[prevartist]
else:
#Not cached so fetch from Audioscrobbler
try:
similarartists = [artist.name for artist in audioscrobbler.AudioScrobblerQuery(artist=prevartist).similar()]
# Cache search results and save some time next search
similar_cache[prevartist] = similarartists
except audioscrobbler.AudioScrobblerError:
similar_cache[prevartist] = None # Empty cache
return # Do nothing!
if not similarartists: return # Empty list
# Split list in half and sort upper half
# this means good matches will have priority
# but makes sure artist A does not always result in artist B
half_idx = len(similarartists)/2
upperhalf = similarartists[:half_idx]
lowerhalf = similarartists[half_idx:]
random.shuffle(upperhalf)
artistlist = upperhalf
artistlist.extend(lowerhalf)
# Try each artist in order
for artist in artistlist:
try:
print "Trying:",artist
songs = client.search("artist", artist)
if not songs: continue
selected_song = random.sample(songs, 1)[0]
client.add(selected_song['file'])
print "Added", selected_song['title'],"by",selected_song['artist']
# Delete old song from playlist?
break
except mpd.MPDError, e:
print "MPDError", e.message
continue
except ValueError, e:
print "ValueError:",e.message
continue
timer_control()
Last edited by Kane (2008-06-06 16:22:49)

Similar Messages

  • Help With dynamic scripting for Dervied Property

    Hi,
    I am trying to get the the list of child nodes and then loopthorugh those nodes to do some calculation in a derived propety using dynamic scripting. I tried with below script.
    var childEnumerator = node.GetChildEnumerator();
    while(childEnumerator.MoveNext())
        var propValue = childEnumerator.GetCurrent().PropValue("Custom.Salary");
        print(propValue);
    While Evaluating this script I am getting below mentioned error. Any idea what i am missing here?
    DRM-16008: There was an error calculating Script property Custom.TotalSalaryExp for EMP_Zone/Emp/PPD1: TypeError: 'GetChildEnumerator' is not a function
    Please help me out. thanks fr your co-operation
    Regards,
    Sudipta

    Try this instead...
    var childEnumerator = node.GetChildEnumerator();
    childEnumerator.MoveNext();
    while(childEnumerator.GetCurrent() != null)
        var propValue = childEnumerator.GetCurrent().PropValue("Custom.Salary");
        print(propValue);
    childEnumerator.MoveNext();

  • Problem with tutorial:Creating a dynamic playlist for streaming flash video

    hi, anyone tried the tutorial: creating a dynamic playlist
    for streaming flash video?
    i follow the instruction exactly as stated in the tutorial
    and test the fla file, it worked perfectly well when i open the swf
    using the macromedia flash 8. Everything look fine. Nothing is
    changed except the url is changed to "rtmp://localhost/videosource"
    in the xml file.
    after i publish the file using the setting: access network
    only, i try to open the swf and html file from the folder, the
    thumbnail did not appear and there is no way i can click on any
    videos. What i see is only the list, and there is no response from
    the flash media server 2. All the files is in the same folder.
    Anyone please help with this problem???? thanks

    ....i debug the movie step by step
    and realised that the xml file is being read by the code...
    Your original problem stated it worked but not when playing
    outside the
    Flash authoring environment by simply loading the swf from
    the hard drive.
    The Flash authoring environment is a trusted environment and
    so you really
    need to test in the actual deployment mode which loading an
    swf from the
    hard drive is not a valid deployment unless an installed
    Flash player is
    available outside the web browser which you would have as you
    have the
    authoring tool and your users will not.
    Use a browser with
    http://yourdomain.com/yourmovie.html
    to do final
    debugging.
    In this regard you may need to debug the movie while running
    in real time
    mode in a web browser with
    http:// A technique to trace I suggested is to
    create a temporary TextField perhaps named out_txt and send
    trace message to
    it such as out_txt.text += "My Trace Expression".
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "free23" <[email protected]> wrote in
    message
    news:[email protected]...
    sorry but i don't understand what you mean....i debug the
    movie step by step
    and realised that the xml file is being read by the code...
    this is a sample of my log files:
    #Fields: date time x-pid x-status x-ctx x-comment
    2006-05-15 20:08:58 3072 (i)2651170 Unloaded application
    instance
    videosource/_definst_ -
    2006-05-15 20:48:19 3848 (s)2641173 FCApplication loaded
    successfully.
    2006-05-15 20:48:19 3848 (s)2641173 Communication Framework
    loaded
    successfully.
    2006-05-15 20:48:19 3848 (s)2641173 SimpleConnect loaded
    successfully. -
    2006-05-15 20:48:19 3848 (s)2641173 VideoConference loaded
    successfully. -
    2006-05-15 20:48:19 3848 (s)2641173 Video Playback loaded
    successfully. -
    2006-05-15 20:48:19 3848 (s)2641173 Communication Components
    loaded
    successfully.
    2006-05-15 20:48:19 3848 (s)2641173 Sending this message:
    Hello! You are
    connected as: undefined -
    2006-05-15 20:48:19 3848 (e)2641190 Error : command msg sent
    before client
    connection has been accepted. -
    2006-05-15 20:48:20 3848 (s)2641173 Sending this message:
    Hello! You are
    connected as: undefined -
    2006-05-15 20:48:20 3848 (e)2641190 Error : command msg sent
    before client
    connection has been accepted. -
    2006-05-15 20:48:20 3848 (s)2641173 Sending this message:
    Hello! You are
    connected as: undefined -
    2006-05-15 20:48:20 3848 (e)2641190 Error : command msg sent
    before client
    connection has been accepted. -
    2006-05-15 20:48:20 3848 (s)2641173 Sending this message:
    Hello! You are
    connected as: undefined -
    2006-05-15 20:48:20 3848 (e)2641190 Error : command msg sent
    before client
    connection has been accepted. -
    2006-05-15 20:48:20 3848 (s)2641173 Sending this message:
    Hello! You are
    connected as: undefined -
    2006-05-15 20:48:20 3848 (e)2641190 Error : command msg sent
    before client
    connection has been accepted. -
    2006-05-15 20:49:42 3848 (s)2641173 Sending this message:
    Hello! You are
    connected as: false -
    hope this help...

  • Trouble with Creating a Dynamic Playlist for Progressive Flash Video

    Hey There,
    I have been working on building a flash video player and are
    trying to incorporate the Dynamic Playlist for Progressive Flash
    Video. Everyting is working expect the thumbs are not appearing.
    Instead, on each row of the list it says " type function". The list
    is populated with data b/c i can navigate it and select a video to
    watch, just the thumbs are missin.
    Any ideas how I can get my jpg thumbs to appear?
    thanks

    I worked on the same project and it is working alright and
    still interested in adding more features like play pause etc ....
    but for now I'm more interested in adding the buffering bar and
    progress bar.
    Any help is welcome.

  • Dynamic Playlist for streaming video

    This is my first attempt at building a dynamic playlist for
    streaming flash video and I'm following the tutorial at
    "macromedia.com/devnet/flash/articles/video_player.html". I've
    changed the paths to my FMS and loaded the video files to the
    applications directory of the FMS (flash_applications/videosource).
    The thumbnails load and the player skin loads but the videos do not
    load when I click on the thumbnails.
    I've read the earlier post about this same issue. I followed
    the advice from that post and reloaded the 'main.asc' file from my
    Flash 8 program files but the video still does not play.
    Here is a link to the site so you can see the problem:
    http://media.us.elsevierhealth.com/videosource/VideoSource1.swf
    My FMS is 'media.us.elsevierhealth.com'
    I believe my code is correct and I believe the paths I've
    created are correct. If someone could review my code and check the
    path info I would appreciate it. Here is the code from
    'VideoSource1.as'
    import mx.video.*;
    //Set up the list box, call function VideoThumb to create the
    actual thumbnails
    list.rowHeight = 70;
    list.cellRenderer = "VideoThumb";
    list.selectable = true;
    //create new empty listener object
    listListener = {};
    nc = new NetConnection(); //create a connection
    nc.connect("rtmp://media.us.elsevierhealth.com/videosource");
    //connect to FCS (nav.attributes.url)
    ns = new NetStream(nc); //create a stream
    ns.connect(); //connect the stream
    nc.connect("rtmp://media.us.elsevierhealth.com/videosource");
    var stream_ns:NetStream = new NetStream(nc);
    stream_ns.play("video2.flv");
    // Create function to trace all the status info.
    function traceStatus(info) {
    Message.text+="Level: " + info.level + " Code: " +
    info.code+"\n";
    } // Assign this function to onStatus handlers when you
    create objects.
    //Function to handle what happens when an item in the list is
    selected
    listListener.change = function( evtobj ) {
    var nav = list.dataProvider[list.selectedIndex];
    var reset = true;
    for ( var i = 0; i < nav.childNodes.length; i++ ) {
    var stream = nav.childNodes
    if ( stream.nodeName == "stream" ) {
    attachMovie("FLVPlayback", "my_FLVPlybk", 10, {width:320,
    height:240, x:90, y:100});
    //center the FLVPlayback component when FLV is ready to play
    var listenerObject
    bject = new Object();
    listenerObject.resize = function(eventObject
    bject):Void {
    //center video in playback area
    newx = (460 - my_FLVPlybk.preferredWidth)/2;
    newy = (470 - my_FLVPlybk.preferredHeight)/2;
    my_FLVPlybk._x = newx;
    my_FLVPlybk._y = newy;
    my_FLVPlybk.addEventListener("resize", listenerObject);
    listenerObject.ready = function(eventObject
    bject):Void {
    my_FLVPlybk.setSize(250, 350);
    my_FLVPlybk.skin = "ClearExternalAll.swf";
    my_FLVPlybk.clear();
    my_FLVPlybk.contentPath =
    "rtmp://media.us.elsevierhealth.com/videosource/stream/_definst_/"
    + stream.attributes.name+".flv";
    my_FLVPlybk.autoSize = true;
    trace(my_FLVPlybk.contentPath);
    reset = false;
    //Add an event listener on the list, when it triggers, run
    the listListener function to repopulate the list
    list.addEventListener("change", listListener);
    //Function that loads the XML file, parses it, and builds the
    list of available video clips
    var xmllist = new XML(); //setup a variable to hold the XML
    xmllist.ignoreWhite = true;
    xmllist.load( "playlist-demo-1.xml" ); //load the XML file
    //The following gets called when the XML has been loaded
    xmllist.onLoad = function( status ) {
    if ( !status )
    trace( status );
    var entries = this.childNodes[0];
    var playlists = {};
    var nav = [];
    for ( var i = 0; i < entries.childNodes.length; i++ ) {
    var entry = entries.childNodes;
    if ( entry.nodeName == "listitem" )
    //builds array of video clip names
    playlists[entry.attributes.name] = entry;
    else if ( entry.nodeName == "menu" ) {
    //builds array of available videos
    for ( var j = 0; j < entry.childNodes.length; j++ )
    nav[j] = playlists[entry.childNodes[j].attributes.name];
    } //end else if
    } //end if
    //sends the array of videos to the listbox UI
    list.dataProvider = nav;
    } //end xmllist.onload
    Any advice or troubleshooting will be appreciated. Thanks in
    advance.

    I just used the server on Windows (as opposed to linux) and
    it worked great. So the issue, at least for me and my issue (could
    see the thumbnails, couldn't play the video) was windows vs. Linux.
    I guess the linux version doesn't work with this exact script. Now
    to put together something of my own to test to see if the linux
    version works right.

  • Creating a Dynamic Playlist for Progressive Flash Video

    Hi
    I just finished reading the Creating a Dynamic Playlist for
    Progressive Flash Video (
    http://www.adobe.com/devnet/flash/articles/prog_download.html)
    tutorial, and it gives a pretty good overview, however I would like
    to be able to add the ability to stop and start the video as well,
    and the tutorial doesn't really explain how the embedded video
    works. Does anyone know how this can be accomplished, or at least
    know where I can find information on how to do this.
    Thanks

    I worked on the same project and it is working alright and
    still interested in adding more features like play pause etc ....
    but for now I'm more interested in adding the buffering bar and
    progress bar.
    Any help is welcome.

  • Is it possible to make a search help with dynamic  selection table?

    Hi Experts,
    Is it possible to create search helps with dynamic seletion tables means
    i dont know the selection table names at the time of creation of search help.
    These tables will be determined at runtime.
    if yes, Please give an idea how to create and pass the table names at runtime.
    Thanks
    Yogesh Gupta

    Hi Yogesh,
    Create and fill your itab and show it with FM F4IF_INT_TABLE_VALUE_REQUEST
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'field to return from itab'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'field on your screen to be filled'
          stepl           = sy-stepl
          window_title    = 'some text'
          value_org       = 'S'
        TABLES
          value_tab       = itab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
    Darley

  • HELP HELP HELP with adminstrator password for pavilion dv7 beats audio

    Hi. I need help with  adminstrator password for pavilion dv7 with window 7. I don't remember with is the  adminstrator password for pavilion dv7 beats audio. Is there anyway you can help me with this? once i enter 3 times is gives me this system disabled code: 52464663.  

    Hi
    Try this Key : 43542265 That should fix your issue 
    Hope this helps.
    ***** Click the KUDOS Thumbs UP (Like) on the left to say 'Thanks'*****
    ****Make it easier for other people to find solutions, by marking my answer “Accept as Solution”&"Kudos"if it solves your problem.****
    -VJ
    Although I am an HP Employee, I am speaking for myself and not for HP.

  • Creating a Dynamic Playlist for Streaming Flash Video

    Hello,
    I have been trying the tutorial given by Lisa Larson in order
    to create a dynamic playlist for streaming Flash video files. I
    have realized some of the FLV files that I have downloaded from
    internet don’t show in the thumbPlayList and cannot be
    played. But once I convert them back to WMV and the use the Flash 8
    Video Decoder to convert them to FLV file everything works fine.
    Any idea or suggestion why there is such a problem?
    Thank you for your advice.
    Babak
    ps.
    This
    is the link to the tutorial I mentioned ...

    Hello,
    I have been trying the tutorial given by Lisa Larson in order
    to create a dynamic playlist for streaming Flash video files. I
    have realized some of the FLV files that I have downloaded from
    internet don’t show in the thumbPlayList and cannot be
    played. But once I convert them back to WMV and the use the Flash 8
    Video Decoder to convert them to FLV file everything works fine.
    Any idea or suggestion why there is such a problem?
    Thank you for your advice.
    Babak
    ps.
    This
    is the link to the tutorial I mentioned ...

  • Help with Simple Applescript for Midipipe

    Hey all, I'm in desperate need of help with some Applescript for use in a program called Midipipe:
    http://web.mac.com/nicowald/SubtleSoft/MidiPipe.html
    I simply require an Applescript for Midipipe that filters out all OFF notes except for the most recently pressed key, or most recently pressed ON note. So for example, when multiple keys have been pressed, only the most recently pressed key will send an OFF note. I hope that is clear enough, i've had some major issues trying to get this work and my last hope is to hit the forums and find some help .. I've posted on some of the audio forums and i'm hoping someone here knows how to code this.
    Thanks so much!! .. Its for an upcomming show next week so i'm hoping someone can get me in the right direction to solving this.
    -Jes

    I try to help, but you'll need to apply your brain cells to get it working with what I've already explained (three times with what I offer below).  Try something like the following (I am renaming your buttons to ch1,ch2,ch3,ch4,ch5,ch6 so that the same functions can be shared by all buttons...
    // this assigns listeners to all 6 buttons
    for(var i:uint=1; i<7; i++){
              this["ch"+String(i)].addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint);
    // this processes any one of the 6 btns when they are clicked
    function fl_ClickToSeekToCuePoint_1(event:MouseEvent):void
        var btn = event.currentTarget;
        var cuePointInstance:Object = vid.findCuePoint(btn.name);
        vid.seek(cuePointInstance.time);
       resetButtons();    // this makes all buttons go back to normal
        btn.upState = btn.overState; // this makes the clicked button change states
    function resetButtons():void {
         for(var i:uint=1; i<7; i++){
              this["ch"+String(i)].upState =  this["ch"+String(i)].hitTestState;
    For this to work, your buttons need to have the same artwork in the hit frame as they do in the up frame.

  • I still need help with the Dictionary for my Nokia...

    I still need help with the Dictionary for my Nokia 6680...
    Here's the error message I get when trying to open dictionary...
    "Dictionary word information missing. Install word database."
    Can someone please provide me a link the where I could download this dictionary for free?
    Thanks!
    DON'T HIT KIDS... THEY HAVE GUNS NOW.

    oops, im sorry, i didnt realised i've already submitted it
    DON'T HIT KIDS... THEY HAVE GUNS NOW.

  • FLV Player with Dynamic Playlist

    So this is the first time I've experimented with a Dynamic
    Playlist in an FLV Player and I'm learning a lot. I found a
    tutorial on the Adobe site similar to what I'm looking to create.
    [URL="
    http://www.adobe.com/devnet/flash/articles/prog_download.html"
    one is for Progressive Download, which I want.[/URL]
    The same person also wrote one for [URL="
    http://www.adobe.com/devnet/flash/articles/video_player.html"
    I only mention that, because in the Streaming version, the videos
    have the standard Adobe video controls in them, and the Progressive
    tutorial does not. Usually I just create my own controls and link
    it to the video component that I'm using, but this tutorial is
    different than I normally roll.
    In the library there is an object type "Video", which I can't
    recall ever seeing before. If I delete it from the stage my videos
    won't play, so it's definitely important. It doesn't give
    parameters like the FLVPlayback does so I can't choose controls on
    it. I don't know if there is a way.
    Or maybe I need to build my own controls and find a way to
    tie them into what we have here, but that would be stretching the
    bounds of my knowledge, and I was hoping to have this up soon to
    send to a potential employer.
    What I'm looking for is some help to get pointed in the right
    direction to just add the controls to the player in that tutorial.
    If there is an "easy button" somewhere that I can push that'd be
    great. If I need to get dirty I'm willing to, but I'm a bit lost
    right now.
    Thanks in advance for any help!

    Search for JW player on Google and look at that.
    Regards
    FlashJester Support Team
    e. - [email protected]
    w. - www.flashjester.com
    "This has been one of the most impressive and thoroughly
    pleasant
    experiences of customer support I have ever come across -
    astounding!"
    Director - hedgeapple

  • Need help with Dynamic Excel File Name please.

    I am try to output an excel file with dynamic date. 
    Here what I done.
    I am using SQL 2012.
    Create Execute SQL Task Connect Type: Excel
    Create Data Flow Task set to DelayValidation: True
    Create OLE DB Sourc
    Create Data Converstion
    Excel Destination
    Excel Connection, Expression, select ExcelFilePath
    @[User::sXLFilePath] +  @[User::sFileName] + RIGHT("0" + (DT_WSTR, 2) DATEPART("DD", GETDATE()), 2)+ RIGHT("0" + (DT_WSTR, 2) DATEPART("MM", GETDATE()), 2) + RIGHT((DT_WSTR,
    4) DATEPART("YYYY", GETDATE()), 2) +".csv"
    C:\ExcelOutPut\SOX_CAM_SQL_Report_010215.xls
    What I try to accomplish is output the file with each day append to it, date must be DDMMYY.
    I google it and found many samples, tested it, and none of them is work for me. 
    Any suggestions or some examples to share is greatly appreciate. 
    I am new to SSIS.  I found one poster have similar issue and inside the posted below, there was one suggestion to create variable and connection string but how do I bind that variable to Excel Connection manger.
    Please help.
    Thank you so much in advance.
    Ex: SOX_CAM_SQL_Report _020215.csv
           SOX_CAM_SQL_Report _030215.csv
    --Similar issue:
    https://social.msdn.microsoft.com/Forums/en-US/bda433aa-c8f8-47c9-9e56-efd20b8354ac/creating-a-dynamic-excel-file?forum=sqlintegrationservices
    Suggestion in the above posted but where can bind this to Excel Connection Manger. 
    Please help provide step by step.  Thanks.
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\temp\\" + "ExcelTarget" + (DT_WSTR,4)DATEPART("yyyy",GETDATE())  +
    ".xls" + ";Extended Properties=\"EXCEL 8.0;HDR=YES\";"
    And yes, as you were intimating, the delay validation on the dataflow should be set.

    Hi NguyenBL,
    According to your description, you created ssis package to export data from database to excel, when the package runs, you want to create new excel and name the file with time stamp. If that is the case, we can achieve the goal by following steps:
    Create a script task used to create excel files.
    Create a data flow task to export data from database to excel.
    Add OLE DB source to data flow task.
    Add Excel Destination to data flow task.
    Create connection manager for OLE DB and Excel.
    Click Excel Connection Manager, in Properties window, click (…) button next to Expressions, then set ExcelFilePath with expression like below:
    "C:\\ETL Lab\\CreateNewExcel\\ExportData_"+REPLACE((DT_STR, 20, 1252)(DT_DBTIMESTAMP)@[System::StartTime], ":", "")+".xls"
    For detail information, please refer to the document:
    https://sqljourney.wordpress.com/2013/01/12/ssis-create-new-excel-file-dynamically-to-export-data/
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Need help in dynamic report for a range of year and period

    Dear all,
    I need help in creating an ALV report with dynamic columns based on the Year and period entered on the selection screen. for example if in the year we enter 2002 and period range from 10 to 12 then we should get the 3 columns display for cost(example) for period 10/2002, 11/2002 and 12/2002.
    Can anyone help me in achieving this dynamically since the user can enter the year also in intervals along with the period and data also needs to be populated in the corresponding columns.
    An example code would be of great help.
    Thanks,
    Amit

    Hi,
    Use field symbols as follows.
    TYPE-POOLS : SLIS.
    TABLES : MARC,T001W.
    DATA : BEGIN OF ITAB OCCURS 0,
           MATNR LIKE MARC-MATNR,
           END OF ITAB.
    DATA : FIELDSTAB TYPE LVC_T_FCAT,
           STAB      TYPE LVC_S_FCAT,
           T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           S_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
           NEW_LINE TYPE REF TO DATA,
           NEW_TABLE TYPE REF TO DATA,
           INDEX(3) TYPE C,
           STR(70),
           TEXT(6),
           CNT(1),
           TEXT1(16),
           REPID LIKE SY-REPID.
    FIELD-SYMBOLS : <FS> TYPE STANDARD TABLE,
                    <WA> TYPE ANY.
    SELECT-OPTIONS : S_WERKS FOR MARC-WERKS NO INTERVALS,
                     S_MATNR FOR MARC-MATNR NO INTERVALS.
    INITIALIZATION.
      REPID = SY-REPID.
    START-OF-SELECTION.
      SELECT * FROM MARC
               INTO CORRESPONDING FIELDS OF TABLE ITAB
               WHERE MATNR IN S_MATNR
               AND   WERKS IN S_WERKS.
      SORT ITAB BY MATNR.
      DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MATNR.
      STAB-FIELDNAME = 'MATNR'.
      STAB-DATATYPE  = 'CHAR'.
      STAB-INTLEN    = '18'.
      APPEND STAB TO FIELDSTAB.
      CLEAR CNT.
      LOOP AT S_WERKS.
        CLEAR TEXT.
        CNT = CNT + 1.
        CONCATENATE  'EISLO' CNT INTO TEXT.
        STAB-FIELDNAME = TEXT.
        STAB-DATATYPE  = 'CHAR'.
        STAB-INTLEN    = '16'.
        APPEND STAB TO FIELDSTAB.
        CLEAR S_WERKS.
      ENDLOOP.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = FIELDSTAB
        IMPORTING
          EP_TABLE        = NEW_TABLE.
      ASSIGN NEW_TABLE->* TO <FS>.
      CREATE DATA NEW_LINE LIKE LINE OF <FS>.
      ASSIGN NEW_LINE->* TO <WA>.
      PERFORM MOVE_DATA.
      CLEAR S_FIELDCAT.
      S_FIELDCAT-FIELDNAME = 'MATNR'.
      S_FIELDCAT-TABNAME = ITAB.
      S_FIELDCAT-SELTEXT_M = 'Part Number'.
      S_FIELDCAT-NO_ZERO = 'X'.
      S_FIELDCAT-DDICTXT   = 'M'.
      APPEND S_FIELDCAT TO T_FIELDCAT.
      CLEAR CNT.
      LOOP AT S_WERKS.
        CLEAR T001W.
        CNT = CNT + 1.
        SELECT SINGLE * FROM T001W WHERE WERKS = S_WERKS-LOW AND SPRAS = SY-LANGU.
        CLEAR TEXT.
        CONCATENATE 'EISLO' CNT INTO TEXT.
        S_FIELDCAT-FIELDNAME = TEXT.
        S_FIELDCAT-SELTEXT_M = T001W-NAME2.
    S_FIELDCAT-NO_ZERO = 'X'.
        S_FIELDCAT-DDICTXT   = 'M'.
        APPEND S_FIELDCAT TO T_FIELDCAT.
        CLEAR S_WERKS.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          IT_FIELDCAT = T_FIELDCAT[]
        TABLES
          T_OUTTAB    = <FS>.
    *&      Form  MOVE_DATA
          text
    FORM MOVE_DATA.
      LOOP AT ITAB.
        CLEAR STR.
        CONCATENATE ITAB-MATNR ' ' INTO STR SEPARATED BY SPACE.
        LOOP AT S_WERKS.
          CLEAR MARC.
          SELECT SINGLE * FROM MARC WHERE MATNR = ITAB-MATNR AND WERKS = S_WERKS-LOW.
          IF SY-SUBRC EQ 0.
            CLEAR TEXT1.
            TEXT1 = MARC-EISLO.
            CONCATENATE STR TEXT1 INTO STR SEPARATED BY SPACE.
          ELSE.
            CONCATENATE STR '0' INTO STR SEPARATED BY SPACE.
          ENDIF.
        ENDLOOP.
        <WA> = STR.
        APPEND <WA> TO <FS>.
        CLEAR ITAB.
      ENDLOOP.
    ENDFORM.                    "MOVE_DATA
    Reward points if helpful.
    Regards,
    Sankar..

  • Dynamic Playlist for Streaming Video Errors

    I'm using Lisa Larson's tutorial on the adobe website to
    create a dynamic playlist from an XML file to work with out FMS
    server. After playing around with it for an hour I finally got it
    to connect to the FMS and generate the thumbs but it won't stream
    any of the videos. When I click on the list item the video player
    comes up but doesn't load a video. Any ideas? The live log in the
    FMS console is giving me this error: "
    Error:
    command msg sent before client connection has been
    accepted."
    This is the link for the tutorial
    http://www.adobe.com/devnet/flash/articles/video_player.html

    i don't even get to see the thumbnails! i've left one of the
    original addresses in the xml, and that one always loads, both
    thumbnails and stream. however, every other one i've changed a
    number of ways, i never get any thumbnails nor streams. while
    testing the movie with flash 8, i get the output that the first
    connection (the original one) is a success, but all others are
    failed. in the xml, do you have to put the port in too? cause i've
    tried that, but it makes no difference whatsoever...

Maybe you are looking for

  • How do I keep BI Publisher running when I log out of the console in linux?

    I am using the standalone version of BI Publisher and I want to keep it running even after I log out of the console. I have a script that starts it so I typed 'nohup start_bipub.sh &' but when I log out it shuts down anyway. I started my apache serve

  • ILife does not appear as purchased in the Mac App Store

    I already bought the CD iLife 11 but in the Mac App Store does not appear as Purchased, how can I do it? Thanksi

  • Outlook integration problem

    hello,      I had configured the outlook properly , but  it does not able to send the main in my configred mail id & within the outlook.          some times it is work properlly after new installation of outlook addon  but when  i am change  the user

  • MacBook restarts to blue background when the lid closes-only sometimes????

    My Mac has done this periodically since six months after I've bought it. When I close the lid, I hear the restart tone and when I open it back up it's going through a restart process. Most of the time, it starts back up with a blue background (not th

  • Shadows of 1st monitor on second monitor.

    Hello! I just "upgraded" my setup from macmini to mbp. Which means I'm new to 2 screen setup, that I have now on my table. There are some really annoying things about it. As I use laptop in front of my cinema display I have laptop screen on the botto