cancel
Showing results for 
Search instead for 
Did you mean: 

Reg. module programming

Former Member
0 Kudos

In many of the module programming, I see ABAP statements like:

CHAIN.

FIELD VTTK-TKNUM.

What do they mean? Can you explain me?

Thanks very much.

Accepted Solutions (1)

Accepted Solutions (1)

ferry_lianto
Active Contributor
0 Kudos

Hi Krishen,

The Chain endchain method is a way of input checks in dialog modules.

Suppose you have input fields f1, f2 , f3 etc.

If you write the foll. st,

CHAIN.

FIELD: <f1>, <f 2>,...

MODULE <mod1>.

FIELD: <g1>, <g 2>,...

MODULE <mod2>.

...

ENDCHAIN.

When this command is used, 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.

Please check the below links.

http://help.sap.com/saphelp_47x200/helpdata/en/d1/801ca2454211d189710000e8322d00/frameset.htm

Regards,

Ferry Lianto

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Krishen,

Syntax

Chain.

Field sflight-carrid value (‘LH’).

Field sflight-connid values (between ‘200’ and ‘500’).

Endchain.

Field sflight-price values (‘100’ ‘1000’).

In this case, if the user enters wrong value only for carrid, both the fields i.e. carrid and connid are enabled as they are grouped together in the Chain statement. The field price will be disabled for input. Usually, logically related fields are grouped together with Chain-Endchain statement.

REgards,

Santosh

Former Member
0 Kudos

Hi,

The statements CHAIN and ENDCHAIN of the dynpro flow logic define processing chains. Between CHAIN and ENDCHAIN, the statements FIELD and MODULE can be executed. The statements between CHAIN and ENDCHAIN form a processing chain. Processing chains cannot be nested. The CHAIN statement can be specified in the event blocks at PAI and PBO , however, in the event block at PBO it has no effect.

A processing chain allows the joint processing of all the screen fields stated between CHAIN and ENDCHAIN after FIELD statements:

The contents of all screen fields combined to a processing chain by the FIELD statements can be checked in the shared conditions ON CHAIN-INPUT and ON CHAIN-REQUEST of the MODULE statement.

A warning or error message in a module called within a processing chain resets all input fields whose screen fields are combined in this processing chain using FIELD statements to ready-for-input. After a user input, the PAI processing resumes at the CHAIN statement at the latest.

Example

Call dialog modules to check input values. The screen fields input1 and input2 are checked in individual dialog modules check_1 and check_2. The screen fields input3 to input5 are checked in a processing chain in a shared dialog module check_chain. Warning or error messages in the dialog modules either make only one input field input1 or input2 ready for input again or all three input fields input3 to input5.

PROCESS AFTER INPUT.

MODULE leave_dynpro AT EXIT-COMMAND.

FIELD input1 MODULE check_1 ON REQUEST.

FIELD input2 MODULE check_2 ON REQUEST.

CHAIN.

FIELD input3.

FIELD input4.

FIELD input5.

MODULE check_chain ON CHAIN-REQUEST.

ENDCHAIN.

MODULE handle_user_command.

~~Guduri

former_member181962
Active Contributor
0 Kudos

If you have more than one field inside a chain-endchain statement, it means that those field will all be input ready when ann error occurs for one of the fields.

All the validations for those fields can be done in a single module.

Also, if you do not include them between chain-endchain, all the fields will be greyed out(Input disabled in case of errors).

Regards,

Ravi