Google+ Facebook Twitter MySpace SC
Showing posts with label ABAP. Show all posts
Showing posts with label ABAP. Show all posts

Tuesday, October 30, 2012

Creation of a Logical Database

Creation of a Logical Database

Go to transaction  'SE36' or 'SLDB'. 
 
Enter the logical database name as shown above . 
  
If we are using Logical Database for HR purpose, we should check the check Box “Info types (HR only). Press CREATE Button as shown above. 
It would prompt for package name and workbench request   . 
 
On pressing Save button, following screen appears, prompting for the details of the root node.

Working with Table Maintenance Generator

Working with Table Maintenance Generator

Go to SE11 and enter the Z table name for which the table maintenance generator has to be generated. Click on Change. 
 
Click on Utilities à Table Maintenance Generator
 
 

Creating a secondary index

Creating a secondary index

There are two types of indexes: Primary index and secondary index. Primary index is automatically created using the primary keys defined. 
Secondary index could be created as per the user requirement. This article discusses about creating a secondary index. 
Go to transaction SE11. 
 
For our demo purpose, we have considered the table ZAUTHOR. 
To know if there are any secondary indexes available, click on Goto à Indexes
 
Following popup appears:
 


Creating Type Group and using it in the ABAP program

Creating Type Group and using it in the ABAP program

Introduction: This document explains the creation of type group and its use in ABAP program.
What is type group: There are several type groups available in SAP. For example ‘ABAP’ and ’SLIS’ etc. To use them in program we use key word ‘TYPE-POOLS’. It allows us to define non-predefined types. Combination of all such non-predefined types is knows as type-pool or type-group. In simple terms, if we want to use some custom types in various programs then we need not define them separately, we can simply create a type group in ABAP dictionary and use that in our programs.
Steps to create:
Go to transaction SE11; select the radio button ‘Type Group’. Click ‘Create’ button.
  
Note: - Maximum length of type-group name can be ‘5’.  
Provide some meaningful description in short text  
Description: C:\Users\ashish_trivedi03\Downloads\My Document\Type group\2.PNG
And click on save button.  
Then next screen appears where we can write our source code as highlighted in the below screenshot. As an example, I have created two constants. One thing that needs to be taken care of while declaring the structures, constants, etc. in Type Group is that every object must start with ‘<name of type group>_’. In this example the constants that are declared starts with ‘ZATYP_’. The system gives syntax error in case the above naming convention is not followed.  

Creating Search Helps (Elementary and Secondary)

Creating Search Helps (Elementary and Secondary)

Go To SE11 T-code.
 
Select the radio button of search help.
 
Provide the search help name. Select the create button. 
 
Select ELEMENTARY search help.

Creating a Structure in ABAP Dictionary

Creating a Structure in ABAP Dictionary

Go to transaction SE11 and select the radio button “Data type”. Enter a structure name starting with Y or Z. 
Press create button. 
A pop-up screen appears with 3 different options. Select the radio button structure. 
 The screen will be displayed like this.
Provide the description and also components.

Creation of Transparent Table

Creation of Transparent Table

  1. Enter the table name and press Create
  2.  
    1. Enter the description, Delivery class and check on table maintenance allowed. Then click on the tab Fields.
    1. Enter the ZCHAR in fields tab and ZCHAR_DE in field type tab.
    1. Double click on ZCHAR_DE. Then it will ask for Save. Press ‘YES”.

Friday, August 24, 2012

Web Dynpro Mind Map


The main focus of this chapter is the presentation of the Mind Map created on the basis of the elements described in this book. It can be of a real help in summarizing the knowledge,facilitating the learning of the Web Dynpro.
Tony Buzan is considered the parent of Mind Map. A Mind Map is a diagram used to structure ideas that assist people in many activity fields.
The Mind Maps are mostly used to take notes during meetings or at school,as a good method to summarize the knowledge or to prepare a presentation. More details about the advantages of using Mind Map to learn Web Dynpro can be found in the article: “The Advantages of using Mind Map for learning Web Dynpro” (Cristea et al).

Web Dynpro and Authorization


Web Dynpro and Authorization


Based on the RBAC (Role Based Access Control) pattern,we are going to present the SAP R/3 role based authorization mode. According to it, a user can dispose of a number of roles,which grants to him/her the authorization to access certain resources from the system. In this respect,we will create the development objects required to grant to the user the possibility to access the records from a database, and we will use,in Web Dynpro ABAP, the declaration AUTHORITYCHECK to verify the current user’s authorization.

