How to add a scrolling text to display in a web part?

Hi,
I have 3 files in a doc library that is been referenced by a web part xml viewer in a page. I am referring only  the xml file.
WarningMessage.xml
<script type="text/javascript" src="http://icare/sites/IT/tst/XmlWebParts/WarningMessage/WarningMessage.js"></script>
WarningMessage.js
<script type="text/javascript">
<
//set the marquee parameters
function init() { rtl_marquee.start(); }
var rtl_marquee_Text = 'JavaScript scrolling text';
var rtl_marquee_Direction = 'left';
var rtl_marquee_Contents='<span style="font-family:Comic Sans MS;font-size:12pt;white-space:nowrap;">' + rtl_marquee_Text + '</span>';
rtl_marquee = new xbMarquee('rtl_marquee', '19px', '90%', 6, 100, rtl_marquee_Direction, 'scroll', rtl_marquee_Contents);
window.setTimeout( init, 200);
</script>
and
xbMarquee.js
document.writeln('<style type="text/css">');
document.writeln(' div.marqueecenter1 { text-align: center; }');
document.writeln(' div.marqueecenter2 { margin- margin-right: auto; }');
document.writeln(' div.marqueeleft1 { text-align: left; }');
document.writeln(' div.marqueeleft2 { margin- margin-right: auto; }');
document.writeln(' div.marqueeright1 { text-align: right; }');
document.writeln(' div.marqueeright2 { margin- margin-right: 0; }');
document.writeln('</style>');
function xbMarquee(id, height, width, scrollAmount, scrollDelay, direction, behavior, html)
  this.id            = id;
  this.scrollAmount  = scrollAmount ? scrollAmount : 6;
  this.scrollDelay   = scrollDelay ? scrollDelay : 85;
  this.direction     = direction ? direction.toLowerCase() : 'left';  
  this.behavior      = behavior ? behavior.toLowerCase() : 'scroll';  
//  this.name          = 'xbMarquee_' + (++xbMarquee._name);
  this.name          = id;
  this.runId         = null;
  this.html          = html;
  this.isHorizontal = ('up,down'.indexOf(this.direction) == -1);
  if (typeof(height) == 'number')
    this.height = height;
    this.heightUnit = 'px';
  else if (typeof(height) == 'string')
    this.height = parseInt('0' + height, 10);
    this.heightUnit = height.toLowerCase().replace(/^[0-9]+/, '');
  else
    this.height = 100;
    this.heightUnit = 'px';
  if (typeof(width) == 'number')
    this.width = width;
    this.widthUnit = 'px';
  else if (typeof(width) == 'string')
    this.width = parseInt('0' + width, 10);
    this.widthUnit = width.toLowerCase().replace(/^[0-9]+/, '');
  else
    this.width = 100;
    this.widthUnit = 'px';
  // xbMarquee UI events
  this.onmouseover   = null;
  this.onmouseout    = null;
  this.onclick       = null;
  // xbMarquee state events
  this.onstart       = null;
  this.onbounce      = null;
  var markup = '';
  if (document.layers)
    markup = '<ilayer id="' + this.id + 'container" name="' + this.id + 'container" ' +
             'height="' + height + '" ' +
             'width="' + width + '"  ' +
             'clip="' + width + ', ' + height + '" ' +
             '>' + 
             '<\/ilayer>';            
  else if (document.body && typeof(document.body.innerHTML) != 'string')
    markup = '<div id="' + this.id + 'container" name="' + this.id + 'container" ' +
             'style=" ' + 
             'height: ' + this.height + this.heightUnit + '; ' +
             'width: ' + this.width + this.widthUnit + '; ' +
             'clip: rect(0px, ' + this.width + this.widthUnit + ', ' + this.height + this.heightUnit + ', 0px); ' +
             '">' + 
             '<div id="' + this.id + '" style="' + 
             (this.isHorizontal ? 'width:0px;' : '') + // if we scroll horizontally, make the text container as small as possible
             '">' +
             (this.isHorizontal ? '<nobr>' : '') +
             this.html +
             (this.isHorizontal ? '<\/nobr>' : '') +
             '<\/div>' +
             '<\/div>';             
  else 
    markup = '<div id="' + this.id + 'container" name="' + 
             this.id + 'container" ' +
             'style=" overflowY: visible; ' + 
             'height: ' + this.height + this.heightUnit + '; ' +
             'width: ' + this.width + this.widthUnit + '; ' +
             'clip: rect(0px, ' + this.width + this.widthUnit + ', ' + this.height + this.heightUnit + ', 0px); ' +
            '">' + 
             '<\/div>';             
  document.write(markup);  
  window[this.name] = this;
