2006 Nov 13 10:38 AM
Dear All,
In dialog programming, I have written a validation on a text field that it should not be left blank by the user, but after displaying the message the field becomes gray (non-editable). How can I make it editable once again after displaying the error message.
My code is as following:
----
***INCLUDE MZFBPS1_SAVE_DATAF01 .
----
&----
*& Form save_data
&----
text
----
--> p1 text
<-- p2 text
----
FORM save_data .
****************Check For Empty Fields Start
if ZFBPS_GATE_IN-truck_code is INITIAL
or ZFBPS_GATE_IN-truck_no is INITIAL
or ZFBPS_GATE_IN-transporter_code is INITIAL.
MESSAGE e020(zmatlist).
endif.
****************Check For Empty Fields Start
Regards,
Alok.
Dear All,
In dialog programming, I have written a validation on a text field that it should not be left blank by the user, but after displaying the message the field becomes gray (non-editable). How can I make it editable once again after displaying the error message.
My code is as following:
----
***INCLUDE MZFBPS1_SAVE_DATAF01 .
----
&----
*& Form save_data
&----
text
----
--> p1 text
<-- p2 text
----
FORM save_data .
****************Check For Empty Fields Start
if ZFBPS_GATE_IN-truck_code is INITIAL
or ZFBPS_GATE_IN-truck_no is INITIAL
or ZFBPS_GATE_IN-transporter_code is INITIAL.
MESSAGE e020(zmatlist).
endif.
****************Check For Empty Fields Start
Regards,
Alok.
2006 Nov 13 10:43 AM
HI,
you need to through error in the 'FIELD' module in this way field will be available for entry.
*write this in PAI flow logic and create the module in your program.
FIELD: ZFBPS_GATE_IN-truck_code
MODULE process_truckcode ON REQUEST.
*In screen program.
MODULE process_truckcode INPUT.
IF ZFBPS_GATE_IN-truck_code IS INITIAL.
MESSAGE e000(SU) with 'please enter value'.
ENDIF.
ENDMODULE.
Regards,
2006 Nov 13 10:43 AM
hi,
u can do it in chanin end chain.
For example if there are 10 fields in the screen and for 5 fields whenever the user enters wrong values u like to give some error message. You can declare that fields in the chain enchain so that only those fields will be input enabled and all other fields will disabled.
CHAIN.
FIELD chk_connobj.
FIELD chk_inst.
FIELD chk_devloc.
FIELD ehaud-haus.
FIELD eanl-anlage.
MODULE modify_screenfields.
ENDCHAIN.
*&---------------------------------------------------------------------*
*& Module modify_screenfields INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE modify_screenfields INPUT.
CLEAR okcode.
okcode = sy-ucomm.
CASE okcode.
WHEN 'ENTER' OR 'EXECUTE'.
IF chk_connobj IS INITIAL AND chk_inst EQ c_x AND
chk_devloc EQ c_x. -----------> ur condition
IF ehaud-haus IS INITIAL.
SET CURSOR FIELD 'EHAUD-HAUS'.
MESSAGE e000(zo_spa) WITH text-017. " message obj
ELSE
loop at screen.
if screen-name = 'FIELD_NAME'.
field-name-input = 1. -----------> chnges to non-edit mod
modify screen.
endloop.
ENDIF.
ENDIF.
ENDMODULE. Rgds
Anver
if hlped pls mark points
2006 Nov 13 10:44 AM
Hi ALok,
Try giving warning message to validate, message w000.
regards,
keerthi
2006 Nov 13 10:49 AM
Alok,
if the form is called in the PAI of the screen, the E msg automatically returns to the screen and the field is editable as before.
For validation of three fields, better enclode the parameters within a block
selection screen begin of block truck.
parameters:
p_trkcod type ZFBPS_GATE_IN-truck_code,
p_trknum type ZFBPS_GATE_IN-truck_no,
p_tracod type ZFBPS_GATE_IN-transporter_code.
selection screen end of block truck.
and then use event
AT selection-screen on Block truck.
perform save_data. "Although this name is confusing and the contents must be adapted
If error message is issued, only this block's will be coloured red and open for input.
Regards,
Clemens
2006 Nov 13 10:53 AM
hi alok,
try putting in <b>Chain and Endchain</b>.
Regards,
Priya.
2006 Nov 13 11:09 AM
In the flow logic of ur screen write the below code
Chain.
Field:ZFBPS_GATE_IN-truck_code ,
ZFBPS_GATE_IN-truck_no,
ZFBPS_GATE_IN-transporter_code .
Endchain.
This will make your fields input-enabled even when u throw a error mess.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |