‎2007 Feb 02 6:15 AM
HI Guys,
How can one change the attribute of input field to output field basically greying of field) dynamically
based on the some flag. Loop at screen does not work. I need to change the attributes
of field 'outfiled' and output field display only'.
Any help is highly appreciated.
Regards,
Harsha
‎2007 Feb 02 8:20 AM
Hi Harsha,
set the screen input of the coreesponding element to 0.
try this code..
loop at screen.
if screen-name = ' '. " enter the element name
screen-input = 0.
endif.
endloop.
if u still face any problems, i'll send a example.
Regards,
Prasanth
Reward if helpful
‎2007 Feb 02 8:23 AM
Hi Harsha,
Where did you do your dynamic screen modification? In PBO section right?
It is the only way you can dynamically change screen attributes.
Refer this help link to know more about the topic:
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm
Regards,
Ravi
‎2007 Feb 02 8:26 AM
Hi,
use this code
FIELD-SYMBOLS: <fs_cols> TYPE cxtab_control-cols,
<fs_wkcols> TYPE LINE OF cxtab_control-cols,
<fs_scr> TYPE screen.
ASSIGN tabcntrl-cols TO <fs_cols>.
LOOP AT <fs_cols> ASSIGNING <fs_wkcols>.
ASSIGN <fs_wkcols>-screen TO <fs_scr>.
IF <fs_scr>-name = 'TB_MARA-MATNR'. " here you give ur table and field name
<fs_scr>-input = 0.
ENDIF.
ENDLOOP.
This will work
Regards
Nishant
‎2007 Feb 02 8:27 AM
Hi Harsha,
U need to set the value of flag in PAI event upon enter. In the PBO module write code something like this :
PROCESS BEFORE OUTPUT.
MODULE rad.
MODULE rad OUTPUT.
CASE ok_code.
WHEN ' '.
LOOP AT SCREEN.
IF l_flag = 1.
IF screen-name = 'PROJ_DESC'
OR screen-name = 'PROJECT_TYPE'.
screen-input = 0.
ENDIF.
ENDIF.
ENDLOOP.
ENDCASE.
ENDMODULE.
Now my fields project type and project description gets grayed.
-SatyaPriya
‎2007 Feb 02 8:30 AM
Hi Satya,
This doesn't work for table controls.
harsha,
you can try the code I wrote and test it .
Regards
Nishant
‎2007 Feb 02 10:10 AM
Thanks you all for the express reply. Yes, Nishant
is right, it does not work. Will try your code and revert.
Thanks a ton.
warm regards,
Harsha
‎2007 Feb 23 7:38 AM
Hi Harsha,
I generated a table control (ERP 6.2) and somewhere I found the coding like this (the name of the table control is TABLE_CONTROL):
*&spwizard: output module for tc 'TABLE_CONTROL'. do not change this lin
*&spwizard: get lines of tablecontrol
module TABLE_CONTROL_get_lines output.
g_TABLE_CONTROL_lines = sy-loopc.
If I do a loop at the screen at this place, I can control the individual input/output for the screen fields (the table fields). In my work area (WA_CONTROL) I can see the actual value of fields. Depending on this, I choose to enable/disable input via:
loop at screen.
if wa_control-material <> ' '.
screen-input = '0'.
modify screen.
endif.
endloop.
‎2007 Feb 23 10:01 AM
HI Stefan Bergmann ,
Thanks a ton . I am using 4.6c, will it work? Anyway let met ry this also.
Regards,
Harsha
‎2007 Feb 23 10:57 AM
Hi Harsha,
I guess this will also work in 4.6C.
Cheers,
Stefan.