Thursday, 10 July 2014

LDB: Logical data Base(Multiple Node Hierarchy)

Logical database with multilevel hierarchy provides selected filtered records based on the data dependency.

-------------------------------------------------------------------------------------------------------------------------------
Step1. The two tables SCARR & SPFLI are dependent. based on the CARRID value let's get the records from SCARR  table and based on the records from SCARR get all the dependent records from SPFLI table.
















Step2. Go To Tx- SE36 or SLDB. Provide a LDB name, select Structure radio button and click on Create button.




















Step3. Provide a short text and Create(F5).



















Step4. Provide the first NODE name as SCARR &  click on Create button.





















Step5. We create the node hierarchy, select the first node SCARR and click on the Create button










Step6. This screen appears.



















Step7. Change the value to SPFLI and Hierarchy Under SCARR and Create it.



















Step8. We have creates the two level node hierarchy.  Now click on Selections Button.















Step9. YES to continue.


















Step10. Select all the check boxes and click on Transfer button.





















Step11. The commented code created automatically.
























Step12. Change the commented code as per requirement and provide a select-options name S_CARRID . activate it and go back.

























Step13. To define the data selection process, click on the Source Code button.














Step14. YES to continue.

















Step15. Double click on the second include.














Step16. Click on the include corresponding to node SCARR.(first include)















Step17. Here we find some commented code.

























Step18. Change the commented code and activate it. Go back.

























Step19. Select the Second Include for the node SPFLI.















Step20. Some commented code appears automatically.























Step21. Change the commented code as per requirement. Activate it and go back.





















Step22. Create a report in SE38 and assign the above created LDB to the report.

























Step23. Put the below code and execute it.












Step24. click on F8 button. This selection-screen appears from the LDB.









Step25. The below O/P appears:



















Step26. Go to the third include in the LDB .

















Step27. There is an INIT subroutine which triggers before the selection screen is called. Assign some initial value to the selection-screen element.

























Step28. Execute the report program and we find the initial value to the selection-screen element.








----------------------------------------------------------------------------------------------------------------------------------------

LDB: Logical data Base(Single Node)

Logical Data Base(LDB):  Logical data base can be created in Tx- SLDB or SE36 . The advantage of using LDB is that it provides an automatically selection screen and the data selection process when added to a report program. some events that occurs in LDB are INIT, PUT & GET. Once the LDB is created, it can be added to a report program in the Attributes section or inside the program by calling the standard function module 'LDB_PROCESS'. 
-----------------------------------------------------------------------------------------------------------------------------------

Step1. These are the entries present in SCARR table.


Step2. To Create LDB go to TX- SE36 or SLDB.






OR






Step3. Provide a name ans select structure radio button and then click on Create button.





















Step4. Provide short text and continue.
























Step5. So we need to create an LDB on SCARR table, mention the root node as : SCARR , text and Under Node type SCARR. The root node name and the database table name should be same. At last click on Create button.





















Step6. So node SCARR is created. Now lets create a selection screen element. So click on the Selections button.















Step7. YES to continue.

















Step8. Select both the check boxes and click on Transfer.



















Step9. Here some commented code appears for the Select-option statement based on the primary key of the table. Un-comment the line and provide a select-option name. Here we have provides name as : S_CARRID. Activate it and go back. 






















Step10. Node is defined, Selection-screen is defined. For the data selection process based on the selection screen elements, click on the Source code button.













Step11.  YES to continue.

















Step12. Some automatically created includes. Double click on the second include.













Step13. For the node SCARR selection process, double click on the first include.















Step14. the below screen appears with some commented code. And also PUT event.























Step15. Un comment the code and put a select and endselect statement. Activate and go back. 

























Step16. Go to Tx- SE38 and create a report.



















Step17. Under the attributes section, mention the above created LDB name and continue.























Step18. Just write the below code and execute the report. Here we use the GET event. The NODES statement triggers the LDB and The PUT events forwards the data from the LDB progrm to the GET event of the report.















Step19. The selection appears as a result of the LDB. Execute it.









Step20. All the records are transferred from the LDB PUT event to the GET event of the report & the records are displayed.

Step21. Execution with single input.








Step22.O/P.













Step23. Execution with range I/P.









Step24. O/P.

















---------------------------------------------------------------------------------------------------------------------------------

Explicit Enhancement: Enhancement Section

Enhancement Section: If the business process needs to skip some standard code and to execute some custom code on top of it, then Enhancement section is the technique to do so. Enhancement section holds the code that needs to be skipped and the enhancement implementation for the Enhancement section holds the code that needs to be executed as a substitute for the code that are bounded between enhancement section. Let's try this enhancement section technique in a Z program but it really makes sense to apply this technique in a SAP standard program.
----------------------------------------------------------------------------------------------------------------------------------------


Step1. Create a Z program and Execute it.

















Step2. The O/P is as below.















Step3. Select the piece of code that needs to be shipped and then right click/ from the menu option,  navigate along the path to create a Option.









































Step4. Provide a Section name & the Enhancement Spot name & then continue.

















Step5. Now the selected piece code coded are bounded in between the Enhc Section. To Create an enhancement implementation , click on the Spiral icon to enter into the enhancement mode.



















Step6. Put the cursor on the enhancement section and from the menu navigate along the highlighted path to create an enhancement implementation.


















Step7. Provide the implementation name & short text and continue.














Step8. The enhancement implementation holds the code that are there in the enhancement section.



















Step9. Remove the statements that are there in the enhancement implementation and put the required code as an alternate that are there inside the enhancement section. The Enhancement Implementation is inactive. So double click on the Enhancement implementation name.



















Step10. The Enhancement implementation is inactive.













Step11. Activate it and go back.












Step12. The enhancement implementation is active but the main program is inactive. Go back form the enhancement mode.


















Step13. Here activate the main program.























Step14. It's activated. Now execute the program.




















Step15. The below O/P appears. So the code in the enhancement implementation overrides the part that are bounded in the enhancement section.
















Step16. Just a comparison.










---------------------------------------------------------------------------------------------------------------------------------

Comments system

Disqus Shortname