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: 

Update custom table via program for selected records

former_member182337
Participant
0 Kudos
763

Hello Friends,

I need to update a custom table via program. I have created a tcode for the SM30 of the table and am able to call it in the program. However, I am unable to pass selection conditions. I have tried to use the SET parameter but still on executing all the contents of the table are displayed. I need to display only selected rows so that user can either update/delete the same.

I guess this can be achieved via FM ' VIEW_MAINTENANCE_CALL' however if the user don't have access to SM30 in prod then this will also fail through the program. Is there any recommendation for this?

Thanks,

Prem

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
452

Create your transaction with a program/class that execute VIEW_MAINTENANCE_CALL with DBA_SELLIST containing your selection criteria.

Then call transaction SU24 and deactivate for your transaction the Authority Checks relevant to SM30, such as authorization objects S_TABU_CLI and S_TABU_DIS.

9 REPLIES 9

FredericGirod
Active Contributor
452

If you want to manage the SM30, you could use the statement CALL TRANSACTIN ... USING bdcdata. It's exactly the ame thing as the batchinput. You could record the screen using the transaction SHDB

Otherwise, you could create a program with CL_GUI_ALV_GRID and manade ALV with EDIT options

0 Kudos
452

Thanks Frederic. Isn't there any other option apart from recording the screen or via ALV ? Is it true that the FM 'VIEW_MAINTENANCE_CALL' will fail if the user doesn't have access to SM30?

BR,

Prem

0 Kudos
452

You could check the authorization checked by SAP using the trace: STAUTHTRACE (or ST01).

FM is very old school, and should not be used anymore. Why do you want to manage the SM30 ?

0 Kudos
452

There are few config tables which they want to manage via program. They will display/edit the table contents and for that a simple abap program is needed.

former_member673464
Active Contributor
0 Kudos
452

Hi,

you can try events in table maintenance generator for this requirement. Please refer following help for your requirement.

https://help.sap.com/doc/saphelp_nw73/7.3.16/en-US/4d/da26cd13f1679ce10000000a42189e/content.htm?no_...

regards,

Veeresh

0 Kudos
452

Hi Veeresh,

I need to update via program and filter the relevant record based on the selection screen data.

BR,

Prem

Sandra_Rossi
Active Contributor
452

I don't think that VIEW_MAINTENANCE_CALL does an authority check on S_TCODE with TCD='SM30' as you seem to say.

former_member182337
Participant
0 Kudos
452

Thanks Sandra, I will double check it. Do you think this is the better option and that it cannot be done with creation of a tcode for SM30 and calling it in the program?

BR,

Prem

raymond_giuseppi
Active Contributor
0 Kudos
453

Create your transaction with a program/class that execute VIEW_MAINTENANCE_CALL with DBA_SELLIST containing your selection criteria.

Then call transaction SU24 and deactivate for your transaction the Authority Checks relevant to SM30, such as authorization objects S_TABU_CLI and S_TABU_DIS.