07-02-2007 4:21 PM
HI guyz,
i have created a custom infotype which has 2 subtypes . certain fields should not be displayed when we select the subtypes. i have used the code below. the screen contains a table.
MODULE hide_FIELDS OUTPUT.
IF p9555-subty = '1'.
LOOP AT SCREEN.
IF screen-group2 = 'ABC'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF p9555-subty = '2'.
LOOP AT SCREEN.
IF screen-group2 = 'XYZ'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " hide_FIELDS OUTPUT
the fields which are not in the table are not getting displayed as required but the fields in the table still appear on the screen(they are grayed out). i do not want them to appear on the screen. can anyone help me with this. Thanks in advance.
07-02-2007 4:39 PM
Use like this :
MODULE hide_FIELDS OUTPUT.
IF p9555-subty = '1'.
LOOP AT SCREEN.
IF screen-group2 = 'ABC'.
<b>if screen-name = 'field name'.</b>
screen-active = 0.
MODIFY SCREEN.
ENDIF.
endif.
ENDLOOP.
ENDIF.
IF p9555-subty = '2'.
LOOP AT SCREEN.
IF screen-group2 = 'XYZ'.
b]if screen-name = 'field name'.</b>
screen-active = 0.
MODIFY SCREEN.
ENDIF.
endif.
ENDLOOP.
ENDIF.
ENDMODULE. " hide_FIELDS OUTPUT
Thanks
Seshu
07-02-2007 6:17 PM
HI Seshu,
i think you dint understand my question. The field in the table which should not be displayed is already included in the screen group. but it is getting displayed(it is actually getting grayed out, but i want to remove it completely). the fields outside the table which are in the group are not displayed. but the field in the table is displayed.
if the group does not contain the fields from the table its working properly(the fields are not displayed). But i also want to hide a field from the table which i am not able to do.
i have tried the code you give, but its not working.
Thank you.
07-03-2007 5:19 AM
Hi Madhu,
To hide the column use the following code.
MODULE hide_FIELDS OUTPUT.
IF p9555-subty = '1'.
LOOP AT SCREEN.
IF screen-group2 = 'ABC'.
<b>if screen-name = 'field name'.
screen-invisible = 1.</b>
MODIFY SCREEN.
ENDIF.
endif.
ENDLOOP.
ENDIF.
Regards,
Siva.
Message was edited by:
Siva Satya Prasad Yerra
07-03-2007 5:29 AM
HI,
Instead of SCREEN-GROUP1 use the COLUMN name that you want to disable along with SCREEN-NAME.
Regards,
Sesh
07-03-2007 2:35 PM
HI guyz,
thanks for the answers. i have included the column name in the screen-group2 . so should i remove that particular field from the group and include as screen-field separately. i have tried as you have said. its not working. please help me guyz.
Is it screen-name = 'ztable-z_opt' or is it like screen-name = 'Options'.(i mean should i use the technical name or the text name on the screen.)
By the way how do i award points. i am not getting options below your names.
Thank you.
Message was edited by:
madhu reddy
07-03-2007 2:51 PM
Hi Madhu,
see the example one below :
************************************************************************
Selection Screen
************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: s_werks LIKE zwafpo-dwerk OBLIGATORY DEFAULT '1000'.
"Plant
PARAMETERS: p_vdatu LIKE sy-datum OBLIGATORY modif id bel .
select-options : s_vdatu for sy-datum obligatory modif id rel.
SELECT-OPTIONS: s_waveno FOR zwafpo-zzrun. "Wave Run
SELECT-OPTIONS: s_dept FOR marc-zzdept OBLIGATORY. "Department
select-options : s_arbpl for RC68A-arbpl modif id arb.
select-options : s_mtart for mara-mtart modif id mta.
SELECT-OPTIONS: s_pwave FOR zwafpo-zzpwaveno.
SELECT-OPTIONS: s_swave FOR zwafpo-zzswaveno.
SELECT-OPTIONS: s_aufnr FOR zwafpo-aufnr.
SELECT-OPTIONS: s_matnr FOR zwafpo-matnr.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_conf AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(30) text-003.
SELECTION-SCREEN END OF LINE.
selection-screen : begin of block blk with frame title text-010.
parameters : p_old radiobutton group rad default 'X',
p_new radiobutton group rad.
selection-screen : end of block blk.
User Dynamic Selection
at selection-screen output.
select single * from t000md.
loop at screen.
case screen-group1.
when 'REL'.
if not p_old is initial.
screen-input = '0'.
screen-required = '0'.
screen-invisible = '1'.
endif.
modify screen.
when 'BEL'.
if not p_new is initial.
screen-input = '0'.
screen-required = '0'.
screen-invisible = '1'.
endif.
modify screen.
when 'ARB'.
if p_new is initial.
screen-input = '0'.
screen-required = '0'.
screen-invisible = '1'.
endif.
modify screen.
when 'MTA'.
if p_new is initial.
screen-input = '0'.
screen-required = '0'.
screen-invisible = '1'.
endif.
modify screen.
endcase.
endloop.
Thanks
Seshu