ABAPRonWatkins - Internal Tables SQL Debugging ABAP Ron to...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style 4/6/11 Internal Tables, SQL, & Debugging ABAP Ron Watkins Consulting Applications Engineer Steelcase, Inc 03/15/2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/6/11 Internal Tables Internal Tables are used to capture data during the processing of an ABAP program. Like a spreadsheet (columns/rows) of data Similar to “Array” in other languages.
Background image of page 2
4/6/11 Internal Tables Class Code Description Credit Hours Professor MGT331 Concepts of Mgmt 3 Smith MGT366 Operations Mgmt 3 Klein MGT438 Business Ethics 4 Jones MGT495 Admin Policy 3 Smith An ABAP program that was pulling data on Management Classes at Grand Valley might have an internal table with data like this. IT_CLASSES
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/6/11 Syntax for Creating Internal Tables There are a couple different ways to create an Internal Table in ABAP o Local Type Definition o In reference to a Data Dictionary Table
Background image of page 4
4/6/11 Local Type Definition TYPES: BEGIN OF ty_classes , classCode(6) TYPE C, classDesc(30) TYPE C, classCredit TYPE I, classProf(10) TYPE C, END OF ty_classes. RESULT : The DATA statement above would create an internal table similar to the Management Classes example a few slides back.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/6/11 Reference to Data Dictionary Table DATA: it_classes TYPE TABLE OF RESULT : The DATA statement above would create an internal table with all of the fields in the Data Dictionary for the VBAK table. This is the easiest way to quickly create an internal table, but can also be overkill if you don’t really need all of the fields.
Background image of page 6
4/6/11 Work Areas classCode classDesc classCredit classProf MGT331 Concepts of Mgmt 3 Smith MGT366 Operations Mgmt 3 Klein MGT438 Business Ethics 4 Jones MGT495 Admin Policy 3 Smith IT_CLASSES <- Internal Table A single row of the exact same field structure (same columns / field names) as an internal table. Used to read, update, and delete data from an internal table. classCode classDesc classCredit classProf WA_CLASSES <- Work Area for IT_CLASSES Internal Table
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/6/11 Syntax for creating a Work Area DATA: it_classes TYPE TABLE OF ty_classes . DATA: wa_classes LIKE LINE OF
Background image of page 8
4/6/11 Reading Data into a Work Area SCENARIO: Your program needs to locate a class taught by Professor Klein. classCode classDesc classCredit classProf MGT331 Concepts of Mgmt 3 Smith MGT366 Operations Mgmt 3 Klein MGT438 Business Ethics 4 Jones MGT495 Admin Policy 3 Smith IT_CLASSES <- Internal Table classCode classDesc classCredit classProf WA_CLASSES <- Work Area for IT_CLASSES Internal Table
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/6/11 Syntax for Reading Data into a Work Area READ TABLE it_classes INTO wa_classes WITH KEY classProf = ‘KLEIN’. classCode classDesc classCredit classProf MGT331 Concepts of Mgmt 3 Smith MGT366 Operations Mgmt 3 Klein MGT438 Business Ethics 4 Jones MGT495 Admin Policy 3 Smith IT_CLASSES classCode classDesc classCredit classProf MGT366 Operations Mgmt 3 Klein WA_CLASSES
Background image of page 10
4/6/11 Looping through an Internal Table SCENARIO: Your program needs to loop through all the class records.
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/05/2011 for the course MGT 475 taught by Professor Klein during the Winter '11 term at Grand Valley State.

Page1 / 41

ABAPRonWatkins - Internal Tables SQL Debugging ABAP Ron to...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online