SlideShare a Scribd company logo
1 of 2
Download to read offline
2/26/2014 Example of passing internal tables to an subroutine - Code Gallery- SCN Wiki
http://wiki.scn.sap.com/wiki/display/Snippets/Example+of+passing+internal+tables+to+an+subroutine 1/2
Getting Started Newsletters Store
Search the CommunityWelcome, Guest Login Register
Products Services & Support About SCN Downloads
Industries Training & Education Partnership Developer Center
Lines of Business University Alliances Events & Webinars Innovation
Added by ravi r, last edited by Manish Kumar on Sep 06, 2013
Code Gallery
Example of passing internal tables to an subroutine
Submitted by: Ravi r
April 30, 2007
Here is an siple program on how to pass an internal table to an sunbroutine
1)
The produces the follow ing output:
1 1
2 4
3 9
You can define the types of the formal parameters of the parameter interfaces of procedures as internal tables. In the example, the subroutines FILL and OUT each have one formal parameter defined as an
internal table. An internal table w ithout header line is passed to the subroutines. Each subroutine declares a w ork area F_LINE as a local data object. Were ITAB a table w ith a header line, you w ould have to
replace ITAB w ith ITAB[] in the PERFORM and FORM statements.
2)
This example is provided for completeness. The TABLES parameter is only supported for the sake of compatibility and should not be used.
PROGRAMform_test.
DATA:BEGINOFline,
col1TYPEi,
col2TYPEi,
ENDOFline.
DATAitabLIKESTANDARDTABLEOFline.
PERFORMfillCHANGINGitab.
PERFORMoutUSINGitab.
*&---------------------------------------------------------------------*
*& Form FILL
*&---------------------------------------------------------------------*
FORMfillCHANGINGf_itabLIKEitab.
DATAf_lineLIKELINEOFf_itab.
DO3TIMES.
f_line-col1=sy-index.
f_line-col2=sy-index**2.
APPENDf_lineTOf_itab.
ENDDO.
ENDFORM. "FILL
*&---------------------------------------------------------------------*
*& Form OUT
*&---------------------------------------------------------------------*
FORMoutUSINGvalue(f_itab)LIKEitab.
DATAf_lineLIKELINEOFf_itab.
LOOPATf_itabINTOf_line.
WRITE:/f_line-col1,f_line-col2.
ENDLOOP.
ENDFORM. "OUT
PROGRAMform_test.
TYPES:BEGINOFline,
col1TYPEi,
col2TYPEi,
ENDOFline.
DATA:itabTYPESTANDARDTABLEOFlineWITHHEADERLINE,
jtabTYPESTANDARDTABLEOFline.
PERFORMfillTABLESitab.
MOVEitab[]TOjtab.
PERFORMoutTABLESjtab.
2/26/2014 Example of passing internal tables to an subroutine - Code Gallery- SCN Wiki
http://wiki.scn.sap.com/wiki/display/Snippets/Example+of+passing+internal+tables+to+an+subroutine 2/2
The produces the follow ing output:
1 1
2 4
3 9
In this example, an internal table ITAB is declared w ith a header line and an internal table JTAB is declared w ithout a header line. The actual parameter ITAB is passed to the formal parameter F_ITAB of the
subroutine FILL in the TABLES addition. The header line is passed w ith it. After the body of the table has been copied from ITAB to JTAB, the actual parameter is passed to the formal parameter F_ITAB of
the subroutine OUT using the TABLES addition. The header line F_ITAB, w hich is not passed, is generated automatically in the subroutine.
*&---------------------------------------------------------------------*
*& Form FILL
*&---------------------------------------------------------------------*
FORMfillTABLESf_itabLIKEitab[].
DO3TIMES.
f_itab-col1=sy-index.
f_itab-col2=sy-index**2.
APPENDf_itab.
ENDDO.
ENDFORM. "FILL
*&---------------------------------------------------------------------*
*& Form OUT
*&---------------------------------------------------------------------*
FORMoutTABLESf_itabLIKEjtab.
LOOPATf_itab.
WRITE:/f_itab-col1,f_itab-col2.
ENDLOOP.
ENDFORM. "OUT
snippet
Follow SCN
Contact Us SAP Help Portal
Privacy Terms of Use Legal Disclosure Copyright

More Related Content

What's hot

Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programsKranthi Kumar
 
Adding custom fields to the fi report fbl5 n using bt es
Adding custom fields to the fi report fbl5 n using bt esAdding custom fields to the fi report fbl5 n using bt es
Adding custom fields to the fi report fbl5 n using bt esKranthi Kumar
 
Sap ecatt - mass data uploading
Sap ecatt -  mass data uploadingSap ecatt -  mass data uploading
Sap ecatt - mass data uploadingCapgemini
 
