2021 Nov 08 6:26 AM
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
2021 Nov 08 2:54 PM
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.
2021 Nov 08 6:36 AM
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
2021 Nov 08 6:47 AM
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
2021 Nov 08 7:02 AM
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 ?
2021 Nov 08 8:14 AM
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.
2021 Nov 08 6:50 AM
Hi,
you can try events in table maintenance generator for this requirement. Please refer following help for your requirement.
regards,
Veeresh
2021 Nov 08 8:13 AM
Hi Veeresh,
I need to update via program and filter the relevant record based on the selection screen data.
BR,
Prem
2021 Nov 08 7:57 AM
I don't think that VIEW_MAINTENANCE_CALL does an authority check on S_TCODE with TCD='SM30' as you seem to say.
2021 Nov 08 8:16 AM
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
2021 Nov 08 2:54 PM
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.