Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging with /h - how it works

Former Member

Hi All,

When i type /h followed by the trasaction code, i get a message saying debugging is switched on. I would like to know how it works. In SE38, i am able to execute a query with debugging & put watcpoints & observe how the program functions, how can i achieve the same using /h

Hope my question is clear, await inputs.

Vivek

1 ACCEPTED SOLUTION

Former Member

Hi

<b>Running a Program in Debugging Mode</b>

You can start the Debugger without previously having set breakpoints. This is the best procedure to use when you want to test a program right from the beginning. It is also useful if you do not know the program very well and therefore are not sure where best to set breakpoints. You can start the Debugger as follows:

From the Object Navigator Select a report or transaction and program and choose Program ->&#61472;Test &#61614;&#61472;Debugging.

From the ABAP Editor Choose Program -> Execute -> Debugging (or the Debugging pushbutton).

From any screen Choose System -> Utilities -> Debug ABAP.

<b>From any screen Enter " /h " in the command field.</b>

for every report program normally we will creat a T-code by useing that T-code you can call the selection screen and there put /H and carry on

<b>Reward if usefull</b>

9 REPLIES 9

Former Member
0 Kudos

write /h on where u specify tcode and press F8.debugger 'll switch on.

Former Member
0 Kudos

Hi,

Your question is somewhat not clear.

It is meant for starting the debugging a program at a specific stage.

Former Member

Hi

<b>Running a Program in Debugging Mode</b>

You can start the Debugger without previously having set breakpoints. This is the best procedure to use when you want to test a program right from the beginning. It is also useful if you do not know the program very well and therefore are not sure where best to set breakpoints. You can start the Debugger as follows:

From the Object Navigator Select a report or transaction and program and choose Program ->&#61472;Test &#61614;&#61472;Debugging.

From the ABAP Editor Choose Program -> Execute -> Debugging (or the Debugging pushbutton).

From any screen Choose System -> Utilities -> Debug ABAP.

<b>From any screen Enter " /h " in the command field.</b>

for every report program normally we will creat a T-code by useing that T-code you can call the selection screen and there put /H and carry on

<b>Reward if usefull</b>

0 Kudos

Hi Naresh,

Thanks for the inputs. Also thanks to the others for having given your inputs. What i am actually trying to do, is study the program SAPMM07M, which runs when transaction MB01 is used.

I want to know how this program updates the EKET table, i.e I want to know how SAP has implemented the logic, where supposing a given Purchase Order line has 2 delivery schedules, the program first fills the EKET-WEMNG till it is equal to EKET-MENGE & then proceeds to line 2.

Eg: Purchase Order with one line

EKPO-MENGE = 10 nos

EKPO-EBELP=0010

This item has 2 delivery schedules

EKET-EBELP = 0010, EKET-ETENR=0001, EKET-MENGE = 3 nos

EKET-EBELP = 0010, EKET-ETENR=0002, EKET-MENGE = 7 nos

When goods receipt for 5 nos is done

EKET-ETENR=0001, EKET-MENGE = 3 nos, EKET-WEMNG = 3 nos

EKET-ETENR=0002, EKET-MENGE = 7 nos, EKET-WEMNG = 2 nos

I want to know how the program is splitting the quantity. I am building a query & want to implement a similar logic, but in my query i want to subtract EKET-MENGE with EKES-MENGE

Hope my problem is clear, await inputs.

Vivek

Message was edited by:

Vivek Seelin

0 Kudos

HI Vivek

if you want to that logic you need to follow the debugging process ,

do one thing put break point in that program ,

goto that program and put it in display mode and place cursur on start-of-selection and press stop button then it will create a break point there

after execute the Tcode normally when ever control comes to that line then break point will trigger

from that program you can press F5 and see in each step where and what happening

Debugging a standard program takes much time to understand if you do 3 or 4 times then you can find the logic very easily

<b>Reward if usefull</b>

0 Kudos

Hi Naresh,

Thanks for those inputs. But i think the program is not helping me much, because i find this program updating the MSEG table, but i am not able to understand which program is updating the EKET table.

Logically what i wish to achieve is simple, but not able to figure out how to implement it. I want to first total the EKES-MENGE field for a given delivery schedule line i.e. EKES-EBELP. Then populate my custom field 'Open_Quantity' by subtracting this quantity (total of EKES-MENGE for a particular line) with the first delivery schedule line (i.e EKET-ETENR) until Open_Quantity becomes zero & then proceed to line 2.

If you have any inputs for this, please share the same.

Vivek

0 Kudos

You can use the ST05 for that...

Open your transaction in one Session

Open another session for ST05 .. Start the trace with the filter for the user

Come to first session.. do your processing.. or reach to the screen for which you need the data...

Come to second session and stop the trace..

List trace...

Regards,

Naimesh Patel

0 Kudos

HI

try this one

<b>SQL Trace transaction ST05:</b> The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.

The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on a particular database table of the ABAP program would be mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.

The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.

To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.

<b>Starting the Trace:</b>

To analyze a trace file, do the following:

...

Choose the menu path Test &#61614; Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.

Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).

If you want to switch on the trace under your user name, choose Trace on. If you want to pass on values for one or several filter criteria, choose Trace with Filter. -> Typical filter criteria are: the name of the user, transaction name, process name, and program name.

Now run the program to be analyzed.

<b>Stopping the Trace:</b>

To deactivate the trace:

...

Choose Test &#61614;Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.

Select the trace functions that you want to switch off.

Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-

<b>Analyzing a Sample trace data:</b>

PREPARE: Prepares the OPEN statement for use and determines the access method.

OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.

FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area.

<b>Reward if usefull</b>

0 Kudos

Hi Naresh & Naimesh,

Thank you both for that. I now have the trace output & i do see EKET table featuring in it. In Object Name i see ATP_EKET & Op. it has three options i.e. PREPARE, OPEN & FETCH. I am not able to figure out where it is actually writing into this table. The program is SAPLATP2. Can you please check & let me know where it is actually splitting the received quantity & writing into the respective delivery schedule line.

Await inputs.

Vivek