‎2009 Jan 13 5:16 AM
Hi Experts,
When error is thrown in Module pool programming for a field, its corresponding Text field must be highlighted with bold & with different color. Can any one provide a suggestion to solve this problem?
Kavitha.
‎2009 Jan 13 11:24 AM
Use CHAIN...END CHAIN to group the fields together .
CHAIN.
FIELD:
w_werks,
w_con_pt,
w_date_low,
w_date_high MODULE field_validation ON CHAIN-INPUT.
ENDCHAIN.
If there is error in any of the above 4 fields, all these fields will be open and the rest of the fields on the screen will be disabled.
regards,
Jinson
‎2009 Jan 13 5:34 AM
Hi Kavitha,
Use this code, its working:-
If you enter an invalid value, then an error message will be displayed and the field value entered will be coloured as red.
At screen logic:-
PROCESS AFTER INPUT.
FIELD ebeln MODULE get_data. "for field PO#
In PAI,
*&---------------------------------------------------------------------*
*& Module GET_DATA INPUT
*&---------------------------------------------------------------------*
MODULE get_data INPUT.
IF ( ebeln <> ' ' ).
SELECT
ebeln
ebelp
matnr
werks
menge
netpr
INTO TABLE it_ekpo
FROM zekpo
WHERE
ebeln = ebeln.
IF sy-subrc <> 0.
MESSAGE e000. " invalid PO# with field value as red colored
ENDIF.
ELSE.
MESSAGE e005. "if no value entered
ENDIF.
ENDMODULE. " GET_DATA INPUT
Using the line as mentioned at screen logic, only field EBELN will be enabled when error message is encountered, and rest fields will be greyed-out.
To keep a set of field values on screen enabled when error message is encountered, you can use the concept of CHAIN...ENDCHAIN.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
‎2009 Jan 13 11:24 AM
Use CHAIN...END CHAIN to group the fields together .
CHAIN.
FIELD:
w_werks,
w_con_pt,
w_date_low,
w_date_high MODULE field_validation ON CHAIN-INPUT.
ENDCHAIN.
If there is error in any of the above 4 fields, all these fields will be open and the rest of the fields on the screen will be disabled.
regards,
Jinson
‎2009 Jan 13 11:52 AM
There won't be a way to make the field BOLD, and to change the color, the only option is to set the
SCREEN-INTESIFIED = 1 in the PBO routine. This will give you the color of RED.
Unfortunetly, when you use MESSAGE to do the error, you do not get back to the PAI routine to
make the adjustments.
You could keep a list of the fields with errors instead of using the MESSAGE verb then handle the
coloring in the PAI routine.. but then.. where/when do you display the message?
‎2009 Mar 10 4:31 AM