‎2008 Apr 17 5:38 AM
hi.
i want to know that why we use the chain & end chain in dialog programing.
pls explain with example.
thanks
‎2008 Apr 17 5:45 AM
Hi Ashok,
Input Checks in Dialog Modules
You cannot perform input checks in PAI modules of programs until you have transported the contents of the input fields to the ABAP program. You can then use logical expressions to check the values that the user entered. You should then allow the user to correct any wrong entries before calling further modules.
You can do this by sending warning (type W) or error (type E) messages from PAI modules that are called in conjunction with the ABAP statements FIELD and CHAIN.
Checking Single Fields
If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
FIELD <f> MODULE <mod>.
the corresponding input field on the current screen (and only this field) is made ready for input again, allowing the user to enter a new value. If the field is only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
Checking a Set of Fields
If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
CHAIN.
FIELD: <f1>, <f 2>,...
MODULE <mod1>.
FIELD: <g1>, <g 2>,...
MODULE <mod2>.
...
ENDCHAIN.
all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
Controlling Input and Data Transport
If you use the FIELD statement outside a chain, only a single field is made ready for input when a warning or error message is displayed. If you use it between the CHAIN and ENDCHAIN statements, it controls a set of fields. All of the fields controlled by a FIELD statement are transported back to the screen, bypassing PBO processing. This means that any changes made to the field contents before the message become visible on the screen. This also applies to information
Checking Fields Repeatedly
You may sometimes need to include the same field in more than one FIELD or CHAIN statement. If one of the corresponding modules sends a warning or error message, PAI processing resumes with the value that the user corrected. However, in this case, processing cannot simply resume at the corresponding FIELD or CHAIN statement if the field in question has already been included in an earlier FIELD or CHAIN statement.
Instead, all of the FIELD and CHAIN statements containing a field in which an error occurred are repeated. PAI processing resumes at the first FIELD or CHAIN statement containing a field in which an error occurred and that the user changed the last time the screen was displayed.
Example:
PROCESS AFTER INPUT.
FIELD f1 MODULE m1.
FIELD f2 MODULE m2.
CHAIN.
FIELD: f1, f2, f3.
FIELD: f4, f5, f1.
MODULE m3.
MODULE m4.
ENDCHAIN.
CHAIN.
FIELD: f6.
MODULE m5.
ENDCHAIN.
CHAIN.
FIELD f4.
MODULE m6.
ENDCHAIN.
Reward if useful
Regard,
Muneesh Gitta.
‎2008 Apr 17 5:44 AM
Hi,
CHAIN.
FIELD <field1>.
FIELD <field2>.
FIELD: <field3>, <field4>, ... <fieldn>.
MODULE <module1>.
MODULE <module2>.
ENDCHAIN.
When an ABAP/4 module finds an error, it puts out an error message or
warning to notify the user. Issuing these messages alerts the system that
an error dialog is needed. The system redisplays the screen, requiring the
user to enter a new value for the erroneous field. All other fields are input-
disabled. With the CHAIN statement, if an error is found, the screen is re-
displayed with all fields in the chain input-enabled.
Reward if useful.
Regards,
Swetha.
‎2008 Apr 17 5:45 AM
Hi Ashok,
Input Checks in Dialog Modules
You cannot perform input checks in PAI modules of programs until you have transported the contents of the input fields to the ABAP program. You can then use logical expressions to check the values that the user entered. You should then allow the user to correct any wrong entries before calling further modules.
You can do this by sending warning (type W) or error (type E) messages from PAI modules that are called in conjunction with the ABAP statements FIELD and CHAIN.
Checking Single Fields
If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
FIELD <f> MODULE <mod>.
the corresponding input field on the current screen (and only this field) is made ready for input again, allowing the user to enter a new value. If the field is only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
Checking a Set of Fields
If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
CHAIN.
FIELD: <f1>, <f 2>,...
MODULE <mod1>.
FIELD: <g1>, <g 2>,...
MODULE <mod2>.
...
ENDCHAIN.
all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
Controlling Input and Data Transport
If you use the FIELD statement outside a chain, only a single field is made ready for input when a warning or error message is displayed. If you use it between the CHAIN and ENDCHAIN statements, it controls a set of fields. All of the fields controlled by a FIELD statement are transported back to the screen, bypassing PBO processing. This means that any changes made to the field contents before the message become visible on the screen. This also applies to information
Checking Fields Repeatedly
You may sometimes need to include the same field in more than one FIELD or CHAIN statement. If one of the corresponding modules sends a warning or error message, PAI processing resumes with the value that the user corrected. However, in this case, processing cannot simply resume at the corresponding FIELD or CHAIN statement if the field in question has already been included in an earlier FIELD or CHAIN statement.
Instead, all of the FIELD and CHAIN statements containing a field in which an error occurred are repeated. PAI processing resumes at the first FIELD or CHAIN statement containing a field in which an error occurred and that the user changed the last time the screen was displayed.
Example:
PROCESS AFTER INPUT.
FIELD f1 MODULE m1.
FIELD f2 MODULE m2.
CHAIN.
FIELD: f1, f2, f3.
FIELD: f4, f5, f1.
MODULE m3.
MODULE m4.
ENDCHAIN.
CHAIN.
FIELD: f6.
MODULE m5.
ENDCHAIN.
CHAIN.
FIELD f4.
MODULE m6.
ENDCHAIN.
Reward if useful
Regard,
Muneesh Gitta.