Wednesday, September 30, 2020

Control Break Statements, explain about them in SAP ABAP.

What are the Control Break Statements, explain about them?.

Control Break Statements, explain about them in SAP ABAP.

Ans :-

Control Break statements: - They are used to control the data flow of an internal table.

Ø  The Control break statements start with AT and ends with ENDAT.

Ø  These statements should be used within the LOOP statements only

Ø  Following are the different types of Control break statements.

·         AT FIRST: - This event is triggered at the first record of an internal table. This is used to display the Header information.

·         AT NEW: - This event is triggered at the first record of each block. This is used to display the individual headings.

·         AT END OF: - This event is triggered at the last record of each block. This is used to display the total/sub totals in the internal table.

·         AT LAST: - This event is triggered at the last record of an internal table.

·         ON CHANGE OF: - It is a special control break statement which can be used outside of the                                loop statement also.

Ø  It is almost similar to AT NEW statement but it doesn't consider the preceding fields.

Ø  It can be used on the multiple fields using SET operators (AND, OR, BETWEEN).

Events associated with Interactive Reports in SAP ABAP.

 Events associated with Interactive Reports.

What are the events associated with Interactive Reports?

Ans :- Following are the EVENTS associated with the Interactive Reports .

Ø  AT LINE-SELECTION: This event is triggered at the time of user clicks on any record of any list. It is used to provide the detailed list based on the current list.

The system field SY-LSIND holds the Index of the next drill down list.

Ø  AT USER-COMMAND: This event is triggered at the time of user clicks on any menu item. This event is used to provide the additional functionality based on the selected push button.

Ø  TOP-OF-PAGE DURING LINE-SELECTION: This event is triggered with the first WRITE/ULINE/SKIP of the drill down list. It is used to provide the column headings for the drill down list.

Ø  AT PF: This event is triggered when the function key is pressed. This event is used to provide the additional functionality based on the selected menu item.

Ø   SET PF-STATUS: This event is triggered at the time of attaching our own GUI to the list. It is used to call the menu status.

Ø  Up to 35 Push buttons can be created on the Application tool bar.

Explain about Loop termination statements in SAP ABAP.

Explain about Loop termination statements?

Explain about Loop termination statements in SAP ABAP.

Ans :-  The following statements are used to come out of the loops and continue with the next    

             loop statements.

·         EXIT: - This statement is used to come out of the loop statement and continue with the  next statement line outside of the loop statements in the program.

·         STOP: - This statement is used to stop the Loop process along with the next part of the  loop statement.

·         CONTINUE: - This statement is used to stop the current loop process and continue with  the next loop process.

·         CHECK: - This statement is used to check the specified conditions and continue with the next loop process.

Ø  CHECK = CONDITION + CONTINUE.

Types of execution modes in SAP ABAP.

Types of execution modes in SAP ABAP.

What are the types of execution modes?

Ans:  There are 2 types of execution mode to execute a program or the transaction codes.

1. Foreground: It is used to execute the programs or the transaction codes directly by pressing  execute icon or F8 function key. It requires user interaction.

2. Background: This execution mode is used to execute the programs or the transaction codes   periodically such as Hourly, Daily, Weekly, Monthly etc in background. It doesn’t require any user interaction. The variants must be created before the programs are scheduled in back ground.

Ø  The T-code SM36 is used to define the background jobs &

Ø  The T-code SM37 is used to check the status of the background jobs.

The standard function modules JOB_OPEN -> To open back ground job

JOB_SUBMIT -> To submit job in back ground

JOB_CLOSE -> To close scheduled job.

Debug Background Jobs in SAP ABAP.


How to debug Background Jobs?

Debug Background Jobs SAP ABAP.

Ans: The Background jobs can be debugging using the command ‘JDBG’.

Ø  Execute the T-code SM37

Ø  Check the required background job to be debugged.

Ø  Enter JDBG in the Command field & Press Enter

Ø  Keep on pressing F7 until the required program is stopped.

Ø  Use the Function keys F5/F6/F7 to check the program Line by line/Block by Block once it is reached.

Classical & New debugger Differences in SAP ABAP.

 Differences between Classical & New debugger?


Classical & New debugger Differences in SAP ABAP.

Ans:

Classical debugger

New debugger

1.It is the old debugger

1.It is introduced from the version ECC 5.0

2.It runs on the same session to check & resolve the issues in the program

2.It runs on the separate session

3. It has Lots of limitations such as different desktops are not there, no separate sections for local , global Variables etc

3.It is very efficient tool to check lots of actions such as different desktops, separate actions for local & global Variables & objects at a time


Single Step F5
: The function key F5 is used to check Line By Line of the program.

Execute F6: The function key F6 is used to check Block By Block of the program.

Return F7: The function key F7 is used to Return from the source code of the process blocks such                 as sub-routines, function modules, methods etc.

Continue F8: The function key F8 is used to jump from one break point into the next break point                         then execute once the last break point is reached & then execute.

Debugger, Break points and Watch points in SAP ABAP.

Explain about Debugger, Break points and Watch points?

Debugger, Break points and Watch points in SAP ABAP.

Ans :-  Debugger :- This tool is used to check the program line by line & block by block for finding          and rectifying errors or bugs.

     Break Points:- These are Statement based. They are used to stop the program in the         debugger tool for checking line by line or block by block.

·         Break points are of 4 types. We can place up to 30 break points in the program.

1. Session Break Point: An icon set/delete breakpoint icon or click on statement line at       gray color vertical selection in the source code.

