Modularization in ABAP: Macro,Subroutines & Function Modules - Shikshaglobe

Content Creator: Preet.Sharma

At the point when you modularize source code, you place a grouping of ABAP proclamations in a module. Then, at that point, rather than putting every one of the assertions in your fundamental program, you simply call the module.When the program is created, the source code in the modularization unit is treated like it were quite present in the primary program.In this instructional exercise you will learn:

Need of Modularization

Work on the construction of the program.

Simple to peruse the code

Simple to keep up with the code

Keep away from overt repetitiveness and advances code reuse

Different Modularization Techniques

Utilization of Macros

Utilization of incorporate documents

Subroutines

Capability Modules

Gives investigate every one of them access detail :

SAP-ABAP Macro

If you have any desire to reuse similar arrangement of proclamations at least a couple of times in a program, you can remember them for a large scale.You can involve a full scale inside the program wherein it is characterized, and it must be brought in lines of the program following its definition.Investigate MOREMacros can be valuable for long estimations or complex WRITE explanations.Language structureCharacterize <macro_name>'Full scale StatementsEND-OF-DEFINITIONMacros can utilize Parameters &N where N = 1,2,3…Information: number1 TYPE I VALUE 1.Characterize increase.

Incorporate Programs

Incorporate Programs are exclusively for modularizing source code, and have no boundary interface.Incorporate projects permit you to utilize a similar source code in various projects. They can be valuable if you have extended information statements that you need to use in various projects.PunctuationIncorporate <include program Name>Focuses to Note

Incorporate projects can't call themselves.

Incorporate projects should contain total proclamations.

PROGRAM ZRPM0001.

Incorporate ZILX0004.

Subroutines

Subroutines are techniques that you can characterize in any ABAP program and furthermore call from any program. Subroutines are regularly called inside, or at least, they contain segments of code or calculations that are utilized much of the time locally. In the event that you maintain that a capability should be reusable all through the framework, utilize a capability module.

Linguistic structure-

Structure <Subroutine> [<pass>].<Articulation block>.

ENDFORM.

<Subroutine> = Name of the subroutine

<pass> = Parameters being passed

Sorts of Subroutines

Inner

Subroutine characterized in same program being called.Can get to every one of the information objects proclaimed in the fundamental ABAP/4 program.Outside

Subroutine characterized external the program being called.Need to utilize the <pass> choice or proclaim information objects in like manner parts of memory.

Calling a Subroutine

Interior Subroutines

PERFORM <subroutine> [<pass>]

<subroutine> = Name of the subroutine

<pass> = Parameters being passed

Information proclaimed in fundamental program is naturally accessible.

Outside Subroutines

PERFORM <subroutine>(<Program>) [<pass>].

PERFORM <subroutine> (<Program>) [<pass>] [IF FOUND].

PERFORM (<subroutine>) IN PROGRAM (<Program>) [<pass>] [IF FOUND].

PERFORM <index> OF <subroutine1> <subroutine2> <subroutine3> [<pass>].

Focuses to Note

Settled calls are permitted in subroutines (for example PERFORM inside a FORM … ENDFORM ).Recursive calls are likewise conceivable.To characterize neighborhood information, utilize the DATA articulation after FORM . Each time you enter the subroutine, the information is reproduced (with an underlying worth) and delivered toward the end (from the stack).To characterize worldwide information utilized inside a subroutine, utilize the LOCAL assertion after FORM . The qualities are saved when you enter the subroutine and afterward delivered toward the end (from the stack)

Capability Modules

Capability Modules are broadly useful ABAP/4 schedules that anybody can utilize. Infact , there are an enormous number of standard capability Modules accessible.Capability Modules are coordinated into Function Groups: Collections of legitimately related capabilities. A Function module generally has a place with a Function Group.PunctuationCapability <function module>

<Statements>

ENDFUNCTION.

Significant data Associated with Function Module

Organization

Import/Changing/Export boundaries.

Table Parameters/Exceptions.

Capability Groups

Capability bunches are holders for capability modules. Infact, there are an enormous number of standard Function Groups.

All of the capability modules in a capability gathering can get to the worldwide information of the gathering.

