Service and Solution provider under SAP BTP in 5 piller.
1.Application Development.
2.Automation
3.Intregration
4.Data & Analytics
5.AI
SAP ABAP for best practice and travel related guide.
Service and Solution provider under SAP BTP in 5 piller.
1.Application Development.
2.Automation
3.Intregration
4.Data & Analytics
5.AI
BSH VS PIC Dream11 Team Prediction. |
BSH VS PIC Dream11 Team Prediction. |
Today T20 Match England vs Australia team prediction today match.
Dream 11 T20 Match prediction AUS VS ENG today match..
Dream 11 Team 1 England VS Australia Match Prediction.
Content writing is the most effective way to earn money without investment. In today's world, if you buy something first, you check customer review details.
Nowadays, some companies are paying a good amount for content. If you are good at English, you can try to write content. You can publish your content . If you have industrial or technical knowledge, it will be better for you. Companies need these kinds of people because they have good industrial and technical knowledge.
Creating YouTube videos is the most popular platform to earn money without any investment. You create your own video and create your own personal YouTube channel. After that, you upload your video to your channel.
You can create your own content video or music video ,funny video ,any knowledge sharing video. This kind of video is very popular nowadays. To earn money, you need 1000 subscribers. You must spend all of your time creating your own content; attempting to copy any video on YouTube will result in a copy right clam. If you get three copy rights clams, your account will be suspended. All time, try your own content.
Creating blogs is also the most popular earning platform. You create your own blog. You can share any kind of information, like travel related information ,any product related information,any city related information, or country related information. You can share. You can create a technical information-related blog. This kind of blog is very popular nowadays. All the time, try to create unique types of content or articles.
Today, software development is the most popular platform for earning money without any investment. Nowadays, companies do not need full-time employees; they try to get part-time employees because a full-time employee's salary is very high, and a part-time employee's salary depends on how much time they work. The company can reduce the expanse. A company always tries to find a good resource. If you have good knowledge of any software platform, it would be better to get a software related job . They provide a huge amount of money for good resources. This is one way to earn money without investment.
PPC (Pay Per Click) is the most popular way to earn money without investment. Actually, some websites or blogs give a commission per click or impression.
SEO means Search Engine Optimization. In this process, you can analyse and review your website. This SEO work means optimising search engines. After SEO work, your website gets more views and search rankings also go to a high level.
When you get more views on your website, you earn more money.You can get Google ads and get more keywords. When your website gets more views and key words, this is very good for your website. If you have knowledge of SEO, you can do part-time work and you get money without any investment.
1. BD54 Create logical systems
2. SCC4 Assign logical systems to client
3. SM59 Create RFC
4. WE21 Create Port
5. WE20 Create partner Profiles
6. BD64 To create Distribution Model view
All these T-codes should be run in the same order. All these T-codes should be run in both source and destination systems. If it is needed to transfer the data from one client to another client run steps 1 to 5 in source system, run 5th step in destination system and run 6th step in source system. The order should also be same.
To view the idocs use either WE02 or WE05 T-codes. T-code WE19 is the
testing tool for Idoc. T-code BD87 for mass processing of Idocs.
Every Idoc contains three types of records.
Control Record (EDIDC)
Data Records (EDIDD)
3. Status Records (EDIDS)
CONTROL RECORD:- It is like address on the post card which gives the information about sender, receiver and type of data the idoc is holding. It will be always single record.
DATA RECORDS:- The actual data that is to be transferred is contained by data records. It can be single or multiple records. Actually the data records internally contain the segments and segments contain fields and fields contain values.
STATUS RECORDS:- It specifies about the actual position of the idoc. As idoc travels different mile stones system gives different statuses. Using the status of the idoc we can find out the position of the idoc.
1 to 49 statuses are used for out bound idoc
50 to 99 statuses are used for inbound idoc.
Important statuses are.
--- outbound idoc just created
30 --- ALE settings are ok
03 --- Idoc reached port
50 --- Inbound Idoc just created
51 --- Error in posting the document into data base
53 --- Document successfully posted in to data base
There are 2 types of Idocs.
Master Idoc
Communication Idoc
MASTER IDOC: - The data that is to be transferred is fetched from data base and formatted into Idoc format. This Idoc is called master Idoc. This Idoc is not stored in data base. This Idoc is not transferred. Its life span is until communication Idocs are created.
COMMUNICATION IDOCS:- The recipient specific Idocs are called communication Idocs. These Idocs are stored in data base. These Idocs are moved from source system to destination system.
MESSAGE TYPE:- This specifies about the type of data the Idoc is holding. The standard message types are
1. MATMAS Material master data
2. CREMAS Vendor master data
3. DEBMAS Customer master data
PORT:- it specifies about how the data should be transferred from source system to destination system. Transaction code for Port creation is WE21.Two important ports are..
T-RFC Port (Transactional RFC Port)
File Port
In T-RFC port the data will be moved in the form of memory buffers. In file port the data will be transferred in the form of files.
REMOTE FUNCTION CALL (RFC):- It is used to define the character of communication link between two system where the remote enabled function module is intended to be executed. In ALE this RFC will be used to connect to the remote system.
Transaction for RFC is SM59.
For generation of Idocs SAP has given standard T-codes based on the type of data you are going to transfer. The important T-codes are.
1. BD10 Material master push
2. BD11 Material master pull
3. BD12 Customer master push
4. BD13 Customer master pull
5. BD14 Vendor master push
6. BD15 Vendor master pull
You have to either run push or pull T-code. No need to run both the programs. If you want to send the data from source system run push T-code. If you want to get the data from destination system run pull T-code.
T-code CMOD
Give project name
Press create button
Give description
Press enhancement Assignments button
Give the exit name you have found in SMOD
Press components button
Double click exit
Double click include starting with Z
Press enter
Write the logic
check for errors and activate
Come back to the first screen of CMOD and activate the project.
T-code SMOD
Press F4
Press information system
Give the package name found out previously
Press enter
Based on the description choose the relevant Exit
Go to the T-code to be enhanced
System ( status
Double click program
Go to attributes
There you can find the package
These are used to add extra intelligence to SAP standard programs to suit the business requirements. If we want to add extra code to SAP standard programs, if we go for change mode system asks for access key. Instead of this, SAP has provided hooks where we can write the code. These hooks are enhancement spots. If a code is written in theses spots along with the normal program the code written in these spots is also executed. There are two ways to enhance the SAP standard code.
User Exits
BADIS (Business Addins)
If user exits are used one time in any project it can not be reused. But Badis can
be used any no of times.
There are 4 types user exits.
Function module exit
Field exit
screen exit
Menu exit
Exits are defined at package level. So we want to enhance any T-code first we
have to find out the package for that T-code. Then we have to find out the exits present in that package. For finding the exits present in a package we have to use SMOD T-code. After finding the suitable exit for writing the code we have to use CMOD T-code.
T-code SO10
Give name and press create
Give the text
Press save
Prepare a Bitmap Image
T-Code SE78
Expand graphics
Double click BMP.
Press import button
Give the path where image is present in you system
Give name to logo
Give description
Specify color image or Black and white image
Press enter
The image will be uploaded into SAP with the name you have given in 7th step.
If the image is of .TIF format we have to run the standard program RSTXLDMC to upload the image into SAP. The image will be stored on document server. All the images will be stored in STXBITMAPS table.
Now my requirement is to insert the logo in one of the windows of the form that I have designed .
Program
Dynpro
Dynbegin
Fnam
Fval.
There are 2 methods to upload the from legacy system to sap system.
Direct input method
Batch input recording
In each of these methods we are having internally 3 methods.
Call transaction method
Session Method
LSMW (Legacy System Migration Workbench)
SHDB
Press New Recording
Giving recording name
Give T-code to be recorded
Press start recording
Execute the T-code until save
Save the tabular format generated
Back
Select the recording name
Press program button
Give program (System will generate the program with that name)
Select radio button transfer from recording
Enter
Give Title
Press source code
Give package and save
Enter (You can see the program generated)
Select the program from the line after perform open_group.
Till a line above transaction code and copy
Paste it between loop at endloop in the program which you have written for uploading the data from flat file to internal table.
Copy the from the include present in the recorded program and paste at the bottom of the program.
Process before output (PBO)
Process after input (PAI)
Process on value-request (POV)
Process on help-request (POH)
PROCESS BEFORE OUTPUT:- This event is triggered before the screen is displayed. This event is used to assign some default values to screen fields. With those values the field will be displayed.
PROCESS AFTER INPUT:- This event is triggered after giving input to the screen fields. This is used to handle user action actions on the screen.
PROCESS ON VALUE-REQUEST:- This is used to give F4 help to screen fields.
PROCESS ON HELP-REQUEST:- This is used to give F1 help to screen fields.
The in the module pool program should be written between module and endmodule.
AT EXIT-COMMAND:- It is used to go to the leave the screen or process some logic even though some of the mandatory fields of a screen not filled.
SY-UCOMM:- It is a system variable used to catch the function code that is triggered for user actions on the screen.
OK_CODE:- It is used as substitute for sy-ucomm.
INITIALIZATION
AT SELECTION-SCREEN
AT SELECTION-SCREEN ON <FIELD>
AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN ON VALUE-REQUEST FOR <FIELD>
START-OF-SELECTION
TOP-OF-PAGE
END-OF-PAGE
AT LINE-SELECTION
AT USER-COMMAND
TOP-OF-PAGE DURING LINE-SELECTION
AT LINE-SELECTION:- This event is used to generate an interactive list when ever particular in the out is double clicked.
TOP-OF-PAGE DURING LINE-SELECTION:- This event is used to write some thing on top of every page of individual secondary lists. Top-of-page event is used
to write something on only basic list.
AT USER-COMMAND:- This is used to handle user action on the screen when ever standard menu bar and application tool are changed.
In these interactive lists we take the help of HIDE table. Hide is an intermediate memory area which is used to hold the values that are used for generation of next secondary list. Hide statement should be used after write statement. Then only you will get correct results. Other wise you will get wrong values. Hide table values you cant see even in debug mode.
SY-LSIND:- This is also a system variable which gives present processing list number. Its value will be 0 for basic list and 1 to 20 for secondary lists. We will make use of this sy-lsind in our next program to tell the system about which logic should be executed while going to a particular list..
SY-LILLI:- This is a system variable which will hold the clicked line number.
SY-LISEL:- This is also a system variable which will hold all the contents of clicked line.
SY-UCOMM:- This system variable is used to hold the function code that is triggered for the user actions on the screen
There are three types of reports.
Classical Reports
Interactive Reports
Drill down Reports
CLASSICAL REPORT:- A report which can generate only one list, that is Basic List, is called classical report. First List of a report is called BASIC LIST.
INTERACTIVE REPORT:- A report which can generate one basic list and upto 20 interactive lists is called an interactive report. First list is called Basic List and Interactive lists are called Secondary Lists.
DRILL DOWN REPORTS:- In these reports the output will be in tree format.
Internal table is an intermediate table. It can hold multiple records at a time. It is a temporary table. The memory for the internal table will be allocated at runtime and de allocated after the execution of the program automatically by the system. The changes that made to the records of internal table are temporary. The changes are not reflected in data base until some DML commands are written. Hence original data is retained in data base. There are three types of internal tables.
Standard Internal Tables
Sorted Internal Tables
Hashed Internal Tables.
There two ways to declare the Internal tables.
Internal Tables with Header line.
Internal tables without Header line.
There are three types of tables.
1. Transparent Tables
2. Clustered Tables
3. Pooled Tables.
TRANSPARENT TABLES:- For every table created in Data dictionary (DDIC) there will be table created in database with same name, same no of fields, fields having same names and the order of the fields will be same. That means for every same replica of table or mirror image will be created in Data base. That means it is having one to one relation. By default every table created will be Transparent Table.
CLUSTERED TABLES:- Many tables created in DDIC are stored in single table in data base called table cluster. That means it is having many to one relation. All the tables present in table cluster will have primary key in common.
POOLED TABLES:- In case also many tables created in DDIC are stored in single table in database called table pool. Hence it also having many to one relation. Here the tables present in table pool many have primary key in common.
SE11 T-Code is used to create data base objects which includes tables.
A table can be client dependent or client independent. Table data only client dependent or client independent, but table structure is client independent.
CLIENT:- Client is SAP specific which contains its own master data and its own set of records. All SE38 programs are client independent programs. That means if a program is written in one client it can be seen all the clients present in the system.
To see all the clients present in a system T-code is SCC4.
If first field of the table is MANDT the table becomes client dependent table, otherwise it becomes client independent table. If the table is client dependent table the data that you enter in one client can not be seen in other clients. If the table is client independent table the data that is entered in one client can be seen all other clients. That means if the table is client independent all table in all clients contain same data.
Every table should have at least one primary key or foreign key. All primary key fields and foreign key fields of a table should be declared first.
Every table field should have DATA ELEMENT and DOMAIN.
DATA ELEMENT:- It gives semantic attributes of table field.
Eg:- Short description of table field.
DOMAIN:- It gives technical attributes of the table fields. Domain is the more reusable component than data element.
Eg:- Type of data it is going to hold.
There are three types of data in SAP.
Customized data
Master data
Transactional data.
CUSTOMIZED DATA:- The data which never changes is called Customised data. This data is not created but configured by functional consultant using SPRO tranction.
MASTER DATA: The data which changes very rarely is called Master data.
TRANSACTIONAL DATA:- The data which changes very frequently is called Transactional data.
Control statements are nothing but loops. The property of the loop is to rotate by it self until loop is terminated. There are 4 types of control statements in SAP. They are
DO.
..
..
ENDDO.
DO N TIMES.
..
..
ENDDO.
WHILE <CONDITION>.
..
..
ENDWHILE.
CASE <VARIABLE>.
WHEN <VALUE1>.
..
..
WHEN <VALUE2>.
..
WHEN OTHERS.
..
ENDCASE.
Exit statement is used to terminate the loop. SY-INDEX is a system variable which gives present loop iteration number. These both things we use in coming program to see how they act in the loop.
1. sy-datum -- Date
2. sy-uzeit -- Time
3. sy-mandt -- Logon client number
4. sy-uname -- Logon user name
5. sy-repid -- Report program name
6. sy-cprog -- Current program name
7. sy-dynnr -- Screen number
8. sy-tcode -- Transaction code
9. sy-pagno -- Page number
Sample program with these system variable is.
&---------------------------------------------------------------------*
*& Report ZSAMPLE *
*& *
*&---------------------------------------------------------------------*
*& *
*& SYSTEM VARIABLES *
*&---------------------------------------------------------------------*
REPORT ZSAMPLE .
write / sy-datum.
write / sy-uzeit.
write / sy-uname.
write / sy-repid.
write / sy-cprog.
write / sy-mandt.
write / sy-dynnr.
write / sy-pagno.
Write / sy-tcode.
Smart forms are used to design the business documents such as purchase order, sales order,
invoice, Performa etc.
Smart forms are introduced from 4.6c version onwards. It also supports output mode as ‗EMAIL‘.
Components of Smart forms:
1. Smart form layout.
2. Function module.
3. Print layout.
Components of the smart forms layout:
1. Global settings.
2. Pages and windows.
Components of Global settings:
1. Form attributes
2. Form interface
3. Global definition
Form attributes:
Form attributes contain header information i.e.
Form name
Language
Page format
Created by…………..
Form interface: this is used to declare the variables, work area and internal tables which we need to
transfer the data from print program to layout.
Global definition: this is used to declare the variables, work-area and internal table which are used to
implement the logic in the layout.
PAGES: page is the physical area where we place the window. We can‘t print the text in the page.
WINDOWS: we can place the same window in ‗n‘ number of pages but we can‘t print the data directly
on the window.
Procedure of Smart Form:
1. Based on the client requirement we design the smart form layout by using SMARTFORMS t-
code.
2. After activating the smart form it generates a function module.
3. Based on the function module we develop the print program.
NOTE: Printing the data on the page window is always through symbols.
There are four types of symbols.
1. Program symbols
2. System symbols
3. Standard symbols
4. Text symbols.
Each symbol starts with ‗&‘ ends with ‗&‘.
1.Attributes:-
Attributes specify the type of the function module, normal or remote.
We can access the normal function module with in the server only, where as we
can access remote function modules with in the server as well as outside the server
also.
2. Import acts like using in the subroutine.
3. Export acts like changing the subroutine.
4. Changing acts like both import & export.
5. Tables acts like both import & export only for internal tables.
6. Exception use to handle the errors.
7. Source code – the logic related to function module.
Differences between function module & subroutine:-
Function module Subroutine
1. Function modules are global, i.e.,
we can access the function module
with in the server as well as outside
the server also.
2. We can test the function module
independently.
3. We can handle the errors in
function module.
4. Function modules are defined by
using SE37 transaction code.
1. Subroutines are local, i.e., we can
access the subroutine with in the
server only.
2. We can‘t test the subroutine
independently without calling the
subroutine.
3. We can‘t handle the errors in
subroutine.
4. Subroutines are defined by using
SE38 transaction code.
Steps to create function module:-
Execute SE37.
Provide your function module name.
Create.
Provide function group name & short description.
Save.
Note:-
Function modules return single values, multiple single value
Steps to create Function group:-
Execute SE37.
In the menu bar – goto – function groups – create group.
Provide your function group name.
Provide short description.
Save – local object.
Steps to activate the function group:-
Execute SE37.
In the menu bar – environment – inactive objects.
Expand your function group.
Select your function group.
Click on activate (in ECC 6.0 – select function group – right click – activate).
Components of the function module:-
1. Attributes.
2. Import.
3. Export.
4. Changing.
5. Tables.
6. Exception.
7. Source code.
Macros Subroutines
1. In macro definition should be the
first & the calling should be the next.
2. The definition of the macro as
well as the calling of the macro in
the same program.
3. Macros can take up to 9 place
holders.
4. We can place any executable
statements after the definition of the
macro.
5. Macros are used in HR ABAP.
1. In subroutine calling should be the
first & definition should be the next.
2. The definition of the subroutine as
well as the calling of the subroutine
may or may not be in the same
program.
3. Subroutines can take any number
of place holders.
4. We can‘t place any executable
statements after the definition of the
macro.
5. Subroutines are used in both
ABAP & HR ABAP.
Global data:-
Subroutines can access the global declarations in which they are
defined.
When ever the changes occurred in the subroutine those changes will be reflected
to global declarations.
Note:-
LOCAL is the keyword to avoid the changes in subroutines.Differences between Macros & Subroutines:-
Macros Subroutines
1. In macro definition should be the
first & the calling should be the next.
2. The definition of the macro as
well as the calling of the macro in
the same program.
3. Macros can take up to 9 place
holders.
4. We can place any executable
statements after the definition of the
macro.
5. Macros are used in HR ABAP.
1. In subroutine calling should be the
first & definition should be the next.
2. The definition of the subroutine as
well as the calling of the subroutine
may or may not be in the same
program.
3. Subroutines can take any number
of place holders.
4. We can‘t place any executable
statements after the definition of the
macro.
5. Subroutines are used in both
ABAP & HR ABAP.
Global data:-
Subroutines can access the global declarations in which they are
defined.
When ever the changes occurred in the subroutine those changes will be reflected
to global declarations.
Note:-
LOCAL is the keyword to avoid the changes in subroutines.
Subroutine
1. Function modules are global, i.e.,
we can access the function module
with in the server as well as outside
the server also.
2. We can test the function module
independently.
3. We can handle the errors in
function module.
4. Function modules are defined by
using SE37 transaction code.
1. Subroutines are local, i.e., we can
access the subroutine with in the
server only.
2. We can‘t test the subroutine
independently without calling the
subroutine.
3. We can‘t handle the errors in
4. Subroutines are defined by using
SE38 transaction code.
Execute SE37.
Provide your function module name.
Create.
Provide function group name & short description.
Save.
Execute SE37.
In the menu bar – goto – function groups – create group.
Provide your function group name.
Provide short description.
Save – local object.
Steps to activate the function group:-
Execute SE37.
In the menu bar – environment – inactive objects.
Expand your function group.
Select your function group.
Click on activate (in ECC 6.0 – select function group – right click – activate).
Components of the function module:-
1. Attributes.
2. Import.
3. Export.
4. Changing.
5. Tables.
6. Exception.
7. Source code.
Macros
Subroutines
1. In macro definition should be the
first & the calling should be the next.
2. The definition of the macro as
well as the calling of the macro in
the same program.
3. Macros can take up to 9 place
holders.
4. We can place any executable
statements after the definition of the
macro.
5. Macros are used in HR ABAP.
1. In subroutine calling should be the
first & definition should be the next.
2. The definition of the subroutine as
well as the calling of the subroutine
may or may not be in the same
program.
3. Subroutines can take any number
of place holders.
4. We can‘t place any executable
statements after the definition of the
macro.
5. Subroutines are used in both
ABAP & HR ABAP.
Select single
Select up to 1 rows
1. It always retrieves only one record
at a time.
2. Here we must pass entire primary
key combination in the where
condition.
3. This is used to retrieve particular
record.
Syntax:-
1. It always retrieves only one
record.
2. Enough to pass a part of key
combination in the where condition.
It always picks the first record
among the matched records.
3. This is used for validation.
Steps to create the Emp table by using Top-down approach data type.
element:-
Execute SE11.
Select the radio button database table.
Provide your table name (YSPRAO_730_Emp1).
Click on create – enter.
Provide any short meaningful description (Emp table by using Top-down
approach).
Provide delivery class (a).
Select the maintenance allowed.
Click on the fields tab.
Provide the field name (Eid) & data element name which is not there
(ZZSPRAO_730_Eid).]
Double click on the data element – save before editing – yes – local object –
cerate the data element – yes.
Provide a meaningful description.
Provide domain name which is not created (ZSPRAO_730_Eid).
Double click on domain – save before editing – yes – local object – yes.
Provide a short description, data type & length.
Eid ZZSPRAO_730_Eid.
Save the domain.
Check the domain.
Activate the domain.
Come back.
Save the data element.
Check the data element.
Activate the data element.
Come back.
Repeat the same for all the fields
Execute SE11.
Select the radio button data type.
Provide your data element name (YYSPRAO_730_Eid).
Click on create – enter.
Provide any short meaningful description (id of the emp).
Provide domain name which is already created – enter.
Save the data element.
Check the data element.
Activate the data element.
Repeat the same procedure for all the data elements
Execute SE11.
Select the radio button domain.
Provide your domain name (YSPRAO_730_Eid).
Click on create.
Provide any short description (domain).
Provide data type & length.
Save the domain.
Check the domain.
Activate the domain.
Repeat the same steps to all the domains
STEPS TO BE FOLLOWED IN CREATION OF LAYOUTSET IN SAP ABAP.
T-code SE71
Give form name
Give language
Press create button
Give description
Press page button
Give page name
Press enter
Give page description
Give next page name
Press page windows button
To copy main window Edit --( Create element
Double click main window. ( main window will be copied to the page)
Give some window width and height (eg. 10 cm and 10 cm)
To see the page format Settings --( Form Painter
Check the check box Graphical Form Painter
Press enter
To adjust the main window , drag it to the place where you want. You can change the size also.
To create new windows right click create window.
Move the window to the position where it is needed and adjust the size.
To rename window Right click Rename.
To close page format Settings-( Form painter
Un check the check box Graphical Form Painter
Press enter
To create paragraph format Press Paragraph formats push button
Give paragraph format name
Press enter
Give description
Press header
Press Basic settings
Give first page and Default paragraph
Save
To check errors form-( check-( Definition
To activate form -( Activate.
This is how we have to design the page. The no of windows in the page depends on page layout. Now I want to keep a logo in one of the windows of page. For that we first have to upload the logo into sap. For uploading logo into sap the T-code is SE78.
It is used to upload only Bitmap images.
It is the integrated text management system of SAP. The output of scripts and normal report will be same. But formatting is very easy using scripts. Usually scripts are used for external purpose and reports are used for internal purpose. When specific format is required in output we go for scripts.
In scripts we require layout set and print program. Layout set is used for designing the output. That is page designing is done here. For this Transaction code is SE71 (form painter).
Print program is used for writing the logic to get the data from data base. It is an executable program which is written in SE38 T-code.
Attributes of form painter (SE71)
Header
Pages
Windows
Page windows
Paragraph Formats
Character Formats
HEADER:- It contains Basic settings and administrative data. Administrative data gives history of the form and basic settings gives technical information about the form.
PAGES:- It is a logical memory area where output is formatted. It is a repository of pages.
WINDOWS:- I t is a place on the page where output or data is formatted. Page has to be divided into windows in order to hold the output. We cant format the output outside the windows. Windows is repository of windows.
Paragraph formats and Character formats are used for alignment or beautifying the output.
In call transaction updation is immediate but in session method updation is not immediate.
In call transaction user has to handle errors but in session system handles the errors.
In call transaction updation can be synchronous or asynchronous or local but in session method updation by default synchronous.
Call transaction returns sy-subrc value but session will not return sy-subrc value.
In session method the data will be stored intermediately in session. After processing the session only the data will be moved into data base. For processing the session the T-code is SM35.
SESSION:- It is an intermediate memory area where data with flow logic is stored. It is intermediate between internal table and data base table. A session can not be processed on the date on which it is created. A session can not be processed if it is processed successfully. If session is having error it can be processed any number of times.
In session method we have to use 3 function modules.
BDC_OPEN_GROUP
BDC_INSERT
BDC_CLOSE_GROUP
BDC_OPEN_GROUP: - This function module is used to create a session with particular name.
BDC_INSERT:- This function module is used to move flow logic and data into session. This function module should be called between the loop and endloop after recording steps.
BDC_CLOSE_GROUP:- This function module should be used to close the session. If this function module is not used the session will be created but we cant process the session.
DIFFERENCES BETWEEN AT NEW AND ON CHANGE OF IN SAP.
At new should be used inside the loop, but on change of can be used outside the loop also.
At new takes only one field, but on change of can take multiple fields.
Let us assume that an internal table is having f1, f2, f3 , f4 and f5 fields and if at new is applied on f3 field it will be triggered for every change in f1, f2 and f3 fields, but on change of will be triggered for only changes in f3.
TYPES OF REPORTS IN SAP.
There are three types of reports.
Classical Reports
Interactive Reports
Drill down Reports
CLASSICAL REPORT:- A report which can generate only one list, that is Basic List, is called classical report. First List of a report is called BASIC LIST.
INTERACTIVE REPORT:- A report which can generate one basic list and upto 20 interactive lists is called an interactive report. First list is called Basic List and Interactive lists are called Secondary Lists.
DRILL DOWN REPORTS:- In these reports the output will be in tree forma
SOME IMPORTANT STANDARD TABLES IN SAP
1. MARA MATERIAL MASTER TABLE
2. MARC MATERIAL PLANT
3. MAKT MATERIAL DESCRIPTION
4. MARD MATERIAL STORAGE LOCATION
5. KNA1 CUSTOMER MASTER TABLE
6. LFA1 VENDOR MASTER TABLE
7. EKKO PURCHASE ORDER HEADER
8. EKPO PURCHASE ORDER ITEM
9. VBAK SALES ORDER HEADER
10. VBAP SALES ORDER ITEM
11. VBRK BILLING DOCUMENT HEADER
12. VBRP BILLING DOCUMENT ITEM
13. LIKP DELIVERY HEADER
14. LIPS DELIVERY ITEM
CONTROL STATEMENTS IN SAP ABAP.
Control statements are nothing but loops. The property of the loop is to rotate by it self until loop is terminated. There are 4 types of control statements in SAP. They are
DO.
..
..
ENDDO.
DO N TIMES.
..
..
ENDDO.
WHILE <CONDITION>.
..
..
ENDWHILE.
CASE <VARIABLE>.
WHEN <VALUE1>.
..
..
WHEN <VALUE2>.
..
WHEN OTHERS.
..
ENDCASE.
Exit statement is used to terminate the loop. SY-INDEX is a system variable which gives present loop iteration number. These both things we use in coming program to see how they act in the loop.
SYSTEM VARIABLES IN SAP ABAP.
1. sy-datum -- Date
2. sy-uzeit -- Time
3. sy-mandt -- Logon client number
4. sy-uname -- Logon user name
5. sy-repid -- Report program name
6. sy-cprog -- Current program name
7. sy-dynnr -- Screen number
8. sy-tcode -- Transaction code
9. sy-pagno -- Page number
Sample program with these system variable is.
*&---------------------------------------------------------------------*
*& Report ZSAMPLE *
*& *
*&---------------------------------------------------------------------*
*& *
*& SYSTEM VARIABLES *
*&---------------------------------------------------------------------*
REPORT ZSAMPLE .
write / sy-datum.
write / sy-uzeit.
write / sy-uname.
write / sy-repid.
write / sy-cprog.
write / sy-mandt.
write / sy-dynnr.
write / sy-pagno.
Write / sy-tcode.
MODULARIZATION IN SAP ABAP.
It is a technique of splitting larger code into smaller block of code. It is done for easy understanding, easy debugging and to decrease the code. We can achieve this in SAP using 4 concepts.
Events
Subroutines
Include programs
Function modules
SMART FORMS IN SAP ABAP.
It is enhanced version to SAP scripts. Transaction code is smartforms.
First we discuss about the differences scripts and smart forms.
Scripts are client dependent but smart forms are client independent.
Scripts are not self executable i.e. print program is compulsory, but smart forms are self executable. On executing the smart form system generates function module.
We can not write the logic in scripts but we can write the logic in smart forms.
Main window is compulsory in scripts but it is optional in smart forms.
Background logo is not possible in scripts but it is possible in smart forms.
There are character and paragraph formats in scripts but there are no character and paragraph formats in smart forms
Labels are present in scripts but no labels in smart forms.
When ever you enter into smartforms under global settings you get three things.
Form attributes
Form interface
Global definitions
FORM ATTRIBUTES:- It gives the history and technical attributes of smart form
FORM INTERFACE: - The variables that are needed to be populated at run time should be declared here.
GLOBAL DEFINITIONS:- The variables that are needed in the smart form should be declared here.
Now we discuss about the steps in creation of smart forms.
T-code smartforms
Press create button
To create logo window right click o page create( Graphic
Give the logo name
The variables that are needed to be populated at run time should be declared under form interface
The variables that are needed to be populated at run time should be declared under Global definitions.
To write the select query or logic select the window right click create( flow logic ( program lines
It is mandatory to give input parameters and output parameters
To write loop select the code Right click create( flow logic -( loop
To write the output select loop Right click Create ( Text
Check for errors
Activate and Execute
Function module will be generated. Execute it
Give printer name LP01 (Default Printer)
Press print preview to see output
ENHANCEMENTS in SAP ABAP.
These are used to add extra intelligence to SAP standard programs to suit the business requirements. If we want to add extra code to SAP standard programs, if we go for change mode system asks for access key. Instead of this, SAP has provided hooks where we can write the code. These hooks are enhancement spots. If a code is written in theses spots along with the normal program the code written in these spots is also executed. There are two ways to enhance the SAP standard code.
User Exits
BADIS (Business Addins)
If user exits are used one time in any project it can not be reused. But Badis can
be used any no of times.
There are 4 types user exits.
Function module exit
Field exit
screen exit
Menu exit
Exits are defined at package level. So we want to enhance any T-code first we
have to find out the package for that T-code. Then we have to find out the exits present in that package. For finding the exits present in a package we have to use SMOD T-code. After finding the suitable exit for writing the code we have to use CMOD T-code.
There are four types of USER EXITS
Function Module exits
Screen exits
Menu exits
Fields exits
Function Module exits:
In this we will use FUNCTION MODULE, to enhance, SAP standard program.
Screen exits:
They are used to add extra FIELDS in SAP standard screens.
Menu exits:
It is used to add extra MENU ITEMS to SAP standard screens.
Field exits:
It is used to add extra VALIDATIONS to SAP standard screen fields
T-code SO10
Give name and press create
Give the text
Press save
STES IN INSERTING THE STANDARD TEXT IN FOR WINDOW
Go to Se71.
Open form in change mode
Select the window where standard text is needed to be inserted
Press Text elements button
Insert( text( standard
Give text name
Press enter
System adds this code in the editor
Prepare a Bitmap Image
T-Code SE78
Expand graphics
Double click BMP.
Press import button
Give the path where image is present in you system
Give name to logo
Give description
Specify color image or Black and white image
Press enter
The image will be uploaded into SAP with the name you have given in 7th step.
If the image is of .TIF format we have to run the standard program RSTXLDMC to upload the image into SAP. The image will be stored on document server. All the images will be stored in STXBITMAPS table.
Now my requirement is to insert the logo in one of the windows of the form that I have designed .
There are three types of tables.
1. Transparent Tables
2. Clustered Tables
3. Pooled Tables.
TRANSPARENT TABLES:- For every table created in Data dictionary (DDIC) there will be table created in database with same name, same no of fields, fields having same names and the order of the fields will be same. That means for every same replica of table or mirror image will be created in Data base. That means it is having one to one relation. By default every table created will be Transparent Table.
CLUSTERED TABLES:- Many tables created in DDIC are stored in single table in data base called table cluster. That means it is having many to one relation. All the tables present in table cluster will have primary key in common.
POOLED TABLES:- In case also many tables created in DDIC are stored in single table in database called table pool. Hence it also having many to one relation. Here the tables present in table pool many have primary key in common.
There are three types of data in SAP.
Customized data
Master data
Transactional data.
CUSTOMIZED DATA:- The data which never changes is called Customised data. This data is not created but configured by functional consultant using SPRO tranction.
MASTER DATA: The data which changes very rarely is called Master data.
TRANSACTIONAL DATA:- The data which changes very frequently is called Transactional data.
Process before output (PBO)
Process after input (PAI)
Process on value-request (POV)
Process on help-request (POH)
PROCESS BEFORE OUTPUT:- This event is triggered before the screen is displayed. This event is used to assign some default values to screen fields. With those values the field will be displayed.
PROCESS AFTER INPUT:- This event is triggered after giving input to the screen fields. This is used to handle user action actions on the screen.
PROCESS ON VALUE-REQUEST:- This is used to give F4 help to screen fields.
PROCESS ON HELP-REQUEST:- This is used to give F1 help to screen fields.
The in the module pool program should be written between module and endmodule.
AT EXIT-COMMAND:- It is used to go to the leave the screen or process some logic even though some of the mandatory fields of a screen not filled.
SY-UCOMM:- It is a system variable used to catch the function code that is triggered for user actions on the screen.
OK_CODE:- It is used as substitute for sy-ucomm.
At new should be used inside the loop, but on change of can be used outside the loop also.
At new takes only one field, but on change of can take multiple fields.
Let us assume that an internal table is having f1, f2, f3 , f4 and f5 fields and if at new is applied on f3 field it will be triggered for every change in f1, f2 and f3 fields, but on change of will be triggered for only changes in f3.
Both are used to find out subtotals but the difference is point of triggering.
At new is triggered at the starting of new record, but at last is triggered at the end of the record.
At new checks previous record, but at last checks next record.
Pre-requisites for using Control break statements Control break statements should be used in side the loop but on change of can be used outside the loop. Before using the control break statement the internal table should be sorted by the field on which control break statement is going to be used.
AT FIRST:- This is triggered at the first record of the internal table. This is triggered only once. It is usually used to write the heading to columns while displaying the records of internal table.
AT LAST:- This is also triggered only once at the last record of the internal table. This is used to find out grand totals of numeric values.
AT NEW <FIELD>:- This is triggered at the starting of every new record based on a particular field. It is used to calculate sub totals.
AT END OF <FIELD>:- This is triggered at the end of every new record based on a particular field. It is also used to find out sub totals.
When ever same logic is needed to be executed many times in a program, create a subroutine and call the subroutine when ever the logic is needed to be executed.
Perform statement is used to create the subroutine and to call the subroutine.
A subroutine can be created with passing the variables and without passing the variables. The logic of the subroutine is written between form and endform. It is not required to start the subroutine name with Z OR Y.
The variables that are passed into subroutine are called global variables or actual variables. The variables that are used to receive the values in subroutine from main program are called local variables or formal variables.
There are 3 ways to pass the variables into subroutine.
CALL BY VALUE
CALL BY REFERENCE
CALL BY VALUE AND RESULT
CALL BY VALUE:- In this new memory area is allocated for the local variables between form and endform. When the values of local variables are changed , they are changed in only or reflected in only newly created memory area. The original values of corresponding global variables are not changed.
CALL BY REFERENCE:- In this no new memory area is created for the local variables between form and endform. They make use of memory of the corresponding global variables. Hence when the values of local variables are changed between form and endform immediately the corresponding global variables values are changed.
CALL BY VALUE AND RESULT:- In this new memory area is created for local variables. When ever the values of local variables are changed between form and endform, the changes are reflected in only newly created memory area. But when the control is moving back from subroutine to main program, the values present in local memory are copied back to the corresponding global variables memory area.
Hence we can say that in CALL BY VALUE the values of global variables are never changed when corresponding local variables values are changed, in CALL BY REFERENCE the values of global variables are changed immediately. In CALL BY VALUE AND RESULT the values of corresponding global variables are changed control moves from subroutine to main program.
INITIALIZATION
AT SELECTION-SCREEN
AT SELECTION-SCREEN ON <FIELD>
AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN ON VALUE-REQUEST FOR <FIELD>
START-OF-SELECTION
TOP-OF-PAGE
END-OF-PAGE
END-OF-SELECTION
INITIALIZATION:- This is the first event to be triggered. This event is triggered before the selection-screen is displayed. This event is used to give default vales to selection-screen fields.
AT SELECTION-SCREEN:- This event is triggered after giving input in selection-screen fields. This event is used to handle the user actions on the screen. This is also used to validate all the selection-screen fields.
AT SELECTION-SCREEN ON <FIELD>:- This is used to validate a particular field present on the selection-screen.
AT SELECTION-SCREEN OUTPUT:- This is used to change the selection-screen properties dynamically.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR <FIELD>:- This is used to give F4 help to a particular field resent on the selection-screen.
START-OF-SELECTION:- Main logic of the program is written in this event. Usually write statement is recognized from this event.
TOP-OF-PAGE:- This is used to write something on top of every page. The first write statement or output statement (SKIP) of a page triggers this event.
END-OF-PAGE: - This event is used to write something at end of every page. Last line of the page triggers this event. We have to allocate the line for end of page.
END-OF-SELECTION:- Usually program output is written in this event. This event is used to handle abnormal termination of the program. The stop statement written in start-of-selection event takes the control to end-of-selection event.
The Call transaction is used if you need the generated document number to be returned to the program. It is often used if you need to do some additional processing after your document is generated. It is usually a small data set because if you have large data, you might have a time out error.
Sessions are used when you are unsure when you will run the BDC... you could schedule it during the night.This is used when you are working with large numbers of transactions.
Which BAPI do they use for DMR mass creation?
1.BDC_Open_group.
2.BDC_Insert.
3.BDC_Close_group
These three modules are primarily used in successfully transferring data in sequence using BDC.
Billing Date validation In SAP ABAP.
FORM USEREXIT_ACCOUNT_PREP_KOMKCV.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form USEREXIT_ACCOUNT_PREP_KOMKCV, Start A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZAK_INVOICE_VALID. "active version
**TYPES: BEGIN OF ty_final,
** vbeln TYPE vbeln_vl,
** lfdat TYPE lfdat_v,
** END OF ty_final.
**DATA: it_final TYPE STANDARD TABLE OF ty_final,
** wa_final TYPE ty_final.
**
** SELECT SINGLE vbeln lfdat
** FROM likp
** INTO wa_final
** WHERE vbeln = vbrp-vgbel.
**
** IF VBRK-FKDAT < wa_final-lfdat.
** MESSAGE 'billing Date should not be less than delivery date' TYPE 'E'.
** fcode = 'ENT1'.
** PERFORM FOLGE_GLEICHSETZEN(SAPMV60A).
** SET SCREEN 6105.
** LEAVE SCREEN.
** ENDIF.
How to make field Address required in transaction KE51 in SAP ABAP.
Normally SAP doesn’t provide us
configuration and user exit to make fields in Address tab required in
transaction KE51 . but after little bit of debug ABAP Code, i found the clue
that you need to create enhancement point in include program LRKPMF05 in
subroutine md_user_command_handle.
Example:
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1)
Form MD_USER_COMMAND_HANDLE, Start A
*$*$-Start:
(1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT
1 ZIMP_CO_REQUIRED_ADDR_KE51. "active
version
"Added By Rachmad Kurniawan
"Tgl 06/10/2016
IF md_fcode = 'MD_SAVE'.
IF PRCT_V-STRAS EQ ''.
MESSAGE 'You must input
Street' TYPE 'E'.
ENDIF.
IF PRCT_V-ORT01 EQ ''.
MESSAGE 'You must input Kota' TYPE 'E'.
ENDIF.
IF PRCT_V-LAND1 EQ ''.
MESSAGE 'You must input Country' TYPE 'E'.
ENDIF.
IF PRCT_V-REGIO EQ ''.
MESSAGE 'You must input Region' TYPE 'E'.
ENDIF.
ENDIF.
ENDENHANCEMENT.
Definition of Infotype within the Data Dictionary.
Each infotype nnnn requires at least two structures and one table:
• Structure PSnnnn
Structure PSnnnn contains all of the infotype data fields.
• Structure Pnnnn
Structure Pnnnn contains infotype key fields and all of the data fields from structure PSnnnn .
• Transparent table PAnnnn and/or transparent table PBnnnn
Transparent table PAnnnn is required if you want to use an infotype within Personnel Administration.
If you want to use an infotype within Recruitment, transparent table PBnnnn is required.
In accordance with the distribution of infotype name ranges, objects P9nnn , PS9nnn , PA9nnn and PB9nnn are assigned to the customer name range.