0% found this document useful (0 votes)
41 views42 pages

ABAP Topics

Uploaded by

krishnapray18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views42 pages

ABAP Topics

Uploaded by

krishnapray18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

When Customizing TR and when Workbench TR is required??

Code Change- Workbench Request

It totally depends on Data Dictionary: Delivery Class.

1. A -> Application Table (Master Data and Transaction Data) => Workbench Request

2. C ->Customizing Table( Maintenance only by customer, No SAP IMPORT ) => Customizing Request
SY-TABIX and SY-INDEX

SY-TABIX => Current Table Record

SY-INDEX => Current Loop Pass/iteration


View:

• Doesn’t store the data permanently.


• It is virtual table which stores the data at run time only.
• It is result of output made by select query on one or multiple table with or without join.

• There are 4 types of view as per SAP DATA DICTIONARY: -


1) Database View(Inner Join on two or more table)
2) Projection View(Select some columns from same table)
3) Maintenance View (Same as Table maintenance generator)
4) Help View(Left Outer Join for search help)
Dynamic Selection Screen
Exclusive Lock(Write lock): The locked data can be read or processed by ONLY one user AT A
TIME.
Shared Lock: Several users can read the same data at the same time, but as soon as a user
edits the data, a second user can no longer access this data.
Exclusive but not cumulative lock: Exclusive locks can be requested by the same
transaction more than once and handled successively, but an exclusive but not cumulative lock
can only be requested once by a given transaction. All other lock requests are rejected.

Whenever lock object is creted and activated then two function module is automatically
created.
1. Enque fm
2. Deque fm

Lock object we created: EZ_PKLOCKOBJ


• ENQUEUE_EZ_PKLOCKOBJ => To put the lock
• DEQUEUE_EZ_PKLOCKOBJ => Release the lock

• ZPKDEMOTAB1,ZPKCOUNTRY
How to design a selection screen

Define the data object

Sequence of event

Interactive report using different techniques


For maintaining any kind of selection text like parameter,
select option etc.
SEQUENCE OF EVENTS IN ABAP REPORT:
a) LOAD OF PROGRAM.
b) INITIALIZATION.(This is to initialize the variable)
c) AT SELECTION-SCREEN OUTPUT(Dynamic selection screen)
d) AT SELECTION-SCREEN => To Validate the value at selection screen
e) AT SLECTION-SCREEN ON VALUE REQUEST FOR p_file => search help on any
parameter field/select-option
f) START-OF-SELECTION
g) END-OF-SELECTION(OBSOLETE)
h) TOP-OF PAGE (To display the header on each page)
i) END-OF-PAGE(To display the page number subtotal on each page)

 *****************************INTERACTIVE REPORT
EVENTS***********************************
a) AT LINE-SELECTION
b) AT USER-COMMAND
c) TOP-OF PAGE DURING LINE SELECTION
d) END-OF-PAGE DURING LINE SELECTION
UPDATE FUNCTION MODULE

Q. What it is?
Ans - It is one of the Bundling Technique to achieve the SAP LUW. It also
improves the performance as it runs asynchronously.
Q. Why simply with the help of COMMIT WORK and ROLLBACK we can’t
achieve the SAP LUW?
Ans – Whenever there is a change in work processes, system takes implicit
COMMIT in between the process, Which is not desired because we want either
all or none.
Different Types of Update Module
There are 4 types of Update option in function builder –

1. Update with immediate start


Set this option for high priority ("V1") functions that run in a shared (SAP LUW).
These functions can be restarted by the update task in case of errors.
2. Update with immediate start but no restart
Set this option for high priority ("V1") functions that run in a shared (SAP LUW).
These functions may not be restarted by the update task.
3. Update with delayed start
Set this option for low priority ("V2") functions that run in their own update
transactions. These functions can be restarted by the update task in case of
errors.
4. Collective
Need to run all the update function module collectively
Note:

1. While an update function module is processed in an update work process, you are not allowed to
execute the statements SUBMIT, CALL DIALOG, CALL SCREEN, CALL TRANSACTION,
COMMIT WORK, ROLLBACK WORK and all other statements that provoke a database commit.

2. The additions IMPORTING, CHANGING and EXCEPTIONS of the general function module call may
be specified, but they are ignored during the execution.
Dynamic internal table

Dynamic internal
table

Classical method Using the RTTS services