Tier Validation Workflows
Tier Validation WorkflowsTier Validation Workflows
Tier Validation WorkflowsOdoo
 
Fast formula queries for functions, contexts, db is and packages
Fast formula queries for functions, contexts, db is and packagesFast formula queries for functions, contexts, db is and packages
Fast formula queries for functions, contexts, db is and packagesFeras Ahmad
 
Oracle Concurrent Program Setup document
Oracle Concurrent Program Setup  documentOracle Concurrent Program Setup  document
Oracle Concurrent Program Setup documentvenkatesh gurusamy
 
Pmcs user exits
Pmcs user exitsPmcs user exits
Pmcs user exitsJohn Peter
 
Authorisation Concept In SAP | http://sapdocs.info
Authorisation Concept In SAP | http://sapdocs.infoAuthorisation Concept In SAP | http://sapdocs.info
Authorisation Concept In SAP | http://sapdocs.infosapdocs. info
 
Variant Configurition in SAP: Beginners Guide | www.sapdocs.info
Variant Configurition in SAP: Beginners Guide | www.sapdocs.infoVariant Configurition in SAP: Beginners Guide | www.sapdocs.info
Variant Configurition in SAP: Beginners Guide | www.sapdocs.infosapdocs. info
 
Fico interview questions and answers
Fico interview questions and answersFico interview questions and answers
Fico interview questions and answersProcessweaver Hr
 
Lsmw step by- step
Lsmw step  by- stepLsmw step  by- step
Lsmw step by- stepCapgemini
 
Oracle Purchasing Internal Requisition
Oracle Purchasing Internal RequisitionOracle Purchasing Internal Requisition
Oracle Purchasing Internal RequisitionAhmed Elshayeb
 
Copa planning star3
Copa planning star3Copa planning star3
Copa planning star3EY
 
Drop Ship Sales Order Across Operating Units
Drop Ship Sales Order Across Operating UnitsDrop Ship Sales Order Across Operating Units
Drop Ship Sales Order Across Operating UnitsBizinsight Consulting Inc
 
Controlling management
Controlling managementControlling management
Controlling managementbadityaa
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniquesJugul Crasta
 

What's hot (20)

Badi document
Badi documentBadi document
Badi document
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programs
 
Adding custom fields to the fi report fbl5 n using bt es
Adding custom fields to the fi report fbl5 n using bt esAdding custom fields to the fi report fbl5 n using bt es
Adding custom fields to the fi report fbl5 n using bt es
 
Sap ecatt - mass data uploading
Sap ecatt -  mass data uploadingSap ecatt -  mass data uploading
Sap ecatt - mass data uploading
 
Tier Validation Workflows
Tier Validation WorkflowsTier Validation Workflows
Tier Validation Workflows
 
Fast formula queries for functions, contexts, db is and packages
Fast formula queries for functions, contexts, db is and packagesFast formula queries for functions, contexts, db is and packages
Fast formula queries for functions, contexts, db is and packages
 
Oracle Concurrent Program Setup document
Oracle Concurrent Program Setup  documentOracle Concurrent Program Setup  document
Oracle Concurrent Program Setup document
 
Pmcs user exits
Pmcs user exitsPmcs user exits
Pmcs user exits
 
Authorisation Concept In SAP | http://sapdocs.info
Authorisation Concept In SAP | http://sapdocs.infoAuthorisation Concept In SAP | http://sapdocs.info
Authorisation Concept In SAP | http://sapdocs.info
 
Variant Configurition in SAP: Beginners Guide | www.sapdocs.info
Variant Configurition in SAP: Beginners Guide | www.sapdocs.infoVariant Configurition in SAP: Beginners Guide | www.sapdocs.info
Variant Configurition in SAP: Beginners Guide | www.sapdocs.info
 
Fico interview questions and answers
Fico interview questions and answersFico interview questions and answers
Fico interview questions and answers
 
Lsmw step by- step
Lsmw step  by- stepLsmw step  by- step
Lsmw step by- step
 
Oracle Purchasing Internal Requisition
Oracle Purchasing Internal RequisitionOracle Purchasing Internal Requisition
Oracle Purchasing Internal Requisition
 
Customizing Oracle EBS OA Framework
Customizing Oracle EBS OA FrameworkCustomizing Oracle EBS OA Framework
Customizing Oracle EBS OA Framework
 
Copa planning star3
Copa planning star3Copa planning star3
Copa planning star3
 
Drop Ship Sales Order Across Operating Units
Drop Ship Sales Order Across Operating UnitsDrop Ship Sales Order Across Operating Units
Drop Ship Sales Order Across Operating Units
 
Bapi step-by-step
Bapi step-by-stepBapi step-by-step
Bapi step-by-step
 
07.Advanced Abap
07.Advanced Abap07.Advanced Abap
07.Advanced Abap
 
Controlling management
Controlling managementControlling management
Controlling management
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniques
 

