SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Lecture 11 Subroutines & Function Modules BCO5647 Applications Programming Techniques (ABAP)
Readings & Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Modularisation Techniques ,[object Object],[object Object],[object Object],[object Object],[object Object]
Internal Subroutines (“Forms”) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Global and Local Data ,[object Object],[object Object]
Passing Parameters ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Passing Parameters - Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Calling by Value and by Reference ,[object Object],[object Object],[object Object]
External Subroutines ,[object Object],[object Object],[object Object],[object Object]
Function  M odules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Searching for a Function Module ,[object Object],[object Object],[object Object],[object Object],Click Matchcode Button
Displaying a Function Module ,[object Object],[object Object],[object Object],[object Object]
Displaying a Function Module ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Calling a Function Module ,[object Object],[object Object]
Calling a Function Module
Calling a Function Module

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

User Defined Functions in C
User Defined Functions in CUser Defined Functions in C
User Defined Functions in C
 
Sap scripts
Sap scriptsSap scripts
Sap scripts
 
DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)
 
user defined function
user defined functionuser defined function
user defined function
 
Functions
FunctionsFunctions
Functions
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 
structure of a c program
structure of a c programstructure of a c program
structure of a c program
 
Abap package concept
Abap package conceptAbap package concept
Abap package concept
 
Functions in C - Programming
Functions in C - Programming Functions in C - Programming
Functions in C - Programming
 
Function
Function Function
Function
 
Sap Abap Reports
Sap Abap ReportsSap Abap Reports
Sap Abap Reports
 
INTRODUCTION TO C PROGRAMMING - PART 2
INTRODUCTION TO C PROGRAMMING - PART 2INTRODUCTION TO C PROGRAMMING - PART 2
INTRODUCTION TO C PROGRAMMING - PART 2
 
Abap course chapter 7 abap objects and bsp
Abap course   chapter 7 abap objects and bspAbap course   chapter 7 abap objects and bsp
Abap course chapter 7 abap objects and bsp
 
User defined functions
User defined functionsUser defined functions
User defined functions
 
Built in function
Built in functionBuilt in function
Built in function
 
Programming style guideline very good
Programming style guideline very goodProgramming style guideline very good
Programming style guideline very good
 
Ms vb
Ms vbMs vb
Ms vb
 
Procedure n functions
Procedure n functionsProcedure n functions
Procedure n functions
 
Notes part5
Notes part5Notes part5
Notes part5
 
Chap 2 structure of c programming dti2143
Chap 2  structure of c programming dti2143Chap 2  structure of c programming dti2143
Chap 2 structure of c programming dti2143
 

Ähnlich wie Lecture11 abap on line

Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programmingnmahi96
 
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...marco_paradiso
 
Abap function module help
Abap function module helpAbap function module help
Abap function module helpKranthi Kumar
 
Fnctions part2
Fnctions part2Fnctions part2
Fnctions part2yndaravind
 
Functions part1
Functions part1Functions part1
Functions part1yndaravind
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptxmiki304759
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignmentAhmad Kamal
 
AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1guest38bf
 
Functions and modular programming.pptx
Functions and modular programming.pptxFunctions and modular programming.pptx
Functions and modular programming.pptxzueZ3
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfSowmyaJyothi3
 

Ähnlich wie Lecture11 abap on line (20)

Unit 2
Unit 2Unit 2
Unit 2
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
 
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...
 
Abap function module help
Abap function module helpAbap function module help
Abap function module help
 
Fnctions part2
Fnctions part2Fnctions part2
Fnctions part2
 
Functions part1
Functions part1Functions part1
Functions part1
 
FUNCTION CPU
FUNCTION CPUFUNCTION CPU
FUNCTION CPU
 
PSPC-UNIT-4.pdf
PSPC-UNIT-4.pdfPSPC-UNIT-4.pdf
PSPC-UNIT-4.pdf
 
Ch07.pdf
Ch07.pdfCh07.pdf
Ch07.pdf
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptx
 
User defined functions in matlab
User defined functions in  matlabUser defined functions in  matlab
User defined functions in matlab
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignment
 
AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1
 
Functions and modular programming.pptx
Functions and modular programming.pptxFunctions and modular programming.pptx
Functions and modular programming.pptx
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
 
cp Module4(1)
cp Module4(1)cp Module4(1)
cp Module4(1)
 
Chapter - 4.pptx
Chapter - 4.pptxChapter - 4.pptx
Chapter - 4.pptx
 
Lecture 11 - Functions
Lecture 11 - FunctionsLecture 11 - Functions
Lecture 11 - Functions
 
C functions list
C functions listC functions list
C functions list
 
Ch4 functions
Ch4 functionsCh4 functions
Ch4 functions
 

Mehr von Milind Patil

Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesMilind Patil
 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lovMilind Patil
 
Step bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationStep bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationMilind Patil
 
Step bystep abap_field help or documentation
Step bystep abap_field help or documentationStep bystep abap_field help or documentation
Step bystep abap_field help or documentationMilind Patil
 
Abap slides user defined data types and data
Abap slides user defined data types and dataAbap slides user defined data types and data
Abap slides user defined data types and dataMilind Patil
 
Abap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checksAbap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checksMilind Patil
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordMilind Patil
 
Abap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksAbap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksMilind Patil
 
Abap slide exceptionshandling
Abap slide exceptionshandlingAbap slide exceptionshandling
Abap slide exceptionshandlingMilind Patil
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordMilind Patil
 
Lecture16 abap on line
Lecture16 abap on lineLecture16 abap on line
Lecture16 abap on lineMilind Patil
 
Lecture14 abap on line
Lecture14 abap on lineLecture14 abap on line
Lecture14 abap on lineMilind Patil
 
Lecture13 abap on line
Lecture13 abap on lineLecture13 abap on line
Lecture13 abap on lineMilind Patil
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on lineMilind Patil
 
Lecture10 abap on line
Lecture10 abap on lineLecture10 abap on line
Lecture10 abap on lineMilind Patil
 
Lecture09 abap on line
Lecture09 abap on lineLecture09 abap on line
Lecture09 abap on lineMilind Patil
 
Lecture08 abap on line
Lecture08 abap on lineLecture08 abap on line
Lecture08 abap on lineMilind Patil
 

Mehr von Milind Patil (20)

Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfiles
 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lov
 
Step bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationStep bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentation
 
Step bystep abap_field help or documentation
Step bystep abap_field help or documentationStep bystep abap_field help or documentation
Step bystep abap_field help or documentation
 
Abap slides user defined data types and data
Abap slides user defined data types and dataAbap slides user defined data types and data
Abap slides user defined data types and data
 
Abap slides set1
Abap slides set1Abap slides set1
Abap slides set1
 
Abap slide class3
Abap slide class3Abap slide class3
Abap slide class3
 
Abap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checksAbap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checks
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecord
 
Abap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksAbap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecks
 
Abap slide exceptionshandling
Abap slide exceptionshandlingAbap slide exceptionshandling
Abap slide exceptionshandling
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecord
 
Abap reports
Abap reportsAbap reports
Abap reports
 
Lecture16 abap on line
Lecture16 abap on lineLecture16 abap on line
Lecture16 abap on line
 
Lecture14 abap on line
Lecture14 abap on lineLecture14 abap on line
Lecture14 abap on line
 
Lecture13 abap on line
Lecture13 abap on lineLecture13 abap on line
Lecture13 abap on line
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on line
 
Lecture10 abap on line
Lecture10 abap on lineLecture10 abap on line
Lecture10 abap on line
 
Lecture09 abap on line
Lecture09 abap on lineLecture09 abap on line
Lecture09 abap on line
 
Lecture08 abap on line
Lecture08 abap on lineLecture08 abap on line
Lecture08 abap on line
 

