‎2011 Nov 09 9:18 AM
Hi All,
I have 1 custom table with 4 fields. user can maintain via SM30 for 3 fields, other 4th field is in display mode (updates via program).
Based on the display field (4th field) value, example display field value = X, user shouldn't be able to modify hole record.
If display field blank, user can change other 3 fields data.
There is a possibility of display field (4th field) may contains value for some records and some blank.
which ever is blank user can modify that record. Which having the value in 4th field other fields can be modify.
How to achieve this requirement ?
Moderator Message: Please use a more descriptive subject line for your post.
Edited by: Suhas Saha on Nov 9, 2011 4:28 PM
‎2011 Nov 09 9:47 AM
Hi,
I think you have to build an ALV application that handles your requirements.
Best regards,
Oliver
‎2011 Nov 09 9:47 AM
Hi,
I think you have to build an ALV application that handles your requirements.
Best regards,
Oliver
‎2011 Nov 09 9:53 AM
Hi Oliver,
Thanks for quick reply ,
can you please tell in bit clear, let me know if you have any related links.
Thanks,
KK
‎2011 Nov 09 9:59 AM
Hi
You can also use the SM30, instead of to create a new program, but the SM30 has to be generated for a maintenance view based on your Z-table.
In this way the 4th field can be set for read-only, then you need to change the PBO in order to change the attributes of others fields by statament LOOP AT SCREEN.
If you use the SM30 you can have a problem with the new hit, because in this situation 4th will be blank so other fields could be protected for input
Max
Edited by: max bianchi on Nov 9, 2011 10:59 AM
‎2011 Nov 09 10:34 AM
Hi KK,
I guess u can try the below option.
Go to maintainence screen of your table maintainence ( go to SE11 ->table maintainence->enviornment->modification->maintenance screens).
Go to element list of the screen and give modification group1 as GR1 to first three fields.
Then check the PBO of the screen there you will get a table control loop so inside this loop you can create your module to write logic to hide the fields. I just gave logic below which you can write in this module
MODULE modify_records OUTPUT.
IF (Your screen field name for field 4) = 'X'.
LOOP AT SCREEN.
IF screen-group = 'GR1'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
Thanks,
Pawan
‎2011 Nov 09 10:02 AM
Hi
There are two ways you can achieve this.
Way 1) Try to modify the function module that you created while generating the Table maintenance. There will be a PAI include within which you can put your logic to check if the 4th field has 'X', then put a loop to deactivate the edit feature of the other three fields.
Way 2) Build a program to display the table entries in ALV. In ALV, you can open the fields editable and have a Sy-UCOMM button to update the value once it is editied. In this, while displaying the ALV output, put your logic to see if the 4th field has 'X', then make that column as no_edit option while building the field catalog.
I would say, way 2 would be much easier than the way one, but the choice is yours. Let me know if you require more details
Regards
Senthil
‎2011 Nov 09 11:13 AM
Hi KKP,
Look for the read event in TMG and implement your logic so that you can filter all the records having X in the 4th field.
This way user cannot modify records which are having X in 4th field.
For TMG events, search the SDN Wiki/Forum.
Regards,
Karthik
‎2011 Nov 09 11:36 AM
Hi,
Why not simply use the maintenance view events and trigger an error message when needed? (SE56->Environment->Modification->Events)
Kr,
Manu.
Added: just see the reply from Karthik...Agree
Edited by: Manu D'Haeyer on Nov 9, 2011 12:37 PM
‎2011 Nov 09 11:54 AM
Hi Kumar ,
By adding the code in PBO you can do this one.try with that code which is posted By PawanG . i am pretty sure,it will work.
Thanks and regards
Naresh Bammidi
‎2011 Nov 10 1:53 AM
Hi All,
Thanks a lot for your valuable inputs , it has been resolved.
Thanks.
KK