Similar to Passing table to subroutine

modularization-160202092213 (1).pdf
modularization-160202092213 (1).pdfmodularization-160202092213 (1).pdf
modularization-160202092213 (1).pdfSreeramBaddila
 
Sydney Oracle Meetup - access paths
Sydney Oracle Meetup - access pathsSydney Oracle Meetup - access paths
Sydney Oracle Meetup - access pathspaulguerin
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ICarlos Oliveira
 
Pos 355 Enhance teaching / snaptutorial.com
Pos 355  Enhance teaching / snaptutorial.comPos 355  Enhance teaching / snaptutorial.com
Pos 355 Enhance teaching / snaptutorial.comHarrisGeorg62
 
Vb6 ch.6-3 cci
Vb6 ch.6-3 cciVb6 ch.6-3 cci
Vb6 ch.6-3 cciFahim Khan
 
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...IBMSystemzEvents
 
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfSAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfKoushikGuna
 
ORACLE APPS TECHNICAL ONLINE TRAINING
ORACLE APPS TECHNICAL ONLINE TRAININGORACLE APPS TECHNICAL ONLINE TRAINING
ORACLE APPS TECHNICAL ONLINE TRAININGTRAINING ICON
 
Automate sap security user audit
Automate sap security user auditAutomate sap security user audit
Automate sap security user auditSatyajit Deb
 
325546_adding fields in CJI3 & CJI5.pdf
325546_adding fields in CJI3 & CJI5.pdf325546_adding fields in CJI3 & CJI5.pdf
325546_adding fields in CJI3 & CJI5.pdfVaishali Ketkar
 
Introduction to Parallel Execution
Introduction to Parallel ExecutionIntroduction to Parallel Execution
Introduction to Parallel ExecutionDoug Burns
 
Lead time reduction in CAE: Automated FEM Description Report
Lead time reduction in CAE:  Automated  FEM Description ReportLead time reduction in CAE:  Automated  FEM Description Report
Lead time reduction in CAE: Automated FEM Description ReportAltair
 
Final Project Presentation
Final Project PresentationFinal Project Presentation
Final Project Presentationzroserie
 
Introduction to Performance Analysis tools on Shaheen II
Introduction to Performance Analysis tools on Shaheen IIIntroduction to Performance Analysis tools on Shaheen II
Introduction to Performance Analysis tools on Shaheen IIGeorge Markomanolis
 
PIDtuningsoftwareApracticalreview.pdf
PIDtuningsoftwareApracticalreview.pdfPIDtuningsoftwareApracticalreview.pdf
PIDtuningsoftwareApracticalreview.pdfAbdulSalamSagir1
 
Using HP TEST EXEC SL
Using HP TEST EXEC SLUsing HP TEST EXEC SL
Using HP TEST EXEC SLInterlatin
 

Similar to Passing table to subroutine (20)

modularization-160202092213 (1).pdf
modularization-160202092213 (1).pdfmodularization-160202092213 (1).pdf
modularization-160202092213 (1).pdf
 
Do You Know The 11g Plan?
Do You Know The 11g Plan?Do You Know The 11g Plan?
Do You Know The 11g Plan?
 
Sydney Oracle Meetup - access paths
Sydney Oracle Meetup - access pathsSydney Oracle Meetup - access paths
Sydney Oracle Meetup - access paths
 
Copa implementation
Copa implementationCopa implementation
Copa implementation
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
 
Pos 355 Enhance teaching / snaptutorial.com
Pos 355  Enhance teaching / snaptutorial.comPos 355  Enhance teaching / snaptutorial.com
Pos 355 Enhance teaching / snaptutorial.com
 
Vb6 ch.6-3 cci
Vb6 ch.6-3 cciVb6 ch.6-3 cci
Vb6 ch.6-3 cci
 
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
 
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfSAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdf
 
ORACLE APPS TECHNICAL ONLINE TRAINING
ORACLE APPS TECHNICAL ONLINE TRAININGORACLE APPS TECHNICAL ONLINE TRAINING
ORACLE APPS TECHNICAL ONLINE TRAINING
 
Automate sap security user audit
Automate sap security user auditAutomate sap security user audit
Automate sap security user audit
 
325546_adding fields in CJI3 & CJI5.pdf
325546_adding fields in CJI3 & CJI5.pdf325546_adding fields in CJI3 & CJI5.pdf
325546_adding fields in CJI3 & CJI5.pdf
 
Introduction to Parallel Execution
Introduction to Parallel ExecutionIntroduction to Parallel Execution
Introduction to Parallel Execution
 
Lead time reduction in CAE: Automated FEM Description Report
Lead time reduction in CAE:  Automated  FEM Description ReportLead time reduction in CAE:  Automated  FEM Description Report
Lead time reduction in CAE: Automated FEM Description Report
 