using the field symbol Runtime type services
To Create a Dynamic Internal Table: Part - 1
First Method( Classic Approach )

 Define a generic variable with reference to Generic Data type (DATA)

 Create the Object type table of < Any data dictionary table >

 To access the data of referenced data object use the field symbol of
type standard table

 Assign the dereferenced data value to field symbol to convert the


field symbol into dynamic internal table
To Create a Dynamic Internal Table –
Part 2 : Second Method ( Using lvc_f
How to read syntax from official documentation
(SAP Help i.e. F1)
Q. How to create the Check Box and use in
Module Pool Program
Q. What is Parallel Processing and how it’s used in ABAP to improve the performance

All the tasks in the parallel processing program which is allocated in the work proce
by the developer is dialogue work process

Big Task Taking 100 Minutes Single Work


Process

DWP1 DWP2 DWP3 DWP4 ...... DWP10

.
AS1 AS2
40 30
AS3
20

AS7
AS4
50
50

AS6 AS5
49 45

SERVER GROUP
PARELLEL_GENERATOR
IDOC
WORKFLOW_GROUP
HEART OF THE PARALLEL PROCESSING

CALL FUNCTION <RFC Function Module>


STARTING NEW TASK <TASKNAME>
DESTINATION IN GROUP server_group PERFORMING RETURN_INFO ON END
OF TASK
EXCEPTIONS
COMMUNICATION_FAILURE = 1 MESSAGE msg
SYSTEM_FAILURE =2 MESSAGE msg
RESOURCE_FAILURE = 3. "No work processes are currently available.
Your
* YOUR_EXCEPTIONS = 4

Handle Subroutine for Result


FORM RETURN_INFO USING TASKNAME.
RECEIVE RESULTS FROM FUNCTION ' <RFC Function Module>
IMPORTING <PARAMETER> = <LOCAL_DATA_OBJECT>
EXCEPTIONS
COMMUNICATION_FAILURE = 1
SYSTEM_FAILURE = 2.

RCV_JOBS = RCV_JOBS + 1. "Receiving data


IF SY-SUBRC EQ 0.
" Handle output message
ENDIF.
CASE sy-subrc.
WHEN 0.
task = task + 1.
snd_jobs = snd_jobs + 1.
WHEN 1 OR 2.
"Handle communication and system failure.=> This can be permanent problem with the se
hence
"Get the server name and remove the server from further consideration
"Get name of server just called...
CALL FUNCTION 'SPBT_GET_PP_DESTINATION'.
"Exclude this server from server group
CALL FUNCTION 'SPBT_DO_NOT_USE_SERVER'.
WHEN 3.
"No resources (dialog work processes) available at
"present. need to handle this exception, waiting
"and repeating the CALL FUNCTION until processing , generally recoverable
"First attempt of handling -> wait up to 1 second
IF excp_flag = space.
excp_flag = 'X'.
WAIT UNTIL rcv_jobs >= snd_jobs UP TO '1' SECONDS.
ELSE. " Second attempt of handling
WAIT UNTIL rcv_jobs >= snd_jobs UP TO '5' SECONDS.
IF sy-subrc = 0. " That means Job successfuly recieved
CLEAR excp_flag.
ELSE. "No replies
Important T-Code:
RZ12 => To check the Server Group
SM66 => To check all the work processes(Very Important) ,
SM51 => To check the Application servers specific work processes
SM21 => System log in case of any failure etc.

IMPORTANT Optional FUNCTION MODULE Which can be used

1. SPBT_INITIALIZE(OPTIONAL) => To get the total number of work processes and free
work processes at this moment which can be used for parallel processing

2. SPBT_GET_PP_DESTINATION(OPTIONAL) => To know the last used server/ongoing


performing server name

3. SPBT_DO_NOT_USE_SERVER(OPTIONAL) => To Exclude the problematic server


CALL FUNCTION 'SPBT_INITIALIZE'
EXPORTING
GROUP_NAME = GROUP
"Name of group to check
IMPORTING
MAX_PBT_WPS = WP_TOTAL
"Total number of dialog work
"processes available in group
"for parallel processing
FREE_PBT_WPS = WP_AVAILABLE
"Number of work processes
"available in group for
"parallel processing at this
"moment
EXCEPTIONS
INVALID_GROUP_NAME =1
"Incorrect group name; RFC
"group not defined. See
"transaction RZ12
INTERNAL_ERROR =2
"SAP system error; see the
"system log (transaction
"SM21) for diagnostic info
PBT_ENV_ALREADY_INITIALIZED = 3
"Function module may be
Pre-requisites/limitation to use parallel processing :-

The function module that you call must be marked as externally callable. This
attribute is specified in the Remote function call supported field in the function module
definition (transaction SE37).

The called function module may not include a function call to the destination
"BACK.“

The calling program should not change to a new internal session after making an
asynchronous RFC call. That is, you should not use SUBMIT or CALL TRANSACTION
in such a report after using CALL FUNCTION STARTING NEW TASK.

You cannot use the CALL FUNCTION STARTING NEW TASK DESTINATION IN GROUP
keyword to start external programs.

In calls between systems, both systems must be of Release 3.0A or higher.

Minimum 3 WP should be available.

Reference: https
://help.sap.com/viewer/b07e7195f03f438b8e7ed273099d74f3/7.5.4/en-US/4d909309eb
a36e73e10000000a15822b.html
PARALLEL PROCESSING PROGRAM

TOP_INCLUDE.txt
MAIN_PROGRAM.txt

SUBROUTINE_INCLUDE.txt
What is MESH and Meshes in SAP ABAP?
Ans- These are special structures. Their components (referred to as nodes) are either structured internal
tables or reference variables that point to structured internal tables.

Meshes: It’s instance of the mesh type.


Q. What is a Dialogue step, DATABASE LUW and SAP LUW?

Dialogue Step –
An Smallest unit of work performed by SAP system with respect to screen/DYNPRO in an SAP
system is called Dialogue Step.
It consists PAI,PBO and Screen Logic. Each dialogue step is assigned to Dialogue

SAP
Work process. At once only one dialogue step is assigned to a dialogue work process.

Implicit
DB
LUW Commit
DB SAV 3rd Dialogue
LUW LUW E

SCREE Step DB
SCRE SCRE PAI
N PAI---- PAI-- LUW
EN EN PBO
1000 PBO PBO
2000 3000
1st Dialogue 2nd Dialogue
Successfully
Step Step saved

Implicit Implicit
Commit Commit

ACID – A-ATOMICITY, C-CONSISTENCY, I-ISOLATION, D-DURABILITY


Notes for LUW

• SCREEN + PAI + PBO => A DIALOGUE STEP


• One Dialogue step contain Single DB LUW(also known as DB Transaction)
• Multiple DB LUW => SAP LUW

Note: -> A dynamic programming is also called screen programming because with
the help of a screen, a user is able to give dynamic input. So Screen is know as
DYNPRO.

SAP Transaction: ->A Transaction is set of Dialogue steps may have multiple
Database LUW involved .

Note: -> A dynamic programming is also called screen programming because with
the help of a screen, a user is able to give dynamic input. So Screen is know as
DYNPRO.

SAP Transaction: ->A Transaction is set of Dialogue steps may have multiple
Q. What are the Various Techniques to Achieve the SAP LUW?

Ans. SAP LUW Achieved can be various Bundling Techniques -

SAP LUW is achieved using –

 CALL FUNCTION <function_name> IN UPDATE TASK = UPDATE FUNCTION MODULE

 VIA BACKGROUND TASK(t RFC) – COMMIT WORK

 PERFORM <form_name> ON COMMIT


What is Update Function Module and how we can achieve SAP LUW.

Ans – Please go through My Video on SAP UPDATE Function Module


There it has been described in detail.
Q. What is t-RFC? Describe it in Detail and Demonstrate that how
SAP LUW can be achieved with the help of t-RFC.

Ans – it is one of the Bundling techniques to achieve the SAP LUW.

It has following Property –

1. It is run Exactly Once in Reciever System.


2. Reciever system may not be available all the time to receive the t-RFC call.
3. Each t-RFC call is identified with unique ID is known as TID.
4. If the receiving system is not available within certain time to receive the call then the t-
RFC call gets scheduled to get execute in batch job by program RSARFCSE
5. This Program is by default set to run at 15 minutes interval. This program is written in
such way that whenever it runs it tries for 30 times to send a t-RFC call to receiver
system. The Attempt count can be changed under enhancement programs SABP0000 and
SABP0003
6. All the T-RFC failed Call can be seen under SM59 t-code.
7. Tables –
ARFCSSTATE => Name of the destination
ARFCSDATA => Import Parameters/ Export Parameters / Tables etc.
Explain about the separate unit addition in trfc

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy