‎2010 Apr 12 10:07 AM
Hi friends,
This issue regarding Module Pool Error Handling
How to handle the multiple error on the same screen ,
For example in the below code you could see "Carrid is Invalid" when carrid is entred wrongly
"in the same way i also need " Connid is invalid" When the customer entres the wrong Connid
*Select single * from sflight into e_sflight*
where carrid = e_sflight-carrid AND
connid = e_sflight-connid AND
fldate = e_sflight-fldate.
IF NOT sy-subrc IS INITIAL.
MESSAGE ID 'ZADT' TYPE 'E'
NUMBER '002' WITH 'Carrid is invalid'.
Kindly let me know your feedback\
Thank you
Sandy
‎2010 Apr 12 10:13 AM
Hi Sandy,
in PAI. " Also try to close your Questions as currently 8 out of 8 are unresolved
Chain. " For More info take F1 help on this Key word
field : carrid, connid. " These are the Screen Field names
module validate on chain-request.
endchain.
in Program.
module validate.
select single carrid into carrid
from scarr
where carrid = carrid.
if sy-subrc = 0.
select single connid into connid
from sflight
where connid = connid,
if sy-subrc NE 0.
message 'Enter Valid Connid' type 'E'.
endif.
else.
message 'Enter Valid Carrid' type 'E'.
endif.
endmodule.Cheerz
Ram
Edited by: Ramchander Krishnamraju on Apr 12, 2010 11:48 AM
‎2010 Apr 12 10:15 AM
This functionality is possible using OOPS ALV. If you are using a table control, you can replace it by an ALV grid. A pop up can be displayed at the end of user entry with all the errors.
‎2010 Apr 12 10:17 AM
Hi,
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.
Hopes this is helpful.
Regards,
Raj,