Friday, September 28, 2018

use and difference between on chain input and on chain request in dialog program


  • ON CHAIN-INPUT

Similar to ON INPUT. The ABAP module is called if any one of the fields in the chain contains a value other than its initial value (blanks or empty).
  • ON CHAIN-REQUEST

   This condition functions just like ON REQUEST, but the ABAP module is called if any one of     the  fields in the chain changes value.

FOR EXAMPLE :

CHAIN.
FIELD: FIELD1, FIELD2.
FIELD: FIELD 3, FIELD 4.
MODULE X ON CHAIN-INPUT.
MODULE Y.
ENDCHAIN.

 
In the above code , module X is called only when value of  any fields are entered other than initital value where as  MODULE Y will be called, there is no condition attached to it.but , if MODULE Y  has an error then it will open all the fields for input.

IF YOU WANT TO RESTRICT THE CONDITION ON PARTICULAR FIELD  ,THEN ATTACH THAT MODULE NAME AFTER THAT FIELD .

CHAIN.
FIELD: BSEG-HKOT,BSEG-BUKRS MODULE X ON INPUT.
ENDCHAIN.


In this is case, MODULE X will be called only when BUKRS will have non-initial value , but if MODULE X finds an error, then both the fields will be opened for input again. 

on chain request.

CHAIN.
FIELD: A, B, C MODULE X ON CHAIN-REQUEST.
ENDCHAIN.

                                AT EXIT COMMAND IN MODULE POOL

 Sometimes, when we have obligatory fields(REQUIRED FIELD)  input fields and we don't want to proceed further , and we want to come out of the program , it will not allow us. We have to enter the required value  on screen fiels , then only we can  come out of the screen , to overcome this problem,
 we use AT EXIT-COMMAND at PAI of screen to force exit from screen without filling it .