Like executable projects (type 1) and module pools (type M), capability gatherings can contain screens, choice screens, and records.Focuses to Note

Capability Groups can't be executed.

The name of a capability gathering can really depend on 26 characters in length.

At the point when you make a capability gathering or capability module, the fundamental program and incorporate projects are created consequently.

Capability bunches embody information.

The most effective method to make a Function GroupGoto Transaction SE80.

Select Program in the DropDown.

Compose the name of the Function Group That you need to make. For the most part User made Function bunches start with "Z". for example - <Z_FUNCTION_GROUP_NAME> . Hit Enter Key.Note that The TOP Include is make naturally assuming that the client really takes a look at the choice of making a TOP incorporate.

Instructions to make a Function Module

Characterize interface boundaries and Exceptions

Compose the source code

Initiate Function Module

Testing the Function Module - Single Test and Debugging

Recording and Releasing a Function Module

That is all to Modularity in ABAP.

Tags:

modularization in abapadvantages of modularization in abapmodularization techniques in sap abap interview questionsmodularization techniques in sap abap sapnutsmodularization techniques in sap abap ppttypes of modularization techniques in sap abapdifferent modularization techniques in sap abapmodularization in sap abap examplewhat is modularization in programmingbenefits of modularization in programmingabap exampleswhat are modularization techniques in abapmodularization in abap bookmodularization in abap blogmodularization in abap baeldungmodularization in abap bapmodularization in abap bapimodularization in abap based on radio buttonmodularization in abap businessmodularization in abap biologymodularization in abap boot applicationmodularization in abap codemodularization in abap classmodularization in abap cdsmodularization in abap conceptsmodularization in abap cds viewsmodularization in abap constructionmodularization in abap c programmingmodularization in abap c++modularization in abap cybersecuritymodularization in abap chemical processingmodularization in abap developermodularization in abap dictionarymodularization in abap debuggermodularization in abap designmodularization in abap devopsmodularization in abap definitionmodularization in abap differentmodularization in abap definemodularization in abap formatmodularization in abap fieldmodularization in abap formattermodularization in abap from javamodularization in abap for beginnersmodularization in abap fluttermodularization in abap frenchmodularization in abap githubmodularization in abap guimodularization in abap gurumodularization in abap gcpmodularization in abap gamemodularization in abap get timestampmodularization in abap get current timestampmodularization in abap get timemodularization in abap gas projectsmodularization in abap gas industrymodularization in abap helpmodularization in abap hanamodularization in abap howmodularization in abap hrmodularization in abap hindiwhat is modularization in abapwhat is modularization in sap abapinterview questions on modularization techniques in abapmodularization in abap javamodularization in abap jobsmodularization in abap java examplemodularization in abap jdbcmodularization in abap jobs in usamodularization in abap javascriptmodularization in abap java 9modularization in abap jmetermodularization in abap jsmodularization in abap kotlinmodularization in abap kanbanmodularization in abap kannadamodularization in abap languagemodularization in abap loopmodularization in abap loopbackmodularization in abap meaningmodularization in abap modulemodularization in abap messagemodularization in abap methodmodularization in abap module poolmodularization in abap manufacturingmodularization in abap managementmodularization in abap not workingmodularization in abap new syntaxmodularization in abap newmodularization in abap notemodularization in abap notationmodularization in abap node jsmodularization in abap resumemodularization in abap redditmodularization in abap reportmodularization in abap rest apimodularization in abap reactmodularization in abap rpamodularization in abap r shinymodularization in abap restaurantmodularization in sap abapmodularization techniques in sap abapmodularization techniques in abapwhat are the advantages of modularization in abapmodularization in abap usingmodularization in abap using javamodularization in abap unitmodularization in abap urdumodularization in abap videomodularization in abap visual studiomodularization in abap visualizationmodularization in abap vbusing bapi in abap programmodularization in abap xmlmodularization in abap xssmodularization in abap x86modularization in abap xilinxmodularization in abap youtubemodularization in abap youtube videomodularization in abap z/osmodularization in abap z tablemodularization in abap zapmodularization in abap 0.7modularization in abap 01modularization in abap 0.5modularization in abap 0.4modularization in abap 11modularization in abap 19cmodularization in abap 10modularization in abap 2022