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: 

Custom program for insert, modify, delete from tables using SE11/SE16 dynamic selection screen

meenakshi-btp
Explorer
0 Kudos

Hi All,

I have to design a program such that the selection screen contains a parameter for table name and 3 radio buttons one for each insert, modify and delete.

Now when we run this, screen of table should appear (same as SE11, SE16- where we give values).

Whatever values we give there, should be inserted, modified and deleted according to what we have selected on the first screen.

I got one FM, RS_TABLE_LIST_CREATE. Through this FM, I am able to get the table screen based on table name (what we give on selection screen) dynamically. After that, it is calling a program which is nothing but normal SE11/SE16 property. We give values and we get data.

Once the SE11/SE16 screen comes I don't have any control over the same to do the required action

Please suggest how can this be achieved?

1 ACCEPTED SOLUTION

former_member195402
Active Contributor
0 Kudos

Hi Meenakshi,

SE11/SE16 doesn't support all types of fields.

Which screen do you want to use? Do you really want to use the selection-screen, which contains only a few table fields (that can be changed from everyone changing settings on selection screen). Or  the data screen(s) that are used to show and change the data of 1 single line?

But in both cases I don't think you will be successfull.

It will be better to create a specific update solution for each table you want to change.

Or you can create a  fm with dynamic logic to do this.

Regards,

Klaus

9 REPLIES 9

Former Member
0 Kudos

Hi Meenakshi,

Under the event AT SELECT SCREEN write the code like this.

if 'RB1' is selected write the logic for insert.

elseif 'RB2' is selected write the logic for modify.

elseif 'RB3' is selected write the logic for delete.

endif.

Let me know if you want any help.

Thanks & Regards.

Pavan.N

0 Kudos

Hi Pavan,

I don't want to do it for a limited number of tables. This requirement is for all the tables which exist in system.

Issue I am facing is that when SE11/SE16 screen comes, after that I want the control to a custom program/function module.

The code can be written, but my issue is, where to write the code.

Former Member
0 Kudos

Are there a small number of tables you wish to update in this way? If so, you could create a table maintenance view for each of the tables, assign a transaction of the same name (ie transaction ZTABLE1 would maintain ZTABLE1), then CALL_TRANSACTION to call the table maintenance screen for the required table.

I have created such a thing in the past using this method, but there were only about 20 Z tables to maintain so the overhead of creating maintenance views for each wasn't too high.

0 Kudos

Hi Kevin,

Thanks for the response.

No, we want this functionality for all the tables which exist in the system.

It would have been easier if it was only for custom tables.

former_member195402
Active Contributor
0 Kudos

Hi Meenakshi,

SE11/SE16 doesn't support all types of fields.

Which screen do you want to use? Do you really want to use the selection-screen, which contains only a few table fields (that can be changed from everyone changing settings on selection screen). Or  the data screen(s) that are used to show and change the data of 1 single line?

But in both cases I don't think you will be successfull.

It will be better to create a specific update solution for each table you want to change.

Or you can create a  fm with dynamic logic to do this.

Regards,

Klaus

0 Kudos

Hi Klaus,

I want to use the selection-screen, which contains only a few table fields (that can be changed from everyone changing settings on selection screen).

After putting values in that screen, I want to trigger a custom program/FM where I can write my DELETE, MODIFY, INSERT logic.

VXLozano
Active Contributor
0 Kudos

Just a friendly advice:

BEFORE CONTINUE, NOTICE YOU MUST NOT UNDER ANY CIRCUNSTANCE TO MODIFY THE CONTENT OF ANY SAP STANDARD TABLE.

Once said that, your requirement is too complex and I don't see any true benefit from it. Let me explain: if your goal is just to manage your data in Z-tables that are not related with any other table, just create a maintenance view for each table. It will be easier, although SAP sometimes is not very trustworthy while creating them.

If you are still decided to continue with your requirement, if I were in your position I should create a program with a single field (table name), and (after check the selected field is not a SAP table) a call to a FM that allows you to keep multiple fields. You can populate that FM's fields using some FIELDCATALOG function module.

Good luck, but I'm still thinking your requirement is a dangerous a wierd one.

0 Kudos

Hi Lozano,

What you said is very true, I totally agree with you. This may cause huge data inconsistencies but I think this will be used by functional team for some special cases.

But we are doing this exercise because of the following reason:

We have to delete the records of IT0006 by using the T-code UASE16N in Production System as the standard Report RPUFIXDS did not worked out for this employee & also with PU00 the data cannot be deleted. But SAP has made T-code UASE16N obsolete and this can no more be used.

As suggested by SAP, we have written a code just for IT0006 but we thought of generalizing it so that it can be used in future for similar issues.

After I give values on SE16 selection screen, I want to trigger a custom program/FM.

VXLozano
Active Contributor
0 Kudos

If I'm not wrong: you had to open a SAP ticket, and they asked you to run a program with a direct SQL update/delete on it with the key of your object in its WHERE clause.

Keep it that way. If you consider your problem shall arise again, change your recommended program adding a selection screen with all the table's keys as OBLIGATORY. And ensure yourself no one except by a very few authorized users will be able to run it.

Your idea would sound fine, but it's like to give a lighter to a maniac teenager in a gas station. It will create huge damage in the future for sure.