Updating data using a tree structure?

Hi,
I need to change some hierarchical data and wondered the best way to do it.
Basically I have a menu table which I query as a tree structure:
select menu_name, level, option_text, displayed
from menu_option
start with menu_name = 'CONTROL' and option_number >= 0
connect by prior command_line = menu_name
command line has the next menu in the level, unless its a leaf!
What I want to do is, if a 'parent' has the displayed flag set to N, change all the children underneath to N as well. Whats the neatest way to do this in PL/SQL or SQL statements?
Thanks,
Tracey.

How about
update menu_option m1
set displayed = 'N'
where exists
(select 1
from menu_option m2
where m2.displayed = 'N'
start with m2.menu_name = m1.menu_name
connect by prior m2.menu_name = m2.command_line)

Similar Messages

  • Error while updating data using session and call transaction method

    Hi all,
        i have to update data using MM01 transaction from flat file to database.i have used both session method and call transaction method to do that.in both the methods data has been transferred from internal tables to screens but while updating the data that is by clicking the ok-code at the end of the transaction iam getting a dialogue box stating
       SAP EXPRESS DOCUMENT "UPDATE WAS TERMINATED" RECEIVED FROM AUTHOR "SAP".
      please tell whether the problem lies and solution for that.
                                       thanks and regards.

    hi,
    check your recording.check whether u saved your material no in recording or not.
    once again record the transacton mm01.
           MATNR LIKE RMMG1-MATNR,
           MBRSH LIKE RMMG1-MBRSH,
           MTART LIKE RMMG1-MTART,
           MAKTX LIKE MAKT-MAKTX,
           MEINS LIKE MARA-MEINS,
           MATKL LIKE MARA-MATKL,
           BISMT LIKE MARA-BISMT,
           EXTWG LIKE MARA-EXTWG,
    these are the fields which u have to take in internal table.
    this is the record which i took in my flatfile.use filetype as asc and hasfieldseperator as 'X'.
    SUDHU-6     R     ROH     MATSUDHU     "     001     7890     AA
    i did the same.but i didn't get any error.

  • Error Updating Data using a Web Service from BPM

    Hi there,
    I'm trying to update data in an oracle database using a webservice created in DSP and get the following errors. It appears that BPM is unable to find a name, but I'm not sure what name this is referring to. The web service is straight forward and takes in the original and current objects as arguments. I can successfully call the query and insert web services and have double checked my code for the update web service but can't figure out why this is failing. Any idea on why this error might be occurring, or any pointers on what I need to be aware of?
    Caused by: Task '0' in activity '/PlanSubmittal#Default-1.0/Interactive[ViewEditPlan]' for instance '/PlanSubmittal#Default-1.0/1/0' could not be successfully executed. The task failed while executing method 'AddEditWell_Router'.
    Caused by: The method 'AddEditWell_Router' from class 'xobject.Fuego__AutoGen__Screenflows__.__EditPlan' could not be successfully executed.
    Caused by: Could not retrieve name
    fuego.web.exception.WapiTaskFailedException: Task failed.
    Thanks.
    Azeem.

    Hi,
    For the same 'omni portlet' tutorial I am stuck whiile using 'http://webservices.oracle.com/WeatherWS/WeatherWS?WSDL' the error
    'Failed to open specified URL. Check the following: is the URL is active; is there a valid proxy setting or, if HTTP authentication is required, check user name and password. [http://webservices.oracle.com/WeatherWS/WeatherWS?WSDL]'
    get dispalyed. Any quick pointers to resolve this please..
    Thanks,
    Kalyan.

  • Listing File Hierarchy in console using a Tree structure

    first off i'm a college student. i'm not that good at java... we got this CA in class and try as i might i just can't get my head around it
    i was wondering if someone who know a bit more about java then i do would point me in the right direction, were i'm going wrong in my code
    i have to list out sub-files and sub-directorys of a folder (i.e. C:/test) to console using tree structure
    like this
    startingdir
    dir1 //subfolder of startingdir
    dir11 //subfolder of dir1
    dir111 //subfolder of dir11
    dir12 //subfolder of dir1
    file1A // document on dir1
    dir2 //subfolder of startingdir
    Tree.java
    import java.util.Iterator;
    import java.util.LinkedList;
    import java.util.ListIterator;
    import java.util.NoSuchElementException;
    import java.util.Deque;
    public class Tree<E> {
        // Each Tree object is an unordered tree whose
        // elements are arbitrary objects of type E.
        // This tree is represented by a reference to its root node (root), which
        // is null if the tree is empty. Each tree node contains a link to its
        // parent and a LinkedList of child nodes
        private Node root;
        //////////// Constructor ////////////
        public Tree () {
        // Construct a tree, initially empty.
            root = null;
        //////////// Accessors ////////////
        public boolean isEmpty () {
        // Return true is and only if this tree is empty.
             return (root == null);
        public Node root () {
        // Return the root node of this tree, or null if this tree is empty.
            return root;
        public Node parent (Node node) {
        // Return the parent of node in this tree, or null if node is the root node.
            return node.parent;
        public void makeRoot (E elem) {
        // Make this tree consist of just a root node containing element elem.
            root = new Node(elem);
        public Node addChild (Node node, E elem) {
        // Add a new node containing element elem as a child of node in this
        // tree. The new node has no children of its own. Return the node
        // just added.
            Node newChild = new Node(elem);
            newChild.parent = node;
            node.children.addLast(newChild);
            return newChild;
        public E element (Node node) {
             return node.getElement();
        //////////// Iterators ////////////
        public Iterator childrenIterator (Node node) {
            return node.children.iterator();
        public Iterator nodesPreOrder () {
        // Return an iterator that visits all nodes of this tree, with a pre-order
        // traversal.
            return new Tree.PreOrderIterator();
        //////////// Inner classes ////////////
        public class Node {
            // Each Tree.Node object is a  node of an
            // unordered tree, and contains a single element.
            // This tree node consists of an element (element),
            // a link to its parent
            // and a LinkedList of its children
            private E element;
            private Node parent;
            private LinkedList<Node> children;
            private Node (E elem) {
                // Construct a tree node, containing element elem, that has no
                // children and no parent.
                this.element = elem;
                this.parent = null;
                children = new LinkedList<Node>();
            public E getElement () {
            // Return the element contained in this node.
                return this.element;
            public String toString () {
            // Convert this tree node and all its children to a string.
                String children = "";
                // write code here to add all children
                return element.toString() + children;
            public void setElement (E elem) {
            // Change the element contained in this node to be elem.
                this.element = elem;
        public class PreOrderIterator implements Iterator {
            private Deque<Node> track; //Java recommends using Deque rather
            // than Stack. This is used to store sequence of nomempty subtrees still
            //to be visited
            private PreOrderIterator () {
                track = new LinkedList();
                if (root != null)
                    track.addFirst(root);
            public boolean hasNext () {
                return (! track.isEmpty());
            public E next () {
                Node place = track.removeFirst();
                //stack the children in reverse order
                if (!place.children.isEmpty()) {
                    int size = place.children.size(); //number of children
                    ListIterator<Node> lIter =
                            place.children.listIterator(size); //start iterator at last child
                    while (lIter.hasPrevious()) {
                        Node element = lIter.previous();
                        track.addFirst(element);
                return place.element;
            public void remove () {
                throw new UnsupportedOperationException();
        FileHierarchy.java
    import java.io.File;
    import java.util.Iterator;
    public class FileHierarchy {
        // Each FileHierarchy object describes a hierarchical collection of
        // documents and folders, in which a folder may contain any number of
        // documents and other folders. Within a given folder, all documents and
        // folders have different names.
        // This file hierarchy is represented by a tree, fileTree, whose elements
        // are Descriptor objects.
        private Tree fileTree;
        //////////// Constructor ////////////
        public FileHierarchy (String startingDir, int level) {
            // Construct a file hierarchy with level levels, starting at
            // startingDir
            // Can initially ignore level and construct as many levels as exist
            fileTree = new Tree();
            Descriptor descr = new Descriptor(startingDir, true);
            fileTree.makeRoot(descr);
            int currentLevel = 0;
            int maxLevel = level;
            addSubDirs(fileTree.root(), currentLevel, maxLevel);
        //////////// File hierarchy operations ////////////
        private void addSubDirs(Tree.Node currentNode, int currentLevel,
                int maxLevel) {
        // get name of directory in currentNode
        // then find its subdirectories (can add files later)
        // for each subdirectory:
        //    add it to children of currentNode - call addChild method of Tree
        //    call this method recursively on each child node representing a subdir
        // can initially ignore currentLevel and maxLevel   
            Descriptor descr = (Descriptor) currentNode.getElement();
            File f = new File(descr.name);
            File[] list = f.listFiles();
            for (int i = 0; i < list.length; ++i) {
                if (list.isDirectory()) {
    File[] listx = null;
    fileTree.addChild(currentNode, i);
    if (list[i].list().length != 0) {
    listx = list[1].listFiles();
    addSubDirs(currentNode,i,1);
    } else if (list[i].isFile()) {
    fileTree.addChild(currentNode, i);
    // The following code is sample code to illustrate how File class is
    // used to get a list of subdirectories from a starting directory
    // list now contains subdirs and files
    // contained in dir descr.name
    ////////// Inner class for document/folder descriptors. //////////
    private static class Descriptor {
    // Each Descriptor object describes a document or folder.
    private String name;
    private boolean isFolder;
    private Descriptor (String name, boolean isFolder) {
    this.name = name;
    this.isFolder = isFolder;
    FileHierarchyTest.javapublic class FileHierarchyTest {
    private static Tree fileTree;
    public static void main(String[] args) {
    FileHierarchy test = new FileHierarchy ("//test", 1);
    System.out.println(test.toString());

    Denis,
    Do you have [red hair|http://www.dennisthemenace.com/]? ;-)
    My advise with the tree structure is pretty short and sweet... make each node remember
    1. it's parent
    2. it's children
    That's how the file system (inode) actually works.
    <quote>
    The exact reasoning for designating these as "i" nodes is unsure. When asked, Unix pioneer Dennis Ritchie replied:[citation needed]
    In truth, I don't know either. It was just a term that we started to use. "Index" is my best guess, because of the
    slightly unusual file system structure that stored the access information of files as a flat array on the disk, with all
    the hierarchical directory information living aside from this. Thus the i-number is an index in this array, the
    i-node is the selected element of the array. (The "i-" notation was used in the 1st edition manual; its hyphen
    became gradually dropped).</quote>

  • WebLogic missing data on JNDI Tree Structure

    I need to work with Tuxedo through WebLogic, but I am having a bad time trying to figure what is going wrong in here. I have installed WebLogic 10.3 twice and still can't make it right.
    In the JNDI Tree Structure many data is missing (among them tuxedo) and can't find a way to fix it.
    Please, if anyone can give me a light I'll appreciate it.
    Regards.
    Pablo Bustos.
    EDIT: I am running WebLogic 10.3 on Windows XP 32bits.

    Hi,
    Check this debug in ur environment.
    -Dweblogic.jndi.retainenvironment=true
    this should show you the path.
    Regards,
    Kal.

  • Not able to fetch updated data using jdbc and oracle 10g

    Whenever i m updating the data and fetching the same record after updating i m not able to get the fresh/new updated data , old record is fetched every time, but when i checked in database the record gets updated successfully , even if i fire the query two times after 10 seconds using Thread.sleep even then problem persist.
    Please help me out!!!!!!!!
    Implementation has been stucked up!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :(

    Well its okWhat is OK? Your stuff working now?
    i m doing the same thing Apparently not.
    please go thru the below code fragment:
    code for Update :::
    DataAccessBean1 partsHistoryDataAccessBean = new
    DataAccessBean1(context);
    partsHistoryDataAccessBean.setData(data);
    partsHistoryDataAccessBean.update();
    After Updating i m forwading it to the other servletForwarding what? Why do you need another servlet? Just do the query, put the new data into the response object, and return.
    According to your assumption i should get the updated
    data on the other screen but Nope, you don't understand what I'm saying.
    %

  • Acquiring continuous data using an event structure

    I am new to labview, having recently taken the Core I and II courses.
    I am programming a test rig to acquire the linear position of a hydraulic cylinder and plot it over time.  In programming this code, I elected to use an event structure so that when a front panel button is pressed, a certain part of the test is run. 
    In one particular part of the test, called the Snub Test, I need to measure the position of the cylinder over time and plot it to a graph.  The data acquisition needs to be continuous, however the event structure only allows the loop to run once. 
    I have attached a portion of my code for reference.
    Can someone please advise how I can get this data acquisition to run continuously until the user (or a reference trigger) stops the test?
    Thanks
    Attachments:
    Front Panel.vi ‏115 KB

    A few comments to your VI in general:
    You changed the stop button to "switch until released", most likely because you fabricated a race condition and did this as a quick fix. The reason is (1) your placement of the stop terminal outside the event structure and (2) the use of a local variable wired to the stop condition. The button terminal of a latch action boolean belong inside it's associated event case! This way it gets read (and reset to false) when the event occurs. In your case, the local variable and the button get read before the event occurs and the loop needs to spin once more at the event that occurs when you release it (true->false). At this point, the local is still true from the earlier event and the loop stops. Correct would be: latch action, stop terminal inside stop case and wired to the stop condition from inside the event. Other cases use the default output (false) and don't stop the loop.
    Your "equal false" code fragment is just an invert, right? So why complicate things?
    Why do you need a wait if there is an event structure?
    LabVIEW Champion . Do more with less code and in less time .

  • Report  using a tree structure

    I have found function modules RS_TREE_CONSTRUCT  and  rs_tree_list_display
    but they enable me in having only 1 line at one level of the heirarchy , my requirement is to have multiple lines at one level of the tree.
    I have found a function module  TREEV_CREATE_LIST_TREE  which i can not figure out how to use . Any help from the experts ?

    hi,
    check the below example of a list tree which is expandable and collapsable,
    CLASS LCL_EVT_HDLR DEFINITION DEFERRED. " definition is given later
    CLASS CL_GUI_CFW DEFINITION LOAD. " global class to be loaded
    DATA:G_EVENT(50),    " to hold the event
         G_NODE_KEY TYPE TV_NODEKEY,  "holds the node key
         G_ITEM_NAME TYPE TV_ITMNAME,
         G_KEY TYPE TV_ITMNAME,
         G_CHECK TYPE AS4FLAG.
    DATA:G_EVT_HDLR TYPE REF TO LCL_EVT_HDLR,  "reference variable to the
                                                   "class implemented
         G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
         G_TREE TYPE REF TO CL_GUI_LIST_TREE,
         G_OK_CODE TYPE SY-UCOMM.
    TYPES:ITEM_TABLE_TYPE LIKE STANDARD TABLE OF MTREEITM
          WITH DEFAULT KEY.
    TABLES:MARA.
    SELECTION-SCREEN BEGIN OF SCREEN 123.
    SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
    SELECTION-SCREEN END OF SCREEN 123.
    SELECTION-SCREEN BEGIN OF SCREEN 200.
    SELECT-OPTIONS:S_ERNAM FOR MARA-ERNAM.
    SELECTION-SCREEN END OF SCREEN 200.
          CLASS lcl_evt_hdlr DEFINITION
    CLASS LCL_EVT_HDLR DEFINITION.
      PUBLIC SECTION.
        METHODS:
    *---- methods for action handling for nodes
        NODE_DBL_CLK
         FOR EVENT NODE_DOUBLE_CLICK
         OF CL_GUI_LIST_TREE
         IMPORTING NODE_KEY,
        HANDLE_NODE_KEY_PRESS
         FOR EVENT NODE_KEYPRESS
         OF CL_GUI_LIST_TREE
         IMPORTING NODE_KEY KEY,
    *---- methods for action handling for Items
        ITEM_DBL_CLK
         FOR EVENT ITEM_DOUBLE_CLICK
         OF CL_GUI_LIST_TREE
         IMPORTING NODE_KEY ITEM_NAME,
        HANDLE_ITEM_KEY_PRESS
         FOR EVENT ITEM_KEYPRESS
         OF CL_GUI_LIST_TREE
         IMPORTING NODE_KEY ITEM_NAME KEY,
    *---- other methods for action handling
        HANDLE_EXPAND_NO_CHILDREN
         FOR EVENT EXPAND_NO_CHILDREN
         OF CL_GUI_LIST_TREE
         IMPORTING NODE_KEY.
       HANDLE_CHECKBOX
       FOR EVENT CHECKBOX_CHANGE
       OF CL_GUI_LIST_TREE
       IMPORTING NODE_KEY ITEM_NAME CHECKED.
    ENDCLASS.                    "lcl_evt_hdlr DEFINITION
          CLASS lcl_evt_hdlr IMPLEMENTATION
    CLASS LCL_EVT_HDLR IMPLEMENTATION.
      METHOD NODE_DBL_CLK.
      this method handles the node double click event of the tree control
      and shows the key of the double clicked node in a dynpro field
       G_EVENT = 'NODE_DOUBLE_CLICK'.
       G_NODE_KEY = NODE_KEY.
       G_ITEM_NAME = ' '.
    CASE NODE_KEY.
    WHEN 'Root'.
    *call transaction 'VA03'.
    *CALL FUNCTION 'ZFUNC_SCREEN'
    EXPORTING
       PRG_NAME       = 'ybasic3'.
    CALL METHOD G_CUSTOM_CONTAINER->LINK
      EXPORTING
       REPID = SY-REPID
       DYNNR = '0123'.
       CALL SELECTION-SCREEN 123.
      case sy-ucomm.
       when 'BACK'.
        LEAVE PROGRAM.
      endcase.
    WHEN 'Child1'.
    CALL METHOD G_CUSTOM_CONTAINER->LINK
      EXPORTING
       REPID = SY-REPID
       DYNNR = '0200'.
       CALL SELECTION-SCREEN 200.
       LEAVE PROGRAM.
    ENDCASE.
      ENDMETHOD.                    "node_dbl_clk
      METHOD ITEM_DBL_CLK.
        G_EVENT = 'ITEM_DOUBLE_CLICK'.
        G_NODE_KEY = NODE_KEY.
        G_ITEM_NAME = ITEM_NAME.
      ENDMETHOD.                    "ITEM_DBL_CLK
      METHOD HANDLE_NODE_KEY_PRESS.
        G_EVENT = 'NODE_KEYPRESS'.
        G_NODE_KEY = NODE_KEY.
        G_ITEM_NAME = ' '.
        G_KEY = KEY.
      ENDMETHOD.                    "HANDLE_NODE_KEY_PRESS
      METHOD HANDLE_ITEM_KEY_PRESS.
        G_EVENT = 'ITEM_KEYPRESS'.
        G_NODE_KEY = NODE_KEY.
        G_ITEM_NAME = ITEM_NAME.
        G_KEY = KEY.
      ENDMETHOD.                    "HANDLE_ITEM_KEY_PRESS
      METHOD HANDLE_EXPAND_NO_CHILDREN.
        G_EVENT = 'EXPAND_NO_CHILDREN'.
        G_NODE_KEY = NODE_KEY.
      ENDMETHOD.                    "handle_EXPAND_NO_CHILDREN
    METHOD HANDLE_CHECKBOX.
       G_EVENT = 'CHECKBOX_HANDLING'.
       G_NODE_KEY = NODE_KEY.
       G_ITEM_NAME = ITEM_NAME.
       G_CHECK = CHECKED.
    ENDMETHOD.                    "HANDLE_CHECKBOX
    ENDCLASS.                    "lcl_evt_hdlr IMPLEMENTATION
    *------   start-of-selection.
    START-OF-SELECTION.
      CREATE OBJECT G_EVT_HDLR. "create an object for the class
    *lcl_evt_hdlr
      SET SCREEN 100.
    MODULE pbo_100 OUTPUT
    MODULE PBO_100 OUTPUT.
      SET PF-STATUS 'BUT'.
      IF G_TREE IS INITIAL.
      the tree control has not yet been created
    create a tree control and insert nodes into it.
        PERFORM CREATE_AND_INIT_TREE.
      ENDIF.
    ENDMODULE.                    "pbo_100 OUTPUT
    MODULE pai_100 INPUT
    MODULE PAI_100 INPUT.
      DATA:RETURN_CODE TYPE I.
    CL_GUI_CFW=>DISPATCH must be called if events are registered
    that trigger PAI
    this method calls the event handler method of an event
      CALL METHOD CL_GUI_CFW=>DISPATCH
        IMPORTING
          RETURN_CODE = RETURN_CODE.
      IF RETURN_CODE <> CL_GUI_CFW=>RC_NOEVENT.
        " a control event occured => exit PAI
        CLEAR G_OK_CODE.
        EXIT.
      ENDIF.
    *at user-command.
      G_OK_CODE = SY-UCOMM.
      CASE G_OK_CODE.
        WHEN 'BACK'. " Finish program
          IF NOT G_CUSTOM_CONTAINER IS INITIAL.
            " destroy tree container (detroys contained tree control, too)
            CALL METHOD G_CUSTOM_CONTAINER->FREE
              EXCEPTIONS
                CNTL_SYSTEM_ERROR = 1
                CNTL_ERROR        = 2.
            IF SY-SUBRC <> 0.
              MESSAGE A000.
            ENDIF.
            CLEAR G_CUSTOM_CONTAINER.
            CLEAR G_TREE.
          ENDIF.
          LEAVE PROGRAM.
      ENDCASE.
    CAUTION: clear ok code!
      CLEAR G_OK_CODE.
    ENDMODULE.                    "pai_100 INPUT
    *&      Form  create_and_init_tree
          text
    -->  p1        text
    <--  p2        text
    FORM CREATE_AND_INIT_TREE .
      DATA:NODE_TABLE TYPE TREEV_NTAB,
           ITEM_TABLE TYPE ITEM_TABLE_TYPE,
           EVENTS TYPE CNTL_SIMPLE_EVENTS,
           EVENT TYPE CNTL_SIMPLE_EVENT.
      create a container for the tree control.
      CREATE OBJECT G_CUSTOM_CONTAINER
       EXPORTING
        the container is linked to the custom control with the
        name 'TREE_CONTAINER' on the dynpro
         CONTAINER_NAME = 'TREE_CONTAINER'
       EXCEPTIONS
          CNTL_ERROR = 1
          CNTL_SYSTEM_ERROR = 2
          CREATE_ERROR = 3
          LIFETIME_ERROR = 4
          LIFETIME_DYNPRO_DYNPRO_LINK = 5.
      IF SY-SUBRC <> 0.
        MESSAGE A000.
      ENDIF.
      create a list tree control
      CREATE OBJECT G_TREE
       EXPORTING
        PARENT = G_CUSTOM_CONTAINER
        NODE_SELECTION_MODE = CL_GUI_LIST_TREE=>NODE_SEL_MODE_SINGLE
        ITEM_SELECTION = 'X'
        WITH_HEADERS = ' '
       EXCEPTIONS
        CNTL_SYSTEM_ERROR           = 1
         CREATE_ERROR                = 2
         FAILED                      = 3
         ILLEGAL_NODE_SELECTION_MODE = 4
         LIFETIME_ERROR              = 5.
      IF SY-SUBRC <> 0.
        MESSAGE A000.
      ENDIF.
    *------- KEY = enter
      CALL METHOD G_TREE->ADD_KEY_STROKE
        EXPORTING
          KEY               = CL_TREE_CONTROL_BASE=>KEY_ENTER
        EXCEPTIONS
          FAILED            = 1
          ILLEGAL_KEY       = 2
          CNTL_SYSTEM_ERROR = 3.
      IF SY-SUBRC <> 0.
        MESSAGE W006 WITH 'ADD_KEY_STROKE'.
      ENDIF.
       define the events which will be passed to the backend
    node double click
      EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_NODE_DOUBLE_CLICK.
      EVENT-APPL_EVENT = 'X'.
      APPEND EVENT TO EVENTS.
      EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_ITEM_DOUBLE_CLICK.
      EVENT-APPL_EVENT = 'X'.
      APPEND EVENT TO EVENTS.
      EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_NODE_KEYPRESS.
      EVENT-APPL_EVENT = 'X'.
      APPEND EVENT TO EVENTS.
      EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_ITEM_KEYPRESS.
      EVENT-APPL_EVENT = 'X'.
      APPEND EVENT TO EVENTS.
      EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_EXPAND_NO_CHILDREN.
      EVENT-APPL_EVENT = 'X'.
      APPEND EVENT TO EVENTS.
    EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_CHECKBOX_CHANGE.
    EVENT-APPL_EVENT = 'X'.
    APPEND EVENT TO EVENTS.
    *------ register the events
      CALL METHOD G_TREE->SET_REGISTERED_EVENTS
        EXPORTING
          EVENTS                    = EVENTS
        EXCEPTIONS
          CNTL_ERROR                = 1
          CNTL_SYSTEM_ERROR         = 2
          ILLEGAL_EVENT_COMBINATION = 3.
      IF SY-SUBRC <> 0.
        MESSAGE A000.
      ENDIF.
    assign event handlers in the application class to each desired events
      SET HANDLER G_EVT_HDLR->NODE_DBL_CLK FOR G_TREE.
      SET HANDLER G_EVT_HDLR->ITEM_DBL_CLK FOR G_TREE.
      SET HANDLER G_EVT_HDLR->HANDLE_NODE_KEY_PRESS FOR G_TREE.
      SET HANDLER G_EVT_HDLR->HANDLE_ITEM_KEY_PRESS FOR G_TREE.
      SET HANDLER G_EVT_HDLR->HANDLE_EXPAND_NO_CHILDREN FOR G_TREE.
    SET HANDLER G_EVT_HDLR->HANDLE_CHECKBOX FOR G_TREE.
    add some nodes to the tree control
      PERFORM BUILD_NODE_AND_ITEM_TABLE USING NODE_TABLE ITEM_TABLE.
      CALL METHOD G_TREE->ADD_NODES_AND_ITEMS
        EXPORTING
          NODE_TABLE                     = NODE_TABLE
          ITEM_TABLE                     = ITEM_TABLE
          ITEM_TABLE_STRUCTURE_NAME      = 'mtreeitm'
        EXCEPTIONS
          FAILED                         = 1
          CNTL_SYSTEM_ERROR              = 3
          ERROR_IN_TABLES                = 4
          DP_ERROR                       = 5
          TABLE_STRUCTURE_NAME_NOT_FOUND = 6.
      IF SY-SUBRC <> 0.
        MESSAGE A000.
      ENDIF.
    ENDFORM.                    " create_and_init_tree
    *&      Form  build_node_and_item_table
          text
         -->P_NODE_TABLE  text
         -->P_ITEM_TABLE  text
    FORM BUILD_NODE_AND_ITEM_TABLE  USING
              NODE_TABLE TYPE TREEV_NTAB
              ITEM_TABLE TYPE ITEM_TABLE_TYPE.
      DATA:NODE TYPE TREEV_NODE,
           ITEM TYPE MTREEITM.
    build the node table
    node with key 'root'.
      CLEAR NODE.
      NODE-NODE_KEY = 'Root'.  " key of the node
      CLEAR NODE-RELATKEY.    " root node has no parent node
      CLEAR NODE-RELATSHIP.
      NODE-HIDDEN = ' '.      " the node is visible
      NODE-DISABLED = ' '.     " selectable
      NODE-ISFOLDER = 'X'.    " a folder
      CLEAR NODE-N_IMAGE.     " folder-/ leaf symbol in state "closed"
      "use default.
      CLEAR NODE-EXP_IMAGE.   " folder-/ leaf symbol in state "open"
      "use default.
      CLEAR NODE-EXPANDER.    " the width of the item is adjusted to its "
      " content (text)
      APPEND NODE TO NODE_TABLE.
    node with key 'child1'.
      CLEAR NODE.
      NODE-NODE_KEY = 'Child1'. "key of the node
      NODE-RELATKEY = 'Root'.
      NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
      NODE-ISFOLDER = 'X'.
      APPEND NODE TO NODE_TABLE.
    node with key 'Subchild1' for child1.
      CLEAR NODE.
      NODE-NODE_KEY = 'SubChild1'.
      NODE-RELATKEY = 'Child1'.
      NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
      NODE-ISFOLDER = 'X'.
      APPEND NODE TO NODE_TABLE.
    node with key 'subchild2' for child1.
      CLEAR NODE.
      NODE-NODE_KEY = 'SubChild2'.
      NODE-RELATKEY = 'Child1'.
      NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
      APPEND NODE TO NODE_TABLE.
    node with key 'subchild3' for child1.
      CLEAR NODE.
      NODE-NODE_KEY = 'SubChild3'.
      NODE-RELATKEY = 'Child1'.
      NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
      APPEND NODE TO NODE_TABLE.
    node with key 'subchild4' for child1.
      CLEAR NODE.
      NODE-NODE_KEY = 'SubChild4'.
      NODE-RELATKEY = 'Child1'.
      NODE-DISABLED = ' '.
      NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
      APPEND NODE TO NODE_TABLE.
    node with key 'child2'.
      CLEAR NODE.
      NODE-NODE_KEY = 'Child2'. "key of the node
      NODE-RELATKEY = 'Root'.
      NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
      NODE-ISFOLDER = 'X'.
      NODE-EXPANDER = 'X'.    " The node is marked with a '+', although
      " it has no children. When the user clicks on the
      " + to open the node, the event expand_nc is
      " fired. The programmerr can
      " add the children of the
      " node within the event handler of the expand_nc
      " event  (see callback handle_expand_nc).
      APPEND NODE TO NODE_TABLE.
    items of the nodes
    item with key 'root'.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'Root'.
      ITEM-ITEM_NAME = '1'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT. " text item
      ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO. "the width of the item
      "is adjusted to its content
      ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP. "use proportional font
      " for the item
      ITEM-TEXT = 'object'.
      APPEND ITEM TO ITEM_TABLE.
    item with key 'child1'.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'Child1'.
      ITEM-ITEM_NAME = '11'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO.
      ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP.
      ITEM-TEXT = 'dynpros'.
      APPEND ITEM TO ITEM_TABLE.
    item with key 'child2'.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'Child2'.
      ITEM-ITEM_NAME = '12'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO.
      ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP.
      ITEM-TEXT = 'programme'.
      APPEND ITEM TO ITEM_TABLE.
    items of node  with key 'Subchild1'.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'SubChild1'.
      ITEM-ITEM_NAME = '111'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-LENGTH = 11.
      ITEM-TEXT = 'include'.
      APPEND ITEM TO ITEM_TABLE.
    items of node with key 'SubChild2'.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'SubChild2'.
      ITEM-ITEM_NAME = '112'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-LENGTH = 4.  " the width of the item is 4 chars
      ITEM-IGNOREIMAG = 'X'.  " see documentation of structure treev_item
      ITEM-USEBGCOLOR = 'X'.
      ITEM-T_IMAGE = '@01@'.
      APPEND ITEM TO ITEM_TABLE.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'SubChild2'.
      ITEM-ITEM_NAME = '113'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-LENGTH = 4.  " the width of the item is 4 chars
      ITEM-USEBGCOLOR = 'X'.
      ITEM-TEXT = '0100'.
      APPEND ITEM TO ITEM_TABLE.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'SubChild2'.
      ITEM-ITEM_NAME = '114'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-LENGTH = 11.
      ITEM-USEBGCOLOR = 'X'.
      ITEM-TEXT = ' mueller'.
      APPEND ITEM TO ITEM_TABLE.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'SubChild2'.
      ITEM-ITEM_NAME = '115'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO.
      ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP.
      ITEM-TEXT = ' comment to dynpro 100'.
      APPEND ITEM TO ITEM_TABLE.
    items of node with key 'SubChild3'.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'SubChild3'.
      ITEM-ITEM_NAME = '121'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-LENGTH = 20.
      ITEM-IGNOREIMAG = 'X'.
      ITEM-USEBGCOLOR = 'X'.
      ITEM-T_IMAGE = '@02@'.
      ITEM-TEXT = '  0200 harryhirsch'.
    ITEM-CHOSEN = 'X'.
      APPEND ITEM TO ITEM_TABLE.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'SubChild3'.
      ITEM-ITEM_NAME = '122'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO.
      ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP.
      ITEM-TEXT = ' comment to dynpro 200'.
      APPEND ITEM TO ITEM_TABLE.
      CLEAR ITEM.
      ITEM-NODE_KEY = 'SubChild4'.
      ITEM-ITEM_NAME = '144'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-LENGTH = 20.
      ITEM-IGNOREIMAG = 'X'.
      ITEM-USEBGCOLOR = 'X'.
      ITEM-TEXT = '  select'.
      ITEM-CHOSEN = 'X'.
      ITEM-DISABLED = ' '.
      APPEND ITEM TO ITEM_TABLE.
    ENDFORM.                    " build_node_and_item_table
    Hope it helps you,
    Regards,

  • How to update data using BAPI for MD61

    Hello,
    IN my zprogram i used to bapis for uploading data from flat file to sap-system
    1)BAPI_requirement_create
    2)BAPI_requirement_change
    i)my program is taking data from my flat file but it is wipping out old data i nned to update not to overwrite is there any BAPI for this query
    ii)One more thing if data is already entered in on date (i.e 10.07.2009) and when he upload data from flat file for another date same month (12.07.2009) old date data sholud not removed ...
    Please reply me if my query is not understand..
    Thanks in advance..

    Assuming you have your new requirements in table IT_REQ.
    You could do something like:
    DATA: it_req TYPE TABLE OF BAPISSHDIN.
    DATA: l_req TYPE BAPISSHDIN.
    DATA: it_req_out TYPE TABLE OF bapisitmeo.
    DATA: l_req_out TYPE bapisitmeo.
    *   Get existing requirements
        CLEAR it_req_out[].
        CALL FUNCTION 'BAPI_REQUIREMENTS_GETDETAIL'
             EXPORTING
                  material         = p_matnr
                  plant            = p_werks
                  requirementstype = p_bedae
                  version          = p_versb
                  reqmtsplannumber = ''
             TABLES
                  requirements_out = it_req_out[]
                  return           = lt_return[].
    *   Append old requirements to requirements table
        LOOP AT it_req_out INTO l_req_out.
          MOVE: l_req_out-date_type TO l_req-date_type,
                l_req_out-req_date TO l_req-req_date,
                l_req_out-req_qty TO l_req-req_qty,
                l_req_out-unit TO l_req-unit.
          APPEND l_req TO it_req.
        ENDLOOP.
    *   Change requirements
        CALL FUNCTION 'BAPI_REQUIREMENTS_CHANGE'
             EXPORTING
                  material                 = p_matnr
                  plant                    = p_werks
                  requirementstype         = p_bedae
                  version                  = p_versb
                  reqmtsplannumber         = ''
                  vers_activ               = p_vervs
             TABLES
                  requirements_schedule_in = it_req[]
                  return                   = lt_return[].

  • Update data using table contol in bdc

    please anyone can help me in this code  i.e how to update the database yusing table control please make changes in my code if required
    this is my code
    report ZTEST_XK01
           no standard page heading line-size 255.
    *include bdcrecx1.
    ***************PARAMETERS DECLERATIONS*********
    PARAMETERS  : P_file type rlgrap-filename, P_FILE1 TYPE RLGRAP-FILENAME
    **************internal table decleration*******
    data : bdcdata type standard table of bdcdata with header line.
    data : begin of t_lfa1 occurs 0,
            lifnr like RF02K-LIFNR,
            BUKRS LIKE RF02K-BUKRS,
            EKORG LIKE RF02K-EKORG,
            KTOKK LIKE RF02K-KTOKK,
            ANRED LIKE LFA1-ANRED,
            NAME1 LIKE LFA1-NAME1,
            SORTL LIKE LFA1-SORTL,
            LAND1 LIKE LFA1-LAND1,
            AKONT LIKE LFB1-AKONT,
            ZTERM LIKE LFB1-ZTERM,
           END OF T_LFA1.
    DATA : BEGIN OF T_LFBK OCCURS 0,
             BANKS LIKE LFBK-BANKS,
             BANKL LIKE LFBK-BANKL,
            END OF T_LFBK.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
    FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = p_FILE
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE1.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = P_FILE1
    start-of-selection.
    data : v_file type string.
    move p_file to v_file.
    data : e_file type string.
    move p_file1 to e_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = v_file
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = T_LFA1
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = E_FILE
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = T_LFBK
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    loop at t_lfa1.
    perform bdc_dynpro      using 'SAPMF02K' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  t_lfa1-lifnr.
    perform bdc_field       using 'RF02K-BUKRS'
                                  t_lfa1-bukrs.
    perform bdc_field       using 'RF02K-EKORG'
                                  t_lfa1-ekorg.
    perform bdc_field       using 'RF02K-KTOKK'
                                  t_lfa1-ktokk.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-SORTL'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-ANRED'
                                t_lfa1-anred.
    perform bdc_field       using 'LFA1-NAME1'
                                 t_lfa1-name1.
    perform bdc_field       using 'LFA1-SORTL'
                                 t_lfa1-sortl.
    perform bdc_field       using 'LFA1-LAND1'
                                 t_lfa1-land1.
    perform bdc_dynpro      using 'SAPMF02K' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    loop at t_lfbk .
    data : val(2) type c.
    data :v_fil type c.
    concatenate 'lfbk-banks(' val  ')' into v_fil.
    perform bdc_field using v_fil
    t_lfbk-BANKS.
    concatenate 'lfbk-bankl(' val  ')' into v_fil.
    perform bdc_field using v_fil
    t_lfbk-BANKl.
    val = 01.
    val = val + 1.
    if val > 5.
    val = 5.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-BANKL(val)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  'ENTR'.
    perform bdc_field       using 'LFBK-BANKL(val)'
                                  v_fil.
    perform bdc_field       using 'LFBK-BANKS(val)'
                                  v_fil.
    *perform bdc_field       using 'LFBK-BANKS(02)'
                                 'IN'.
    *perform bdc_field       using 'LFBK-BANKS(03)'
                                 'in'.
    *perform bdc_field       using 'LFBK-BANKS(04)'
                                 'in'.
    *perform bdc_field       using 'LFBK-BANKS(05)'
                                 'in'.
    *perform bdc_field       using 'LFBK-BANKL(02)'
                                 '00000142'.
    *perform bdc_field       using 'LFBK-BANKL(03)'
                                 'sunny'.
    *perform bdc_field       using 'LFBK-BANKL(04)'
                                 'sunny'.
    *perform bdc_field       using 'LFBK-BANKL(05)'
                                 'sunny'.
    *perform bdc_dynpro      using 'SAPMF02K' '0130'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'LFBK-BANKS(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=ENTR'.
    endif.
    endloop.
    perform bdc_dynpro      using 'SAPMF02K' '0210'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB1-AKONT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFB1-AKONT'
                                  '160000'.
    perform bdc_dynpro      using 'SAPMF02K' '0215'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB1-ZTERM'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFB1-ZTERM'
                                  '0001'.
    perform bdc_dynpro      using 'SAPMF02K' '0220'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB5-MAHNA'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0310'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFM1-WAERS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0320'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'

    Hi,
    you can check the following piece of code.
    *Batchinputdata of single transaction
    DATA :   tbl_bdcdata LIKE bdcdata   OCCURS 0 WITH HEADER LINE.
    *Input records
    DATA : BEGIN  OF tbl_input OCCURS 0,
           lifnr     LIKE     lfa1-lifnr,   "Account number of vendor or
           banks     LIKE     lfbk-banks,   "Bank country key
           bankl     LIKE     lfbk-bankl,   "Bank key
           bankn     LIKE     lfbk-bankn,   "Bank account number
           koinh LIKE    lfbk-koinh,   "Account holder name
           bvtyp     LIKE     lfbk-bvtyp,   "Partner bank type
           banka     LIKE     bnka-banka,   "Name of bank
           stcd3     LIKE     lfa1-stcd3,   "Tax number 3
           scacd     LIKE     lfa1-scacd,   "Standard carrier access code
           zwels     LIKE     lfb1-zwels,   "List of the Payment Methods to be
                                       "Considered
           lnrzb     LIKE     lfb1-lnrzb,   "Alternate payee
           iban     LIKE     tiban-iban,   "IBAN (International Bank Account
                                       "      Number)
           valid_from(10) TYPE c,      "Start of IBAN validity
           swift     LIKE     bnka-swift,   "SWIFT Code for International
                                       "Payments
           bukrs  LIKE zgroup_code_xref-bukrs,
                                       "Company code
           land1  LIKE t001-land1,     "Country
           END   OF tbl_input.
    *Constants
    *CONSTANTS
    CONSTANTS: c_tcode TYPE tstc-tcode VALUE 'XK02',   "For holding
                                                       "the TCODE
               c_keep(1) TYPE c VALUE 'X',                "To hold X
               c_tabctrl    TYPE i VALUE '6',             "For holding
               c_and        TYPE c VALUE '&',
               c_tab TYPE x VALUE '09'.
             START-OF-SELECTION                                         *
    START-OF-SELECTION.
      IF p_appser NE 'X' .
    *Download from presentation server
        PERFORM pres_file_download .
      ELSE.
    *Download from application server
        PERFORM appl_file_download.
      ENDIF.
      DESCRIBE TABLE tbl_input LINES w_rec.
    *Banking details upload
      IF  p_bank = 'X'.
        IF NOT tbl_input[] IS INITIAL.
          PERFORM data_fetching.
        ELSE.
          WRITE : text-017.
          EXIT.
        ENDIF.
        PERFORM data_validation.
        PERFORM final_data_prep.
        IF p_test NE 'X'.
        <b>  PERFORM bdc_data_load</b>.
        ENDIF.
    *Linking alternate payee
      ELSE.
        IF NOT tbl_input[] IS INITIAL.
          PERFORM data_fetching_zalt.
        ENDIF.
        PERFORM data_validation_zalt.
        PERFORM final_data_prep_zalt.
        PERFORM zalt_data_load.
      ENDIF.
    *&      <b>Form  bdc_data_load</b>
    FORM bdc_data_load.
      PERFORM open_group.
      DATA : l_cnt(2) TYPE n.                                   "TIR-70118
      SORT tbl_final BY lifnr bukrs.
      SORT tbl_lfbk BY lifnr.
      LOOP AT tbl_final.
        AT NEW bukrs.
          PERFORM 1_screen.
          PERFORM cursor_location.
        ENDAT.
        PERFORM table_control.
        l_cnt = l_cnt + 1.                                      "TIR-70118
        AT END OF bukrs.
    *Begin of addition for TIR-70118
          MOVE l_cnt TO tbl_lfbk-cnt.
          tbl_lfbk-lifnr = tbl_final-lifnr.
          COLLECT tbl_lfbk.
          SORT tbl_lfbk BY lifnr.
          CLEAR l_cnt.
    *End of addition for TIR-70118
          PERFORM last_screen.
          PERFORM insert_bdc.
          REFRESH tbl_bdcdata.
        ENDAT.
      ENDLOOP.
      PERFORM close_group.
    ENDFORM.                    " bdc_data_load
    *&    <b>  Form  1_screen</b>
    FORM 1_screen.
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0101'.
      PERFORM bdc_field   USING : 'BDC_CURSOR'
                                  'RF02K-D0215',
                                    'BDC_OKCODE'
                                    '/00',
                                    'RF02K-LIFNR'
                                    tbl_final-lifnr,
                                    'RF02K-BUKRS'
                                     tbl_final-bukrs,
                                    'RF02K-D0110'
                                    'RF02K-D0120'
                                    'X',
                                   'RF02K-D0130'
                                    'X',
                                   'RF02K-D0215'
                                    'X'.
      PERFORM bdc_dynpro  USING 'SAPMF02K' '0120'.
      PERFORM bdc_field   USING :   'BDC_CURSOR'
                                    'LFA1-TXJCD',
                                    'BDC_OKCODE'
                                    '/00'.
    *Begin of changes for TIR-70118
      IF NOT tbl_final-stcd3 IS INITIAL.
        PERFORM bdc_field   USING :   'LFA1-STCD3'
                                      tbl_final-stcd3.
      ENDIF.
      IF NOT tbl_final-scacd IS INITIAL.
        PERFORM bdc_field   USING :   'LFA1-SCACD'
                                      tbl_final-scacd.
      ENDIF.
    *End of changes for TIR-70118
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
    ENDFORM.                                                    " 1_screen
    *&     <b> Form  cursor_location</b>
    FORM cursor_location.
      DATA : l_times TYPE i.
      CLEAR tbl_lfbk.                                           "TIR-70118
      READ TABLE tbl_lfbk WITH KEY lifnr = tbl_final-lifnr
                                                 BINARY SEARCH.
      IF sy-subrc = 0.
        l_times = tbl_lfbk-cnt DIV 5.
        w_count = ( tbl_lfbk-cnt MOD 5 ) + 1.
        DO l_times TIMES.
          PERFORM page_down.
        ENDDO.
      ELSE.
        w_count = 1.
      ENDIF.
      CLEAR l_times.
    ENDFORM.                    " cursor_location
    *&   <b>   Form  table_control</b>
    FORM table_control.
      CONCATENATE 'LFBK-BANKS(' w_count ')'
                                       INTO w_fld1.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                   w_fld1.
      CLEAR w_fld1.
      IF NOT ( tbl_final-banks IS INITIAL ).                    "TIR-70118
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        CONCATENATE 'LFBK-BANKS(' w_count ')'
                                         INTO w_fld1.
        PERFORM bdc_field       USING w_fld1
                                        tbl_final-banks.
        CLEAR w_fld1.
        CONCATENATE 'LFBK-BANKL(' w_count ')'
                                         INTO w_fld1.
        PERFORM bdc_field       USING w_fld1
                                        tbl_final-bankl.
        CLEAR w_fld1.
        CONCATENATE 'LFBK-BANKN(' w_count ')'
                                         INTO w_fld1.
        PERFORM bdc_field       USING  w_fld1
                                       tbl_final-bankn.
        CONCATENATE 'LFBK-KOINH(' w_count ')'
                                         INTO w_fld1.
        PERFORM bdc_field       USING w_fld1
                                         tbl_final-koinh.
        CONCATENATE 'LFBK-BKONT(' w_count ')'
                                         INTO w_fld1.
        PERFORM bdc_field       USING w_fld1
                                        tbl_final-bkont.
        CONCATENATE 'LFBK-BVTYP(' w_count ')'
                                         INTO w_fld1.
        PERFORM bdc_field       USING w_fld1
                                        tbl_final-bvtyp.
        CONCATENATE 'LFBK-BKREF(' w_count ')'
                                         INTO w_fld1.
        PERFORM bdc_field       USING w_fld1
                                       tbl_final-bkref.
        CLEAR w_fld1.
        IF NOT tbl_final-swift IS INITIAL.
          PERFORM swift_screen.
        ENDIF.
        IF NOT tbl_final-iban IS INITIAL.
          PERFORM iban_screen.
        ENDIF.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
    <b>    w_count = w_count + 1.
        IF w_count EQ c_tabctrl.
          w_count = 1.
          PERFORM page_down</b>.
        ENDIF.
      ENDIF.                                                   
    ENDFORM.                    " table_control
    *&  <b>    Form  page_down</b>
    FORM page_down.
      PERFORM bdc_field   USING 'BDC_OKCODE'
                                '=P+'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                              'LFBK-BANKS(01)'.
      PERFORM bdc_dynpro  USING 'SAPMF02K'
                                '0130'.
      PERFORM bdc_field   USING 'BDC_OKCODE'
                                '/00'.
    ENDFORM.                    " page_down
    *&      Form  <b>Insert_BDC</b>
          This form takes the transaction code and populates the data
    FORM submit_bdc .
    **Function module that takes the TCODE and populate the data
      CALL FUNCTION 'BDC_INSERT'
           EXPORTING
                tcode            = c_tcode
           TABLES
                dynprotab        = tbl_bdcdata
           EXCEPTIONS
                internal_error   = 1
                not_open         = 2
                queue_error      = 3
                tcode_invalid    = 4
                printing_invalid = 5
                posting_invalid  = 6
                OTHERS           = 7.
    *Incase of error while populatin data
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                      "End of Submit_bdc
    I think this code can help for you, let me know if any doubts.
    Reward with points, if it helpful for u.
    Regards,
    Vijay

  • How to  create Tree Structure for given data?

    Hi,
    I have to create a tree structure of Folders and the contents in the Folder.
    I have a XML, it contains data for the tree structure to display. How can I create a tree structure which would look like below
    Parent
       Child
         Supporting Views
            Raw eInfotree Table Views
            Background Calculations
            QC Data Views
         Calculation Views
         Unit Operation Views
            Cell Culture Views
            Purification Views
            MFR Views
         Personal Views
    All the nodes should have folder Icon.
    Please find the XML as
    <?xml version="1.0" encoding="UTF-8"?><Rowsets DateCreated="2007-05-02T07:37:37" EndDate="2007-05-02T16:59:53" StartDate="2007-05-02T16:59:53" Version="11.5.3"><Rowset><Columns><Column Description="" MaxRange="1" MinRange="0" Name="TK" SQLDataType="4" SourceColumn="TK"/><Column Description="" MaxRange="1" MinRange="0" Name="NAME" SQLDataType="1" SourceColumn="NAME"/><Column Description="" MaxRange="1" MinRange="0" Name="TYPE" SQLDataType="1" SourceColumn="TYPE"/><Column Description="" MaxRange="1" MinRange="0" Name="PK" SQLDataType="4" SourceColumn="PK"/></Columns>
    <Row><TK>1</TK><NAME>Parent</NAME><TYPE>F</TYPE><PK>0</PK></Row>
    <Row><TK>2</TK><NAME>Child</NAME><TYPE>F</TYPE><PK>1</PK></Row>
    <Row><TK>3</TK><NAME>Supporting Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
    <Row><TK>4</TK><NAME>Raw eInfotree Table Views</NAME><TYPE>F</TYPE><PK>3</PK></Row>
    <Row><TK>5</TK><NAME>Background Calculations</NAME><TYPE>F</TYPE><PK>3</PK></Row>
    <Row><TK>6</TK><NAME>QC Data Views</NAME><TYPE>F</TYPE><PK>3</PK></Row>
    <Row><TK>7</TK><NAME>Calculation Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
    <Row><TK>8</TK><NAME>Unit Operation Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
    <Row><TK>9</TK><NAME>Cell Culture Views</NAME><TYPE>F</TYPE><PK>8</PK></Row>
    <Row><TK>10</TK><NAME>Purification Views</NAME><TYPE>F</TYPE><PK>8</PK></Row>
    <Row><TK>11</TK><NAME>MFR Views</NAME><TYPE>F</TYPE><PK>8</PK></Row>
    <Row><TK>12</TK><NAME>Personal Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
    </Rowset>
    </Rowsets>

    Vishal,
    If you structure your data with two columns, the first being the Node name and the second being the Parent node name (see your information below), the iBrowser applet will make a nice data driven tree with all of the SelectionEvent or navigational capabilities you want.
    <?xml version="1.0" encoding="UTF-8"?>
    <Rowsets DateCreated="2007-05-02T07:37:37" EndDate="2007-05-02T16:59:53" StartDate="2007-05-02T16:59:53" Version="11.5.3">
    <Rowset><Columns><Column Description="" MaxRange="1" MinRange="0" Name="NAME" SQLDataType="1" SourceColumn="NAME"/><Column Description="" MaxRange="1" MinRange="0" Name="PARENT" SQLDataType="1" SourceColumn="PARENT"/></Columns>
    <Row><NAME>Parent</NAME><PARENT></PARENT></Row>
    <Row><NAME>Child</NAME><PARENT>Parent</PARENT></Row>
    <Row><NAME>Supporting Views</NAME><PARENT>Child</PARENT></Row>
    <Row><NAME>Calculation Views</NAME><PARENT>Child</PARENT></Row>
    <Row><NAME>Unit Operation Views</NAME><PARENT>Child</PARENT></Row>
    <Row><NAME>Personal Views</NAME><PARENT>Child</PARENT></Row>
    <Row><NAME>Raw eInfotree Table Views</NAME><PARENT>Supporting Views</PARENT></Row>
    <Row><NAME>Background Calculations</NAME><PARENT>Supporting Views</PARENT></Row>
    <Row><NAME>QC Data Views</NAME><PARENT>Supporting Views</PARENT></Row>
    <Row><NAME>Cell Culture Views</NAME><PARENT>Unit Operation Views</PARENT></Row>
    <Row><NAME>Purification Views</NAME><PARENT>Unit Operation Views</PARENT></Row>
    <Row><NAME>MFR Views</NAME><PARENT>Unit Operation Views</PARENT></Row>
    </Rowset>
    </Rowsets>
    Regards,
    Jeremy

  • Tree Structure?

    Hi Experts,
    I need to create a screen like a Tree Structure like below. If I click on the Reporting Group values folder, it should populate data from one table and by clicking on Reporting Group Levels, it should open the subfolder and need to populate the values based on the selection of folder.
    Is this Tree Structure can be done in Web Dynpro?If yes, how can I go ahead for my development.
    Please clarify me experts.
    BR,
    RAM.

    Hi RAM,
    Yes, it can be done in WDA.
    Your requirement can be achieved as below
    you can create 2 containers side by side in your view i.e. by using PANEL or transparent containers
    Tree structure
    Create tree uielement
    Create context node for tree with required attributes
    Populate the data for tree structure with node key
    Details Display
    Create a table to display data based on tree structure element
    if structure of table of each node/leaf element of tree is different, you can create table ui element dynamically based on your data
    On click of tree element, based on KEY of the selected element, you can populate the details and fill the table in the right side container
    Please refer the demo component for Tree example:
    WDR_TEST_TREE
    Also, check the below links
    Web DynPro ABAP Application using Tree and Frame - Web Dynpro ABAP - SCN Wiki
    SAP nxt: How to create a three level tree node in Webdynpro ABAP
    Hope this helps you.
    Regards,
    Rama

  • Tree Structure V Linear List

    I am designing a new program and am examining the various data structures that are available for use. This program I am desiging is basically a database, with various attributes of and employee - eg Name, Id, dept etc.
    What are the advantages & disadvantages of using the tree structure to store this data instead of using the standard linear list?
    Many Thanks

    Ok, if you're a programmer or even maybe a software engineer you SHOULD definetly know what the advantages and disadvantages are. Heck, you should even know what the runtime complexity, in standard "Big-Oh" notation, of a search for each structure.
    Ny
    I am designing a new program and am examining the
    various data structures that are available for use.
    This program I am desiging is basically a database,
    with various attributes of and employee - eg Name, Id,
    dept etc.
    What are the advantages & disadvantages of using the
    tree structure to store this data instead of using the
    standard linear list?
    Many Thanks

  • Complex Tree Structure Query

    Hi,
    I have a table which contains the hierarchial data upto 4 levels. I needed to have the information of all the four levels in a row, so I created 3 tree structured views and one another view using the tree structured views as below
    --To get the great grand parent id for the children*
    CREATE OR REPLACE VIEW VR_PO_TREE AS
    SELECT LEVEL pathlength,
    connect_by_root partner_organization_id root_po,
    partner_organization_id,
    partner_common_name,
    partner_organization_type
    FROM partner_organization po
    START WITH po.org_entity_above_id IS NULL
    CONNECT BY PRIOR po.partner_organization_id = po.org_entity_above_id
    ORDER BY po.partner_organization_id;
    -- level 2 (grant parent) id
    CREATE OR REPLACE VIEW VR_PO_AREA_TR AS
    SELECT LEVEL pathlength,
    connect_by_root partner_organization_id root_po,
    partner_organization_id,
    partner_common_name,
    partner_organization_type
    FROM partner_organization vcpo
    START WITH vco.partner_organization_type = 'AREA'
    CONNECT BY PRIOR vcpo.partner_organization_id = vcpo.org_entity_above_id
    ORDER BY vcpo.partner_organization_id;
    --level 3 (parent) id*
    CREATE OR REPLACE VIEW VR_PO_REGION_TREE AS
    SELECT LEVEL pathlength,
    connect_by_root partner_organization_id root_po,
    vcpo.partner_organization_id,
    vcpo.partner_common_name,
    vcpo.partner_type
    FROM partner_organization vcpo
    START WITH vcpo.partner_organization_type = 'REGION'
    CONNECT BY PRIOR vcpo.partner_organization_id = vcpo.org_entity_above_id
    ORDER BY vcpo.partner_organization_id;
    ---and finally created a view to have all the levels in a single row
    CREATE OR REPLACE VIEW VR_PO_ALL_TREE AS
    SELECT pot.pathlength,
    po.partner_organization_id,
    po.partner_common_name,
    pot.root_po int_partner_org_id,
    pot.intl_po_name int_partner_common_name,
    vpat.root_po area_partner_org_id,
    vpat.area_po_name area_partner_common_name,
    vprt.root_po region_partner_org_id,
    vprt.region_po_name region_partner_common_name
    FROM partner_organization po
    JOIN vr_po_tree pot
    ON pot.partner_organization_id = po.partner_organization_id
    LEFT outer JOIN vr_po_area_tr vpat
    ON vpat.partner_organization_id = po.partner_organization_id
    LEFT OUTER JOIN vr_po_region_tree vprt
    ON vprt.partner_organization_id = po.partner_organization_id;
    All the views are working fine, very fast, giving the expected output.
    if we make a join to the view vr_po_all_tree in a query that also works fine. However, if we make an outer join to a query that has the join to vr_po_all_tree, Oracle throws an internal error - Ora-00600 internal error codes, arguments [qrctce1], [0],[0],.....
    Is the view vr_po_all_tree is cause for this problem?, in such a case can any one help me to rewrite the view with a simple query to give the same results?
    Thanks in advance.
    Nattu
    Edited by: Nattu on Nov 26, 2009 8:25 PM
    Edited by: Nattu on Nov 27, 2009 11:48 AM
    Edited by: Nattu on Nov 27, 2009 11:55 AM

    Hi,
    if we make a join to the view vr_po_all_tree in a query that also works fine. However, if we make an outer join to a query that has the join to vr_po_all_tree, Oracle throws an internal error - Ora-00600 internal error codes, arguments [qrctce1], [0],[0],.....
    Is the view vr_po_all_tree is cause for this problem?As Sven said, ORA-00600 is the sign of some low-level problem, and you should seek a solution from Oracle support. Your views are not the cause of this problem; most likely, the views trigger something that would not be a problem except for a installatin problem or maybe a bug.
    We can try to find a work-around for you, but don't ignore the problem.
    in such a case can any one help me to rewrite the view with a simple query to give the same results?It seems very likely that you could do something that didn't involve so many CONNECT BYs and outer joins.
    Post some sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
    Simplify as much as possible. For example, in the first view you say:
    CREATE OR REPLACE VIEW VR_PO_TREE AS
    SELECT LEVEL pathlength,
    connect_by_root partner_organization_id root_po,
    connect_by_root partner_common_name intl_po_name,
    connect_by_root is_wbti is_wbti,
    connect_by_root is_sil_int is_sil_int,
    connect_by_root organization_entity_code int_org_entity_code,
    org_entity_above_id, partner_organization_id,
    partner_organization_type,
    sys_connect_by_path(partner_organization_id, '\') po_path_id,
    sys_connect_by_path(partner_common_name, '\') po_path_name
    FROM ...That is, you're selecting 1 pseudo-column (LEVEL), 4 CONNECT_BY_ROOTs, 3 plain columns, and 2 SYS_CONNECT_BY_PATHs.
    Can you post a problem with just one of each: 1 pseudo-column, 1 CONNECT_BY_ROOT, 1 plain column, and 1 SYS_CONNECT_BY_PATH?  Adding the others later should be easy.
    Any information you can give about the data would be helpful.
    In particular,
    (a) Can org_entity_above be NULL on the same row where partner_organization_type is 'AREA' or 'REGION'?
    (b) How many ancestors with partner_organization_type = 'AREA' Can a node have? 1? No more than 1?  1 or more? 0 or more?
    (c) Same for 'REGION'.  How many ancestors with partner_organization_type = 'REGION' Can a node have? 1? No more than 1?  1 or more? 0 or more?
    (d) Can a node with partner_organization_type = 'REGION' be the ancestor of a row with partner_organization_type = 'AREA'?
    (e) Other way around: can a node with partner_organization_type = 'AREA' be the ancestor of a row with partner_organization_type = 'REGION'?
    Some of these questions may seem silly to you, because you know the table and the data so well.  I don't, so you'll have to explain things.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Flat  file to upload data using BDC for transaction MM01

    Hi
    I am trying to update data using bdc code has been attached below using a txt file.
    It is updating the first set of data into the table mara ,but  for the rest it is not
    All the data from txt file has being loaded to internal table , but the problem is it does not gets updated from internal table to the database .
    Only the first set of data has been loaded ,<u><b> rest of the data is not loaded</b></u>
    <u><b>content of txt file</b></u>
    zsc     zsc     kg     
    zsv     zsv     kg     
    zsb     zsb     kg
    <u><b>Actual code</b></u>
    report ZMAT_UPLOAD
           no standard page heading line-size 255.
    types declaration..........................................................................
    types : begin of t_mat,
       matnr(20),
       desc(50),
       uom(5),
    end of t_mat.
    internal table and workarea declaration.......................................
    data : i_mat type table of t_mat.
    data : wa_mat type t_mat.
    include bdcrecx1.
    start-of-selection.
    moving the flat file content to internal table................................
    CALL FUNCTION 'UPLOAD'
         EXPORTING
             FILETYPE   = 'DAT'
         TABLES
             data_tab   = i_mat.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    perform open_group.
    loop at i_mat into wa_mat.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                       'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                        '=AUSW'.
    perform bdc_field       using 'RMMG1-MATNR'
                                        wa_mat-matnr.
    perform bdc_field       using 'RMMG1-MBRSH'
                                        'P'.
    perform bdc_field       using 'RMMG1-MTART'
                                        'ZOH'.
    perform bdc_dynpro   using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                        'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                        '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                        'X'.
    perform bdc_dynpro   using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                        '=BU'.
    perform bdc_field       using 'MAKT-MAKTX'
                                        wa_mat-desc.
    perform bdc_field       using 'BDC_CURSOR'
                                        'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                        wa_mat-uom.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                        'NORM'.
    perform bdc_transaction using 'MM01'.
    endloop.
    Perform close_group.

    Hi Sumant,
    just concentrate on bold one
    report ZMAT_UPLOAD
    no standard page heading line-size 255.
    types declaration..........................................................................
    <b>
    data : begin of t_mat occurs 0,
    matnr(20),
    desc(50),
    uom(5),
    end of t_mat.</b>
    internal table and workarea declaration.......................................
    <b>*data : i_mat type table of t_mat.
    *data : wa_mat type t_mat.</b>
    include bdcrecx1.
    start-of-selection.
    moving the flat file content to internal table................................
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    FILETYPE = 'DAT'
    TABLES
    <b>data_tab = i_mat.---> t_mat.</b>
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    perform open_group.
    <b>loop at i_mat into wa_mat.------>loop at t_mat.</b>
    perform bdc_dynpro using 'SAPLMGMM' '0060'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_field using 'BDC_OKCODE'
    '=AUSW'.
    perform bdc_field using 'RMMG1-MATNR'
    <b>wa_mat-matnr.---->t_mat-matnr(change in this for ur wa to t_mat.</b>
    perform bdc_field using 'RMMG1-MBRSH'
    'P'.
    perform bdc_field using 'RMMG1-MTART'
    'ZOH'.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
    'X'.
    perform bdc_dynpro using 'SAPLMGMM' '4004'.
    perform bdc_field using 'BDC_OKCODE'
    '=BU'.
    perform bdc_field using 'MAKT-MAKTX'
    wa_mat-desc.
    perform bdc_field using 'BDC_CURSOR'
    'MARA-MEINS'.
    perform bdc_field using 'MARA-MEINS'
    wa_mat-uom.
    perform bdc_field using 'MARA-MTPOS_MARA'
    'NORM'.
    perform bdc_transaction using 'MM01'.
    endloop.
    Perform close_group.
    Reward points for helpful answers.
    Thanks
    Naveen khan
    Message was edited by:
            Pattan Naveen
    Message was edited by:
            Pattan Naveen

Maybe you are looking for

  • I'm looking for DW MX6

    Hello, Does anyone know where I can buy Dreamweaver MX (version 6)? Thanks

  • WLS Proxy in Cluster with Firewall

    We are currently setting up a system that has a DMZ with Netscape inside           the DMZ proxying a WLS cluster that is behind the DMZ. When a cookie           based session is started a cookie is returned successfully, but it looks           like

  • Nikon 1 V3 profile for Lightroom

    Please update the Nikon V3 Adobe Standard profile for Lightroom 5.4.  I regret to say it is not nearly as good as the corresponding profile for Camera Raw 8.5.

  • Itunes Server (store) not working !

    I have an 16GB Iphone 4s  When i download somthing on the app store i must type in my password i do that then it will load 5 minutes and then its say Could not connect to itunes i tried different apps to download on my i phone but not working turned

  • Where we authorized the assigne work permits

    Dear Experts, how i can authorized the assigned work permits? while creating the maintenance order i assigned the work permit and saved it , now order status was created status. i select the condition as if permit not authorized dont release the orde