Integrating a Web Dynpro Application into the SAP NetWeaver Portal


Integrating a Web Dynpro Application into the SAP NetWeaver Portal


The present chapter is mainly dedicated to the presentation of the modality to integrate the Web Dynpro applications in the portal,by using the SAP NetWeaver Portal.In the same time, we show how we can communicate between two applications by using the portal eventing (event sender and event receiver).
SAP NetWeaver Portal offers many possibilities to create its content,from Wizards and templates,to applications developed in Web Dynpro ABAP or Web Dynpro Java. Our scope is to integrate into the portal a created Web Dynpro ABAP application named y_ui_contextualpanel. After this, we create a Web Dynpro component that can send a portal event,a Web Dynpro component that can react to a portal event and,finally, we integrate the created applications in the Portal.

ALV and Select Options


ALV and Select Options


The following section details and describes the modality to use the standard components ALV and SO as assistance,in creating our own Web Dynpro applications.We start from a simple example,where ALV is used to display the data in a table,and we end by using both components for advanced search and display the searched data, disposing of the extra functionalities offered by ALV (e.g. exporting data in Excel).
SAP List Viewer(ALV) is a tool we c.an use to display data in a two-dimensional table,in a hierarchical-sequential list or in a tree structure.It allows us to use it in a large range of applications,from the classical Dynpros to the Web Dynpro.
In our examples,we use inWeb Dynpro the ALV component SALV_WD_TABLE to display data in a two-dimensional table.
Through “Select Options”,we can benefit of complex searching possibilities.For example,we use the WDR_SELECT_OPTIONS component to create a selection option screen that offers,
in the same time, four standard buttons:Cancel,Reset, Done and Check.

WebDynproModel


WebDynproModel


This chapter presents the role of a model in a multicomponentWeb Dynpro application, showing not only themodality to use such a model, but also to create it. We are going to focus on three types of models: Assistance class, BAPI and Web Service.
So far,we have created only small applications used to access the data contained in a table,through the SQL statements introduced in the methods defined in the views. This art of programming is not in concordance with the MVC design pattern.
According to the Model View Controller MVC paradigm,the application data and their user interface are separated. The Model represents the business logic, the View represents the user interface and the controller has certain responsibilities, as the communication between the model and the view,or data processing at runtime.

Writing Multilanguage Applications

Writing Multilanguage Applications

This chapter mainly focuses on the creation of Multilanguage applications.So,
the applications we realize are going to be easilyinternationalized without being necessary to recode them,butonlyto translate some centralized strings.For this,we haveto respect some rules,as follows: using the tools offered by the ABAP Workbench,establishing an initial language for our project,and avoiding to enter language specific texts in the codification of the business logic.
Internationalization(I18N)is a need for the global business software.In this chapter,we will see some of the tools offered by the ABAP Workbench to create Multilanguage User Interface and the tools we can use to make Multilanguage records in the database.
When the user logs onto the SAP System,he should enter a log-on language.If he doesn’t enter a language,then it is used the default log-on language from the user account.

Messages, Exceptions and Web Dynpro ABAP



Messages, Exceptions and Web Dynpro ABAP

This chapter shows how to work with exceptions and messages within the Web Dynpro ABAP applications. For each of the two variants (messages and exceptions),we present two possible implementation scenarios. Therefore, we start with the modality to create the texts of messages and exceptions,and we conclude with the modality of using them for the created applications.
A good user interface catches exceptions, describes the errors that occur and displays messages that contain information for the application end user.
As we have already seen,Web Dynpro offers the interface, through the IF_WD_MESSAGE_MANAGER, as a manager for messages.This interface has many methods we can choose to create messages.For example:

User Interface Elements (UI elements) Static and Dynamic Programming-part-3

User Interface Elements (UI elements) Static and Dynamic Programming-part-3
RoadMap
By using this UI element, we can display the steps required to complete a certain task. Hereunder,we show some of the roadMap properties that can be bound,and the attribute type in case the property is bindable.
For the RoadMap example,we use the exercise from the ViewContainerUIElement,a little bit re-arranged. The WD component structure is presented.
WD component structure
In this case,we replace the LinkToAction UI elements with two Buttons: Next and Back. These Buttons are inserted into the view V_VIEW, and the user can navigate from the first step to the end one, via the RoadMap. In this case, we used only a ViewContainerUIElement,and for each step we have a view. In the view V_VIEW, we insert a RoadMap UI element with three steps. To insert a step into a RoadMap UI Element, we right-click on the element and, from the contextual menu, we choose Insert Step.

