View previous topic :: View next topic
|
Author |
Message |
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
There is a field in online screen which is always Y(yes),how I will change it to editable form(default should be Y but if they want they can make it N also)...what changes do i need to write in dialog . |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
Hi Krushna,
If the field in non-editable in online screen, then that field in protected. Now if you want that field to be editable, then you have UNPROTECT the field.
SYNTAX to UNPROTECT a field:
Code: |
MODIFY MAP CURSOR AT FIELD
<MAP FIELD> FOR (<MAP FIELD>)
ATTRIBUTES UNPROTECTED. |
|
|
Back to top |
|
|
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
Thanks Nelson,The same thing I also thought ,but why I m not implementing this is,there are some other fields in ONLINE which are EDITABLE also,but those fields are not UNPROTECTED.THEY ARE PROTECTED BUT how come they are coming in editable form,I analysed ,and still in the process of analysis,how they are in editable form even though protected.(like i can change there Y to N and N to Y also).
Please suggest...
~krish
Chennai |
|
Back to top |
|
|
Chinnadu
New User
Joined: 05 Mar 2009 Posts: 46 Location: Hyderabad
|
|
|
|
Try and see 'Field definition' of the required map field. It might be unprotected for the remaining fields that you are working on.
Unprotected (/) . . . . . / Required (/). . . . . . _
Automatically edited (/) _ Skipped by tab key (/) _ |
|
Back to top |
|
|
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
Hi Chinnadu,its already unprotected in map structure,all the fields which accept value from end user are unprotected,still someme fields are editable and some of them are non editable...I think its because we are hardcoding that(moving Y or N to that field to show that one)
previously this field which i m trying to make editable was coming in editable mode but there was no default value Y for that.
now I moved Y to that variable whatever may be the condition.now our purpose is fulfilled,its always coming Y,but not in a editable field where as USER needs it in a editable mode with Y as default always,if he wants he can change it to N also..
ANYBODY PLEASE SUGGEST .... |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
Hi Krish,
It is not that if you give a default value a field, it will become non-editable. Generally at the premap process, all the fields will be made protected. After which some fields will be made unprotected, as per the user requirement and input to the screen. So check whether your field get protected in this way. Or in any of the include module there will be some condition to make the field non-editable. so if you can, take a ADSO REPORT on that particular dialog, it will be very useful to do analysis. If can please try to post the code where the field is getting protected or unprotected. |
|
Back to top |
|
|
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
Hi Nelson,
Thanks..the code which you had given was not present there,so i added that....but still some more i have to change it seems...
one more thing is even though i m commenting all the instances of that variable in dialog,still I m getting value for that field as Y,I have commented all the instances except the declaration.....why,i dunno...the main purpose has been solved that watever may be the codition it sud be Y,that is coming now,but that usd be in a editable...my struggling is there.... |
|
Back to top |
|
|
sudharsan.soundararajan Warnings : 1 New User
Joined: 15 Oct 2008 Posts: 17 Location: Chennai
|
|
|
|
Hi Krish,
i just now saw the full topic. you are saying that the Field is still NON EDITABLE.. even after putting the Nelson's code in Dialog and Changing the Map Field Definitions. |
|
Back to top |
|
|
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
yes sudashan,that field is unprotected in map declaration and this part of code was not there(nelson's) previously,i added that ,still non editable,but the thing is that field is editable long before bcz when i m seeing the previous cases which is from long time they r still now opening editable,i can make changes there,but with the current code its ineditable field....
now another thing is when i m creating something with my code changes its created asssigning Y to that field but when i m inquiring it again its coming as N....both at the time of creation and inquiry its non editable....
suppose the filed name is A and map name is MAP1
the main dilaogue code is:
MOVE 'Y' TO A OF MAP1.
MODIFY MAP TEMP CURSOR
AT FIELD A OF MAP1. (this is for having Y as default to that field when the screen is opened)
The called dialogue code is:
-
IF A OF Map1 EQ 'R'
DO.
MOVE 'Y' TO A OF MAp1.
END.
IF A OF MAP1 NE 'Y' AND
A OF MAP1 NE 'N'
DO.
MOVE 'DATA INDICATOR MUST BE Y OR N' TO MSG-IND.
!KCS ADDED
MODIFY MAP TEMP CURSOR AT FIELD A OF MAP1 FOR FIELD A OF MAP1 ATTR BRIGHT.
!KCS ADDED |
|
Back to top |
|
|
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
Hi Nelson,
I did not put ur code in correct place,now it is editable ,but for making that field always Y i have commented whenever any N is moving to that field,so now even though it is coming as editable,if i m trying to change it to N then it is still saving Y.....
Please suggest me any other way to save 'N' there also |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
Hi krish,
Two question's for you. Are you storing this N to the database? If so, are you getting Y, when you try to retrieve the same record from the database next time? Please reply me. |
|
Back to top |
|
|
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
Ya Nelson, N is stored to the database and and when I m trying to retrieve the value after creating as Y,it is coming as Y also ,there is no concern,
Then How can i store N to that varibale ?
please suggest... |
|
Back to top |
|
|
sudharsan.soundararajan Warnings : 1 New User
Joined: 15 Oct 2008 Posts: 17 Location: Chennai
|
|
|
|
Hi Krish,
i would suggest you to check the database value before moving it to the MAP variable.
If the database value is 'N' or 'Y' move it to the screen.
If it is spaces hard code the MAP variable as 'Y'
hope this will sove your requirement. |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
Hi Krish,
Sudharsan's solution is correct. The problem is, irrespective of the database value you are moving Y to the screen. That is the reason, your getting Y in the screen, after storing N to the database.
So as sudharsan said check the database value before you hardcode Y to the screen.[/b] |
|
Back to top |
|
|
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
Sorry........
N is stored in the map only,not to the databse....and when i m retreiving the data after creating it is coming as Y..now only concern is to make it 'N'
and it sud be saved.......... |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
We can only display the values using MAP, we cont store any value in it. Your hardcoding the map field as Y. So if you try to retrieve any record, your hardcoded value will be overwritten. So only Y will be displayed in the MAP.
Now tell your specification clearly. |
|
Back to top |
|
|
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
deeply sorry for confusing..the value is stored to database only..i checked in databse,whatever i m creating ,at the time of fetching it is coming from DB ..i che checked thru OLQ..
now the requirement is:
that field should be always Y in editable mode ,but if they want sometime they will make it to N(altough not needed always)..now I m not able to save N to that variable,if possible please give a piece of code with using varibales A,B,C like tht.. |
|
Back to top |
|
|
kcs4u2004
New User
Joined: 21 Apr 2008 Posts: 56 Location: Chennai
|
|
|
|
Many many thanks to Nelson,Sudarshan and all.......
I solved it along with some more modification was there....
Thank you again.......
Please help me out in the same way.. |
|
Back to top |
|
|
|