// Class Properties/Methods
xbMarquee._name = -1;
xbMarquee._getInnerSize = function(elm, propName)
  var val = 0;
  if (document.layers)
    // navigator 4
    val = elm.document[propName];    
  else if (elm.style && typeof(elm.style[propName]) == 'number')
    // opera
    // bug in Opera 6 width/offsetWidth. Use clientWidth
    if (propName == 'width' && typeof(elm.clientWidth) == 'number')
      val = elm.clientWidth;
    else
      val =  elm.style[propName];
  else
    //mozilla and IE
    switch (propName)
    case 'height':
       if (typeof(elm.offsetHeight) == 'number')
         val =  elm.offsetHeight;
       break;
    case 'width':
       if (typeof(elm.offsetWidth) == 'number')
         val = elm.offsetWidth;                  
       break;
  return val;
xbMarquee.getElm = function(id)
  var elm = null;
  if (document.getElementById)
    elm = document.getElementById(id);
  else
    elm = document.all[id];
  return elm;
xbMarquee.dispatchUIEvent = function (event, marqueeName, eventName)
  var marquee = window[marqueeName];
  var eventAttr = 'on' + eventName;
  if (!marquee)
    return false;
  if (!event && window.event)
    event = window.event;
  switch (eventName)
  case 'mouseover':
  case 'mouseout':
  case 'click':
    if (marquee[eventAttr])
      return marquee['on' + eventName](event);
  return false;
xbMarquee.createDispatchEventAttr = function (marqueeName, eventName)
  return 'on' + eventName + '="xbMarquee.dispatchUIEvent(event, \'' + marqueeName + '\', \'' + eventName + '\')" ';
