This blog explains how to create a macro which will make row "Total" not editable in transaction /SAPAPO/SDP94.
Based on the following true table:
AGG_LEVEL | ACT_LEVEL | RESULT |
---|
X | 1 | Edit |
0 | 0 | Edit |
1 | 0 | No Edit |
- Use function "ACT_LEVEL" inside the "If" condition. If ACT_LEVEL ( ) > 0, this means that the level is not the total level.
- Then choose the Row that you want to use this functionality and change the attribute.
- Inside that you will use function ROW_INPUT ( 1 ). If X = 1, the status of the row is set to Ready for Input.
- Then use ELSEIF Agg_level (Your characteristic) = 0. This means you will check if you are on the detailed level of a selection. In that case you should be able to edit.
- The last step is to use the ELSE condition. Put Row as an attribute.
- Inside that you will use function ROW_INPUT ( 0 ). If X = 0, the status of the row is set to Read-Only (write-protected).
Note that I also used the function ROW_BG to change the background color of the row. See example below:
You should put this macro in the events "Level change" and "Start" because when you open /SAPAPO/SDP94 and when you change the level the macro will be executed.
And here is the result in /SAPAPO/SDP94 transaction. The gray background color means that you can't change the row. The green background color means that the row is ready for input:
a) When you open /SAPAPO/SDP94 and load only one product (the caracteristic that I've insert on the ELSEIF), you will be able to change the total:
b) If you open /SAPAPO/SDP94 and load more than one product you will not be able to change the total:
c) If you select details (all) you will not be able to change the total again as expected: