How to Create Tree Structure in ALV using OOP Objectoriented programming OOP is a computer science term used to characterize a programming language that began. Hi, How to validate data in editable alv grid in enter key. There are so many threats but I didnt get correct answer from them. Thank You, Duminda. ABAP Controls, Trees and editable ALV with drag drop. Introduction. In todays World of upcoming new technologies, interoperability and the power of SAPs. Hi, I have editable ALV and due to requirement, i need to refresh table using refreshtabledisplay in event datachangedfinished and can not bypass it. Because of. On the 8th of February 2008 James Hawthorne started the discussion link above as to why SAP does not give the CL SALV TABLE the option to be editable, as CL GUI ALV. Create Tree Structure in ALV using OOP Community Profiles Read onlyHow to Create Tree Structure in ALV using OOPObject oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1. The term object oriented programming was originally coined by Xerox PARC to designate a computer application that describes the methodology of using objects as the foundation for computation. By the 1. 98. 0s, OOP rose to prominence as the programming language of choice, exemplified by the success of C. Currently, OOPs such as Java, J2. EE, C, C, Visual Basic. NET, Python and Java. Script are popular OOP programming languages that any career oriented Software Engineer or developer should be familiar with. Now a days OOPs concept are widely used in the ABAP. It provides more reusability of the code. OOP is widely accepted as being far more flexible than other computer programming languages. OOPs use three basic concepts as the fundamentals for the programming language classes, objects and methods. Additionally, Inheritance, Abstraction, Polymorphism, Event Handling and Encapsulation are also significant concepts within object oriented programming languages. Why OOP One may ask, what is the need of using ALV grid through OOP approach when we have the normal Function Module which can meet most of our requirements. Editable Alv Grid In Sap Abap Developer' title='Editable Alv Grid In Sap Abap Developer' />Hi guys,I use the following method registereditevent in the PBO soon after first display of an editable ALV grid to register enter as an event to do validations. SAP ABAP Tutorial ALV Grid Example with clguialvgrid and Screen Painter. This ABAP ALV tutorial includes an example ABAP program which lists VBAK and VBAP sales. ALV-Grid1.jpg' alt='Editable Alv Grid In Sap Abap Developer' title='Editable Alv Grid In Sap Abap Developer' />Answer for the above are following points. Effort for coding is reduced to achieve the same functionality. E. g. Putting a new button on ALV toolbar, menu ,radio button, checkbox. We can have more than one ALV grid on the same screen which is not possible in FM approach. Flexibility of modify and playing with the ALV control is higher in OOPS approach likea. Making a cell or column editableb. Coloring of the cellcolumnrowc. Modifying ALV catalog on runtimed. Validation of the data before after processinge. Overriding the standard sap methods in the program there by customizing the complete SAP standard toolbarf. Spread sheet look and feel e. Merging g. Adding HTTP links in the gridh. Addition of F4 helps to the fieldsi. Making Cell as buttons. Creating Tree Structure in ALV using OOP Steps in creating Tree structure 1. Creating the Instance In this step one will create the instance of the ALV table object using factory method. One will pass the ALV internal table into it as shown below. Pseudo. Code clsalvtree factoryimportingrsalvtree obtreechangingttable itab. Error Messageendtry. Where itab is the internal table and obtree is of type class clalvtree. Build Header In this step one will perform all the Tree settings using class clsalvtreesettings by calling the methods gettreesettings sethierarchyheader sethierarchysizePseudo. Code build the hierarchy headerdata ptitle type salvdetreetext. Tree Settingsobsettings obtree gettreesettings. Hierarchy Header Settingsobsettings sethierarchyheader HELLO. Hierarchy Tool. Tip Settingsobsettings sethierarchytooltip Hello. Hierarchy Size Settingsobsettings sethierarchysize 3. Hierarchy Header Titleptitle SDN0. Where obsettings is of type class clalvtreesettings. Creating nodes In this step we will create the nodes using classes clsalvnodes and clsalvnode by calling the methods getnodes addnodes getkeyPseudo. Code working with nodesobnodes obtree getnodes. Moving the Data to the Work. Areamove pwaftlist oprtunit to waftlist. Where obnodes is of type class clsalvnodes and obnode is of type class clsalvnode. Column Heading In this step one will get the column headings using class clsalvcolumnstree and class clsalvcolumn by calling methods getcolumns setshorttext setmediumtext setlongtextPseudo. Code set the columns technicalobcolumns obtree getcolumns How to set our own Technical Names Psuedo. Code try. obcolumn pcolumns getcolumn TEST0. TEST. obcolumn setlongtext TESTER. Where obcolumns is of type clsalvcolumnstree and obcolumn is of type class clsalvcolumn. Creating Top of Page In this step one will create the top of page using classes clsalvformlayoutflow and clsalvformlayoutgrid by calling methods createflow createlabel createheaderinformationPsuedo. Code For setting the flow from which row and column the text will display obflow obgrid createflowrow 2column 3. Displaying the textobflow createlabeltext HELLO SDN. Setting Top of the Listobtree settopoflist obgrid. Where obflow is of type clsalvformlayoutflow and obgrid is of type clsalvformlayoutgrid. Displaying the Tree In this step we will display the tree using class clalvtree by calling method. DisplayPseudo. Code display the tableobtree display. Example Output Display of the Hierarchal Tree. ABAP Controls, Trees and editable ALV with drag drop. ABAP Controls, Trees and editable ALV with drag drop. Introduction. In todays World of upcoming new technologies, interoperability and the power of SAPs strategic UI technology web dynpro it is easy to forget about some of the earlier but equally usable technologies. The ABAP control framework is one such technology that offers a powerful alternative to web dynpro or BSP. This is a point well made in previous blogs such as that by David Halisky Yea though I walk through the valley of the shadow of WDAWDJ, I have taken BC4. Yea though I walk through the valley of the shadow of WDAWDJ, I have taken BC4. As part of a recent project in the automotive industry a customer required a new transaction to maintain vehicle model accessory data at a higher and easier central level to that provided as standard. The customers legacy system allowed the user to easily move data around the screen via drag and drop and maintain many records at any one time. Web access to the transaction which was to be effectively one screen was not required and the volume of data was comparatively low. From a conceptual point of a view my first thoughts were to provide a solution something similar to the layout of SE8. Vehicle model selection criteria top left hand corner Hierarchical vehicle model data tree control bottom left hand corner Vehicle accessory data ALV grid right hand sideA new table would be created which would store the accessory master data records at the central level and this would represent a 1 many relationship with the standard accessory table records. An ALV grid would be used to maintain the new table and the user would be able to assign the records to the standard vehicle model master data records. The assignment would be performed via drag drop. It was at this point at which I started to think about the options to do this technically. The project was a predominately ABAP biased Netweaver 7 environment and drag and drop technology is not currently supported in ABAP Web Dynpro. Aside from BSP technology the ABAP control framework seemed almost the only choice for this development. What I came up with was the following transaction This is an attempt to highlight some of the key elements of this transaction within the ABAP control framework namely ALV models Tree controls Use of HTML Drag and drop between an ALV grid and tree control. The basics. There is a wealth of information available on all the things that are required for this development but I found only a few limited attempts to chain it all together. Some good sources of information include BC4. ABAP Dialog Programming Using Enjoy. SAP Controls SAP delivered coursehttp www. B5. B7. CBC4. 127. C7. C7. C7. C5. D5. D7. CUser Interface Development in ABAP GUI ControlsdocsDOC 1. Control framework helphttp help. OO ABAP and Design Patterns 3 Docking Containers Controller. OO ABAP and Design Patterns 3 Docking Containers Controller. SAP delivered examples See transaction DWDM Enjoy SAP demos For OO ALV see ABAP programs prefixed with SALV or package SLIS or programs prefix BCALV for ALV grid examples Programs RSDEMODRAGDROPTREEMULTI RSDEMODRAGDROPEDITTREEplus of course the ABAP controls technology book with the infamous crazy painting on the cover if you can get hold of a copy. A newer SAP Controls Workshop book does exist http www. H1. 91. 3Choice of ALV Model. The ABAP List Viewer has been around for some time now and has developed significantly since its initial 4. As a developer you are presented with a raft of different ways in which to use ALV from the calling of function modules to the new simple factory method for example My advice here is to ensure you know how the ALV is to be used and decide up front what you want to do in the ALV as you may find that the approach you choose will not support what you want to do. As my transaction used controls for example that automatically meant I needed to use one of the OO approaches to ALV. If you have any doubt or just wish to check then I would strongly recommend reading the following Note 5. ALV FAQ General informationhttps service. ALV Grid controlhttp help. By far the most important point to make here is that currently the new object model of the SAP List Viewer CLSALVTABLE does not support editable ALV. This is stated in a few places but unless you do your homework it is easy to miss. Whilst there have been solutions offered to overcome this restriction for example Power of ABAP Objects Overcome the Restrictions of SALV Model. Power of ABAP Objects Overcome the Restrictions of SALV Model. I decided I would use CLGUIALVGRID for my vehicle accessory data this offered the user the ability to fully edit data in the grid, display icons and also supported drag drop functionality. Choice of Tree control. How To Install Windows Media Player Plug In Downloads. In a similar vain to ALV the developer is also presented with different techniques for displaying data in a hierarchical tree format. There are two approaches SAP tree and SAP tree model and within these three types of tree control. Essentially SAP tree model retains data itself within an instance which means it is better for actions such as searching, requiring less network communication than SAP tree. SAP tree is however available in earlier pre 4. C releases to SAP tree model and has different environment restrictions. The three types of tree control simple, column and list appear as follows Initially I found this quite confusing and there to be some overlap in functionality between all 3 types. In short, as with ALVs, do your homework and decide what you want to do and then use that to determine your type of tree control. There are limitations with certain types such as functionality that is not available in certain environments or different behaviour from one environment to another. The standard help is very good once youve digested the different approaches and got your head around nodes, branches and leavesSAP Tree and Tree Modelhttp help. I decided I would use CLGUILISTTREE for my vehicle model data a choice that was driven by the need to have icons and a checkbox for user input in my tree. If you wish to have a checkbox then you need to choose either the column or list tree approach from SAP tree and not an approach from the SAP tree model. Aside from this the SAP tree model provides some functionality that is not available in the SAP tree such as printing and searching and is the recommended approach. Selection criteria fields using HTMLIn my transaction the vehicle accessory data is driven entirely by the vehicle models that are displayed on the left hand side of the screen. There was no requirement to restrict this data however the user had requested the ability to be able to change the vehicle model data that was displayed thus influencing what vehicle accessories were displayed. I wanted to present my user with all the data and tools to use the transaction on one screen. To do this, in keeping with my SE8. I opted to use HTML to place a small number of fields available for input in the top left hand corner. To put this into context The HTML section proved to be fairly straightforward to do however did have limitations which I was not normally used to for me these were namely Single value entry only.