// Instance properties/methods
xbMarquee.prototype.start = function ()
  var markup = '';
  this.stop();
  if (!this.dirsign)
    if (!document.layers)
      this.containerDiv = xbMarquee.getElm(this.id + 'container')
      if (typeof(this.containerDiv.innerHTML) != 'string')
        return;
      // adjust the container size before inner div is filled in
      // so IE will not hork the size of percentage units 
      var parentNode    = null;
      if (this.containerDiv.parentNode)
        parentNode = this.containerDiv.parentNode;
      else if (this.containerDiv.parentElement)
        parentNode = this.containerDiv.parentElement;
      if (parentNode && 
          typeof(parentNode.offsetHeight) == 'number' && 
          typeof(parentNode.offsetWidth) == 'number')
        if (this.heightUnit == '%')
          this.containerDiv.style.height = 
          parentNode.offsetHeight * (this.height/100) + 'px';
        if (this.widthUnit == '%')
          this.containerDiv.style.width = 
          parentNode.offsetWidth * (this.width/100) + 'px';
      markup += '<div id="' + this.id + '" name="' + this.id + '" ' +
        'style=" ' +
        //(this.isHorizontal ? 'width:0px;' : '') + // if we scroll horizontally, make the text container as small as possible
        '" ' +
        xbMarquee.createDispatchEventAttr(this.name, 'mouseover') +
        xbMarquee.createDispatchEventAttr(this.name, 'mouseout') +
        xbMarquee.createDispatchEventAttr(this.name, 'click') +
        '>' +
        (this.isHorizontal ? '<nobr>' : '') +
        this.html +
        (this.isHorizontal ? '<\/nobr>' : '') +
        '<\/div>';
      this.containerDiv.innerHTML = markup;
      this.div                    = xbMarquee.getElm(this.id);
      this.styleObj     = this.div.style;      
    else /* if (document.layers) */
      this.containerDiv = document.layers[this.id + 'container'];
      markup = 
        '<layer id="' + this.id + '" name="' + this.id + '" top="0" left="0" ' +
        xbMarquee.createDispatchEventAttr(this.name, 'mouseover') +
        xbMarquee.createDispatchEventAttr(this.name, 'mouseout') +
        xbMarquee.createDispatchEventAttr(this.name, 'click') +
        '>' +
        (this.isHorizontal ? '<nobr>' : '') + 
        this.html +
        (this.isHorizontal ? '<\/nobr>' : '') +
        '<\/layer>';
      this.containerDiv.document.write(markup);
      this.containerDiv.document.close();
      this.div          = this.containerDiv.document.layers[this.id];
      this.styleObj     = this.div;
    if (this.isHorizontal && this.height < xbMarquee._getInnerSize(this.div, 'height') )
      this.height = xbMarquee._getInnerSize(this.div, 'height')
      this.containerDiv.style.height = this.height + this.heightUnit;
      this.containerDiv.style.clip = 'rect(0px, ' + this.width + this.widthUnit + ', ' + this.height + this.heightUnit + ', 0px)';
    // Start must not run until the page load event has fired
    // due to Internet Explorer not setting the height and width of 
    // the dynamically written content until then
    switch (this.direction)
    case 'down':
      this.dirsign = 1;
      this.startAt = -xbMarquee._getInnerSize(this.div, 'height');
      this._setTop(this.startAt);
      if (this.heightUnit == '%')
        this.stopAt = this.height * xbMarquee._getInnerSize(this.containerDiv, 'height') / 100;
      else
        this.stopAt  = this.height;
      break;
    case 'up':
      this.dirsign = -1;
      if (this.heightUnit == '%')
        this.startAt = this.height * xbMarquee._getInnerSize(this.containerDiv, 'height') / 100;
      else     
        this.startAt = this.height;
      this._setTop(this.startAt);
      this.stopAt  = -xbMarquee._getInnerSize(this.div, 'height');      
      break;
    case 'right':
      this.dirsign = 1;
      this.startAt = -xbMarquee._getInnerSize(this.div, 'width');
      this._setLeft(this.startAt);
      if (this.widthUnit == '%')
        this.stopAt = this.width * xbMarquee._getInnerSize(this.containerDiv, 'width') / 100;
      else    
        this.stopAt  = this.width;
      break;
    case 'left':
    default:
      this.dirsign = -1;
if (this.widthUnit == '%')
this.startAt = this.width * xbMarquee._getInnerSize(this.containerDiv, 'width') / 100;
else  
this.startAt = this.width        
this._setLeft(this.startAt);
// this.stopAt  = -xbMarquee._getInnerSize(this.div,'width')*2;
// this method does not work very well with FireFox.  offsetWidth property used in this function returns the absolute width of the div container
// instead of the new offsetWidth when innerHTML is added or when the div becomes wider. To overcome this a new span element is added to 
// the document body to measure the new offsetwidth and then it is removed.
var temp_span = document.createElement('span');     
temp_span.id = 'span_' + this.div.id;
temp_span.innerHTML = this.html;
document.body.appendChild(temp_span);                
this.stopAt = - temp_span.firstChild.firstChild.offsetWidth;
document.body.removeChild(temp_span);            
      break;
    this.newPosition          = this.startAt;
    this.styleObj.visibility = 'visible'; 
  this.newPosition += this.dirsign * this.scrollAmount;
  if ( (this.dirsign == 1  && this.newPosition > this.stopAt) ||
       (this.dirsign == -1 && this.newPosition < this.stopAt) )
    if (this.behavior == 'alternate')
      if (this.onbounce)
        // fire bounce when alternate changes directions
        this.onbounce();
      this.dirsign = -this.dirsign;
      var temp     = this.stopAt;
      this.stopAt  = this.startAt;
      this.startAt = temp;
    else
      // fire start when position is a start
      if (this.onstart)
        this.onstart();
      this.newPosition = this.startAt;
  switch(this.direction)
    case 'up': 
    case 'down':
      this._setTop(this.newPosition);
      break;
    case 'left': 
    case 'right':
    default:
      this._setLeft(this.newPosition);
      break;
  this.runId = setTimeout(this.name + '.start()', this.scrollDelay);
