Sie sind auf Seite 1von 34

FastTrack

FastTrack ons,ERP Solutions, Inc.

ABAP Debugger and SAP Query

6/2/20
Agenda
• ABAP Debugger – 1 hour
• Definition
• Types of ABAP Debugger
• Ways to start ABAP Debugger
• How to Debug an ABAP Program
• How to determine variables, structures and internal tables
• Demo
• Exercise and Q&A

• SAP Query – 2 hours


• Definition, Steps
• User Group (SQ03)
• Infosets (SQ02)
• Query (SQ01)
• How to attach a transaction code
• Demo
• Exercise and Q&A

Slide 2
ABAP Debugger
ABAP Debugger
• The Debugger is a programming tool that you can use to execute ABAP programs, by
line or by section. With this tool, you can display data objects and check the flow logic of
ABAP programs.

• Two (2) types of ABAP Debugger:


• Classic ABAP Debugger – earlier release up to 6.40
• New ABAP Debugger – after 6.40 release

• How to change/switch ABAP Debugger (Classic <-> New):


• From ABAP Editor menu, go to Utilities > Settings
• ABAP Editor > Debugging Tab > ABAP Debugger

Slide 4
ABAP Debugger

• What’s the difference between Classic and New ABAP Debugger?


• Classic ABAP Debugger – earlier release up to 6.40

WBS CODE Slide 5


ABAP Debugger

• New ABAP Debugger – after 6.40 release

WBS CODE Slide 6


ABAP Debugger

• Ways to start ABAP Debugger:


• From the ABAP Editor (SE38) - Start programs in DEBUG mode

• Inside ABAP program - Set break points in line of source code

Slide 7
ABAP Debugger

• Ways to start ABAP Debugger:


• In Command Field - Put /H or /h

• Inside debugger - Set a break point in source code line during


debug mode

Slide 8
ABAP Debugger

• How to debug an ABAP program?


• Single Step (F5)
• Debugger will stop at every line of source code
• Execute (F6)
• Debugger will stop at main line of source code
• Return (F7)
• Inside a subroutine, Debugger will go return to main line of source
code
• Continue (F8)
• Debugger will stop at a break point. If none, debugger will proceed to
output

• Create Watch-Point (Shift + F4)


• You can create watch points (set a condition) and will break-point at a
certain value. This is great for debugging internal tables (huge data).

WBS CODE Slide 9


ABAP Debugger

• How to create a watch point? (in debugger mode only)

WBS CODE Slide 10


ABAP Debugger

• How to determine variables, structures and internal tables?


• Declaration – DATA
• Example:
• DATA gc_bukrs TYPE bukrs. “ variable
• DATA gs_vbrk TYPE vbrk. “ structure
• DATA gt_bkpf TYPE tt_bkpf. “ internal table
• DATA lt_bseg TYPE tt_bseg. “ internal table
• Field-Symbols – FIELD-SYMBOL
• Example: <var1> TYPE any. “ field symbol
• Double click variable in the ABAP program to know its value

WBS CODE Slide 11


ABAP Debugger

• SELECT
• Examples:
SELECT fields
INTO TABLE [internal table]
FROM [table]
WHERE [conditions]

• LOOP
• Examples:
LOOP AT [internal table] INTO [structure].
“ abap statements
ENDLOOP.

LOOP AT [internal table] ASSIGNING FIELD-SYMBOL(<fs>).


“abap statements
ENDLOOP.

WBS CODE Slide 12


ABAP Debugger

• Demo

WBS CODE Slide 13


ABAP Debugger

• Exercise
• Try to debug one customized ABAP program

• Q&A

WBS CODE Slide 14


SAP Query
SAP Query

• Definition
• SAP Query is used to create reports not already contained in the default. It
has been designed for users with little or no knowledge of the SAP
programming language ABAP.

• Step-by-step
• Create User Group (SQ03)
• Assign User for Authorization
• Create Infoset (SQ02)
• Assign Infoset to User Group
• Create Query from User Group (SQ01)
• Assign Transaction Code to SAP Query (SE93)

• NOTE: Use Y and Z namespaces


• Y – test
• Z – actual / transportable objects

Slide 16
SAP Query

• SQ03 – User Groups

Slide 17
SAP Query

• SQ02 – Infoset

Slide 18
SAP Query

• SQ02 – Infoset (cont.)

Slide 19
SAP Query

• SQ02 – Infoset (cont.)

Slide 20
SAP Query

• SQ01 – Query from User Group

Slide 21
SAP Query

• SQ01 – Query from User Group (cont.)

Slide 22
SAP Query

• SQ01 – Query from User Group (cont.)

Slide 23
SAP Query

• SQ01 – Query from User Group (cont.)


How to execute:

Slide 24
SAP Query

• How to assign user for authorization to change for queries? (in SQ03)

WBS CODE Slide 25


SAP Query
• How to create a required selection parameter? (in SQ02)

WBS CODE Slide 26


SAP Query

• How to change column description [Basic List]? (in SQ01)


• Change mode > Basic List

WBS CODE Slide 27


SAP Query

• How to switch User Group? (in SQ01)

WBS CODE Slide 28


SAP Query

• How to attach a transaction code?


• Transaction Code SE93
• Enter Transaction Code value
• Enter Short Text
• Choose Parameter Transaction
• Values:
• Transaction – START_REPORT
• Click “Skip initial screen” checkbox
• GUI Support
• Click all 3
• Name of Screen field
• D_SREPOVARI-REPORTTYPE - AQ
• D_SREPOVARI-REPORT - User Group value
• Note: 12 characters + (ending with G)
• D_SREPOVARI-EXTDREPORT - Query from User Group value

WBS CODE Slide 29


SAP Query

WBS CODE Slide 30


SAP Query

• Demo

WBS CODE Slide 31


SAP Query

• Exercise
• Create a simple SAP Query based on table below:
• MM – MKPF and MSEG
• SD – VBRK and VBRP
• FICO – BSID and BSAD
• PP – AFKO and AFPO
• EAM – EQUI and EQKT
• PS – PRPS and PROJ
• WM – LTAK and LTAP
• POSDM – /POSDW/TLOGS and /POSDW/TLOGF

• Q&A

WBS CODE Slide 32


THANK YOU!

www.fasttrackph.com
No part of this publication may be reproduced or transmitted in any form or for
any purpose without the express permission of Fasttrack ERP, Inc.

Das könnte Ihnen auch gefallen