cancel
Showing results for 
Search instead for 
Did you mean: 

How to degug the routine in DTP?

Former Member
0 Kudos

Hello

Can somebody do me a favour and answer the following questions :

1. How to debug selection routine in DTP?

2. Routine in DTP has the following build-in code :

read table l_t_range with key

fieldname = 'PSTNG_DATE'.

l_idx = sy-tabix.

Why is it necesary to read table l_t_range for posting date if the table is always empty? Selection for DTP is defined within the routine and nowhere else. Just give me theoretical example how this table may contain records for posting date by the moment the DTP routine runs?

Thanks a lot

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Similar but not same issue in this post.

From what I've found is that sometimes the table that is built when you put in a range (l_t_range) sometimes has a record without a specified field name associated to that record. I'm not sure when this happens other than I've always seen example code check for this case and if it is found. Enter the record into l_t_range and populate that field by modifing that record.

You could test this out, enter some values on the thing you are filtering on like a normal filter. And then run the code with a break-point. Check whether at the beggining does l_t_range return a record for that field name. And then remove those filters and try it. Perhaps there's only a record if you've also hard coded a prompt.

Edited by: Andrew Averbeck on Nov 15, 2010 2:43 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

Put break-point in the routine and debug, you will get all ur answers.

Former Member
0 Kudos

Hi,

Table l_t_range is the internal table which is filled by the values coming from the source. This table is filled when the DTP is executed.

You can place a break-point within your code & as pointed out earlier, you will have to use the options - Serially Debug in the DTP execute tab. This should work.

Regards

Vishal

Former Member
0 Kudos

thanks but it doesnt answer question2

why its needed to read the table if its always empty?

if l_idx ne 0 then the record should be modified. What is to modify if thee are no records? The author suggests that the table sometimes may be populated with values. BUt what are these cases?

read table l_t_range with key

fieldname = ' '.

l_idx = sy-tabix.

*....

if l_idx <> 0.

modify l_t_range index l_idx.

else.

append l_t_range.

endif.

p_subrc = 0.

Former Member
0 Kudos

Comment the above piece of code in the routine and then execute the DTP. You can see why that code has been put.

Former Member
0 Kudos

Hi,

I hope the 2nd option "Serially in the Dialog Process" under Execute tab in the DTP will work for your requirement.