‎2008 Oct 28 3:40 AM
How to resolve the red error and make the input fields available again to continue to enter? In dialog programming.
code i as follow...
TABLES: kna1.
DATA: tf_cust_id(10),
tf_cust_region(3),
tf_cust_s_name(30),
tf_cust_l_name(50),
click_bt TYPE sy-ucomm,
count_cs(2).
&----
*& Module STATUS_0001 OUTPUT
&----
text
----
MODULE status_0001 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
if sy-subrc <> 0.
"leave to transaction 'ZFSLSCB'.
ENDIF.
ENDMODULE. " STATUS_0001 OUTPUT
&----
*& Module USER_COMMAND_0001 INPUT
&----
text
----
MODULE user_command_0001 INPUT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = tf_cust_id
IMPORTING
output = tf_cust_id.
IF click_bt = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
IF click_bt = 'EAGAIN'.
LEAVE TO TRANSACTION 'ZFSLSCB'.
ENDIF.
CONDENSE tf_cust_id.
count_cs = STRLEN( tf_cust_id ).
IF count_cs = 0.
CLEAR: tf_cust_id,
tf_cust_region,
tf_cust_s_name,
tf_cust_l_name.
ELSE.
SELECT SINGLE * FROM kna1 WHERE kunnr = tf_cust_id.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = tf_cust_id
IMPORTING
output = tf_cust_id.
tf_cust_region = kna1-regio.
tf_cust_s_name = kna1-sortl.
tf_cust_l_name = kna1-name1.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = tf_cust_id
IMPORTING
output = tf_cust_id.
CLEAR: "tf_cust_id,
tf_cust_region,
tf_cust_s_name,
tf_cust_l_name.
MESSAGE 'Please Enter the correct Customer ID' TYPE 'E'.
"LEAVE TO TRANSACTION 'ZFSLSCB'.
ENDIF.
ENDIF.
ENDMODULE. " USER_COMMAND_0001 INPUT
if any issue please tell me....
‎2008 Oct 28 3:45 AM
hi,
you have to define your fields in chain endchain in pai .
CHAIN.
FIELDS: f1,f2...
MODULE CHECK.
ENDCHAIN.
and you can do your checks in this module check.
‎2008 Oct 28 3:41 AM
MESSAGE 'Please Enter the correct Customer ID' TYPE 'E'.
when appear this message it not allow me to enter the next input in the input fields.
‎2008 Oct 28 3:45 AM
i think this is the problem of not using chain end chain.
in ur pai
for the field whre u r operating did u enclose the same in
chain endchain .
chain .
field 'xxxxxxxxx' ..
module yyyyyyyyyy.
endchain.
br, vijay>
‎2008 Oct 28 3:45 AM
hi,
you have to define your fields in chain endchain in pai .
CHAIN.
FIELDS: f1,f2...
MODULE CHECK.
ENDCHAIN.
and you can do your checks in this module check.
‎2008 Oct 28 4:01 AM
Hi, thanks,
it is working but there is a problem for example I give it a customer id and it display the records in the fields but next time when I give a wrong customer no it display the message and field are enable but I want that when I enter the wrong customer no it clears out the records related to the previous customer mean display the error message and clear all the fields too.
kind regards,
Faisal
‎2008 Oct 28 4:09 AM
hi,
use refresh statement.
also try to appreciate people by rewarding points to contributing to UN world food pogram, who are trying to help you by spending there time.
i was telling you this because not even a single post in which you have rewarded people who helped you.
‎2008 Oct 28 4:12 AM
Hi,
In the module under chain end chain just clear the fields if input is wrong....
say
MODULE validation_9000 INPUT.
clear : <your wrong field>.
MESSAGE s398(00) WITH 'Please enter correct details'.
ENDMODULE. " VALIDATION_9000 INPUT
Regards
Debarshi