Final Project Presentation
Final Project PresentationFinal Project Presentation
Final Project Presentation
 
Introduction to Performance Analysis tools on Shaheen II
Introduction to Performance Analysis tools on Shaheen IIIntroduction to Performance Analysis tools on Shaheen II
Introduction to Performance Analysis tools on Shaheen II
 
PIDtuningsoftwareApracticalreview.pdf
PIDtuningsoftwareApracticalreview.pdfPIDtuningsoftwareApracticalreview.pdf
PIDtuningsoftwareApracticalreview.pdf
 
Using HP TEST EXEC SL
Using HP TEST EXEC SLUsing HP TEST EXEC SL
Using HP TEST EXEC SL
 
sap
sap sap
sap
 
Achievement Archive
Achievement ArchiveAchievement Archive
Achievement Archive
 

Recently uploaded

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

Passing table to subroutine

  • 1. 2/26/2014 Example of passing internal tables to an subroutine - Code Gallery- SCN Wiki http://wiki.scn.sap.com/wiki/display/Snippets/Example+of+passing+internal+tables+to+an+subroutine 1/2 Getting Started Newsletters Store Search the CommunityWelcome, Guest Login Register Products Services & Support About SCN Downloads Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation Added by ravi r, last edited by Manish Kumar on Sep 06, 2013 Code Gallery Example of passing internal tables to an subroutine Submitted by: Ravi r April 30, 2007 Here is an siple program on how to pass an internal table to an sunbroutine 1) The produces the follow ing output: 1 1 2 4 3 9 You can define the types of the formal parameters of the parameter interfaces of procedures as internal tables. In the example, the subroutines FILL and OUT each have one formal parameter defined as an internal table. An internal table w ithout header line is passed to the subroutines. Each subroutine declares a w ork area F_LINE as a local data object. Were ITAB a table w ith a header line, you w ould have to replace ITAB w ith ITAB[] in the PERFORM and FORM statements. 2) This example is provided for completeness. The TABLES parameter is only supported for the sake of compatibility and should not be used. PROGRAMform_test. DATA:BEGINOFline, col1TYPEi, col2TYPEi, ENDOFline. DATAitabLIKESTANDARDTABLEOFline. PERFORMfillCHANGINGitab. PERFORMoutUSINGitab. *&---------------------------------------------------------------------* *& Form FILL *&---------------------------------------------------------------------* FORMfillCHANGINGf_itabLIKEitab. DATAf_lineLIKELINEOFf_itab. DO3TIMES. f_line-col1=sy-index. f_line-col2=sy-index**2. APPENDf_lineTOf_itab. ENDDO. ENDFORM. "FILL *&---------------------------------------------------------------------* *& Form OUT *&---------------------------------------------------------------------* FORMoutUSINGvalue(f_itab)LIKEitab. DATAf_lineLIKELINEOFf_itab. LOOPATf_itabINTOf_line. WRITE:/f_line-col1,f_line-col2. ENDLOOP. ENDFORM. "OUT PROGRAMform_test. TYPES:BEGINOFline, col1TYPEi, col2TYPEi, ENDOFline. DATA:itabTYPESTANDARDTABLEOFlineWITHHEADERLINE, jtabTYPESTANDARDTABLEOFline. PERFORMfillTABLESitab. MOVEitab[]TOjtab. PERFORMoutTABLESjtab.
  • 2. 2/26/2014 Example of passing internal tables to an subroutine - Code Gallery- SCN Wiki http://wiki.scn.sap.com/wiki/display/Snippets/Example+of+passing+internal+tables+to+an+subroutine 2/2 The produces the follow ing output: 1 1 2 4 3 9 In this example, an internal table ITAB is declared w ith a header line and an internal table JTAB is declared w ithout a header line. The actual parameter ITAB is passed to the formal parameter F_ITAB of the subroutine FILL in the TABLES addition. The header line is passed w ith it. After the body of the table has been copied from ITAB to JTAB, the actual parameter is passed to the formal parameter F_ITAB of the subroutine OUT using the TABLES addition. The header line F_ITAB, w hich is not passed, is generated automatically in the subroutine. *&---------------------------------------------------------------------* *& Form FILL *&---------------------------------------------------------------------* FORMfillTABLESf_itabLIKEitab[]. DO3TIMES. f_itab-col1=sy-index. f_itab-col2=sy-index**2. APPENDf_itab. ENDDO. ENDFORM. "FILL *&---------------------------------------------------------------------* *& Form OUT *&---------------------------------------------------------------------* FORMoutTABLESf_itabLIKEjtab. LOOPATf_itab. WRITE:/f_itab-col1,f_itab-col2. ENDLOOP. ENDFORM. "OUT snippet Follow SCN Contact Us SAP Help Portal Privacy Terms of Use Legal Disclosure Copyright