03-20-2012 10:14 AM
Hi,
I have taken one text field mandatory if condition is true then this filed make obligatory and condition is false then text filed will hide. its working properly.
but my problem is when i am changing the input value and this condition is false then also showing error 'fill required entry.' and after filling required entry the field is hiding.
so i want to show when i will changing the input value, suppose condition is true then field will hide without showing error MSG "fill required entry."
please help!!!
ex:
MODULE ABC OUTPUT.
IF zcustomer-cve_aut = 'B'.
LOOP AT SCREEN.
IF screen-name = 'name'.
screen-required = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE. "if other c,d....
LOOP AT SCREEN.
IF screen-name = 'name'.
screen-required= '0'.
screen-invisible = '1'.
screen-active = '0' .
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
Thanks!!
Dipak.
03-20-2012 12:10 PM
Hello Dipak,
As per my understanding i can say ...
clear : zcustomr-cve.
clear the values of (zcustomr-cve) status & other variable values in PBO, otherwise the values which are existing previously will cause the error.
plzz explain u r doubt clearly. i can help u.
03-20-2012 10:20 AM
Try to attach an function code/user command to field checked in the condition (zcustomer-cve_aut) to trigger a PAI/PBO event.
The field must be a checkbox/radiobutton or use a dropdown list to allow this option. Define the function code as an exit command to bypass screen controls.
Regards,
Raymond
03-20-2012 10:20 AM
Hi
Check system fields SY-MSGID and SY-MSGNO which are related to Message display...Try to clear and check.
Thanks,
Chandra
03-20-2012 11:17 AM
Hi,
you are telling that you made manade text field and checking values for it.
then your giving value in selection screen.
use
AT START OF SELECTION OUTPUT.
loop at screen.
**write logic**
endloop.
why you are writing in pbo ???
Thank and Regards
03-20-2012 11:28 AM
yes i have written code in PBO because status filed means zcustomr-cve_aut field is 'B' then zcustomer-m_rech filed will be mandatory in my pgm if zcustomr-cve not 'B' then zcustomer-m_rech field will be hide.
so my problem is when user changes status B to some other status then zcustomer-m_rech
will be hide but i get error msg fill required entry. i tried to debug but when 1st time set to set status 'B.' & suppose user changes then field will not be hide.
03-20-2012 11:27 AM
Hi,
Please debug and check. The contents of field zcustomer-cve_aut might not be changing.
Regards,
Danish
03-20-2012 12:10 PM
Hello Dipak,
As per my understanding i can say ...
clear : zcustomr-cve.
clear the values of (zcustomr-cve) status & other variable values in PBO, otherwise the values which are existing previously will cause the error.
plzz explain u r doubt clearly. i can help u.
03-20-2012 2:41 PM
MODULE ABC OUTPUT.
IF zcustomer-cve_aut = 'B'.
LOOP AT SCREEN.
IF screen-name = 'ZCUSTOMER_M_RECH'.
screen-required = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE. "if other c,d....
LOOP AT SCREEN.
IF screen-name = ZCUSTOMER_M_RECH'.
screen-required= '0'.
screen-invisible = '1'.
screen-active = '0' .
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
SUPPOSE status zcustomer-cve_aut equal to 'B' then zcustomer-m_rech filed will make mandetory second case if not B then zcustomer-m_rech will hide. its working no doubts.
but in that case user changed status to C or D or any other then value will not refresh error shown fill required entry ,when user fill this required entry after that field is hiding.
i want when user change status B to C or any that time this value will refresh and without showing error MSG, it will hide.
so , tried to clear but its no working .
pls help
03-20-2012 2:41 PM
MODULE ABC OUTPUT.
IF zcustomer-cve_aut = 'B'.
LOOP AT SCREEN.
IF screen-name = 'ZCUSTOMER_M_RECH'.
screen-required = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE. "if other c,d....
LOOP AT SCREEN.
IF screen-name = ZCUSTOMER_M_RECH'.
screen-required= '0'.
screen-invisible = '1'.
screen-active = '0' .
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
SUPPOSE status zcustomer-cve_aut equal to 'B' then zcustomer-m_rech filed will make mandetory second case if not B then zcustomer-m_rech will hide. its working no doubts.
but in that case user changed status to C or D or any other then value will not refresh error shown fill required entry ,when user fill this required entry after that field is hiding.
i want when user change status B to C or any that time this value will refresh and without showing error MSG, it will hide.
so , tried to clear but its no working .
pls help
03-20-2012 8:22 PM
Hi,
you may not able to solve this , change your logic , instead of making that field mendetory Issue error meesage programatically in PBO if field ZCUSTOMER_M_RECH is empty & zcustomer-cve_aut = 'B'
Thanks
Raj
03-21-2012 4:24 AM
Hi,
in your screen or selection screen you would have define the field obligatory.
Instead of making it obligatory, define input as possible and in PBO you can write the above logic.
And also by ONLY writing "screen-active = '0' ." would hide the field.
Regards,
Gaurav.
03-21-2012 4:27 AM
Hi,
First ensure that for screen field ZCUSTOMER_M_RECH, in the screen layout, under Program attributes, both Input field and Output field checkbox is checked. Also, ensure that the Input is selected as "Possible".
Try the below code in your PBO.
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'ZCUSTOMER_M_RECH'.
IF ZCUSTOMER-CVE_AUT EQ 'B'.
SCREEN-REQUIRED = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards,
Danish
03-21-2012 7:02 AM
Hi Danish,
I want ZCUSTOMER-M_RECH field hide and required based on status of ZCUSTOMER-CVE_AUT. if ZCUSTOMER-CVE_AUT = 'B' that time only ZCUSTOMER-M_RECH filed will required or available.
its working but when first time status is 'B' and that time ZCUSTOMER-M_RECH will required, and user was not filled required entry.
suppose user changed status to C or any that time also showing error fill require entry,when user fill the required entry after that filed is hiding .so its not correct behavior. i tried to debug.
03-21-2012 7:10 AM
Hi Dipak
Here are the two options what you can do.
First of all when value of ZCUSTOMER-CVE_AUT changes you can write
CHAIN.
FIELD ZCUSTOMER-CVE_AUT module M_validate on chain-request.
ENDCHAIN.
As soon as your value of this field changes the above module will get triogger where based on value you can loop at screen and make the field not obligatory.
Second solution is you just hide the the field based on value using the above apporach and check mandatory and all in PAI and throw some error message rather than making it mandatory your self.
I hope it answer your query.
Thanks
Nabheet
03-21-2012 8:55 AM
Hi,
Listen what you can do is remove the screen-required = 1 check from your PBO. Handle all validations in your PAI.
Try this.
* Add this in PBO
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'ZCUSTOMER-M_RECH'.
IF ZCUSTOMER-CVE_AUT EQ 'B'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
* Add this in PAI
IF ZCUSTOMER-CVE_AUT EQ 'B'.
IF ZCUSTOMER-M_RECH IS INITIAL.
MESSAGE 'Your error message' TYPE 'E'.
ENDIF.
ENDIF.
Regards,
Danish.
03-21-2012 11:06 AM
hi
i have removed code from PBO
and just make Validation in PAI.
IF ZCUSTOMER-CVE_AUT EQ 'B'.
IF ZCUSTOMER-M_RECH IS INITIAL.
MESSAGE ID 'ZE' TYPE 'E' NUMBER '369'.
ENDIF.
ENDIF.
IF ZCUSTOMER-CVE_AUT NE 'B'.
IF ZCUSTOMER-M_RECH IS not INITIAL.
clear zcustomer-m_rech.
ENDIF.
endif.
for time-being its working but customer want to hide this field.
if you have any solution then pls help.
Thanks.
03-21-2012 11:18 AM
Hi,
The hiding part was already mentioned by me in the previous post as I had told you that hiding part is to be done in PBO and validating to be done in PAI.
Regards,
Danish.
03-21-2012 12:05 PM
Thanks Nabheet.
Its working fine now,
BY using
CHAIN.
FIELD ZCUSTOMER-CVE_AUT module M_validate on chain-request.
ENDCHAIN.
03-21-2012 12:14 PM
03-21-2012 12:30 PM
Solved issue of required field entry error msg
No, issue is field is not hiding when ZCUSTOMER-CVE_AUT NE 'B'
I have tried to using screen-invisible = 1 but in PAI its bot working.
03-21-2012 12:54 PM
Here is what you can do.
In PBO check the value of this field.
If A-->Hide it
loop at screen
if screen-name eq 'ABC'.
screen-active = 0.
modify screen.
endif.
endloop.
If B display it
loop at screen
if screen-name eq 'ABC'.
screen-active = 1.
modify screen.
endif.
endloop.
03-21-2012 12:54 PM
Here is what you can do.
In PBO check the value of this field.
If A-->Hide it
loop at screen
if screen-name eq 'ABC'.
screen-active = 0.
modify screen.
endif.
endloop.
If B display it
loop at screen
if screen-name eq 'ABC'.
screen-active = 1.
modify screen.
endif.
endloop.
03-21-2012 1:25 PM
yes i have tried this one PBO , field is hiding but when status is changes to B then m_rech is not showing obligatory
03-21-2012 1:25 PM
yes i have tried this one PBO , field is hiding but when status is changes to B then m_rech is not showing obligatory
03-21-2012 1:39 PM
Hi
In this case you can put a check in PAI in same module chain endchain if staus is B and Field 2 is empty then display error
03-21-2012 1:39 PM
Hi
In this case you can put a check in PAI in same module chain endchain if staus is B and Field 2 is empty then display error
03-21-2012 1:39 PM
Hi
In this case you can put a check in PAI in same module chain endchain if staus is B and Field 2 is empty then display error
03-20-2012 12:10 PM
Hi,
I have taken one text field mandatory if condition is true then this filed make obligatory and condition is false then text filed will hide. its working properly.
are you trying with DEFAULT is obligatory[required field], just put as normal field and make it mandatory when it is required.
Hope it will solve your issue...
03-21-2012 6:46 AM
Hi Dipak,
You can do one thing. When u going to hide-unhide the fields at that time check the field which is mandatory and you going to hide it. If its blank then pass some value to the field before doing hiding process and then after hiding it jus immediately clear its assigned value..
Hope this will help you.
03-21-2012 6:49 AM
Hi,
Try using the below statement
screen-required = 2. "used for conditional mandatory fields
Regards,
Sharin
03-21-2012 7:52 AM
Hello Deepak...
I worked on your problem...The following details will solve your problem. This is working fine.
Things u need to do.
1) whenever we encounter the mandatory field , we must need At Exit-command to avoid it.
we are not going to use it in this case when the value is not 'B' .
>>>>> so make that field as not a mandatory field. ( change that screen field to "possible" , don't keep it as "required")
2) Do the following code..
The following code is perfectly working ...
DATA : zval(1) TYPE c.
DATA : ztext_now(10) TYPE c.
DATA : zflag(1) TYPE c.
MODULE status_1234 OUTPUT.
IF zval = 'B' AND zflag = 'X'.
LOOP AT SCREEN.
IF screen-name = 'ZTEXT_NOW'.
* screen-required = '1'. " <<<<< comment this , otherwise this will make mandatory field
screen-invisible = '0'.
screen-active = '1' .
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF zval NE 'B' AND zflag EQ ' '.
LOOP AT SCREEN.
IF screen-name = 'ZTEXT_NOW'.
screen-active = '0' .
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " STATUS_1234 OUTPUT
*---------------------------------------------------
MODULE user_command_1234 INPUT.
IF zval = 'A'.
zflag = 'X'.
ELSE.
zflag = ' '.
ENDIF.
ENDMODULE. " USER_COMMAND_1234 INPUT
change the variable's according to your requirement .
zval represent variable for (A/B/C)
( ztext_now represent a variable which is going to be display / hide)
if u have any issues.. come back again..
Thanks & Regards
JVS