12-18-2013 5:28 AM
Dear experts,
In module pool i get some fields from data dictonary .i want one field among them should enable(Display) only when Submit button press and diable before SUBMIT push button press.
I am able to disable the I/O field but not able to disable the text field Of same field even though i assign same groupname to both fields can anyone give solution for this.
Thanks in advance.
12-18-2013 5:34 AM
You keep the field initial in display mode only. Lets say field name is ABC.
When you press submit... in PBO of screen
if sy-ucomm eq 'SUBMIT'.
loop at screen.
if screen-name eq 'ABC'---"should be in caps
screen-input = 1.
modify screen.
endif.
endloop.
endif.
10-10-2015 1:20 AM
Thanks for mentioning screen name should be in caps, was helpful.
12-18-2013 5:35 AM
hi rajendra,
all the fields in the screen have a screen name , Use it
if sy-ucomm EQ 'SUBMIT'.
loop at screen.
If screen-name = 'textfield'.
screen-active = 1.
modify screen.
endif.
endloop.
elseif sy-ucomm NE 'SUBMIT'.
loop at screen.
If screen-name = 'textfield'.
screen-active = 0.
modify screen.
endif.
endloop.
endif.
sivaganesh
12-18-2013 5:36 AM
Hi Rajendra,
Find the name of the field and and make the screen active property as 0 after the submit button check .
Loop at screen.
if screen-name = 'XXXX'.
screen-active = 0.
modify screen.
end screen.
12-18-2013 5:43 AM
if sy-ucomm EQ 'SUBMIT'.
loop at screen.
If screen-group = 'screen group name'. "you can use screen-name also
screen-invisible = '1'.
modify screen.
endif.
12-18-2013 5:47 AM
Hi Rajendra,
Consider if Text Field Screen name is XXXX and your submit code FUNC name is SUBM.
Write the Coding in PBO of screen...
if sy-ucomm eq 'SUBM'.
loop at screen.
if screen-name = 'XXXX'.
screen-active = 1.
endif.
modify screen.
enloop.
else.
loop at screen.
if screen-name = 'XXXX'.
screen-active = 0.
endif.
modify screen.
enloop.
Please use in this logic.. it may satisfies your requirements.
Regards,
Thangam.P
12-18-2013 6:15 AM
hi,
if you to enable the screen give 1 in screen-active. if u want to disable means give 0 to screen -active.
loop at screen.
if screen-name = 'SUBMIT'
screen-active = 0.
endif.
modify screen.
Regards,
gopi
12-18-2013 7:12 AM
Hi Rajendra,
try the below codes. It will help you surely.
if sy-ucomm EQ 'SUBMIT'.
loop at screen.
If not screen-group1 = 'scrn_grp_name'. "Include other conditions if any.
screen-input = '0'. "use screen-invisible to hide
modify screen.
endif.
endloop.
Hope it will help you.
-Regards
Janaraja
12-18-2013 7:18 AM
Looks like you are using your own label to display text with help of Screen Element "Text". If that is the case then select that Text on screen layout and assign Group same as I/O field. So that you can disable entire group (Text and I/O field) with modify screen syntax.
Thanks,
Naveen
12-18-2013 7:22 AM
Thanks all but when i am able to diable I/O field(TEXTBOX) but not TEXT field(LABEL) but both are under same group(ex: G11).why one disable and one canot.
12-18-2013 8:13 AM
Hi Rajendra,
Please share the coding and screen shot of screen painter
12-18-2013 8:21 AM
12-18-2013 8:23 AM
Can you please attach screen shot of attributes where you have define them in one group along with your sample code
12-18-2013 8:26 AM
Can you please try by giving name instead of group for text field ?
I have used the below code and able to hide/unhide text field.
MODULE pbo OUTPUT.
IF sy-ucomm = 'SUBMIT'.
LOOP AT SCREEN.
IF screen-name = 'ZT001-TEXT'.
screen-invisible = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name = 'ZT001-TEXT'.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
BR
Sumeet
12-18-2013 8:58 AM
Hi,
Hope this will help you if you try using name instead of group name,
DATA
sycomm type sy-ucomm.
sycomm = sy-ucomm.
IF sycomm = 'SUBMIT'."FC code for push button
LOOP AT SCREEN.
if screen-name = 'TEXT_FIELD'."Name of that text field
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
else .
LOOP AT SCREEN.
if screen-name = 'TEXT_FIELD'."Name of that text field
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF
.
that text field will be disable(wont display) when you execute it, When you click on submit button that text field will be displayed.
12-18-2013 9:15 AM
Hi,
If you are using group make sure for both fields u give same group name, and make sure in which box you are giving group name among 4 boxes in screen field properties. in below example i have used one text field & one IO field which i grouped under GR1(in 1st box). so I have used screen-group1 = 'GR1'. whatever attributes you are grouping under that particular group will be disabled.
IF sycomm = 'SUBMIT'.
LOOP AT SCREEN.
if screen-group1 = 'GR1'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
else .
LOOP AT SCREEN.
if screen-group1 = 'GR1'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF
.
When you actually execute this code.. only you can see submit push button.. when you click on submit it will display both text field & IO field.
Hope this will solve your issue.
12-18-2013 10:05 AM
Thankyou all if i take text field it is not disabling even though both group1 names are same so i take both as I/O field and i think its working fine.
12-19-2013 6:20 AM