2013 Dec 17 11:53 AM
Hi Experts,
i want to validate the particular field only in module pool after performing some operations(like after pressing push button).if i use CHAIN-END CHAIN on PAI it will show error every time when i press enter but i want that error should be displayed after pressing 'SUBMIT' button only.when i write the error message on sy-ucomm for SUBMIT(i.e with out using CHAIN-END CHAIN)it show error and disabling all the fields. can anyone tell me how to solve the problem.
Thank's in advance.
2013 Dec 17 12:12 PM
Hi
You can do validation in the PAI for the fields
For multiple fields validation you can use CHAIN..ENDCHAIN
Include the fields in a FIELD statement, and enclose it in a CHAIN-ENDCHAIN block statment. Eg. Screen flow logic: CHAIN. FIELD: SPFLI-CARRID, SPFLI-CONNID. MODULE CHECK_FLIGHT. ENDCHAIN. When an error is found inside a chain, the screen is re-displayed, and all fields found anywhere in the chain are input-enabled. All non-chain fields remain disabled.
In your chain endchain statement module.You can check the condition
In the IF condition check the ok_code = 'SUBMIT'
write your logic
2013 Dec 17 11:56 AM
In your chain endchain statement module where you are doing validation put an if gv_okcode eq 'SUBMIT' then only run.
chain
field abc module check.
endchain
module check
if sy-ucomm eq 'SUBMIT'.
validation
endif,.
endmodule
Nabheet
2013 Dec 17 11:57 AM
hi rajendra,
write your code inside chain - endchain itself.. you have to restrict the control for your requirement.
write a IF condition and allow only if the ok_code EQ 'SUBMIT' .
this will work
Regards,
sivaganesh
2013 Dec 17 12:02 PM
Hello;
Input check con be done in different ways; check the package "SDWA"
2013 Dec 17 12:12 PM
Hi
You can do validation in the PAI for the fields
For multiple fields validation you can use CHAIN..ENDCHAIN
Include the fields in a FIELD statement, and enclose it in a CHAIN-ENDCHAIN block statment. Eg. Screen flow logic: CHAIN. FIELD: SPFLI-CARRID, SPFLI-CONNID. MODULE CHECK_FLIGHT. ENDCHAIN. When an error is found inside a chain, the screen is re-displayed, and all fields found anywhere in the chain are input-enabled. All non-chain fields remain disabled.
In your chain endchain statement module.You can check the condition
In the IF condition check the ok_code = 'SUBMIT'
write your logic
2013 Dec 18 5:04 AM
Thankyou much Kiran for this helpful answer but if i want to validate multiple fields and the field i get error only editable and the remaining fields should be in non editable format what should i do then.
thankyou,
2013 Dec 18 5:18 AM
Hi,
When an error is found inside a chain, the screen is re-displayed, and all fields found anywhere in the chain are input-enabled. All non-chain fields remain disabled.
2013 Dec 18 5:20 AM
2013 Dec 18 5:25 AM
2013 Dec 18 5:26 AM
Hi Rajendra,
If you want to make the error fields to be editable and other fields to be in display mode then dont enter the fields with in chain - end chain.
Do as below:
PAI:
field abc module check1.
field def module check1.
field ghi module check2.
module check1.
if sy-ucomm eq 'SUBMIT'.
"validation process"
endmodule.
module check2.
if sy-ucomm eq 'SUBMIT'.
"validation process"
endmodule.
Then the corresponding field which has error will be editable.
Hope it might help you.
With Regards,
Giriesh M
2013 Dec 18 6:11 AM
Hi rajendra,
For validating multiple fields you use CHAIN...ENDCHAIN.
And,for validating single field you use FIELD..MODULE statement.
In second case, only one field becomes editable on error or warning while others are not editable.
In first case all fields specified in CHAIN ENDCHAIN block becomes editable on error or warning while fields outside this block remains non editable.
Now you want, fields in CHAIN..ENDCHAIN to be selectively be editable and non editable based on particular field which produced error or warning.
i think you can mark those fields, and in PBO you can make them non editable.
kherwa
2013 Dec 18 7:08 AM
Thankyou Giriesh Problem solved with your solution.your r genious.
2013 Dec 18 7:11 AM
Thankyou nabeet but now only i know chain endchain is for multiple fields.
2013 Dec 18 7:10 AM
I am very Thankfull to all of you for helping me to solve this problem
2013 Dec 18 7:28 AM
Hi one more doubt If i use chain endchain all the fields which i put Under chain-endchain are in enable mode. if i use FIELD---MODULE it validates first field and shows error .after correcting it it goes for second error field . If i want all the error fields only in editable(i.e AT A TIME) .and remaing fields in noneditable MODE.
2013 Dec 18 8:34 AM
Hi Rajendra,
you can do either a particular field or a group of fields. If you are using a particular field then it will proceed one by one fields as you mentioed earlier and if you are grouping it, the grouped fields irrespective of the error will be enabled. Your scenario is not possible to enable only the error fields.
With Regards,
Giriesh M
2013 Dec 18 10:19 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |