
Converting ABAP Query To ABAP Programs
Okay, there’s one more step in ABAP queries, which is converting ABAP query to ABAP programs.
Thank you for reading this post, don't forget to subscribe!
The reason why we convert ABAP query to ABAP program is that we can’t– Let’s go to ABAP query. We go to ABAP query, remember we created Sun query, you can’t see it here because currently, it’s defaulted to user group, Sun query. It is not the user group that we assigned our Sun query. It was assigned to a user group called test query. So we need to go to that user group to do that. Go to edit, go to other user group, and then, choose test query, this here. Double click, it is a query right?
Now we can see our Sun query, under the task query. See, if the user wants to run this Sun query, one option is the user can come to this as Q01, ABAP queries, and run this Sun query. But we don’t want this to happen, because if the user is given access to this screen, the user can misuse this access to read the values from all the confidential tables, because using this screen, the user can actually read any values from any tables. There could be some financial data which is confidential, which we don’t want the user to look at, so we cannot simply give access to this screen to the user. So what we normally do is that we convert the subquery into an ABAP program and request the basis to attach the ABAP program to a T-code and give the T-code to the user, so that when the user runs a T-code, the T-code will launch the ABAP program and they can get what we are seeing here.
This is all we have to do. So in order to do that, we need to convert the Sun query to ABAP program. To do that, just go here, just choose more functions, generate program. See, the system is compiling the query. See, it has generated the program from the Sun query. To look at the program, just go to SE38.
SE38 is the ABAP editor, so this is the ABAP program. I show you the menu path for SE38. It’s under ABAP Workbench, Development, ABAP Editor. This is the one, SE38. So this is the program name, ABAP program name that is assigned by the system for the ABAP query. Okay, if you run this, you can see our query. All right. If I execute, I can see the values.
So we need to copy this ABAP program, and then, ABAP program name and pass it to basis and ask him to create a T-code and assign this ABAP program to the T-code so that we can pass the T-code to the user. If you want to look at the source code of this above program, just point to here, and then display.
You can see the program. This is what we call ABAP program. This is system generated. This is generated automatically by the system. Now, like I said, the basis team has to create a T-code for this ABAP program before we pass the T-code to the user. When the user launches the T code, automatically, this screen will pop up for them. Okay. That’s about it.