2. Static Break Point: The ABAP statement BREAK-POINT/BREAK <user_name> is used      to set the Static break point. The ABAP statement BREAK-POINT               should not be used since all the users are stopped.                                                              3. Dynamic Break Point: They are used to check the program in case of not possible to    find a location. The command /H is used to set dynamic break points.  The program is stopped at the first statement line of the performed action.

4. External Break Point: They are used to check the cross application components such

     as RFC, BAPI from one system to another. An icon set or delete external break points  is used to set or delete external break-points.

Watch Points: - These are Condition based. They are used to stop the program once the set condition is reached. The Watch points can be set inside the debugger tool. We can place up to 9 watch points in the program. We can reduce debugging time using watch points.

Different parameters in Function Modules and Explain in SAP ABAP.

What are the different parameters in Function Modules and Explain about them?

Different parameters in Function Modules and Explain in SAP ABAP. 

Ans:    Following are the different types of Parameters in Function Modules

Ø  Attributes:

It contains technical properties of a function module such are type of function module, function group.

Ø  Import parameters :

      They are imported from the calling program to the function module.

Ø  Export parameters:

                                These are used to exported the data from the function module to the calling                                      programs.

Ø  Changing parameters:

These are imported from the calling program, changed them in the function modules & exported/returned to the calling program. (Import -> Change -> Export)

Ø  Tables:

These can be used to import & export only for internal tables.

Ø  Exceptions:

They are used to raise/handle the messages in the function module based on return code (SY-SUBRC).

Ø  Source code: It is used to write central ABAP source code.

Differences between Macro & subroutine in SAP ABAP.

 What are the differences between Macro & subroutine?

Differences between Macro & subroutine in SAP ABAP.

                             Macro

                            Subroutine

1. Definition & calling in the same program.

1. Definition & calling may/may not in the same

    Program.

2. Definition should be the 1st & calling should be

    The next.

2. Calling should be the 1st & Definition should

     Be the next.

3.  Macros can take up to 9 inputs.

3. Subroutines can take any no of inputs.

 4. Macros cannot be debugged.

4. Sub-routines can be debugged at run time.

Differences between Subroutines and Function Modules in SAP ABAP.

 What are the differences between Subroutines and Function Modules?



Differences between Subroutines and Function Modules.

                           Subroutines

                        Function modules 

1. These are local. We can access the 

     Subroutine within the server only.

1. These are global. We can access the

    function module with in server as well as

    Outside the server.

2. We can’t execute the subroutine independently

2. we can execute function module independently using the T-code SE37

 

3. Subroutines can’t handle the Exceptions.

3. Function module can handle the errors

    through Exceptions.

 

What are the Modularization techniques in SAP ABAP.

Details about Modularization techniques in SAP ABAP.


Modularization techniques in SAP ABAP.

Ans :- They are used to organize the ABAP code in the proper way , make the program more

            Understandable and make use of the code re-usable to avoid the duplicate data.

           To divide the business processing logic into reusable block of statements.

ü  Following are the different types of Modularization techniques

o   INCLUDES:  These programs are part of another main/include programs. Include programs can’t be executed independently whereas the same include program can be included in any no of executable programs. The ABAP statement INCLUDE is used to call or define the INCLUDE programs.

o   Subroutines: These are statements local modularization techniques. The sub-routines can be debugged at run time. Calling should be 1st & Definition should be next. The ABAP statement PERFORM is used to call the sub-routines & FORM…ENDFORM is used to define the sub-routines.

There are 2 types of sub-routines.

                                               I.        Internal Subroutine: These are defined & called in the same program.

                                              II.        External Subroutine: These are defined in one program & called in another program.

Actual Parameters: The parameters which can be called while calling the subroutines (with PERFORM statement).

Formal Parameters: The parameters which can be passed while defining the subroutine (with FORM statement).

Ø  The no of actual parameters should be similar to the no of formal parameters.

Ø  The sub-routines definitions should not be nested (form with in the form) but the sub-routine can be called within the sub-routine.

Ø  The statements between 2 sub-routines definitions cannot be accessed

=================================================== 

o   Macros: These are used for the complex write statements & for long calculations. Macros can take up to 9 place holders (&1…. &9). In macros Definition should be 1st & Calling should be next. The ABAP statement, DEFINE…END-DEFINTION is used to define a macro. The macro definitions cannot be debugged at run time. The standard table TRMAC pooled table is used to maintain macros.

o   Function Modules:  These are global modularization objects. The function modules can be called any where in the same system & in another system also. The function modules are defined in function builder.

 ========================================================================

The T-code SE37 is used to work with the function modules & SE80 is used to work with the function group. The function modules should be assigned to a function group & Function group is the collection of function modules.

Ø  The standard table ‘TFDIR’ is used to find FMs since it contains the entire Function module in the system.

Ø  Normal Function Module: These are defined & called in the same system to reuse the central source code.

Ø  Remote Function Module: These are defined in one system & can be called another system.

Ø  Update Function Module: This is used for SAP LUW (Logic Unit of Work). These function modules are triggered in case of implicit or explicit COMMIT work is encountered. Commit Work is used to make changes in data base permanently.

o   Message class: This tool is used to maintain the Messages in the message pool.

They are used to give messages for instructing the users.

The standard T-Code SE91 is used to work with the message pool.

 Different types of messages are Error, Success, Warning, Information, Abort, Exit.

Syntax: MESSAGE ‘<MSG Text>’ type ‘E/I/W/S’.

==================================================== 

o   Text symbols & Constants: The ABAP Statement TEXT followed by the symbol number (XXX) can used to define or call the text symbol. Constants are used to avoid the hard coded text and improve the reuse them in the program.

The T-code SE63 is used to translate the different types of text elements.