Making a field on screen input enabled or disabled
Dear Friends,
Please suggest how can I make a field on my dialog-program screen input enabled or disabled through coding. I understand that the same can be done by setting screen parameters but i wish to do that through programming only.
Regards,
Alok.
Hi Alok,
A field can Enabled or Disabled by setting its attributes.
As it is a element placed on screen and modify the screen you need to modify the screen table.
loop at screen.
screen-group1 = 'SC1'.
Enable:
if screen-name = 'PA_MATNR':
screen-input = '1'.
screen-output = '0'.
modify screen.
endif.
DISABLE:
if screen-name = 'PA_MATNR':
screen-input = '0'.
screen-output = '1'.
modify screen.
endif.
endloop.
Some more Info :
1 --- Active
1 --- Input
1 --- Output
0 --- Invisible
Screen field is displayed, even if Invisible is set statically.
Field contents are displayed.
Ready for input, even if Input is not set statically. However, not ready for input if the Output only is set statically.
1
1
0
0
Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
Field contents are not displayed.
Ready for input, even if Input is not set statically.
1
0
1
0
Screen field is displayed, even if Invisible is set statically.
Field contents are displayed.
Not ready for input, even if Input is set statically.
1
0
0
0
Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
Field contents are not displayed.
Not ready for input, even if Input is set statically.
1
1
1
1
Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
Field contents are not displayed.
Ready for input, even if Input is not set statically. User input is masked by asterisks (*).
1
1
0
1
Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
Output is masked by asterisks (*).
Ready for input, even if Input is not set statically. User input is masked by asterisks (*).
1
0
1
1
Screen field inactive.
Screen field is not displayed, regardless of the static attributes.
0
0
0
1
Screen field inactive.
Screen field is not displayed, regardless of the static attributes.
Br,
Laxmi
Similar Messages
-
Selection screen dynamic enable and disable
HI all,
I have one requirement like
on selection of redio button my selection screen hould be enable and disable
Like if i select rediobutton tfile then my selection screen block B2 should enable and Block B3 hould be disable
If redio button selscr is selected then my block B3 should be enable and Block B2 should disable
my selection screen code is below
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-005.
PARAMETERS: tfile RADIOBUTTON GROUP g1 DEFAULT 'X'.
PARAMETERS: selscr RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR marc-matnr,
s_fkdat FOR vbrk-fkdat OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
PARAMETERS : filename TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b3.
How to do that.
Help me here its urgent tnx in advance.Hi Lalit,
Check the below code.
TABLES: marc, vbrk.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-005.
PARAMETERS: tfile RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND rusr.
PARAMETERS: selscr RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR marc-matnr MODIF ID abc,
s_fkdat FOR vbrk-fkdat MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
PARAMETERS : filename TYPE rlgrap-filename MODIF ID def.
SELECTION-SCREEN END OF BLOCK b3.
AT SELECTION-SCREEN OUTPUT.
*Note: To disable the fields use the below one.
LOOP AT SCREEN.
IF screen-group1 = 'DEF'. "Name field
IF selscr = 'X'.
screen-input = 1.
ELSE.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'ABC'. "Name field
IF selscr = 'X'.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*Note: To hide the screen use the below one.
LOOP AT SCREEN.
IF screen-group1 = 'DEF'. "Name field
IF selscr = 'X'.
screen-active = 1.
ELSE.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'ABC'. "Name field
IF tfile = 'X'.
screen-active = 1.
ELSE.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP. -
Selection screen, dynamic enable and disable of blocks
Hi,
i have several parameters in different blocks.i want to enable one block and disable other blocks depending on the radio button selection. could some one help me on this.
for eg.
radiobutton1. under this text entries for date, time etc.
radiobutton 2. under this text entries for location from, location 2,phone etc.
so, if i select radio button 1 all the remaining text entries under other radio buttons should be disabled. how to do this.
your help would be appreciated.
Thanks,
kranthi.Hi Kranthi,
I am not sure what you meant by disabling all the selection screen fields. Are you saying ALL the selection screen fields or all fields that don't belong to the selected radio-button.
Anyway, here is a sample code how you manipulate the selection screen. The key options to use are 'modif id', 'at selection-screen output' and 'loop at screen'.
*------------------------ Selection Screen ---------------------------*
SELECTION-SCREEN BEGIN OF BLOCK selscr WITH FRAME TITLE text-000.
PARAMETERS: p_rad1 RADIOBUTTON GROUP rad1 USER-COMMAND a DEFAULT 'X',
p_rad2 RADIOBUTTON GROUP rad1,
p_rad3 RADIOBUTTON GROUP rad1.
*-- Selection Screen for radio button 1
SELECTION-SCREEN BEGIN OF BLOCK rad1 WITH FRAME TITLE text-001.
PARAMETERS: p_date LIKE sy-datum DEFAULT sy-datum MODIF ID one.
SELECT-OPTIONS: s_uzeit FOR sy-uzeit MODIF ID one.
SELECTION-SCREEN END OF BLOCK rad1.
*-- Selection Screen for radio button 2
SELECTION-SCREEN BEGIN OF BLOCK rad2 WITH FRAME TITLE text-002.
PARAMETERS: p_werks LIKE t001w-werks MODIF ID two.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(6) text-003 MODIF ID two.
SELECTION-SCREEN POSITION 8.
PARAMETERS: p_chk AS CHECKBOX DEFAULT 'X' MODIF ID two.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK rad2.
*-- Selection Screen for radio button 3
SELECTION-SCREEN BEGIN OF BLOCK rad3 WITH FRAME TITLE text-004.
PARAMETERS: p_matnr LIKE mkal-matnr MODIF ID tri,
p_verid LIKE mkal-verid MODIF ID tri.
SELECTION-SCREEN END OF BLOCK rad3.
SELECTION-SCREEN END OF BLOCK selscr.
AT SELECTION-SCREEN OUTPUT.
IF p_rad1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'TWO' OR
screen-group1 = 'TRI'.
screen-input = 0.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF p_rad2 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'ONE' OR
screen-group1 = 'TRI'.
screen-input = 0.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF p_rad3 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'ONE' OR
screen-group1 = 'TWO'.
screen-input = 0.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
If you want to hide all the, I mean all except the radio-buttons, then simply loop at screen and modify every entry except the radio-button entries to screen-active 0. Something like this.
LOOP AT SCREEN.
IF SCREEN-NAME = 'RAD1' OR
SCREEN-NAME = 'RAD2 OR
SCREEN-NAME = 'RAD3'.
ELSE.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Srinivas -
Making Mandatory fields on Screen and vice versa
Hi,
I've developed a screen on which i've a field say X. Initially when the screen is shown the field is not mandatory as user may or may not enter its value.
But when he enters its value, then i've to make field Y and field Z mandatory also.
For this in PBO i've called a module which would make the necessary screen change.
LOOP AT SCREEN.
IF X IS NOT INITIAL.
IF ( screen-name = 'Y' OR
screen-name = 'Z' ).
screen-required = '1'.
ENDIF.
ELSE.
IF ( screen-name = 'Y' OR
screen-name = 'Z' ).
screen-required = '0'.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Though the above code makes the field Y and Z mandatory but when the user clears the field X value still it shows them mandatory which i don't want
How can i handle this?
PLZ HELP!Hi
What everyone described is using code block..
why not you should define it while designing the screen.
on defining the field Input/Output Field Attributes of Y & Z , define program-> input -> Required.
In detail :
INPUT/OUTPUT Field of Y & Z
Attributes
Dict | Program | Display
*Under Attributes -> Program -> Input (drop down list) -select as Required.*Hope it will work fine.
Rewards Points if useful -
Making material group field in ME22n transaction as Input Enabled
Hi,
I have a requirement in my project, where I need to make the material group field as Input Enabled.
The reason for this being, that after a PO is created, the user might change the material group of the material(using MM02). The new material group must reflect in the already created PO's.
I have searched and gone through the previous threads, which say that it is impossible for new material group to be reflected in the already created PO.
But we can make it as input enabled field, instead of changing the material group, so that user can MANUALLY change it.
I searched and found out that material group cannot be made as Input Enabled field using SPRO settings.
Also there is no BADI or user exit where we can code for it an make it as input enabled.
But there is some internal enhancment point, in the SAP source code, where we can go and do the coding for it. I am sure about it because I have seen such a scenario earlier also.
Can someone help me in finding out the particulare enhancement point where we can code for our field to become Input Enabled?
Thanks in advance.
Ramesh SinghNot possible - if it is SAP standard field.
Regards,
Subramanian V. -
How to get the value entered in input enabled field of a list output?
Hi all,
I am developing a program to display list with two input enabled fields . After users enetered the values into these fields I need to do some calculations based on these values and modify the value of another field in the list.
But i couldn't have an idea how to read the values after users enter into these fields.
Please help me on solving this problem? If possible please provide the sample code.
Thanks,
Aravind.You can enable disable screen fields in at selection screen output event.
And by using loop at screen.
And for changing the values you can do in initialization event.
I Hope you are doing these in Reports. -
How i can show the selection screen input field in the top of page in alv
hi ,
how i can show the selection screen input field in the top of page in alv grid output.
tell me the processHi,
excample from my program:
FORM topof_page.
DATA: l_it_header TYPE TABLE OF slis_listheader WITH HEADER LINE,
l_info LIKE l_it_header-info.
DATA: l_it_textpool TYPE TABLE OF textpool WITH HEADER LINE.
DATA: l_key LIKE l_it_textpool-key.
READ TEXTPOOL c_repid INTO l_it_textpool LANGUAGE sy-langu.
DEFINE m_selinfo.
if not &1 is initial.
clear l_it_header.
l_it_header-typ = 'S'.
l_key = '&1'.
translate l_key to upper case.
read table l_it_textpool with key key = l_key.
if sy-subrc = 0.
shift l_it_textpool-entry left deleting leading space.
l_it_header-key = l_it_textpool-entry .
endif.
loop at &1.
case &1-option.
when 'EQ'
or 'BT'
or 'CP'.
write &1-low to l_it_header-info.
when others.
write &1-low to l_it_header-info.
concatenate &1-option
l_it_header-info
into l_it_header-info
separated by space.
endcase.
if not &1-high is initial.
write &1-high to l_info left-justified.
concatenate l_it_header-info
l_info
into l_it_header-info
separated by space.
endif.
if &1-sign = 'E'.
concatenate ']'
l_it_header-info
into l_it_header-info.
endif.
append l_it_header.
clear: l_it_header-key,
l_it_header-info.
endloop.
endif.
END-OF-DEFINITION.
m_selinfo: s_trmdat,
s_trmext,
s_trmint,
s_fkdat,
s_delno,
s_vbeln,
s_deact,
s_kdmat.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = l_it_header[].
ENDFORM.
I hope, this will help you.
Regards
Nicole -
Short Dump while making a fields as required in BDT object screens
Hi,
I'm making a field as "required" by checking the required button on that field in the BDT screen.
But am getting a short dump when I'm trying to use that screen.
It seems like some data is getting converted to bad format due to this (am not fully sure about it.)
Any idea on this.
Thanks & Regards,
Vipul.Hi Pinaki,
The entire functionality is working absolutely perfect if I dont check that field as "Required" .
I'm not sure if I'm missing some customising or is it a problem with BDT.
Thanks & Regards,
Vipul. -
Custom field in Bid Quote not editable/input enabled/changable
Hai All,
In the SRM Surrogate Bidding process , PO is generated from the Quotation which corresponds to the bid which has been accepted. Now before generating the PO we need to pass the Ordering vendor address information from the Quotation back to the PO. We added a custom field to the Quotation following Note 672960 - User-defined fields 2 and it is being added to the BASIC DATA TAB in the Header data of the Quotation, but we are not able to enter any values since it is in display mode.
We then referred Note 809630 - Customer field in bid invitation and bid - How does it work? ( after referring Notes 458591 and 672960), and found that we need to implement the methods MODIFY_SCREEN and MODIFY_MODE_QUOT of the BADI BBP_CUF_BADI_2.
The MODIFY_SCREEN method works fine, but the MODIFY_MODE_QUOT is not getting called during the Bidding process. MODIFY_MODE_QUOT is already existing in the system as per the Note 822424 - CUF. Customer fields cannot be changed in the bid . Also Function-Pool SAPLBBP_PDH_CUF does not have any calls to the method MODIFY_MODE_QUOT but it has calls for the other 3 methods present in that BADI.
We would like to know (1) How we can make this MODIFY_MODE_QUOT work? (2) And if it is working, Will MODIFY_MODE_QUOT along with MODIFY_SCREEN make the field in the Quotation Input enabled, and/or (3) Is there any other way by which we could make the field Input enabled, for the Users to enter some values, before they Click the Generate PO button.
Please help.
Thanks,
GhaneshHi Ghanesh and SRM experts,
I went through your link mentioned below and I have the EXACT same issue. I am using SRM 5.5 and I have added a custom field to the quotation item level. I am unable to make this field editable no matter what I do .
1) I have gone through all notes mentioned in your scrap and I have implemented them all .
2) I have added the custom field to INCL_EEW_PD_ITEM_CSF_QUOT and INCL_EEW_PD_ITEM_CSF.
3) I have also implemented BADI BBP_CUF_BADI_2 and I confirm that the method MODIFY_MODE_QUOT is never getting called. MODIFY_SCREEN is getting called , and the value of the flag ET_FIELDS-XINPUT is always 'X'. Still the quotation field is display only.
Your post is dated a few months back. If you have solved this problem could you please let me know how.
Help from anyone who anything about the above will be appreciated.
Thank You .
Regards,
Ajali Sen -
Need to hide the field based on input to other field on screen
Hi All,
I enhanced the std. infotype 1029.Now I need to display one custom field only if another custom field (check box) is enabled, otherwise no.
I tried writtinf code in PBO of ZP102900 in subscreen 0200.
loop at screen.
if screen-name = 'fld1'.
if 'fld1' = 'X'. -
>if chk box is selected then it shud display the fld2 on the screen along with fld1
screen-name = 'fld2'.
endif.
endif.
endloop.
But no results:-(
Can you please help me out in this ASAP.
Thanks in advance.
Regards,
AshwiniHi All,
Finally I got the results:-)
Solution:
in PBO module:
LOOP AT SCREEN.
if SCREEN-NAME = 'P1029-<FLD2>'.
IF P1029-FLD1 = 'X'.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ELSE.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
endif.
ENDLOOP.
in PAI module:
LOOP AT SCREEN.
if SCREEN-NAME = 'P1029-<FLD2>'.
IF P1029-<FLD1> = 'X'.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
endif.
ENDLOOP.
Thanks for your valuable time.
Regards,
Ashwini -
Grey out screen Fields after entering input using F4 help without an enter code
Hi Experts,
We have a requirement where we want the Input field on a dialog box screen to be greyed Out as soon as the user enters an
input in the respective field using F4 help without processing an ok code in PAI .
Hence we want to achieve a secured input feature that prevents user from altering the values coming from check table.
Regards
KunalHello Kunal,
Try below code, it works for me.
TABLES : MARA.
DATA: BEGIN OF IT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF IT_MARA.
DATA : IT_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.
PARAMETERS: p_matnr LIKE mara-matnr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
SELECT MATNR FROM MARA UP TO 10 ROWS INTO TABLE IT_MARA.
SORT IT_MARA BY MATNR.
DELETE ADJACENT DUPLICATES FROM IT_MARA COMPARING MATNR.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATNR'
DYNPPROG = SY-REPID
DYNPNR = '1000'
DYNPROFIELD = 'P_MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = IT_MARA
RETURN_TAB = IT_RETURN
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'P_MATNR'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards,
Thanga -
Hi all,
In ME22 Transaction, the DOCUMENT DATE (BUDAT) field by default is disabled .
I have to made it as enabled.
Please suggest me how to make the posting date field as enabled
Are their any BADIS or field exits or any way to solve this problem
Regards
AjayIt can be done by creating transactional variant in the tcode SHD0.
In the field Transaction on SHD0 enter the transactioncode for the screen you want to modify (E.g. VA03)
In the field Variant on SHD0 enter the name you want to give the transaction variant (E.g. ZVA03)
Press Create
Now the screen for the transaction is shown and you can enter default values in the fields of the screen
Press Enter. Now a screen that enables you to make further customizing (Hide, Output only, Invisible,
Mandatory) if the screen fields is shown.
After you have finished customizing the screen press Enter to go to the next screen and exit
to save the Transaction variant.
Check the tcode the field is made enabled. -
How can we restrict the sub-screen input field for particluar country?
Hi all i am having infotype 21 maintained with custom fields for sub-screen 200.
Out of that custom fields(City , District) They restricted city field not to appear for australian employees.
and district is sucesfully appearing .
They have written logic in the sub-screen 200 in PBO.this is reflecting in alll sub-types of 21(alomst 20 subtypes)
module abc_output.
If T001P-MOLGA = 'australia'.
if screen name = 'city'.
screen-input = 'OFF'.
screen-invisible = 'ON'.
endif.
endif.
Now the requirement is that this logic should be modified such that this city should appear in 7 sub-type instead of district.
what should be written can any one guide please .
regards
sasHi we can do in this way.
If T001P-MOLGA = 'australia'
if p00021-subty ne '7'.
if screen name = 'city'.
screen-input = 'OFF'.
screen-invisible = 'ON'.
endif.
endif.
if p0021-subty = '7'.
if screen name = 'district'.
screen-input = 'OFF'.
endif.
endif.
Thanks and closing the thread
regards
sas -
Enabling custom field in screen after error msg
HI experts,
I m facing problem in enabling screen field in infotype screen. That is, i have added a custom field in std infotype screen and this is shown in enable mode by default. In PA30, im enterig values for all fields in the infotype and press SAVE.
At that time, an error message is thrown by the system. Becoz of this error message, my custom field is changed to disable mode and also gets shrinked.
Can anyone suggest me how to enable my own field in screen even after the error msg returned by the system?There are two ways to cater such a kind of problem.
either you can enable custom field manually by writing code or
you can change field group. -
Making a particular row input enabled in ALV grid
I am using set_table_for_first_display Method of class cl_gui_alv_grid in order to display the ALV table control.i want one whole column(flag) to be input enabled all the time.so i have defined in FCAT for that column EDIT as X.Now i have defined a custom toolbar button SAVE using handle_toolbar. My requirement is when the user inputs M in the flag column of a particular row and press SAVE button that row should be made input enabled. i have used method set_ready_for_input in the handle_user_command FOR go_grid, but it is not working.Please help.Thanks in advance.
done..
Maybe you are looking for
-
While i compile this code to create dll file using command line compiler , it shows error in "twain.h" y it is showing error in twain.h? #include <jni.h> #include "Tmanager.h" #include "twain.h" JNIEXPORT jboolean JNICALL Java_Tmanager_isvalidDriver(
-
Amusing little image size/dpi bug in CS5
Has anyone else discovered PS CS5 applying nearly random dpi settings to newly opened documents? This is not a destructive bug, as far as I can tell, but when I open "Image Size," PS will sometimes give me a whacko value for dpi (something like 1.2
-
Why does Write File.vi put a square in front of the data?
I am write a program to run a 601PRO Safety Analyzer using the serial port. I am trying send the results from my program to either a text file or an Excel file. If I use Write to Spreadsheet File.vi I can't get the time/date stamp to work, plus I wou
-
Conte,t Server Error 405 - Method not allowed
Hi, I've got a running content server 6.4 with Apache 2.0 on SuSE Linux 10 and MaxDB 7.6 Things like htpp://myserver:1090/ContentServer/ContentServer.dll?serverInfo and the likes all respond well. However, executing SE38 with RSCMSTH0 shows problems
-
Down load of Adobe creative suite 5.5 premium
Dear Adobe, Fabulous1, I need to download a copy of Adobe creative suite 5.5 premium, I have downloaded the Adobe download Assistant, but the only programs it has for downloading are Photo shop 12 and Adobe 12 can you help me get on the right path?