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

Using infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewerUsing infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewerbsm fico
 
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantSAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantAnkit Sharma
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniquesJugul Crasta
 
Table maintenance generator and its modifications
Table maintenance generator and its modificationsTable maintenance generator and its modifications
Table maintenance generator and its modificationsscribid.download
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programsKranthi Kumar
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONKranthi Kumar
 
Abap performance tunning tips
Abap performance tunning tipsAbap performance tunning tips
Abap performance tunning tipsJay Dalwadi
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPNoman Mohamed Hanif
 
0106 debugging
0106 debugging0106 debugging
0106 debuggingvkyecc1
 
HANA WITH ABAP OVERVIEW
HANA WITH ABAP OVERVIEWHANA WITH ABAP OVERVIEW
HANA WITH ABAP OVERVIEWdheerajad
 
Technical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IITechnical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IIAshish Saxena
 
Sap query creation and transport procedure in ecc6
Sap query creation and transport procedure in ecc6Sap query creation and transport procedure in ecc6
Sap query creation and transport procedure in ecc6bluechxi
 
Sap abap interview questions
Sap abap interview questionsSap abap interview questions
Sap abap interview questionskssr99
 
Sap abap real time questions
Sap abap real time questionsSap abap real time questions
Sap abap real time questionstechie_gautam
 

What's hot (20)

Using infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewerUsing infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewer
 
Reports
ReportsReports
Reports
 
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantSAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional Consultant
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniques
 
Table maintenance generator and its modifications
Table maintenance generator and its modificationsTable maintenance generator and its modifications
Table maintenance generator and its modifications
 
Badis
Badis Badis
Badis
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programs
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATION
 
Abap performance tunning tips
Abap performance tunning tipsAbap performance tunning tips
Abap performance tunning tips
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
0106 debugging
0106 debugging0106 debugging
0106 debugging
 
Badi document
Badi documentBadi document
Badi document
 
HANA WITH ABAP OVERVIEW
HANA WITH ABAP OVERVIEWHANA WITH ABAP OVERVIEW
HANA WITH ABAP OVERVIEW
 
Technical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IITechnical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part II
 
Sap query creation and transport procedure in ecc6
Sap query creation and transport procedure in ecc6Sap query creation and transport procedure in ecc6
Sap query creation and transport procedure in ecc6
 
Basic Debugging
Basic DebuggingBasic Debugging
Basic Debugging
 
Sap abap interview questions
Sap abap interview questionsSap abap interview questions
Sap abap interview questions
 
Alv theory
Alv theoryAlv theory
Alv theory
 
ABAP Advanced List
ABAP Advanced ListABAP Advanced List
ABAP Advanced List
 
Sap abap real time questions
Sap abap real time questionsSap abap real time questions
Sap abap real time questions
 

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

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

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