User Interface Elements (UI elements) Static and Dynamic Programming-part 2



Runtime
Hereunder,we have to display the view V_STEP2 when the user presses the LinkToAction UI element (ID = LTA_NEXT2). To do this, we define an outbound plug named OP_TO_V_STEP2 in the view V_STEP1,and we fire the generated method.
Outbound plug, event handler method
V_STEP2 view layout

User Interface Elements (UI elements) Static and Dynamic Programming-part 1


User Interface Elements (UI elements) Static and Dynamic Programming-part 1


The UI elements we can use in the Web Dynpro ABAP are divided in various categories.In this chapter, we are going to present some of the UI elements, included in the categories:action, selection,layout, complex, graphic and integration. Each UI element will be illustrated by an example,showing the modality of using it either in static or in dynamic variant.
A UI element is a User Interface element we use to create a screen for the end user. The UI Elements are grouped in categories we can access via the View Layout,and each UI Element has some properties, as follows
  • Common with other UI elements,inherited from superclasses
  • Specific only for an UI element
  • For example, the following properties are inherited:
  • Tooltip: Shows a quick info text when the user passes the mouse pointer over the UI element
  • Visible: Determined if an UI element is visible in the screen or not
  • Enabled: Specified if the UI element is active or inactive

Layout UI Elements



Layout UI Elements

The following section details and describes the Layout of the UI elements. Here, we are going to present the various types of existent Layouts and the modality to use them, either in static or in dynamic variant. The layout helps us to manage the arrangement of the UI elements within their parent container.
All the UI elements within a view are hierarchy arranged. The node ROOTUIELEMENTCONTAINER is the root of this hierarchy and all the UI elements. within a view are children of this root container. It is of TransparentContainer type and has initially assigned to it the FlowLayout layout. In our first example, we have seen that we have the possibility to change it from ransparentContainer into another UI element, in case this one doesn’t have any children. Table shows the layout UI elements that are available for arranging the UI elements in a view, and the corresponding LayoutData. The layout is the abstract base class of all the layout UI elements within Web Dynpro and has the runtime class CL_WD_LAYOUT.
Layout and LayoutData UI element
The layout data of an UI element are used to specify the position within a container and have the runtime class CL_WD_LAYOUT_DATA.

View Controller Methods


View Controller Methods

Abstract As we have seen in the previous chapters, in the Methods tab of a View we find various types of methods generated by the Framework, and we can also create our own methods. The purpose of this chapter is to present the role and the modality to use the various methods generated by the Framework and the modality to realize our own methods.
Each view has exactly one view controller. The view controller can contain
methods for data retrieval or for processing user inputs.
As we have seen, each view has a Methods tab where we can create our own user-defined methods or we can find the methods generated by the Framework. In each Method tab of a View, we can find or create three types of methods:
  • Event Handler: This kind of methods respond to actions or to events. An example of such a method is generated by the Framework when we define an inbound plug into a View. Another example is a method generated from the Framework when we create an action.
  • Method: We can use this kind of methods to create User-defined instance methods. Another example is the Hook Methods generated by the Framework.
  • Supply Function: When we create a node and define a supply function for it, the Framework generates a corresponding supply function method used to populate with data a context node.

Data Binding, Context Mapping and Interface Methods


Data Binding, Context Mapping and Interface Methods


This starts with the presentation of the mechanism used to manipulate data between the context attributes and UI elements, mechanism called,in Web Dynpro,“data binding”. We continue with the mechanism of sharing data among the various controllers, which is realized by using different variants of context mapping. Finally, we highlight the importance of the interface methods required to access them “cross-component”.
In the last chapter, we have created context nodes and attributes in the context view.A node or attribute can be created in each context. When we create an attribute in the context view, this value is visible only in this context view. The mechanism for sharing data among different controllers is known as “context mapping”. A context mapping can be internal, when the nodes we map are within the same component, and external, when the mapping is cross-components.
Data Binding
Each UI element has certain properties. With data binding, we define which node or attribute from the context will act as a data source for an UI element property. To exemplify the data binding mechanism, we create a component named Y_DATABINDING with a view named V_BIND and a window W_DEFAULT.