‎2007 Aug 15 5:03 PM
Hi
I am using a custom Z transaction for maintaining my table. This comes up with a selection screen where the user gets to choose one of 4 values for a field in the table (ID). Based on the selection, only the relevant entries are displayed in the SM30 screen.
However when the user wants to make new entries he has the option to pick any of those 4 values in the drop down for ID field. I want the ID field to default the value selected in the 1st selection screen.
Any ideas? I tried looking at form maintenance routines but none of the events trigger prior to clicking on "New Entries".
Thanks
‎2007 Aug 15 5:20 PM
One approach can be that you create a maintenance view for this table hiding the ID field. Fill up the value of that field with the user selected ID from the initial screen in one of the events (typically I have used before saving event). Are you calling VIEW_MAINTENANCE_CALL function module or are you calling the transaction SM30? Use the function module, you will have better control.
‎2007 Aug 15 5:07 PM
‎2007 Aug 15 5:12 PM
‎2007 Aug 15 5:16 PM
Even though you default it, the user can still change it unless you are passing the ID as a restriction in the initial screen of SM30. In that case, even if the user tries to select the other values, it will not allow them to. Is that what you are currently seeing?
‎2007 Aug 15 5:17 PM
Hi Suparna,
I too had a similar problem. We solved it in the following manner:
Create a Domain with the 4 values as your default values.
Sounds simple & it works. Does it satisfy ur requirement ?
Please reward points if helpful.
Suhas ...
‎2007 Aug 15 5:20 PM
One approach can be that you create a maintenance view for this table hiding the ID field. Fill up the value of that field with the user selected ID from the initial screen in one of the events (typically I have used before saving event). Are you calling VIEW_MAINTENANCE_CALL function module or are you calling the transaction SM30? Use the function module, you will have better control.
‎2007 Aug 15 5:25 PM
I am using the FM View Maintenance call. I am passing the user selected value to this FM so that it will display only table entries corresponding to the user selection.
The issue is to retain this value and determining where to pass it when the user tries to make new entries. Right now, he can choose any of the 4 values and he gets an unhelpful message " Specify key within workarea" if he tries to enter values for a field other than the one he selected initially.
‎2007 Aug 15 5:43 PM
Exactly that is what will happen when you are passing values to this call. It is nothing but the same way SM30 works where you have the restrictions option. Once you have restrictions, any new entries that you insert should also follow the same restrictions. So the best thing to do is to hide that column altogether since your user already decided which ID to use upfront and any new entries should be made only for that ID not for any other IDs.
‎2007 Aug 15 5:50 PM
Oh ok, I get your point. To me that sounds like a great idea, let me run it by the "Superuser" and see what they have to say. Thanks