cancel
Showing results for 
Search instead for 
Did you mean: 

How to add coding to a field in Ad-hoc Query?

Former Member
0 Kudos

My requirement is to add a field to P2010 in Ad-hoc Query. The Infoset is specified, I added the field to structure P2010_AF via CI_P2010_AF. Then added the field to the field group, added the code to the field, saved the coding and the infoset, generated the infoset - and the code is not being called.

When I add the code to record processing, then it is called, but it is run right after GET PERNR - and runs only once instead of running for each line in P2010. And in this case, of course, the values read for the added field do not appear in the grid.

What further steps I should take to make it run for each line of P2010 and get the value read for the additional field?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Some additional info that I should display values read from RT table. So I am using PYXX_READ_PAYROLL_RESULT function in the coding, a simple SELECT does not help in this case.

Former Member
0 Kudos

I have found so far that cluster tables cannot be read from QUery, so first an infotype table should be filled using a report then read that infotype in the query.

The problem however still exists, that the code is not running when I run the Ad-hoc query.

Now the code looks as follows, just to try and get some data displayed:


fields: syhr_a_p2010_af_betpe, p2010-begda.
clear syhr_a_p2010_af_betpe.

move 12 to syhr_a_p2010_af_betpe.


As you can see, it is 0,00 for each line instead of 12. When I set up a breakpoint, it does not stop there, so the code part is not running.