xbMarquee.prototype.stop = function ()
  if (this.runId)
    clearTimeout(this.runId);
  this.runId = null;
xbMarquee.prototype.setInnerHTML = function (html)
  if (typeof(this.div.innerHTML) != 'string')
    return;
  var running = false;
  if (this.runId)
    running = true;
    this.stop();
  this.html = html;
  this.dirsign = null;
  if (running)
    this.start();
// fixes standards mode in gecko
// since units are required
if (document.layers)
  xbMarquee.prototype._setLeft = function (left)
    this.styleObj.left = left;    
  xbMarquee.prototype._setTop = function (top)
    this.styleObj.top = top;    
else
  xbMarquee.prototype._setLeft = function (left)
    this.styleObj.left = left + 'px';    
  xbMarquee.prototype._setTop = function (top)
    this.styleObj.top = top + 'px';    
I have nothing displaying in the web-part. How can I make this to work?

This is how i was able to do it. Edit html source.
<div align="center"><marquee id='scroll_news4' bgcolor=#ff9966 "><font color="#000000" size="+1" ><strong>Outlook is down! IT is working on it! </strong></font></marquee></div>
<input type='Button' value='Stop' id ='b1' onClick='button_click()';>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function button_click()
if(document.getElementById('b1').value=="Start"){
document.getElementById('b1').value="Stop";
document.getElementById('scroll_news4').start();
}else{
document.getElementById('b1').value="Start";
document.getElementById('scroll_news4').stop();
// End -->
</script>

Similar Messages

  • How to add a scrolling text in portrait with iMovie

    how to add a scrolling text in portrait with iMovie

    This is how i was able to do it. Edit html source.
    <div align="center"><marquee id='scroll_news4' bgcolor=#ff9966 "><font color="#000000" size="+1" ><strong>Outlook is down! IT is working on it! </strong></font></marquee></div>
    <input type='Button' value='Stop' id ='b1' onClick='button_click()';>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function button_click()
    if(document.getElementById('b1').value=="Start"){
    document.getElementById('b1').value="Stop";
    document.getElementById('scroll_news4').start();
    }else{
    document.getElementById('b1').value="Start";
    document.getElementById('scroll_news4').stop();
    // End -->
    </script>

  • How to add a scroll bar within a view window ?I want to display x and y axis outside the scoll window and keep those axis static and move the graph within scroll area

    how to add a scroll bar within a view window ?I want to display x and y axis outside the scoll window and keep those axis static and move the graph within scroll area
    ananya

    Hey Ananya,
    I believe what you want to do is possible, but it will not be
    easy.  If you want to add a scroll bar that will scroll the graph
    back and forth but keep the axis set, you would want to add a
    horizontal or vertical scrollbar.  Then you would create an event
    handler for the scroll event.  You would have to manually plot
    different data within this scroll event.  Unfortunately, there is
    not really a built in way to do this with the Measurement Studio plot
    control.
    Thanks,
    Pat P.
    Software Engineer
    National Instruments

  • How to add the scroll bar in the vertical photo gallery?

    like this, how to add the scroll bar? http://www.flashvault.net/tutorial.asp?ID=288 Thanks,

    I want to know how to add a vertical scroll bar in the photo gallery which I copied from the tutorial. And add the event to catch MouseEvent.CLICK for each photo. Please advise. Thanks,

  • Who knows how to add emoticons to texts on iphone 4s

    who knows how to add emoticons to text messages on iphone 4s?

    Keep in mind that the Emoji keyboard uses an Apple font. It doesn't always play well with non-Apple devices, Using Emoji when sending a text to an iPhone user can result in weird characters. You're better off using real emoticons:
    smile :-)
    wink ;-)
    And so forth. Android phones will convert them into the proper cutsey symbols.

  • How to show property bag values of site collection in web part on landing page in sharepoint online?

    How to show property bag values of site collection in web part on landing page in sharepoint online - office 365?

    You can use JavaScript Client object model to read the property bag values. Example:
    function getWebProperty() {
    var ctx = new SP.ClientContext.get_current();
    var web = ctx.get_site().get_rootWeb();
    this.props =  web.get_allProperties();
    ctx.load(web);
    ctx.load(this.props); //need to load the properties explicitly
    ctx.executeQueryAsync(Function.createDelegate(this, gotProperty), Function.createDelegate(this, failedGettingProperty));
    function gotProperty() {
        var myPropBag = this.props;
        alert(myPropBag.get_fieldValues()["allowdesigner"]); //returns the value of the key allowdesigner
    function failedGettingProperty(args, sender)
         //handle errors here
    Source:
    http://sharepoint.stackexchange.com/questions/37198/grab-a-specific-property-bag-using-ecma-script
    Blog | SharePoint Learnings CodePlex Tools |
    Export Version History To Excel |
    Autocomplete Lookup Field

  • How can I have Tibetan text correctly displayed on firefox?

    I would like to view websites with tibetan unicode text displayed. how can I view this text correctly, rather than just squares and muddled bits of letters? I've tried downloading tibetan fonts from Play, but they don't work. Thanks.

    I could only find a Tibetan Spellchecker add on firefox. But have you tried the keyboard: [https://play.google.com/store/apps/details?id=org.ironrabbit.bhoboard]
    [http://en.ironrabbit.org/howto]

  • How to add the long text in Production order through FM

    Hi,
    Iam having custom program which has BAPI (BAPI_PRODORD_CREATE) inside it and this program is used to create Production orders with the details of Sales order Number,Line item,Plant,Order type,Quantity and Start date. This program is scheduled in Background.
    Now client wants to add the Long text (seperate TAB in production order and they want to update the VC details of Sales order in the Long text area).
    One option is after creation of Production order, through BDC(calling CO02 and update the long text) we  can update the long text and client doesn't want this option.
    Another option is after creation of Production order, using Function module SAVE_TEXT, Update the Long text in Production Order and this is not working in Production order (already my ABAP consultant checked it ).
    If any one of you came across this requirement, pl share with me how you addressed it.
    Regards
    A.Sureshbabu

    Hi,
    The method is quite simple, i presume you're quite well versed with doing recording, so the key thing to keep in mind is how to prepare the input file.
    At my end i had about 5 lines of data which needed to be uploaded, hence i had a tab-delimited file with the order nos. in the first column & the five lines of text in five different columns (Refer format below)
    Order No.
    Line - 1
    Line - 2
    Line - 3
    Line - 4
    Line - 5
    12345
    txt - 1
    txt - 2
    txt - 3
    txt - 4
    txt - 5
    67890
    txt - a
    txt - b
    txt - c
    txt - d
    txt - e
    Now provide this input file for your lsmw or bdc program & it will work. You can work with your abaper if you're not so comfortable with LSMW or BDC programming he / she should be able to easily make it work for you.
    Regards,
    Vivek

  • How to add full screen text w/out losing audio. I have premier elements 12

    I am creating a language tutorial. Am trying to add full screen text without losing the audio explanation of the text. How do I make this edit and not lose the audio that coincides with the full screen text?

    Roberto
    Thanks for the details.
    Variable - Constant Frame Rate Explanation
    First, the variable frame rate mention and any problems that might be expected if your iPad video was recorded with a variable rather than constant frame rate. Some cameras (such a cell phone, iPod, probably iPad) record video not at one frame rate across the whole video recording. Instead, they record with a variable frame rate depending usually on the lighting conditions during video recording. One way to know what your recording device is using is to view the MediaInfo video audio properties readout. If you have a constant frame rate, you will see just one frame rate listed. If variable, you should see 3 frame rates listed minimum, maximum, and mid range frame rate.
    MediaInfo - Free download and software reviews - CNET Download.com
    This situation may or may not cause problems for you in Premiere Elements. The signs of problems are usually out of sync audio and you just cannot import the video into the project. If this type of problem, then you take your video into a program such as HandBrake to generate a file with a constant rather than variable frame rate. Then you import the file with the constant frame rate into your Premiere Elements project. http://handbrake.fr/
    Again, this may or may not create problems.
    The Generalized Project Workflow
    There is no problem to setup up your Timeline physically. The iPad video with go to Video Track 1 and Audio Track 1. The video is imported into the project linked to it audio portion. And, the Full Screen Text Files will be on Video Track 2 directly above the related content. Now here is the part that I am not yet clear on. Is the Full Screen Text for a given portion of video supposed to synchronize word for word with what you are saying in the audio on Audio Track 1? That will involve a mapping out part with regard to duration of each of the Full Screen Text files. Will these Full Screen Text files be readable against the video representing the background? Font style and size and color will be major considerations as well as getting the text file to be on screen long enough to be readable even with Font style, size, and color considerations.
    The fact that you focus on audio loss in all this makes me wonder if I am missing a vital part of what you want to do. The loss of audio concern that you mention does not seem like a prime factor unless you are referring to sync between the texts and what it is supposed to correspond to in the audio of the video.
    Please review and consider and then, based on your reply, I will offer a mini demo to see if we are OK on the details.
    Thanks.
    ATR

  • How to add document header text area on fb03's selection screen

    hi,
    i want to add an additional area on fb03's selection screen. i need document header text area for my document searchs. is it possible?

    Refer to this thread
    How to Add field to Selection screen of Tx. FBL5N

  • How to add info record text into Schedule agreement

    Dear,
    how can I put the info record text into Schedule Agreement. normally it can contains the short text , but in my company, it needs  some more specific description.so we want to add info record text on it.
    via ME32L ? or ...
    thanks for your kind help
    Meng HM

    Hi,
    In the inforecord trasnaction code ME11,go to  info record text and double click on  'Info record note' -
    Now system will open word document & put whatever text you needed(more) & save.
    With Regards,
    Jaheer

  • How to ADD dynamic header text to Right hand Corner of IDR -FPM OVP/OIF

    Hi,
    How can we add dynamic header text to right hand side corner in FPM OVP?
    I know we can handle left hand side.. but i do need simultaneously right hand side..
    ANy thoughts??
    Rgds
    Tarun

    I am not sure how it is arranged in 7.02, in 7.01 IDR layout is flow layout so you cannot have layouts other than that. I thought that this has been changed in 7.02 to accommodate the matrix layout. I am not sure about it. If this was true then you can try to play with the layout to fit right hand side. It is not easy though.

  • How to add name from text file to jtable?

    hello all,
    how to add name (string) from the notepad file(.txt) into jTable rows.
    I am not able to add it.
    try {
                 FileInputStream fis = new FileInputStream("Devices/Devices_Lst.txt");
                 BufferedReader br = new BufferedReader(new InputStreamReader(fis));
                 String line = null;
                 Vector data = new Vector();
                 line = br.readLine();
                 while ( (line = br.readLine()) != null)
                    int rowCount1 = nmsTable.getRowCount();
                    for(int i=0;i<rowCount1;i++)      
                        myTableInit();  // it initialize the table
                       /* nmsTable.setValueAt(i+1,i,0);
                        Table.setValueAt(line,i,1);
                        Table.setValueAt(" ",i,2);
                        Table.setValueAt(" ",i,3);
                        Table.setValueAt(" ",i,4);
                        Table.setValueAt(" ",i,5); */
                        int rowNo = nmsTable.getRowCount();
                        row.addElement((rowNo+1));
                           //row.addElement(ipText.getText()+"-"+nameText.getText());
                           row.addElement(line);   
                           row.addElement((String)" ");
                           row.addElement((String) "");
                           row.addElement((String) "");
                           row.addElement((String) "");      
                            row.addElement((String) "");      
                            rows.add(row);                                     //rows is the Vector for table row.
                            Table.addNotify(); 
                  br.close();
                 if possible give me some examples.
    thank you.

    For every row you need to create a new Vector and add the data to that Vector. Then the Vector is added to the TableModel.
    If you add 6 items to the single Vector, then you will get 6 columns. So you need to create 6 Vectors and add a single item to each Vector and therefore you will end up with 6 rows with 1 column of data.

  • How to add push button in alv display with out class or method

    Hai,
    How to add push buttons in out put screen of ALV (tool bar) with out using classes or methods .I want to know using normal ALV .
    Thanks in advance .
    kiran

    You should post your question in the ABAP forum.
    ABAP Development

  • How to add  basic data text into material master?

    Hi anybody,
    I want update only basic data text into material master. how to update basic data text ?
    is it any bapi or functional module is there in abap?
    anybody please tell me.
    tks
    s.muthu

    Hi Subramanyan,
    Check this function module:
             CREATE_TEXT
    Check out this sample program:
    REPORT ZMM_INSERT_LONGTEXT.*Internal table to hold long text...
    DATA:
      BEGIN OF T_UPLOAD OCCURS 0,
        MATNR LIKE MARA-MATNR,             " Material number
        ID(2) TYPE C,                      " Identification
        LTEXT LIKE TLINE-TDLINE,           " Long text
      END OF T_UPLOAD,*Internal table to hold long text....
      T_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE.DATA:
       W_GRUN LIKE THEAD-TDID ,            " To hold id
       W_OBJECT LIKE THEAD-TDOBJECT VALUE 'MATERIAL',
                                           " To hold object id
       LV_VALUE(70).                       " Value to hold material number
    START-OF-SELECTION.* This perform is used to upload the file
      PERFORM UPLOAD_FILE.* This perform is used to place the text in MM02 transaction
      PERFORM PLACE_LONGTEXT.
    *&      Form  create_text
    This routine used to create text in MM02 transaction
    Passed the parameter w_grun to P_C_GRUN
                    and lv_value to P_LV_VALUE
    FORM CREATE_TEXT  USING    P_C_GRUN
                               P_LV_VALUE.  DATA:
        L_ID LIKE THEAD-TDID,
        L_NAME(70).  MOVE : P_C_GRUN TO L_ID,
             P_LV_VALUE TO L_NAME.  CALL FUNCTION 'CREATE_TEXT'
           EXPORTING
             FID               = L_ID
             FLANGUAGE         = SY-LANGU
             FNAME             = L_NAME
             FOBJECT           = W_OBJECT
         SAVE_DIRECT       = 'X'
         FFORMAT           = '*'
           TABLES
             FLINES            = T_LINE
          EXCEPTIONS
            NO_INIT           = 1
            NO_SAVE           = 2
            OTHERS            = 3
      IF SY-SUBRC <> 0.
        CLEAR LV_VALUE.
      ELSE.
        DELETE T_LINE INDEX 1.
      ENDIF.ENDFORM.                    " create_text&----
    *&      Form  upload_file
    This routine is used to upload file
    No interface parameters are passed
    FORM UPLOAD_FILE .  CALL FUNCTION 'UPLOAD'
       EXPORTING
        CODEPAGE                      = ' '
        FILENAME                      = ' '
          FILETYPE                      = 'DAT'
        ITEM                          = ' '
        FILEMASK_MASK                 = ' '
        FILEMASK_TEXT                 = ' '
        FILETYPE_NO_CHANGE            = ' '
        FILEMASK_ALL                  = ' '
        FILETYPE_NO_SHOW              = ' '
        LINE_EXIT                     = ' '
        USER_FORM                     = ' '
        USER_PROG                     = ' '
        SILENT                        = 'S'
      IMPORTING
        FILESIZE                      =
        CANCEL                        =
        ACT_FILENAME                  =
        ACT_FILETYPE                  =
        TABLES
          DATA_TAB                      = T_UPLOAD
         EXCEPTIONS
           CONVERSION_ERROR              = 1
           INVALID_TABLE_WIDTH           = 2
           INVALID_TYPE                  = 3
           NO_BATCH                      = 4
           UNKNOWN_ERROR                 = 5
           GUI_REFUSE_FILETRANSFER       = 6
           OTHERS                        = 7
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.  SORT T_UPLOAD BY MATNR ID.
    ENDFORM.                    " upload_file
    *&      Form  place_longtext
    This routine places the text in MM02 transaction
    No interface parameters are passed
    FORM PLACE_LONGTEXT .  LOOP AT T_UPLOAD.    T_LINE-TDFORMAT = 'ST'.
        T_LINE-TDLINE = T_UPLOAD-LTEXT.
        APPEND T_LINE.    IF T_UPLOAD-ID EQ 'BT'.
          MOVE T_UPLOAD-MATNR TO LV_VALUE.
          MOVE 'GRUN' TO W_GRUN.                   "Test ID for Basic data text
          PERFORM CREATE_TEXT USING W_GRUN LV_VALUE.
        ENDIF.    IF T_UPLOAD-ID EQ 'IT'.
          CLEAR W_GRUN.
          MOVE T_UPLOAD-MATNR TO LV_VALUE.
          MOVE 'PRUE' TO W_GRUN.                      "Test ID for Inspection text
          PERFORM CREATE_TEXT USING W_GRUN LV_VALUE.
        ENDIF.    IF T_UPLOAD-ID EQ 'IC'.
          CLEAR W_GRUN.
          MOVE : T_UPLOAD-MATNR TO LV_VALUE,
                 'IVER' TO W_GRUN.                    
                                                      "Test ID for Internal comment
          PERFORM CREATE_TEXT USING W_GRUN LV_VALUE.
        ENDIF.
      ENDLOOP.ENDFORM.                    " place_longtext
    Hope this helps you.
    Regards,
    Chandra Sekhar

Maybe you are looking for

  • CS6 Keeps crashing on the last part of the render

    I get four windows to popup at the very end of any render. These two and another two telling me that this is the last chance to save my work. I have no idea what is wrong. I have tried reinstalling and obviously restarting. I have fine specs for runn

  • How to link Documents to CRM

    Hi Can anyone please suggest on how to link Documents to CRM CIC0 screen. Thanks in Advance

  • The "APPLET" Tag

    On the web site "http://geocities.com/xyz" I have the following files : 1. index.html 2. myJar.jar 2.1 mainClass.class 2.2 someOtherClass.class 2.3 pic.gif In the index file, there is the following tag : <code> <APPLET code="mainClass.class" codebase

  • DOS Commands

    Is there any way I can execute DOS commands such as COPY, MOVE, etc. in Java Program?

  • Partial Search

    Hey all Wondering if anyone would have any idea how to do a partial search of a database in a servlet. I'm doing a database on songs so lets say someone just enters the first word of a song i need to be able to search for that and return details on t