Kürzlich hochgeladen

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Kürzlich hochgeladen (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Lecture11 abap on line

Hinweis der Redaktion

  1. Advantages : Because the external subroutines and function modules are self-contained, they can be debugged independently of each other. Changes only have to be made in the one program - all other programs that call that subroutine or function module will be affected by the change. The overall complexity of the program is reduced.
  2. When the perform command is executed, all statements between the form and endform are processed. Data defined in the ‘main’ program is global and can be used and changed in the subroutine. Double-Click on the subroutine name in the perform statement to create the subroutine at the bottom of the program code with documentation .
  3. The output from the above program would be 1 2 1. Where possible, local data should be used in a subroutine. The contents of a local data object can be retained from one call of the subroutine to the next by using static variables. Example : perform count. perform count. ….. form count. statics calls type i. calls = calls + 1. write calls. endform. … will produce the output 1 2.
  4. This is the preferred method for passing data to a subroutine. Internal tables are always global.
  5. The result from the first call : answer = 6. The result from the second call : answer = 3. The parameter names in the PERFORM statement are called ACTUAL PARAMETERS. The parameter names in the FORM statement are called FORMAL PARAMETERS. The above example passes parameters by reference. The next slide explains this.
  6. Parameters can be called either by reference or by value. Calling by reference: The address of the actual parameter is called. Within the subroutine, the variable is addressed using the formal parameter name and changes have an immediate. If only the formal parameter name is specified in the subroutine interface, then the parameter is called by reference. Calling by value: When the subroutine is called the actual parameter value is copied to the formal parameter. There are two types of call by value: Calling by value: the formal parameter is listed in the interface after the USING clause with the addition VALUE( <parameter name> ) . When the subroutine is called, the actual parameter is copied to the formal parameter. Changes made to the formal parameter only affect the local copy, not the actual parameter. Calling by value and result: the formal parameter is listed in the interface after the CHANGING clause with the addition VALUE( <parameter name> ) . When the subroutine is called, the actual parameter is copied to the formal parameter. Changes made to the formal parameter initially only affect the local copy. When the ENDFORM statement is reached, the formal parameter value is copied back to the actual parameter.
  7. All rules re passing of data as for internal subroutines, except that using parameters is the only way of passing data. (Global data in the calling program may not be referenced in the called subroutine.) SAP do not recommend using External Subroutines.
  8. Examples of Function Modules : Calculates whether a date falls on a Sunday. Rounding a number with decimals to 2 places. Function modules possess a clearly defined fixed interface for data exchange. This makes it easier for you to pass input and output parameters to and from the function module. The function module interface supports exception handling. This allows you to catch errors and pass them back to the calling program for handling. Function modules use their own memory area. The calling program and the function module cannot exchange data using a shared memory area - they must use the function module interface. This avoids unpleasant side effects such as accidentally overwriting data. How many function modules are supplied with SAP? In release 3.1, more than 43,000 function modules are available. In rel 4.5 more than 80,000 function modules are available. (4.6B > 98,000; Enterprise > 170,000) The are many thousands of function groups which contain function modules.
  9. Hint: Add Function Builder to Favorites Information system allows you to search for function modules using search criteria of function name, short description and/or function group. SAP Applications allows you to list function modules associated with application components such as FI, SD, MM.
  10. NOTES: Changing parameters appears to be new in ver 4.0 or greater Documentation can be found in the Goto pull-down menu.
  11. {Pattern} button will display Insert Statement dialog. Enter or search for required function and click Continue to insert function into ABAP Editor. Ctrl-F6 shortcut to produce Insert Statement dialog.
  12. Once the function module template is inserted, it is up to the programmer to fill it in. Note the use of ‘X’ for export SIGN variable. This comes from the function’s documentation where the code “X” indicates commercial rounding. The use of the MESSAGE Statement with system message codes allows the function to handle error processing and produce appropriate error messages. IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. You can choose to handle errors yourself and define your own error messages by replacing the above code with something like: CASE SY-SUBRC. WHEN 0. write: inputnum, ' commercially rounded = ', rounded. WHEN 1. write 'Input Invalid'. WHEN 2. write 'Overflow Error'. WHEN 3. write 'Output Field type Invalid'. WHEN 4. write 'Unknown Error'. ENDCASE.