2008 Feb 07 8:47 AM
I have a table control..
option add/delete suboption value
A add A1
B delete A2
B1
B2
there is a drop down at coloumn add/delete. Now after we select add I want to enable the input field near A1,A2....Suppose Delete is selected for B...I want to disable the input field near B1,B2.....
One thing to note is that.The disabling or enabling of the last button depends on the selection of add/delete from the drop down...
Hw to achieve this fuctionality???????
2008 Feb 07 9:55 AM
Hello Rudra,
Iam just repeating the requirement corrcet me if iam wrong.
You have a table control with field say 5 columns.
You have the add/delete column in column 4. If you select "add" it needs to enable and "delete" its to disabled some thing like this, am i right.
Here we needs to trigger some code when ever you change the value in ADD/DELTE column which are drop down.
So to get the code triggered you need to give some function code for that particular field in the screen painter. Double click the field and give some value in "FctCode".
In coding
you need to mention this piece of code for that particluar coulmn, field "fieldname" module "m" on input.
Regards,
Kiran I
2008 Feb 07 11:25 AM
Hi,
Use the modify screen statement to enable/disable screen fields.
like:
Syntax
Effect
This statement can be used in the statement block after LOOP AT SCREEN only and makes sense only during PBO processing. If FROM is not specified, MODIFY SCREEN modifies the attributes of the current screen element with the values from the predefined screen work area. If a wa work area is specified, its contents are used for the modification.
The wa work area must have the same data type as screen. The name component must contain the name of the current screen element, otherwise the statement is not executed. nweisung nicht ausgeführt. Up to the group1 to group4 and length components, all remaining components of screen and wa must contain either the value 0 or 1. The value 0 deactivates the corresponding field attribute, and 1 activates it.
If MODIFY SCREEN is executed during PBO processing, the modified attributes for the display of the screen affect the current dynpro after PBO processing. The attributes of the screen element of the dynpro are reset to their static attributes at the start of each PBO processing, so that the execution of MODIFY SCREEN during PAI processing does not effect the display of the following screen.
The active component
The active component is used to set the input, output and invisible components at once. At the start of PBO processing, the active component always has the value 1. If active is set to 0 with MODIFY SCREEN, input and output are automatically set to 0 and invisible is set to 1. Other values in input, output and invisible are ignored. Conversely, setting input and output to 0 and invisible to 1 automatically sets active to 0 and a different value in active is ignored.
Modifications in Table Controls and Step Loops
During processing of a table control or a step loop, the changes affect the current line of the table control or the current step loop group. Before the processing of a table control, the change to the attributes of a screen element that is part of a line in the table control does not effect the table control, since the values are transferred from the structure created using CONTROLS. Before a step loop is processed, the change to the attributes of a screen elements that is part of a step loop group affects all groups in the step loop.
Modifications to Tabstrip Controls
If the active component for a tab title of a tabstrip control is set to 0, the whole tabstrip page is hidden.
Example
In the following PBO module, an input field called val is made mandatory and converted to display in the foreground.
MODULE modify_0100 OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'VAL'.
screen-required = '1'. "to make required
screen-intensified = '1'.
screen-input = 0. "to dsplay mode
screen-active = 0. "to hide
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE.
Pls reward points if useful.
Regards,
Renjith Michael.
2008 Feb 07 12:17 PM
Hi Rudra,
Check this standard report.
<b>demo_dynpro_tabcont_loop_at</b>
in this report code check the condition
WHEN 'TOGGLE'.
LOOP AT flights-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
Analyise these and write in your code..
For screen modification...
check this report...
<b>demo_dynpro_modify_screen</b>
execute these two reports... analyise u ll understand easily..
<b>reward if useful</b>
regards,
sunil kairam.