2013 Feb 18 1:32 PM
just did field validation for name field of char data type in the PAI event. its doing field validation properly but not starting next process just strucked there. if i enter correct value after validation itz again showing that error message that please enter correct value.... please someone help me out.
my validation module
module validation input.
if zstudent-name co sy-abcde.
else
message 'enter the correct value' type ' e'.
endif.
end module.
2013 Feb 18 2:41 PM
Venkatesh,
If the field which is causing the error is a screen field, try this.
PROCESS AFTER INPUT.
CHAIN.
FIELD: scree-field module error_check.
ENDCHAIN.
2013 Feb 18 1:37 PM
I believe error message are not allowed could you please try changing message type. and let me know if problem persists.
if zstudent-name co sy-abcde.
else
message 'enter the correct value' type ' i'.
endif.
2013 Feb 18 2:20 PM
hi ,
thanks for ur response sir.
i changed the message type i,but it just showing the message and doesnt make the field for input again and continuing the next process
2013 Feb 18 1:38 PM
Hello.
Put a break point on the if zstudent-name co sy-abcde. statement, check the value of the fields, doing that you will get an idea of why if showing the error.
Regards
2013 Feb 18 2:41 PM
hi miguel,
just did with break points i found the mistake in validation module it just transferring the control again and again to the field statement and validation module associated with it, not processing further modules.how to correct it help me please.
2013 Feb 18 1:45 PM
Hi,
to continue with error messages write the code under MODULE EXIT AT EXIT-COMMAND.
in this module
case sy-ucom or ok_code.
when 'BACK'.
leave program.
when'EXIT'.
leave program.
endcase.
Regards,
Gurunath Kumar D
2013 Feb 18 1:50 PM
2013 Feb 18 2:24 PM
Hi,
it is not possible to post my code.it is our client requirement and also it is confidential. but i already posted the sample code.here write sample code.here double click on this exit. in your GUI status where your having the BACK,EXIT...buttons there double click on the buttons and check with all are type 'E'.
still any issues let me know.
Regards,
Gurunath Kumar D
2013 Feb 18 2:41 PM
Venkatesh,
If the field which is causing the error is a screen field, try this.
PROCESS AFTER INPUT.
CHAIN.
FIELD: scree-field module error_check.
ENDCHAIN.
2013 Feb 18 2:49 PM
hi kishore,
i tried with chain...endchain too but the same result after executing validation module its not transfering control to the further modules.
regards.
2013 Feb 18 2:53 PM
Once again try placing other scree-fields in the chain which you want to navigate after getting error on one screen-field.
2013 Feb 18 3:10 PM
hi kishore,
cant get u iam new to abap could just post some examples please.
2013 Feb 18 3:16 PM
Hi Venkatesh
Please find below code for your reference
LOOP AT v_t056p.
* MODULE STATUS_9010.
* CHAIN.
** FIELD V_T056P-ZILABEZ .
** FIELD V_T056P-ZIKUBEZ .
* FIELD V_T056P-ZSOLL .
* FIELD V_T056P-DATAB .
* FIELD V_T056P-REFERENZ .
* MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
* MODULE COMPLETE_V_T056P ON CHAIN-REQUEST.
* ENDCHAIN.
Regards
dnyan
2013 Feb 18 3:19 PM
CHAIN.
FIELD: scrflds-filename,
scrflds-fspath,
scrflds-filepath,
scrflds-filetype,
scrflds-jname,
scrflds-dnlty,
scrflds-dnlin,
scrflds-dnlas,
scrflds-dctmpl,
scrflds-flocn.
MODULE file_details_check.
ENDCHAIN.
2013 Feb 18 3:32 PM
hi kishore,
i just tried with it but after validating itz not proceeding further.
2013 Feb 18 5:23 PM
Can you please post your code here . So that i will check and let you know where exactly the error is .
At least sceen logic and the module which is not proceeding further.
Or just debug and check why its is not proceeding further. Was it looping at the same time. I mean in a infinite loop or there is some other problem.
2013 Feb 19 2:48 AM
hi dnyan,
i had attached the codes below please check with it. I had did validation module in screen 1000...
2013 Feb 19 9:44 AM
Hi Venkatesh,
I have checked the code .
And found that every time the
IF zstudet-NAME co SY-ABCDE.
IF ZSTUDET-ADDRESS CO SY-ABCDE.
ELSE.
message e000 with text-001.
ENDIF.
else.
message e000 with text-001.
ENDIF.
it gets failed.
As if you put a beakpoint there and check you could understand that. If this condition satisfies correctly then the control moves to next module and program will be executed successfully.
For example below code. Where in Name1 and Name2 contains '1234' and condition satisfies successfully.
IF lfa1-name1 EQ '1234'.
IF lfa1-name2 EQ '1234'.
ELSE.
message e000 with 'error'.
ENDIF.
else.
message e000 with 'error'.
ENDIF.
Please try changing the condition as this means address should contains only A-Z and that will not be a case. please press F1 on the 'CO' you will get all the details of command and you can check why it is getting failed.
Hope this will help you and will resolve your issue .
Regards
Dnyan
2013 Feb 19 11:19 AM
hi dnyan,
i set break point and chekd also changed co but if i remove co itz not working properly if i put co itz showing error... but the values are changing i put a watch point over the screen field and checkd but itz not proceeding further with co. if i add cs instead of co itz not properly validating... so can u tell me any other way to validate char data types.
2013 Feb 19 12:00 PM
what is the requirement. Address and name should only contain letters or what. So that i can provide the alternative for you .
2013 Feb 19 12:39 PM
hi dnyan,
ya name and address can contain only alphabets no other special characters or numbers.
2013 Feb 19 1:03 PM
Use below logic it will solve the problem.
IF address CA '123456789!@#$%^&*()'.
write 'wrong'.
ELSE.
write 'correct'.
ENDIF.
Regards
Dnyan
2013 Feb 19 1:22 PM
hi dnyan,
thanks very much got the perfect output.....
regards,
2013 Feb 19 9:47 AM
Hi Venkatesh,
Try out the code given below,
Use the ON INPUT addition with your module
PROCESS AFTER INPUT
CHAIN.
FIELD: ZSTUDET-NAME,
ZSTUDET-ADDRESS MODULE CHECK_IN ON INPUT.
ENDCHAIN.
-------Code for the module
Module CHECK_IN INPUT.
IF zstudet-NAME co SY-ABCDE.
IF ZSTUDET-ADDRESS CO SY-ABCDE.
ELSE.
message e000 with text-001.
EXIT.
ENDIF.
else.
message e000 with text-001.
EXIT.
ENDIF.
ENDMODULE. " CHECK_IN INPUT
Thanks & Regards,
Tushar
2013 Feb 19 11:21 AM
hi tushar,
ya i did wat u told but the same problem... the problem is with that relational operator co..need an alternative for that.
2013 Feb 19 11:57 AM
Hello Venkatesh,
Change the data type of name and address fields to STRING from CHAR.
Hope this changes will solve your problem.
Thanks & Regards,
Tushar
2013 Feb 19 1:29 PM
hi tushar,
if i change from char type to string itz showing an error that table should not have string as components
regards,
venkatesh.