[RCP]populate a treeviewer using IAdapterFactory

Hello, i need help on my project based on rcp platform, i'd like to list my c:\ directory using a treeviewer and IAdapterFactory to populate it but nothing appears in my view here is my code, if somebody can help me with that.
the code in my view to create the tree viewer :
private TreeViewer treeViewer;
private IAdapterFactory adapterFactory = new MyAdapterFactory();
public void createPartControl(Composite parent) {
// TODO Auto-generated method stub
treeViewer = new TreeViewer(parent, SWT.BORDER
| SWT.MULTI | SWT.V_SCROLL);
Platform.getAdapterManager().registerAdapters(adapterFactory, File.class);
getSite().setSelectionProvider(treeViewer);
treeViewer.setLabelProvider(new WorkbenchLabelProvider());
treeViewer.setContentProvider(new BaseWorkbenchContentProvider());
treeViewer.setInput(new File("c:\\"));
...and the code to populate it :
import java.io.File;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.model.IWorkbenchAdapter;
public class MyAdapterFactory implements IAdapterFactory {
public LogescoAdapterFactory() {
super();
// TODO Auto-generated constructor stub
private IWorkbenchAdapter fileContentAdapter = new IWorkbenchAdapter() {
public Object getParent(Object o) {
return ((File)o).getParent();
public String getLabel(Object o) {
return ((File)o).getName();
public ImageDescriptor getImageDescriptor(Object object) {
return null;
public Object[] getChildren(Object o) {
Object[] kids = ((File)o).listFiles();
return kids == null ? new Object[0] : kids;
public Object getAdapter(Object adaptableObject, Class adapterType) {
// TODO Auto-generated method stub
if(adapterType == IWorkbenchAdapter.class &&
adaptableObject instanceof File)
return fileContentAdapter;
return null;
public Class[] getAdapterList() {
// TODO Auto-generated method stub
return new Class[] {IWorkbenchAdapter.class};
}I followed the tutorial from eclipse rich client platform book but i cant adapt it for my purpose.
So i post this message hoping you can help me. Thanks a lot.

Hello, i need help on my project based on rcp platform, i'd like to list my c:\ directory using a treeviewer and IAdapterFactory to populate it but nothing appears in my view here is my code, if somebody can help me with that.
the code in my view to create the tree viewer :
private TreeViewer treeViewer;
private IAdapterFactory adapterFactory = new MyAdapterFactory();
public void createPartControl(Composite parent) {
// TODO Auto-generated method stub
treeViewer = new TreeViewer(parent, SWT.BORDER
| SWT.MULTI | SWT.V_SCROLL);
Platform.getAdapterManager().registerAdapters(adapterFactory, File.class);
getSite().setSelectionProvider(treeViewer);
treeViewer.setLabelProvider(new WorkbenchLabelProvider());
treeViewer.setContentProvider(new BaseWorkbenchContentProvider());
treeViewer.setInput(new File("c:\\"));
...and the code to populate it :
import java.io.File;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.model.IWorkbenchAdapter;
public class MyAdapterFactory implements IAdapterFactory {
public LogescoAdapterFactory() {
super();
// TODO Auto-generated constructor stub
private IWorkbenchAdapter fileContentAdapter = new IWorkbenchAdapter() {
public Object getParent(Object o) {
return ((File)o).getParent();
public String getLabel(Object o) {
return ((File)o).getName();
public ImageDescriptor getImageDescriptor(Object object) {
return null;
public Object[] getChildren(Object o) {
Object[] kids = ((File)o).listFiles();
return kids == null ? new Object[0] : kids;
public Object getAdapter(Object adaptableObject, Class adapterType) {
// TODO Auto-generated method stub
if(adapterType == IWorkbenchAdapter.class &&
adaptableObject instanceof File)
return fileContentAdapter;
return null;
public Class[] getAdapterList() {
// TODO Auto-generated method stub
return new Class[] {IWorkbenchAdapter.class};
}I followed the tutorial from eclipse rich client platform book but i cant adapt it for my purpose.
So i post this message hoping you can help me. Thanks a lot.

Similar Messages

  • Populate City file using LSM workbench

    I need to know how to populate 'City File' using LSM workbench. It would be extremely helpful if anyone answers the following questions:
    1) Where to get the US regional structure source data?
    2) How to convert it to SAP uploadable format?
    3) How to upload the data to SAP system?
    In other words, I need to know the steps of the process to populate SAP US regional structure from scratch.
    Thanks in Advance.

    I need to know how to populate 'City File' using LSM workbench. It would be extremely helpful if anyone answers the following questions:
    1) Where to get the US regional structure source data?
    2) How to convert it to SAP uploadable format?
    3) How to upload the data to SAP system?
    In other words, I need to know the steps of the process to populate SAP US regional structure from scratch.
    Thanks in Advance.

  • How to populate the xml file into the treeview using c#(along with the attribute called id) using dom.

    <?xml version="1.0" standalone="yes"?>
    <Student_Details>
      <Student Id="1">
        <Name >sandeep</Name>
        <Age>12</Age>
        <Mobile>123456789</Mobile>
      </Student>
      <Student Id="2">
        <Name >ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student Id="3">
        <Name >Sandeep Pr</Name>
        <Age>12</Age>
        <Mobile>9865231870</Mobile>
      </Student>
      <Student Id="4">
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student Id="5">
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student Id="6">
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student Id="7">
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student Id="8">
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student Id="9">
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student Id="10">
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
    </Student_Details>
    Sandeep Puvvadi

    Have a look at the
    XmlDocument class. Read the
    documentation (it's all written there for us all). If you'll have implementation questions, feel free to ask again. At the moment, I can't see what you've already tried and what's not working.
    Armin

  • Creating a TreeView using an SQL data source

    Hello and how is everyone. I have been coding in Java Windows services and console applications for a couple of years and now I want to start working on some Java Server Pages. I have been reading up on JSP and JSTL. What I want to do is query an SQL database and bring the data into my jsp page and display the data using a TreeView. Can someone help out ? Thanks :)

    If you want a tree component on a web page, you will have to use html/javascript to do that.
    You can't use swing components in an html page.
    Take a look around at javascript tree components (there are several around the net). You then have to write your jsp to generate the correct javascript code to populate that component.
    Obviously it all depends on the javascript component that you decide on to display the tree.
    Hope this helps,
    evnafets

  • How to move node in treeView using two buttons ?

    Hello ,
    Am starter , and am working on a Winforms application.
    I browse an XML file , then I populate treeview in my interface. I want to move selected node in the two sens ( up and down)  using two button ( so not with events , normal drag and drop with mouse ) .
    - I select the nod 
    - I click on the up button , then the node take the new place ( something like , drop and insert maybe )
    I don't know if is possible to affect this events to button or they are another way to do this 
    this is my code concerning populating treeView :
    private void browseSourceFileBtn_Click(object sender, EventArgs e)
    var openSourceFile = openSourceFileDialog.ShowDialog();
    if (openSourceFile == DialogResult.OK)
    fichierSourcePath.Text = openSourceFileDialog.FileName;
    // Connect the XML FILE DATABASE to the application interface
    private void button1_Click(object sender, EventArgs e)
    if (openSourceFileDialog.FileName == String.Empty)
    MessageBox.Show("u should open a file", "Erreur de chargement", MessageBoxButtons.OK, MessageBoxIcon.Error);
    else
    try
    MessageBox.Show("plz wait ");
    statusLabel.Text = "Début de chargement du fichier";
    var doc = new XmlDocument();
    doc.Load(openSourceFileDialog.FileName);
    sourceTreeView.Nodes.Clear();
    var rootNode = new TreeNode(doc.DocumentElement.Name);
    sourceTreeView.Nodes.Add(rootNode);
    sourceTreeView.CheckBoxes = true;
    sourceTreeView.AllowDrop = true;
    DateTime starteTime = DateTime.Now;
    BuildNode(doc.DocumentElement, rootNode);
    DateTime endTime = DateTime.Now;
    TimeSpan duree = endTime - starteTime;
    sourceTreeView.ExpandAll();
    sourceTreeView.Nodes[0].EnsureVisible();
    string chargementTemps = "" + duree.Minutes + "min : " + duree.Seconds + "s : " + duree.Milliseconds + "ms";
    statusLabel.Text = "Chargement effectué avec succés en :" + chargementTemps;
    catch (Exception)
    sourceTreeView.Nodes.Clear();
    statusLabel.Text = "Echec de chargement";
    thanks u a lot 

    Hi Nico68er,
    According to your description, you'd like to move up or down the node in TreeView.
    By reseraching, I found this post in StackOverFlow is similar with your issue.http://stackoverflow.com/questions/2203975/move-node-in-tree-up-or-down
    From this answer.
    You can use the following extensions
    public static class Extensions
    public static void MoveUp(this TreeNode node)
    TreeNode parent = node.Parent;
    TreeView view = node.TreeView;
    if (parent != null)
    int index = parent.Nodes.IndexOf(node);
    if (index > 0)
    parent.Nodes.RemoveAt(index);
    parent.Nodes.Insert(index - 1, node);
    else if (node.TreeView.Nodes.Contains(node)) //root node
    int index = view.Nodes.IndexOf(node);
    if (index > 0)
    view.Nodes.RemoveAt(index);
    view.Nodes.Insert(index - 1, node);
    public static void MoveDown(this TreeNode node)
    TreeNode parent = node.Parent;
    TreeView view = node.TreeView;
    if (parent != null)
    int index = parent.Nodes.IndexOf(node);
    if (index < parent.Nodes.Count -1)
    parent.Nodes.RemoveAt(index);
    parent.Nodes.Insert(index + 1, node);
    else if (view != null && view.Nodes.Contains(node)) //root node
    int index = view.Nodes.IndexOf(node);
    if (index < view.Nodes.Count - 1)
    view.Nodes.RemoveAt(index);
    view.Nodes.Insert(index + 1, node);
    Child nodes will follow their parents.
    You could use this class in your program.
    If you want to move the node up. Call the Extensions.MoveUp(this.treeView1.SelectNode)
    private void button1_Click(object sender, EventArgs e)
                if (this.treeView1.SelectedNode != null)
                    Extensions.MoveUp(this.treeView1.SelectedNode);
    If you have any other concern regarding this issue, please feel free to let me know.
    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.

  • How to populate tag_capturedetails field using a datepicker

    So, here is what I am trying to do. I have the online shop layout template -  Individual Product-Large - being used as the page prior to shopping cart used by the customer to finalize the selection of the product. The product is actually a service with a defined start date. I would like to have the customer select a start date using the datepicker (JQUERY UI Widget) that I have succesfully installed on this page.
    My question is probably not a very smart one, but how in the world do you get the information chosen on the date picker to populate the tag_capturedetails field.  I have tried all weekend and have searched everywhere, but have not found any reference to this with a working solution. Any help on this would be super appreciated.  Here is my code for the page as described:
    <link type="text/css" href="/css/custom-theme/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="/Javascript/jquery-ui-1.8.21.custom.min.js"></script>
    <h2 style="text-align: left;">
    <table>
        <tbody>
            <tr>
                <td rowspan="4" style="background-image: url(http://www.solderlab.com/images/cssimg/blue-gradient.jpg); padding-right: 25px; padding-left: 25px; background-attachment: scroll; padding-top: 10px; text-align: left; vertical-align: top;">
                <h4><span style="font-size: 13px;"><span style="font-weight: normal; font-family: arial; font-size: 13px;">{tag_description}</span><span style="font-weight: normal; font-family: arial; font-size: 13px;">{tag_smallimage}</span></span></h4>
                </td>
                <td style="padding-top: 20px; text-align: center; vertical-align: top;"><span style="font-family: arial; font-size: 16px;">{tag_largeimage}</span></td>
            </tr>
            <tr>
                <td style="white-space: nowrap;"><span style="font-family: arial; font-size: 16px;">Click on an image to expand {tag_poplets}</span> </td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr>
                <td style="background-image: url(http://www.solderlab.com/gray-gradient.gif); padding-right: 20px; padding-left: 20px; padding-bottom: 10px; text-align: left; vertical-align: top; white-space: nowrap;"><span style="font-family: arial; font-size: 16px;"><span style="font-size: 20px; font-family: arial;">Configure your quote or order: </span><br />
                <span style="font-size: 20px; font-family: arial;"> Product: {tag_name}</span></span>
                <div><span style="font-family: arial; font-size: 16px;">{tag_custom3} {tag_grouping}</span></div>
                <div><span style="font-family: arial; font-size: 16px;">{tag_custom2} {tag_addtocartinputfield}</span></div>
                <div><span name="date" id="details" style="display: none; font-family: arial; font-size: 16px;">{tag_capturedetails, Specify your start date}<br />
                </span></div>
                <meta charset="utf-8" />
                <script>
         $(function() {
    $( ".selector" ).datepicker({ altField: "#actualDate" });
    //getter
    var altField = $( ".selector" ).datepicker( "option", "details" );
    //setter
    $( ".selector" ).datepicker( "option", "details", "#actualDate" );
              $( "#datepicker" ).datepicker({
                   showOn: "button",
                   buttonImage: "/images/calendar.gif",
                   buttonImageOnly: true
         </script>
                <div class="demo">
                <p><span style="font-family: arial; font-size: 16px;">STEP 3: Select your test start date:
                </span><input type="text" id="datepicker" /></p>
                <p><span style="font-size: medium; font-family: arial; color: #ffffff;">{tag_custom1}<br />
                </span><span style="font-size: medium; font-family: arial; color: #ffffff;">{tag_custom4}</span></p>
                </div>
                <div><span style="font-family: arial; font-size: 16px;">{tag_buynow, Go to Cart}</span></div>
                </td>
            </tr>
        </tbody>
    </table>
    <table>
    </table>
    </h2>
    <div style="text-align: center;"><em><br />
    </em></div>

    Hi Mihai
    Thank you for your reply. I was beginning to think that no-one could answer this one. Am what I am trying to do even possible?

  • How to populate the ranges using FM for the SELECTs

    Hi,
    I am still working on the FM to create a generic extractor. I went through the debugger but I am still unable to determine how the ranges are populated. RSA3 always gives me zero values for the results.
    There is a RANGE statement in the sample FM and the following statements for SELECTs
      RANGES: L_R_CARRID  FOR SFLIGHT-CARRID,
              L_R_CONNID  FOR SFLIGHT-CONNID.
    and...
          LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CARRID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.
            APPEND L_R_CARRID.
          ENDLOOP.
          LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.
            APPEND L_R_CONNID.
          ENDLOOP.
    My question is how is L_R_CONNID and L_R_CARRID populated with low and high values for the SELECT statements? I tried to find the DS 0SAPI_SFLIGHT_SIMPLE to run and see how it is set up but there is no such DS.
    Would someone take the time to say something about this in  several sentences? I have my own code and it seems that it is not populating the values for the SELECTs when I debug from RSA3 when I provide the low and high values.
    Would I normally populate the low and high values from the InfoPackage 'Data Selection' tab once I have implemented in BW or ready to test in BW? That would mean I have to choose those fields as selections from RSO2. Anyway, I think I have asked about this but I am hoping to get an answer to get this going...
    Appreciate any replies.

    Hi
    Here is an example of an extractor that uses
    both method's, if the InfoPackage selection exist's
    it overrides the TVARV selection (which is the default).
    FUNCTION ZBW_TC_FORECAST_SO_EXTRACTOR.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(I_REQUNR) TYPE  SBIWA_S_INTERFACE-REQUNR
    *"     VALUE(I_DSOURCE) TYPE  SBIWA_S_INTERFACE-ISOURCE OPTIONAL
    *"     VALUE(I_CHABASNM) TYPE  SBIWA_S_INTERFACE-CHABASNM OPTIONAL
    *"     VALUE(I_MAXSIZE) TYPE  SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
    *"     VALUE(I_INITFLAG) TYPE  SBIWA_S_INTERFACE-INITFLAG OPTIONAL
    *"     VALUE(I_UPDMODE) TYPE  SBIWA_S_INTERFACE-UPDMODE OPTIONAL
    *"     VALUE(I_DATAPAKID) TYPE  SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
    *"     VALUE(I_PRIVATE_MODE) OPTIONAL
    *"     VALUE(I_CALLMODE) TYPE  ROARCHD200-CALLMODE OPTIONAL
    *"  TABLES
    *"      I_T_SELECT TYPE  SBIWA_T_SELECT OPTIONAL
    *"      I_T_FIELDS TYPE  SBIWA_T_FIELDS OPTIONAL
    *"      E_T_DATA STRUCTURE  ZBW_TC_FORECASTING_EXT_STR OPTIONAL
    *"  EXCEPTIONS
    *"      NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
    *"      HIERARCHY_NOT_FOUND
    Change History                                                      *
    Mod. #  |  Date    |  Developer     |  Description                  *
    *RD3K915762|06/21/2005| SRangaraj      | Change selection of open SO   *
             |          |                | data to include deleted matls *
             |          |                | and obsolete items too        *
    RD3K915888|06/29/2005| SRANGARAJ      | Add ext matl grp and lab offce
             |          |                | filters for data-selection    *
    The input parameter I_DATAPAKID is not supported yet !
    Auxiliary Selection criteria structure
      DATA: L_S_SELECT TYPE SBIWA_S_SELECT.
    Maximum number of lines for DB table
      STATICS L_MAXSIZE TYPE SBIWA_S_INTERFACE-MAXSIZE.
    Parameter I_PRIVATE_MODE:
    Some applications might want to use this function module for other
    purposes as well (e.g. data supply for OLTP reporting tools). If the
    processing logic has to be different in this case, use the optional
    parameter I_PRIVATE_MODE (not supplied by BIW !) to distinguish
    between BIW calls (I_PRIVATE_MODE = SPACE) and other calls
    (I_PRIVATE_MODE = X).
    If the message handling has to be different as well, define Your own
    messaging macro which interprets parameter I_PRIVATE_MODE. When
    called by BIW, it should use the LOG_WRITE macro, otherwise do what
    You want.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
      IF I_INITFLAG = SBIWA_C_FLAG_ON.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    The input parameter I_DATAPAKID is not supported yet !
    Invalid second initialization call -> error exit
        IF NOT G_FLAG_INTERFACE_INITIALIZED IS INITIAL.
          IF 1 = 2. MESSAGE E008(R3). ENDIF.
          LOG_WRITE 'E'                    "message type
                    'R3'                   "message class
                    '008'                  "message number
                    ' '                    "message variable 1
                    ' '.                   "message variable 2
          RAISE ERROR_PASSED_TO_MESS_HANDLER.
        ENDIF.
    Check InfoSource validity
        CASE I_DSOURCE.
          WHEN 'ZBW_TC_SO_EXTRACT'.
          WHEN OTHERS.
            IF 1 = 2. MESSAGE E009(R3). ENDIF.
            LOG_WRITE 'E'                  "message type
                      'R3'                 "message class
                      '009'                "message number
                      I_DSOURCE            "message variable 1
                      ' '.                 "message variable 2
            RAISE ERROR_PASSED_TO_MESS_HANDLER.
        ENDCASE.
    Check for supported update mode
       CASE I_UPDMODE.
         WHEN 'F'.
         WHEN OTHERS.
           IF 1 = 2. MESSAGE E011(R3). ENDIF.
           LOG_WRITE 'E'                  "message type
                     'R3'                 "message class
                     '011'                "message number
                     I_UPDMODE            "message variable 1
                     ' '.                 "message variable 2
           RAISE ERROR_PASSED_TO_MESS_HANDLER.
       ENDCASE.
    Check for obligatory selection criteria
       READ TABLE I_T_SELECT INTO L_S_SELECT WITH KEY FIELDNM = 'PGMID'.
       IF SY-SUBRC <> 0.
         IF 1 = 2. MESSAGE E010(R3). ENDIF.
         LOG_WRITE 'E'                    "message type
                   'R3'                   "message class
                   '010'                  "message number
                   'PGMID'                "message variable 1
                   ' '.                   "message variable 2
         RAISE ERROR_PASSED_TO_MESS_HANDLER.
       ENDIF.
        APPEND LINES OF I_T_SELECT TO G_T_SELECT.
    Fill parameter buffer for data extraction calls
        G_S_INTERFACE-REQUNR    = I_REQUNR.
        G_S_INTERFACE-ISOURCE   = I_DSOURCE.
        G_S_INTERFACE-MAXSIZE   = I_MAXSIZE.
        G_S_INTERFACE-INITFLAG  = I_INITFLAG.
        G_S_INTERFACE-UPDMODE   = I_UPDMODE.
        G_S_INTERFACE-DATAPAKID = I_DATAPAKID.
        G_FLAG_INTERFACE_INITIALIZED = SBIWA_C_FLAG_ON.
    Fill field list table for an optimized select statement
    (in case that there is no 1:1 relation between InfoSource fields
    and database table fields this may be far from beeing trivial)
        APPEND LINES OF I_T_FIELDS TO G_T_FIELDS.
    Fill range tables for fixed InfoSources. In the case of generated
    InfoSources, the usage of a dynamical SELECT statement might be
    more reasonable. BIW will only pass down simple selection criteria
    of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
        LOOP AT G_T_SELECT INTO L_S_SELECT.
          CASE L_S_SELECT-FIELDNM.
            WHEN 'PRDHA'.
              WGF_PRDHA_LENGTH = STRLEN( L_S_SELECT-LOW ).
              IF WGF_PRDHA_LENGTH = 6.  "PARTIAL PRDHA
                 WGF_PRDHA = L_S_SELECT-LOW.
                 CONCATENATE WGF_PRDHA '%' INTO WGF_PRDHA.
              ELSEIF WGF_PRDHA_LENGTH = 12.  "FULL PRDHA
              MOVE-CORRESPONDING L_S_SELECT TO L_R_PRDHA.
              APPEND L_R_PRDHA.
              ENDIF.
            WHEN 'MATKL'.
              MOVE-CORRESPONDING L_S_SELECT TO L_R_MATKL.
              APPEND L_R_MATKL.
          ENDCASE.
        ENDLOOP.
    reset the index of where we are in the gt_header table
      g_tabix = 0.
      perform populate_default_variables.
      perform get_data.
      perform build_detail.
        EXIT.
      ENDIF.                 "Initialization mode or data extraction ?
    Data transfer: First Call      OPEN CURSOR + FETCH
                   Following Calls FETCH only
    First data package -> OPEN CURSOR
       IF G_COUNTER_DATAPAKID = 0.
    Determine number of database records to be read per FETCH statement
    from input parameter I_MAXSIZE. If there is a one to one relation
    between InfoSource table lines and database entries, this is trivial.
    In other cases, it may be impossible and some estimated value has to
    be determined.
      DESCRIBE TABLE LT_DATA LINES l_count.
      IF g_tabix GE l_count.
        RAISE no_more_data.
      ENDIF.
    *CLEAN UP THE OUTPUT TABLE
      refresh E_T_DATA.
      LOOP AT LT_DATA FROM G_TABIX INTO LS_DATA.
        APPEND LS_DATA TO E_T_DATA.
    Set global counter
        g_tabix = g_tabix + 1.
      ENDLOOP.
       G_COUNTER_DATAPAKID = G_COUNTER_DATAPAKID + 1.
    ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.
    Forms
    ***INCLUDE LZBW_TC_FORECAST_SO_EXTF01 .
    *&      Form  populate_default_variables
          text
    -->  p1        text
    <--  p2        text
    FORM populate_default_variables.
      data: wlf_name like tvarv-name.
      clear: R_prdh3[], wlf_name.
    *get the exclusion range from tvarv for the product hierarchy in
    *question
      concatenate 'ZBW_EXL_' WGF_PRDHA(6) INTO WLF_NAME.
    SELECT LOW FROM TVARV INTO R_prdh3-low WHERE
                                 NAME = WLF_NAME.
      move:  'I'    to R_prdh3-sign,
             'EQ'   to R_prdh3-option.
      append R_prdh3.
      clear R_prdh3.
    ENDSELECT.
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
    CLEAR L_R_LABOR[].
    SELECT LOW FROM TVARV INTO L_R_LABOR-Low WHERE
                                 NAME = 'ZBW_TC_FORECAST_LAB_OFF'.
      move:  'I'    to L_R_LABOR-sign,
             'EQ'   to L_R_LABOR-option.
      append L_R_LABOR.
      clear L_R_LABOR.
    ENDSELECT.
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
    ENDFORM.                    " populate_default_variables
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    FORM get_data.
      data: wlf_lmeng like vbep-lmeng.
    *get all deliveries for date range for either a range of product hrchy
    *or a like value
      refresh int_records1.
      if wgf_prdha ne space.
        select ivbeln iposnr iKLMENG jvkorg i~werks
               imatnr imeins mprdha mmatkl
        from vbap as i
           INNER JOIN VBAK AS j
           ON ( jvbeln = ivbeln
                and j~vbtyp = 'C' )
           INNER JOIN vbuk AS k
           ON ( kvbeln = ivbeln
                and k~lfgsk <> 'C'
                and k~gbstk <> 'C' )
           INNER JOIN vbup AS l
           ON ( lvbeln = ivbeln and
                lposnr = iposnr
                and l~lfgsa <> 'C'
                and l~gbsta <> 'C' )
           INNER JOIN mara AS m
           ON ( mmatnr = imatnr
    {Start of insert by SRangaraj on June 21, 2005 >>RD3K915762
                and m~lvorm eq ' '
                and m~mstae ne '99'
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                and m~extwg = '080' )
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
           INNER JOIN marc AS n
           ON ( nmatnr = imatnr
                and nwerks = iwerks
                and n~lvorm eq ' ' )
    }End of insert by SRangaraj on June 21, 2005 >>RD3K915762
        into table int_records1 where ( i~abgru = '  '
                                     and i~klmeng > 0
                                     and m~prdha like wgf_prdha
                                     and m~matkl in l_r_matkl
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                                     and m~labor in l_r_labor ).
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
      elseif not l_r_prdha[] is initial and wgf_prdha = space.
        select ivbeln iposnr iKLMENG jvkorg i~werks
               imatnr imeins mprdha mmatkl
        from vbap as i
           INNER JOIN VBAK AS j
           ON ( jvbeln = ivbeln
                and j~vbtyp = 'C' )
           INNER JOIN vbuk AS k
           ON ( kvbeln = ivbeln
                and k~lfgsk <> 'C'
                and k~gbstk <> 'C' )
           INNER JOIN vbup AS l
           ON ( lvbeln = ivbeln and
                lposnr = iposnr
                and l~lfgsa <> 'C'
                and l~gbsta <> 'C' )
           INNER JOIN mara AS m
           ON ( mmatnr = imatnr
    {Start of insert by SRangaraj on June 21, 2005 >>RD3K915762
                and m~lvorm eq ' '
                and m~mstae ne '99'
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                and m~extwg = '080' )
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
           INNER JOIN marc AS n
           ON ( nmatnr = imatnr
                and nwerks = iwerks
                and n~lvorm eq ' ' )
    }End of insert by SRangaraj on June 21, 2005 >>RD3K915762
        into table int_records1 where ( i~abgru = '  '
                                     and i~klmeng > 0
                                     and m~prdha in l_r_prdha
                                     and m~matkl in l_r_matkl
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                                     and m~labor in l_r_labor ).
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
    endif.
        sort int_records1 by vbeln posnr.
        delete adjacent duplicates from int_records1 comparing
        vbeln posnr.
    *remove unnecessary records
        if not r_prdh3[] is initial.
        DELETE INT_RECORDS1 WHERE PRDHA+6(3) IN r_prdh3.
        endif.
    *get the schedule lines for all of the above records and
    *get the lowest schedule line date per so line item
         if not int_records1[] is initial.
         refresh int_records3.
         select vbeln posnr etenr mbdat into table int_records3
         from vbep for all entries in int_records1
                           where vbeln = int_records1-vbeln and
                                 posnr = int_records1-posnr and
                                 lmeng > 0.
         sort int_records3 by vbeln posnr etenr mbdat ascending.
         loop at int_Records1.
           loop at int_records3 where vbeln = int_records1-vbeln
                                  and posnr = int_records1-posnr.
             int_records1-mbdat = int_records3-mbdat.
             modify int_records1.
             exit.
            endloop.
         endloop.
         refresh int_records3. free int_records3.
         refresh int_records2.
    *get the deliveries and calculate the open quantities
        select vbelv posnv vbeln posnn rfmng plmin
                    from vbfa into table int_records2
                                  for all entries in int_Records1
                                  where vbelv = int_records1-vbeln
                                    and posnv = int_records1-posnr
                                    and VBTYP_N = 'J'. "Dels
    *calculate open quantities next
         loop at int_records1.
           clear wlf_lmeng.
           clear int_records2.
           loop at int_records2 where vbelv = int_records1-vbeln
                                    and posnv = int_records1-posnr.
           case int_records2-plmin.
             when '-'.
              wlf_lmeng = wlf_lmeng - int_records2-rfmng.
             when others.  "just add
              wlf_lmeng = wlf_lmeng + int_records2-rfmng.
            endcase.
           endloop.
           int_records1-klmeng = int_records1-klmeng - wlf_lmeng.
           int_records1-vbeln_dl = int_records2-vbeln.
           int_records1-posnr_dl = int_records2-posnn.
           modify int_records1.
        endloop.
        endif.
        delete int_records1 where klmeng le 0.
        refresh int_records2. free int_Records2.
    ENDFORM.                    " get_data
    *&      Form  build_detail
          text
    -->  p1        text
    <--  p2        text
    FORM build_detail.
        LOOP AT int_records1.
    *DO INDIVIDUAL MOVES - ITS FASTER THAN MOVE-CORRESPONDING
        move: int_records1-vkorg    to LS_DATA-VKORG,
              int_records1-werks    to LS_DATA-WERKS,
              int_records1-matnr    to LS_DATA-MATNR,
              int_records1-klmeng   to LS_DATA-KLMENG,
              int_records1-mbdat(6) to LS_DATA-YEARMONTH,
              int_records1-meins    TO LS_DATA-MEINS,
              int_records1-vbeln    TO LS_DATA-VGBEL,
              int_records1-posnr    TO LS_DATA-VGPOS,
              int_records1-vbeln_dl TO LS_DATA-VBELN,
              int_records1-posnr_dl TO LS_DATA-POSNR,
              int_records1-mbdat    to LS_DATA-WADAT_IST,
              int_records1-PRDHA    to LS_DATA-PRDHA,
              int_records1-matkl    to LS_DATA-MATKL.
        APPEND LS_DATA TO LT_DATA.
        clear: LS_DATA.
        ENDLOOP.
    ENDFORM.                    " build_detail

  • How could I populate S012 to use Sap standard analyse?

    Hello,
    I would like to work with Mce3 and mce7 to analyse the performance of my purchase activities...  Although i have gotten problem to populate the LIS table.
    I accessed s012 table in se16n transaction. I noticed there are some datas in this table, but it is not necessary correct, probably because it has not atualized correct.
    The field theoric quantity is Ok! So, any order I create in sap the Lis can read and my quantity change. It shows that I dont have a connection problem properly.
    The data just is added in table after Migo , miro... when is it insert ?
    Have anyone used the LIS informations to help me ? What is my configuration problem?
    Here , we use purchase order and Scheduling Agreement!
    I m glad for your help!
    Thank you, very much!

    if you have not changed the update rules for S012, then it just works as designed by SAP.
    However, this may not always be the way users would like to see the data.
    The goods receipt is allocated to the period of PO creation, and not to the period when the receipt actually happened.
    So many companies have created a S912 structure and amended the update rules to their own needs.

  • Populate Error Message using  MB_MIGO_BADI

    Hi Friends,
      My requirement is whenever the user does a goods receipt using transaction "MIGO" I need to check whether the item selected has an indicator "Delivery Completed" at the PO level and if this indicator is set for this PO item I need to throw an Error message and should not allow the user to create a GR against that item. I have implemented the BADI "MB_MIGO_BADI" for this purpose and I am using the method "POST_DOCUMENT" to check the PO item and throw an error message, bu the issue is afterI  throw an error message and when the user tries to exit from the transaction MIGO using the exit button, the system throws an short dump " Screen: Illegal message" because the program attempted to issue a " " message during "Exit Command" processing. In order to avoid this i tried the method "CHECK_ITEM" to populate the error message to application log, it works fine but I am not able to get the line item details inside this method. I even tried to import the line item details from the method "LINE_MODIFY" and then use it in "CHECK_ITEM" method, but the issue here is CHECK_ITEM is called only once for all the line item, ""LINE_MODIFY" was called every time i change the line item, so I was not able to use it. Can you please let me know if there is any other better way to achieve this.
    As per the below weblog, this scenario is available as part of the standard in ECC Ehp4, but unfortunately we are on Ehp1.
    Delivery Complete Indicator of PO and Goods Receipt

    Dear Imran,
       To achieve the best possible solution you have to use two methods of this BADI in combination with each other. These two methods are 'LINE_MODIFY' and 'CHECK_ITEM'.
       The method 'LINE_MODIFY' will be called every time there is some activity on the MIGO screen. In this method you will have both the item line id and the item structure available in the interface. You will need to create a class attribute which is an internal table of a locally defined structure. The first field of this  structure will be the line_item_id and the second will be the item structure itself. The first time when this method is called for a line item a new entry is inserted into this class level attribute. For each subsequent time this structure needs to be updated with the new values comparing the line item id.
      The method 'CHECK_ITEM' will be called when you press the 'CHECK' or the 'POST' buttons. In this method based on the line item id the corresponding item structure will be obtained from the class level attribute. Using the data of the structure you can then perform your validations and populate the BAPIRET2_TAB parameter with the message details which will then be dispayed in the popup message box in MIGO.
      Hope this helps.
    Best regards,
    Pradip

  • How to populate the table using webservice

    Hi,
    i have created the web service from function module and  integrated this web service in interactive form using New data connection.
    I have drag and drop all field into the form table and test the form,but its not populate table.
    if any script need for this,
    Kindly explain in detail or give the sample code.
    Thanks in advance
    Parthasarathi

    Dear folks
    M about to create a midlet
    application in which i need to populate my table
    with the current stock exchange values. Since these
    values get changed dynamically , I planned to use
    streaming. Since m new to streaming ,pls someone
    come up to guide me in right path. M using Canvas
    application. I appreciate all the repliesthats fine and funny....
    let me tell you something, in GCF everything you fetch through GPRS is bound to come as an inputstream and whatever request you send is passed as outputstream. so if you have worked with GCF, you have worked with streaming already. isn't it.
    SD

  • How to populate the table using streaming data

    Dear folks
    M about to create a midlet application in which i need to populate my table with the current stock exchange values. Since these values get changed dynamically , I planned to use streaming. Since m new to streaming ,pls someone come up to guide me in right path. M using Canvas application. I appreciate all the replies

    Dear folks
    M about to create a midlet
    application in which i need to populate my table
    with the current stock exchange values. Since these
    values get changed dynamically , I planned to use
    streaming. Since m new to streaming ,pls someone
    come up to guide me in right path. M using Canvas
    application. I appreciate all the repliesthats fine and funny....
    let me tell you something, in GCF everything you fetch through GPRS is bound to come as an inputstream and whatever request you send is passed as outputstream. so if you have worked with GCF, you have worked with streaming already. isn't it.
    SD

  • Howto populate a combobox using DBDatasource?

    Hi!
    How can I populate my combobox with values using a DBDatasource binded to it?
    It show only the last record with the following code
    and I cannot select any other values.
    oDBDSItemCode = oForm.DataSources.DBDataSources.Add("OITM")           
    ocbItemCode.DataBind.SetBound(True, "OITM", "ItemCode")
    oDBDSItemCode.Query()
    For x = 0 To oDBDSItemCode.size - 1
        oDBDSItemCode.Offset = x
    Next

    Hello Zoltan
    I don't think you can populate a ComboBox with the DBDataSource binded to it and I don't think that is the way you should use it.
    If I'm right, what you want to do is populate a combobox from the OITM table, and I guess to save is as a foreign key in an other table.
    I think you should use the following code,
      - it adds the DBDataSource OITM that wil allows you to populate the combo
      - it link the combobox to the table where you want to save the item code
      - It adds the valid value to the combo
    oDBDSItemCode = oForm.DataSources.DBDataSources.Add("OITM") 
    ocbItemCode.DataBind.SetBound(True, "name_of_the_table_you_want_to_save_the_data", "Foreign_key_field_name")
    oDBDSItemCode.Query()
    For x = 0 To oDBDSItemCode.size - 1
        ocbItemCode.ValidValues.Add(oDBDSItemCode.GetValue("ItemCode",i),oDBDSItemCode.GetValue("ItemName",i))
    Next

  • Cannot populate Example Database using ant create-tables

    I encounter the problem like this [t-5362238]. But I've tried to do any thing, but I still cannot populate database. Somebody has another way to populate the database (not use ant) ?
    And more. I can't use ant to deploy the *.WAR file. The terminal shows the message like the message when I perform ant create-tables

    I encounter the problem like this [t-5362238]. But I've tried to do any thing, but I still cannot populate database. Somebody has another way to populate the database (not use ant) ?
    And more. I can't use ant to deploy the *.WAR file. The terminal shows the message like the message when I perform ant create-tables

  • How to populate boolean fields using MDM Java API's

    Hi Experts!
    I am trying to populate Boolean fields in main table of my repository using MDM JAVA API SP 05 patch 2.
    Problem is i am geting syntax error for any value that i try to put in.
    Please provide me sample code for the purpose.
    Thanks in advance!

    Hi,
    Here is the code snippet to populate boolean values from Main Table in the Repository:
    Populating boolean values from Main Table in the Repository:
    wdContext.currentNodeElement().setABC(Boolean.valueOf((strABC).toString()).booleanValue());
    Putting boolean values in the main table:
    Record objEmptyRecord = RecordFactory.createEmptyRecord(new TableId(strTableId));
    boolean bFieldValue = ((Boolean)strABC).booleanValue();
    objEmptyRecord.setFieldValue(new FieldId(strFieldId),new
    BooleanValue(bFieldValue));
    Hope this helps.
    Regards
    Neha Sharma

  • Populate a listbox using javascript

    I want to populate a list box using Javascript .
    I have a  following script:
    // Place all prepopulation data into a single data structure
    var TrainData = { 12002:{ StationFrom: "New Delhi", StationTo: "Bhopal", Stn: ["MTJ", "AGC"]
                     12004:{ StationFrom: "NDLS", StationTo: "Lucknow" }};
    function SetFieldValues(cTrainName)
      this.getField("TrainFromName").value = TrainData[cTrainName].StationFrom;
    this.getField("TrainToName").value = TrainData[cTrainName].StationTo;
    this.getField("TrainStn").value = TrainData[cTrainName].Stn;
    I'm able to get data (MTJ, AGC) using this.getField("TrainStn").value = TrainData[cTrainName].Stn; to a text box
    whereas i require this data into a list box.
    Let me know how to do this?

    You use the setItems method of the combo box or list.
    There are some good examples of how to do this at this thread:
    https://forums.adobe.com/thread/1197859

Maybe you are looking for

  • How can I make the jsp pages not displayed by using the navigation class?

    I'm right now implementing a function on my program GUI . It's like whenever I click "STOP THE SERVER" button on the main page, I need those jsp pages relates to the server running to be not displayed, even by directly type in the URL(that's just sta

  • Changing ViewStack using Radio Buttons

    Any examples I can refer to? Any help much appreciated. Thanks (from a newbie).

  • Help on accessing Oracle object !

    Hi, Looking for a help in accessing oracle object using JDBC. I've the following object defined in Oracle. TYPE ty_ctg_prod AS OBJECT( PROD VARCHAR2(40 ), NODE_ID NUMBER , CTG_ID NUMBER ); TYPE ctg_PROD_ary AS VARRAY (50) OF ty_ctg_PROD; The procedur

  • Pattern Matching and Vision Builder 6.0

    Hi, When I select a ROI from an image to generate a pattern matching, Builder saves it as a PNG file. If I open this pattern in other application (Paint Shop Pro 7) to modified it and save as a PNG file, after I can't open this file as a pattern into

  • Does hybrid Tv tuner work in India.?

    HI guys, i use HP Pavillion DV4-1257tx notebook with an inbuild hybrid TV tuner. I live in kerala,India. I receive analog signals such as cable tv channels.but i am not able to receive HDTV ,radio or on-air signals with TV tuner antenna. why is that?