Using ABAP instrution to change screen field properties
Hi,
I've a screen (SE51) and i need to change field properties using an ABAP instrution.
I need to do this... if variable LV_NDEP_IN is not initial, user can't change field content.
I've tried this...
IF lv_ndep_in IS INITIAL.
SET CURSOR FIELD 'LV_NDEP_IN'.
ELSEIF lv_ndep_in IS NOT INITIAL.
screen-input = ' '.
MODIFY SCREEN.
ENDIF.
but doesn't work.
Can somebody help me ?
Thanks,
Moderator message - Please do not ask or answer basic questions
Points unassigned and thread locked
Rob
Similar Messages
-
Change screen fields properties
Hi all,
I am using a loop screen to change the properties of some teh fields od the following screen:
SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-003.
PARAMETERS: cb_af_e AS CHECKBOX USER-COMMAND abc.
PARAMETERS: p_pep LIKE anla-posnr,
p_centro LIKE anlz-kostl.
SELECTION-SCREEN END OF BLOCK bl3.
AT SELECTION-SCREEN OUTPUT.
IF cb_af_e = 'X'.
LOOP AT SCREEN.
IF screen-name = 'P_PEP' OR screen-name = 'P_CENTRO'.
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name = 'P_PEP' OR screen-name = 'P_CENTRO'.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Now, I would like to make fields P_PEP and P_CENTRO obligatory when checkbox cb_af_e is active.
Thanks a lot!
Regards,
Reyes.Hi
U should use a MESSAGE error to check if the user has inserted the parameter, because if you set the REQUIRED characteristic you can't deactive the checkbox:
SELECTION-SCREEN BEGIN OF BLOCK BL3 WITH FRAME TITLE TEXT-003.
PARAMETERS: CB_AF_E AS CHECKBOX USER-COMMAND ABC.
PARAMETERS: P_PEP LIKE ANLA-POSNR,
P_CENTRO LIKE ANLZ-KOSTL.
SELECTION-SCREEN END OF BLOCK BL3.
AT SELECTION-SCREEN OUTPUT.
IF CB_AF_E = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_PEP' OR SCREEN-NAME = 'P_CENTRO'.
SCREEN-INPUT = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
AT SELECTION-SCREEN.
IF CB_AF_E = 'X'.
IF P_PEP IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_PEP'.
EXIT.
ENDIF.
ENDLOOP.
IF SCREEN-INPUT = 1.
MESSAGE E208(00) WITH 'Insert P_REP'.
ENDIF.
ENDIF.
IF P_CENTRO IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_CENTRO'.
EXIT.
ENDIF.
ENDLOOP.
IF SCREEN-INPUT = 1.
MESSAGE E208(00) WITH 'Insert P_CENTRO'.
ENDIF.
ENDIF.
ENDIF.
Max -
Table for Screen Field Properties
Hi Guys,
I have strange requirement.
Lets say i have designed 5 fields in the Dialog Program. 2 fields belongs to Group1,another 2 fields belongs to Group2 and 3rd field is belongs to group3.
Where can i find those values (I mean which table). I belive it should be Program,screen no and data type.
Note : Groups you can set in Attributes of the field in Dialog Program.
Thanks
PoornaSetting Screen Field Attributes
Every screen field has attributes that you set in the Screen Painter when you define the
screen. At runtime, you may want to change these attributes, depending on what
functions the user has requested in the previous screen. At runtime, attributes for each
screen field are stored in a memory table called SCREEN. You do not need to declare
this table in your program. The system maintains the table for you internally and updates
it with every screen change.
The memory table SCREEN contains the following fields:
Name Length Description
NAME 30 Name of the screen field
GROUP1 3 Field belongs to field group 1
GROUP2 3 Field belongs to field group 2
GROUP3 3 Field belongs to field group 3
GROUP4 3 Field belongs to field group 4
ACTIVE 1 Field is visible and ready for input
REQUIRED 1 Field input is mandatory
INPUT 1 Field is ready for input
OUTPUT 1 Field is for display only
INTENSIFIED 1 Field is highlighted
INVISIBLE 1 Field is suppressed
LENGTH 1 Field output length is reduced
DISPLAY_3D 1 Field is displayed with 3D frames
VALUE_HELP 1 Field is displayed with value help
To activate a field attribute, set its value to 1. To deactivate it, set it to 0. When you set
the ACTIVE attribute to 0, the system suppresses the field and turns off the ready for
input attribute. The user can neither see the field nor enter values into it.
Note
You can define values for each of these attributes in the Attribs. for 1 field section in
the field list of the Screen Painter. If you need more information about attribute
meanings, see BC ABAP/4 Workbench Tools.
Modifying the Screen SAP AG
Setting Screen Field Attributes
32u20134 May 1997
As an example of modifying the screen dynamically, start with transaction tz50
(development class SDWA).
The transaction consists of two screens. In the first screen the user can enter flight
identifiers and either request flight details (by pressing a Display pushbutton) or press the
Change pushbutton to change the data of screen 200.
The field attributes are now set dynamically, according to whether the Display button or
the Change button was selected. In both cases the same screen is now called, but with
different field attributes.
If the same attributes need to be changed for several fields at the same time, these fields
can be grouped together. For example, in order to change the fields in screen 200
dynamically, we assign these fields in the Screen Painter to the group MOD. You can
specify up to four modification groups for each field. The contents of the Groups field
are stored in the SCREEN table.
The changes to the attributes of the fields in this group can be implemented in a PBO
module:
SAP AG Modifying the Screen
Setting Screen Field Attributes
May 1997 32u20135
MODULE MODIFY_SCREEN OUTPUT.
CHECK MODE = CON_SHOW.
L0OP AT SCREEN.
CHECK SCREEN-GROUP1 = u2019MODu2019.
SCREEN-INPUT = u20190u2019.
MODIFY SCREEN.
ENDLOOP.
ENDMODULE.
The memory table SCREEN contains each field of the current screen together with its
attributes.
The LOOP AT SCREEN statement puts this information in the header line of this system
table.
In this example taken from transaction tz50, if the user chooses Display then SCREENINPUT
is set to u20190u2019 and all fields belonging to the MOD group thus become display-only
fields.
Because attributes have been changed, the MODIFY SCREEN statement is used to write
the header line back to the table.
Modifying the Screen SAP AG
Changing Screen Field Attributes with the Function Field Selection -
Changing the field properties (editabel/greyed out) dynamically?
Hello
I am developing an Adobe interactive form. My requirement is dynamically changing the filed properties based on the other field values/selections/inputs.
1) For example in the form, if user puts value_A in field_1, then, the field_2 should be greyed out.
2) If user puts value_B in field_3, then, system automatically populate the value_C in field_4 in order to let the user make easy- user friendly
3) If user puts value_D in field_5, then, only allowed value in field_6 is value_E, if by mistake user puts value_F in field_6, then, system should throw error message
Pls. let me know how to achive this DYNAMIC functionality in the FORM or do we need to handle from WEbDynPro ABAP side?
Thank youHi,
Everything you have mentioned is possible in the form itself. Just write the valid script at valid event of valid field.
1) For example in the form, if user puts value_A in field_1, then, the field_2 should be greyed out.
Ans: Write on change event of Field1:
if($.rawValue eq "value_A")
then
Field2.access = "readOnly"
Field2.fillColor = "192,192,192"
endif
2) If user puts value_B in field_3, then, system automatically populate the value_C in field_4 in order to let the user make easy- user friendly
Ans: Write on change event of Field3:
if($.rawValue eq "value_B")
then
Field4.rawValue = "value_C"
endif
3) If user puts value_D in field_5, then, only allowed value in field_6 is value_E, if by mistake user puts value_F in field_6, then, system should throw error message
Ans: Write at exit event of Field6:
if(Field5.rawValue eq "value_D" and $.rawValue ne "value_E")
then
xfa.host.messageBox("Wrong Value", "Error", 0)
endif
For such type of scripts you can refer to designer help also. So please check there before posting your query that would save your time.
Regards,
Vaibhav -
How to change screen field value.
Hi Experts,
I like to change the screen field MSAUS(check box) of program SAPLIQS0 in one of the exit.But if I use
(SAPLIQS0)VIQMEL-MSAUS = 'X'. its showing compile error.Please tell me how can i change this field in this exit.
Regards,
Ajish.try something like this:
create field symbol
FIELD-SYMBOLS: <fs>.
Assign value of variable from calling prog to field symbol
ASSIGN ('(SAPLIQS0)VIQMEL-MSAUS' ) TO <fs>.
<fs> = 'X'.
Regards,
ravi -
Change screen field network and upload additional wbs network activity
Dear All,
1st. How can i change the screen field company code in network header (assignment tab) to input or required. I tried OPUA but it doesnt show company code. In default it shows that network header (company code) in display mode.
2nd. How can i add additional WBS,network and activity using additional enhancement for easy use method. Or in other word, is there any enhancement program..not cj20n / cj20?
really appreciate.
niesHi
2nd. is there any other solutions? users donot convinience to use cj20n / or copy from template? is there badi /program upload to be used? in other words, users can maintain it in excel then upload it..
Use this BAPI to create WBS elements
BAPI_BUS2054_CREATE_MULTI
Sorry for the my last post on the point 1
The company code for network order is coming from thw WBS element, that you cannot change in network order. This is standard setting.
Thanks
S.Murali -
Changing Screen field position dynamically
Hi,
Is there a way to change the position of screen fields dynamically in a module pool program?
My requirement is that based on the value of a variable, I need to arrange a few input and text fields on a subscreen in different order.
Points will be rewarded for helpful answers..
Regards
AbhishekHi,
For this what I can think of is that u need to create the fields multiple times on the same screen and then using SCREEN variables, u need to make them visible/invisible.
e.g. Say, u want Matnr at first position at one time and 6th position at another. In that case, what u can do is create the field MATNR twice and them hide/unhide it depending upon the condition.
Hope this helps.
Regards,
Himanshu -
Can i change a field properties without affecting source code?
I have an application that is running a test. A field ask a technician to add a serial number, however this field only accepts numeric characters and i have alphanumeric serial numbers. Can i change the porperty of this field wihtout affectinc the source code?
gluviano wrote:
> I have an application that is running a test. A field ask a technician
> to add a serial number, however this field only accepts numeric
> characters and i have alphanumeric serial numbers. Can i change the
> porperty of this field wihtout affectinc the source code?
No probably not, unless your chars are 0..9 and A..F only. In that case
you could change the numeric control to display Hexadecimal numbers.
Only 8 hex-char length however for the int32 which is the maximum size
integer you can use.
For anything else you need a string control to enter alpha chars. The
problem is even more complicated as you will have to change more things
downstram the wire where you use that serial number.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Acrobat 9.0 Changing Form Field Properties
When working with Form Fields in Acrobbat 9.0, how can I quickly and easily change a Text Field to a Check Box field without having to delete and then add in the new field? I thought right-clicking would do the trick, but it doesn't give me the option to change from a Text field to a Check Box field or vice versa.
Cannot be done. Its like asking how to change a chicken into a duck, they are both fowl but...
-
Change screen field dynamically only for decimal places
Hi,
I have variable for which is declared to take upto 3 decimal places, my requirement is ...
when this variable is getting populated for a particular screen i have to display decimal upto only 2 places, this data element is also used in other screens ao i cannot modify its domain directly...
is there anyway i can do it dyanmically when values are getting populated on screen
Regards,
Prateek.Hi,
If you want to use with WRITE statement:
Effect of different DECIMALS specifications:
DATA: X TYPE P DECIMALS 3 VALUE '1.267',
Y TYPE F VALUE '125.456E2'.
WRITE: /X DECIMALS 0, "output: 1
/X DECIMALS 2, "output: 1.27
/X DECIMALS 5, "output: 1.26700
/Y DECIMALS 1, "output: 1.3E+04
/Y DECIMALS 5, "output: 1.25456E+04
/Y DECIMALS 20. "output: 1.25456000000000E+04
If you want to use in ALV display - Fieldcatalog:
*-Decimal places for Del Qty and Bag Wt
IF p_fieldname = 'DELQTY' OR p_fieldname = 'BAGWT'.
ls_fieldcat-decimals = '000002'.
ENDIF.
APPEND ls_fieldcat TO gt_fieldcat.
Regards,
~Satya -
Change Dialog Screen Field Position Dynamically
Hi
Can I change screen field position at runtime?
I saw that in the SCREEN Structure there aren't any fields to set the position. Is there a Function Module or a Class to do that?
Thanks,
EyalHi Eyal,
Good Question.
1. R/3 abap does not allow this facility.
2. However, if we use a custom control /container,
then there one property LEFT, TOP,
which is avaialbe in the OO hierarchy.
CL_GUI_OBJECT 1
CL_GUI_CONTROL 2 <----
... CL_GUI_ALV_GRID, ETC. ETC.
3. This 2 has got this property
4. we can use like this.
CALL METHOD grid->set_top
EXPORTING
top = 1500
EXCEPTIONS
cntl_error = 1
OTHERS = 2.
5. I tried but i don't know why its not working.
regards,
amit m. -
Changing text field (need more positions) of variant ZUK01 in FF67
I am using a variant called ZUK01 in FF67. In that variant I have a Line item text field, but with not enough positions.
Is it possible to change the field properties so I can change the positions of the field?
I want to use the variant but need to feel in more text then I have positions.
Is it possible to change it? So yes where can I find it?Hi,
You could go to OT43 tcode (screen variant maintenance for manual bank statement); double click on your variant and note down your Field name (for text); then click on "Technical names" and note down the table and field for that field name. Then, from SE11; you can find out how many characters that field (data element) allows. Then, you can talk to ABAP team member for the possibilities: to enhance that data element or use another field for your purpose.
Mani -
Regarding screen fields include in purchase order transaction
Hai guys,
I need to add new field in purchase order transaction ( me21n, me22n, me23n ) . i have added the new field in screen painter. when i was creating the field and then i made the field to refer from dictionary , when i refer from dictionary the field is showing in non-editable format.how to make the field as editable format to enter the value.what is the settings behind it please explain.
for your information i have added one more field without refering dictionary it is accepting inputs .
Regards,
N.selvamuthukumar.thanks for your reply.
we have already done the changes as you mentioned. but still we are facing the same problem of inactive state on the newly created field.
kindly suggest any other settings to be done for dictionary related fields.. (we have enabled the dictionary related option in the screen field properties menu)
otherwise provide step by step setting for new field creation.....(se51)
thanks with regards
selva -
Hi Experts,
Is there any way to display for example customer name on the right of a customer code select option in a report? Is just the same like in screen, when we define an input field for customer code and one output field to display the customer name based on what he or she enters.
I am doing this way but got stuck:
SELECTION-SCREEN BEGIN OF BLOCK r01 WITH FRAME TITLE text-003.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT (28) FOR FIELD cust.
SELECT-OPTIONS: cust FOR kna1-kunnr NO INTERVALS NO-EXTENSION. <--------the customer code
SELECTION-SCREEN POSITION 48.
PARAMETERS: name LIKE kna1-name1. <--------the customer name
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK r01.
How can i show the customer name field as output only?
I have used screen-output = 1, but the layout is not the same when we choose it from the screen field properties --> output only.
Please advise.
Thanks
Edited by: starry99 on Nov 3, 2009 4:59 PMHi,
<li>Try this. It works.
REPORT ztest_program.
DATA: BEGIN OF it_kna1 OCCURS 0,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
END OF it_kna1.
DATA:
i_return_tab TYPE STANDARD TABLE OF ddshretval,
w_return_tab TYPE ddshretval.
DATA:w_dynpfields TYPE dynpread,
i_dynpfields LIKE STANDARD TABLE OF dynpread.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
TABLES kna1.
SELECTION-SCREEN BEGIN OF BLOCK r01 WITH FRAME TITLE text-003.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT (28) FOR FIELD cust.
SELECT-OPTIONS: cust FOR kna1-kunnr NO INTERVALS NO-EXTENSION. " <--------the customer code
SELECTION-SCREEN POSITION 48.
PARAMETERS: name1 LIKE kna1-name1. " <--------the customer name
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK r01.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'NAME1'.
screen-input = '0'.
screen-output = '1'.
screen-display_3d = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
"F4 Help for Werks
AT SELECTION-SCREEN ON VALUE-REQUEST FOR cust-low.
IF it_kna1[] IS INITIAL.
SELECT kunnr name1
FROM kna1
INTO TABLE it_kna1.
ENDIF.
"Function module for F4 help
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'KUNNR' "field name on f4 help window
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'CUST-LOW' "Screen field name
value_org = 'S'
TABLES
value_tab = it_kna1
return_tab = i_return_tab.
READ TABLE i_return_tab INTO w_return_tab INDEX 1.
cust-low = w_return_tab-fieldval.
READ TABLE it_kna1 WITH KEY kunnr = cust-low.
IF sy-subrc = 0.
w_dynpfields-fieldname = 'NAME1'.
w_dynpfields-fieldvalue = it_kna1-name1.
APPEND w_dynpfields TO i_dynpfields.
CLEAR w_dynpfields.
"DYNP_VALUES_UPDATE
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = i_dynpfields.
ENDIF.
Thanks
Venkat.O -
How ti disable screen fields in Module pool
hi
How to change screen fields to DISPLAY MODE aftr clicking on a particular pushbutton in Module pool prg .
regards
chetan
Edited by: chetan teli on Jul 29, 2008 1:04 PMhiiii
use following code for disabling field
IF p_rad2 IS INITIAL .
LOOP AT SCREEN.
IF screen-name CS 'p_docno'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " IF screen-name CS 'p_docno'.
ENDLOOP. " LOOP AT SCREEN.
ELSE.
LOOP AT SCREEN .
IF screen-name CS 'p_docno'.
screen-active = 1.
screen-input = 1.
MODIFY SCREEN.
ENDIF. " IF screen-name CS 'p_docno'.
ENDLOOP. " LOOP AT SCREEN .
ENDIF. " IF p_rad2 IS INITIAL .
regards
twinkal
Maybe you are looking for
-
I've bought several apps before that work fine. All of a sudden I try to download yelp and it says it is works then it's not on the screen and I can't open it in the downloads section. Any ideas on what to do???
-
Generate a text .sql (another question)
thanks for your script V. garcia about generate a text .sql but, i want to know if i want to generate a text sql with a database but i want to take juste object without row inside. In fact, i want empty base, juste object? Is it possible? thanks for
-
Need Interactive Report EBiz 11.5.9 inventory tables and views over DB Link
I need to create an Interactive report on this SQL: select glcc.segment4 as ENTITY_CODE , glcc.segment2 as DEPARTMENT_NUMBER , glcc.segment1 as Account , ai.VENDOR_NUMBER as VENDOR_NUMBER , ai.VENDOR_NAME as VENDOR_NAME , aiv
-
Footers only print on front page when using two sided printing.
I am printing front to back and for some reason the footers in my document are only printing on one side of the page. My headers are printing on both sides.
-
My wifi keeps cutting out on my 1st gen iPad since I updated to iOS 5.0... It's never done this before. The wifi is working fine on my other devices. Not really sure what to do.