Transaction programming - Making screen fields 'output only'
Hi all,
I have a problem concerning a screen - it is so that the screen is used by several transactions - Create 'plan', Display 'plan' and Change 'plan'.
When it's called from the 'Display' transaction I want the screen to be output-only. So I wrote something like this:
MODULE modify_screen OUTPUT.
if sy-tcode = 'ZAF03'.
loop at screen.
if screen-name cp 'I_AFPL*'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
ENDMODULE.
The problem is that this screen contains a tabstrip control. The subscreens on the pages of the tabstrip control contain table controls, and the table controls refer to some internal tables in the program.
All the fields which I want to make 'output only' are fields of internal tables beginning with 'I_AFPL' that's why the condition...
This works very well for the fields on the main screen, but not for the fields of the table controls on the tabstrip control... and I'm calling that module from the main screen and also from the subscreens of the 'pages' of the tabstrip control. In the debugger I see that the input is set to 0 but when the screen 'comes on screen' I can still do input in those fields...
Can anyone tell me what I'm doing wrong?
Thanks,
Hi Ashish,
for table control to disable a column we use the cols property in the screen'..the tablecontrol-cols is set to zero to inactivate a column
Now assume the name of your table control is ZTABLECONT..double click on the screen painter on the table control..these 2 names must be the same....
if you need to disable columns of table control as a part of user action..like say click of a button..it can be entered in PAI by checking the sy-ucomm
data declaration:
data : cols like line of ZTABLECONT-cols.
Case sy-ucomm.
when 'PUSH'.
loop at ZTABLECONT-cols into cols.
if cols-screen-input = '1'.
cols-screen-input = '0'.
endif.
modify ZTABLECONT-cols from cols index sy-tabix.
endloop.
endcase.
This will disable all the columns
for a particular column do the following
For this imagine you have 5 columns
in the below code
index = 1 => column 1
index = 2 => column 2
index = 3 => column 3
index = 4 => column 4
index = 5 => column 5
in the below code , only column2 will be disabled....
so whicever column you want to disable ..just give the index
for multiple disabling..just write the code accordingly
LOOP AT ZTABLECONT-cols INTO cols WHERE index = 2.
IF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY ZTABLECONT-cols FROM cols INDEX sy-tabix.
ENDLOOP.
Pls check and revert....
Regards
Byju
Similar Messages
-
Making selection-screen fields output only
Hi all and thanks for the quick replies to my last question!
Here comes another one: Does anyone know how to display a parameter field in a selection screen as output only?
Thanks
Magnushi Magnus,
Check event AT SELECTION-SCREEN OUTPUT.
<b>PARAMETERS: P_MNTH RADIOBUTTON GROUP H1 USER-COMMAND ABC DEFAULT 'X'</b>
MODIF ID ABC.
<b>AT SELECTION-SCREEN OUTPUT.
IF P_DETA = 'X' OR P_STRT = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.</b>
Regards,
santosh
Message was edited by: Santosh Kumar P -
Making parameter fields output only dynamically
Hi all!
I have four different radiobuttons in a selection screen and when some of them are chosen I want some parameter fields in the selection screen to be output only. Is that possible or do parameter fields have to be made output only in the at selection-screen output event?
Thanks
MagnusHi,
check this code :
PARAMETERS: r1 RADIOBUTTON GROUP rad1 DEFAULT 'X',
r2 RADIOBUTTON GROUP rad1.
PARAMETERS: TXT1(10) type c,
TXT2(10) type c,
TXT3(10) type c,
TXT4(10) type c.
implement below code under AT SELECTION-SCREEN OUTPUT event.
AT SELECTION-SCREEN OUTPUT.
When user selects the first radio
IF r1 = 'X' .
LOOP AT SCREEN.
IF screen-name = 'TXT3' OR screen-group1 = 'TXT4'.
screen-input = '0'.
MODIFY SCREEN.
ELSEIF screen-name = 'TXT1' OR screen-group1 = 'TXT2'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF r2 = 'X' .
LOOP AT SCREEN.
IF screen-name = 'TXT1' OR screen-group1 = 'TXT2'.
screen-input = '0'.
MODIFY SCREEN.
ELSEIF screen-name = 'TXT3' OR screen-group1 = 'TXT4'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards
Appana
*Reward Points for helpful answers -
Make SAP standard PO fields output only using ME22N?
Is there a way to suppress the standard SAP fields (output only) when the user selects ME22N, that will still allow input to custom fields which have been added to EKPO? Has anyone had to do this before? Any suggestions would be greatly appreciated!
Sharon GermanHi Sharon,
FYI, there is probably a better forum for this question, this is more of a NetWeaver discussion forum.
If I read your question correctly, your desire is to have only certain fields (some custom) available when users execute the transaction ME22N. First, don't mess with ME22N, if you desire custom performance, create a new transaction as a copy of ME22N and make available only those standard and custom fields you want. Hope this helps... -
hi can any one help in making the field email as a mandatory in su01 t-code and kindly help with process where to go and what are the steps do i take to make the field mandatory
Go to SHD0,
give the transaction as SU01 and give the name of transaction variant for example 'USR1'. click create. Since your requirement is only for email give some dummy name and click on create. In the next screen give some dummy name and enter and continue till you reach the screen with this title "Screen values 0900 Program SAPLSZA5" . In this screen for the field 'Email' check the box under 'required' column. now click exit&save. give some short text in the next screen and save it under appropriate package, Transport requests.
Note : you can default your transaction variant as the standard variant. (SHD0 - standard variants tab-> Activate/Deactivate as standard variant)
Now go to se93 and click on create , give transaction code as for example 'SU01N' (this will be your new transaction for creating user with email as mandatory field) and choose start object as 'Transaction with variant'
In the resultant screen, give the transaction code as SU01 and transaction variant as 'USR1' (the one we created earlier), check on all gui support box's accordingly, and save it under appropriate package and Transport request.
From here on you can use SU01N as the transaction for creating users with email as a mandatory field. -
Hi,
In our IC webclient, when we enter a business partner, if nothing is entered in the address fields it creates ok but when we come back to change the partner again, the address fields are output only, so we can't enter anything in them. If we do enter address details when we create the partner, they are available ok for changing at a later date.
Can anyone offer any advice on how we solve this ? I've taken a look at transaction BUCG. The fields in question are set to 'optional'.
thanks,
Malcolm.anyone ?
-
Making screen field uneditable in runtime
Hi all,
I have a field that should be READ-ONLY when the screen appears (SCREEN-INPUT = 0). Then i should be able to select F4 help for the field, for which i make SCREEN-INPUT = 1. But after selection of a value from the F4 help i want to make the field again READ-ONLY (SCREEN-INPUT = 0) which is not happening.
Either am able to display the value that i select from F4 help or I am able to make the field READ-ONLY. Both are not happening together.
Can any one please let me know how to do this.
Thanks and Regards,
Ram.hi ram kumar check this one, i worked with this kind of scenraio, check only the bold portion, the rest just shows the scenario
When i looping again at at selection screen output i check whether the field with F4 help is filled or not and then lock them accordingly
AT SELECTION-SCREEN ON VALUE-REQUEST FOR ST_NAME.
CLEAR: FIELD_VALUE, DYNPRO_VALUES.
REFRESH DYNPRO_VALUES.
FIELD_VALUE-FIELDNAME = 'EXCH'.
APPEND FIELD_VALUE TO DYNPRO_VALUES.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DYNPRO_VALUES.
READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
IF FIELD_VALUE-FIELDVALUE IS NOT INITIAL.
IF SY-SUBRC = 0 AND FIELD_VALUE-FIELDVALUE = 1.
FIELD_VALUE-FIELDVALUE = 'BSE'.
ELSEIF SY-SUBRC = 0 AND FIELD_VALUE-FIELDVALUE = 2.
FIELD_VALUE-FIELDVALUE = 'NSE'.
ENDIF.
SELECT STOCK ST_NAME
CURRPR
FROM
ZEXCH
INTO TABLE TEMP_ITAB
WHERE EXCH = FIELD_VALUE-FIELDVALUE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ST_NAME'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'ST_NAME'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = TEMP_ITAB
RETURN_TAB = RETURN.
SELECT STOCK CURRPR
FROM ZEXCH
INTO (T_CODE, T_CURRPR)
WHERE ST_NAME = RETURN-FIELDVAL.
ENDSELECT.
CLEAR DYNPRO_VALUES[].
FIELD_VALUE-FIELDNAME = 'ST_NAME'.
FIELD_VALUE-FIELDVALUE = RETURN-FIELDVAL.
APPEND FIELD_VALUE TO DYNPRO_VALUES .
FIELD_VALUE-FIELDNAME = 'ST_CODE'.
FIELD_VALUE-FIELDVALUE = T_CODE.
APPEND FIELD_VALUE TO DYNPRO_VALUES .
CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'
EXPORTING
BETRG = T_CURRPR
IMPORTING
STRING = T_CHAR.
FIELD_VALUE-FIELDNAME = 'CURRPR'.
FIELD_VALUE-FIELDVALUE = T_CHAR.
APPEND FIELD_VALUE TO DYNPRO_VALUES .
* Update the dynpro values.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYNPRO_VALUES.
ENDIF.
* At Selection-Screen output
AT SELECTION-SCREEN OUTPUT.
* APPEND 'ONLI' TO CURRENT_SCR-EXCL. "Execute
* APPEND 'PRIN' TO CURRENT_SCR-EXCL. "Execute and Print
* APPEND 'SJOB' TO CURRENT_SCR-EXCL. "Execute in Background
LOOP AT SCREEN.
IF SCREEN-NAME = 'ACCNO'.
SELECT ACCNO
NAME
BANK
BANKACC
AMOUNT
FROM ZUSERDETAILS
INTO (ACCNO,NAME,BANK,BANKACC,AMOUNT)
WHERE ACCNO = TEMP_ACCNO.
ENDSELECT.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME = 'NAME' OR
SCREEN-NAME = 'BANKNAME' OR
SCREEN-NAME = 'BANKACC' OR
SCREEN-NAME = 'AMOUNT' OR
SCREEN-NAME = 'CURRPR' OR
SCREEN-NAME = 'ST_CODE'.
SELECT NAME FROM ZBANKCODE INTO BANKNAME WHERE BANK = BANK.
ENDSELECT.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
<b> IF SCREEN-NAME = 'ST_NAME'.
IF ST_NAME IS NOT INITIAL AND FLAG_SEL IS INITIAL.
CLEAR LIMPR.
CLEAR QTY.
IF EXCH = 1.
L_EXCH = 'BSE'.
ELSEIF EXCH = 2.
L_EXCH = 'NSE'.
ELSE.
FLAG_END = 'X'.
MESSAGE I000(ZZ) WITH 'Select an exchange from dropdown'.
STOP.
ENDIF.
SELECT STOCK CURRPR
FROM
ZEXCH
INTO (ST_CODE, CURRPR)
WHERE ST_NAME = ST_NAME
AND EXCH = L_EXCH.
ENDSELECT.
IF SY-SUBRC <> 0.
FLAG_END = 'X'.
CLEAR CURRPR.
CLEAR ST_CODE.
CLEAR ST_NAME.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ST_CODE' OR SCREEN-NAME = 'CURRPR'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
MESSAGE I000(ZZ) WITH 'This is not valid name of the stock'.
STOP.
ENDIF.
ENDIF.</b>
ENDIF.
ENDLOOP. -
Making Screen field visible for BDC upload
Hi All
I have an existing BDC program to add Vendor data to LFB1 table using transaction FK01
Now I want to add Personnel No. PERNR value in LFB1-PERNR
On the Account Information (SAPMFK02 Screen 0210) screen field Personnel number is not visible so I am not able to run the BDC program it says LFB1-PERNR field not available on screen.
Please let me know how can i make that field visible on the screenHi Akshay,
U can make it visible thru SPRO transaction.
Financial accounting --> accounts receivable and acounts payable --> Vendor master --> Master data --> Define screen layout per company code.
Choose the specific company code and make the necessary changes,.
thank you.
reward points if u find the discussion useful -
Making Screen fields Non editable in Migo
Hi TO ALL,
In MIGO T-code , aganist oubound delivery under Batch Tab i want to make fields Non editable.
I am unable to find suitable exit for this,can any body help me regarding this.
ThanksHi,
Use Transaction variant (Tcode : SHD0) to make fields display only.
Regards,
Ashok. -
Making a field read only (and bound) or editable depending on some criteria
Hi,
I am using Netweaver 2004s SP15 and Adobe Lifecycle Designer 7.1 with Web Dynpro for Java.
I am generating a PDF that contains a number of fields that are bound context values attribues.
Now I know according to certain criteria if any given field will have a value....
Now if such a given field has a value then it must populate the Adobe form and make that field read-only - so it can not be changed.
However, if that field has no value.. instead I need to make it editable.
I am re-implementing the application this will be used within; and the previous version had 8 different interactive forms to cater for the 8 different possible combinations of fields that would not have values.
I would really really prefer to have one interactive form to maintain with logic in it that determines dynamically if a field should be read-only or editable. (For example I could have a boolean context node that could be used)
Am I doomed to have to create 8 different forms? Or is there a way of doing this smarter?
Thanks to anyone who can point me to the light,
Ilanhmmm....
I did a search through the forum using the phrase "javascript" and it turned out a lot posts that indicate that this should indeed be possible.
I am boggled, the original application was developed by an Indian outsourcing company that is well respected. The developer who took over maintenance of it told me that it was impossible to change the read only nature of the fields once set at design-time.
My search through the forum has turned up much to indicate that this design was idiotic and the "facts" I was given completely wrong.
grrrrrrrrrrrrrrrrr... I am marking this as answered now. I will have to learn some javascript.
Are there any caveats for using it within WDJ?
I am assuming I can do something simple in pseudo-code.. (I will need to work out the Javascript version).
if (hasOption1) {
field.readonly = true;
field.style = sunken;
else if (hasOption2) {
else if (hasOption3) {
etc
(There are only actually 3 options that can change.. but that results in 8 different possible forms) -
Making screen fields non-editable in standard SAP screen
Hi All,
I have a reuirement. In transaction code CAA2 I have to make the field 'Incoming payment method' (EZAWE) as read only/non-editable. This field is available in table FKKVKP. We can make this field as read only by performing some configuration setting. But this field needs to be disabled based on some validations.
For example EZAWE field should appear in changable mode when user has the role 'ZDJ: SUPER_USER' assigned to him. If the user does not hold this role the EZAWE fields needs to be disabled.
One more thing here I don't have to use screen variants for this.
Thanks,
Venkat>
Vijay Babu Dudla wrote:
> Try with Transaction Variants , if there is no exit available to modify the screen dynamically, check the Transaction code SCDO.
>
> Search SDN with Transaction Variants
Hi,
I think it is SHD0. correct me if am wrong
Rhea.
Edited by: rhea on Oct 17, 2008 12:39 PM -
Dialog Programming ("Required" Screen Field) Processing
Hey Guys,
I have a screen that contains a field that I have set as "Required". I also have 2 buttons on the Function Keys bar
BACK -> LEAVE TO SCREEN 0. and
EXIT -> LEAVE PROGRAM.
My problem is that I want to process these buttons even if the user has not entered any information in the "Required" field, since the user wants to leave the screen and not process data.
Is there a way to bypass the "Required" clause?
Regards,
MadhurHi Madhur,
This <a href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa9535c111d1829f0000e829fbfe/content.htm">link</a> gives you the exact inofrmation you need along with wonderful explanation and illustration.
Regards,
Anand Mandalika. -
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 -
How to make pricing field as output only in sales order header and item lev
Hi ,
I want to make the field PRICING DATE as output only both at header and item level. How can i do pls guide me in detail.
Regards
SunainaHi Sunaina ,
Through User Exit you get this requirement plese take help of ABAPer to activate the user exit according to your requirement.
Try With this User Exit
Program MV45AFZZ
USEREXIT_FIELD_MODIFICATION
This user exit can be used to modify the attributes of the screen fields.
To do this, the screen fields are allocated to so-called modification groups 1 - 4 and can be edited together during a modification in ABAP. If a field has no field name, it cannot be allocated to a group.
The usage of the field groups (modification group 1-4) is as follows:
Modification group 1: Automatic modification with transaction MFAW
Modification group 2: It contains 'LOO' for step loop fields
Modification group 3: For modifications which depend on check tables or on other fixed information
Modification group 4: is not used
The FORM routine is called up for every field of a screen. If you require changes to be made, you must make them in this user exit.
This FORM routine is called up by the module FELDAUSWAHL.
See the Screen Painter manual for further information on structuring the interface.
I hope it will help you,
Regards,
Murali. -
Making a field as display only in custom Infotype.
Hi,
I have to a requirement to make a field as display only in a custom infotype. This field should be greyed out while entering data via PA30 for any employee such that it wont allow to eneter data manually but it gets updated by a program. And also this field should have a default value , say, NO.
Please help me as this is too urgent.
Regards,
Binay.Hi Binay
Please go to Screen Painter SE51 for your custom infotype program MP9XXX00
9XXX - infotype number.
Go to Layout editor for your Single screen (Screen Number 2000)
Double click on the field you want to make display only
In the screen attributes DISPLAY OPTIONS for that field choose "Output Only"
Activate Layout.
If you want to code something to be populated for the field code in PAI or PBO modules in the Module pool program
Its very easy.
Maybe you are looking for
-
Can you single out an APP and put a pass code on it on the Iphone 4
Can you single out an APP and put a pass code onit on the Iphone 4
-
Create a custom Logger based on messages in LogViewer
Hi All, I am presently trying to create a logger to log all of my Process logs instead of using the logViewer. However, the option of using the "Global Automatic Activity" with Events listeners using the API Fuego.Msg.ServerLogListener seems to have
-
Incorrectly calculating hfe/input impedance
Hello Multisim calculates wrongly the input impedance of a common emitter stage - judging from the voltage drop on the base resistor network it appears it assumes a hfe of about 10, when the real value is over 500. I used the 2N2222A as a model, and
-
How to remove all the blanks in a String
what I mean is that there is any convenient way to help remove the blanks (or carriage returns) in a string
-
Data target '0BBP_PO' removed from list of loadable targets; not loadable
We have implemented the Business Content for Logistics and when we run the InfoPackage (IP) we have this message : Data target '0BBP_PO' removed from list of loadable targets; not loadable. We have Support Package 19 of BI 7.04 . The Data Target 0BBP