Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Clear Fields of a Screen, included in Chain..EndChain

Former Member
0 Kudos

Dear All,

I have developed a screen program with a few text fields. I have also used Chain..EndChain on these. I am unable to clear the fields included in this Chain..EndChain on the screen, while others are getting cleared.

Please suggest a solution.

Regards,

Alok.

3 REPLIES 3

Former Member
0 Kudos

Hi,

We write a Chain Statment like this ..

CHAIN.

FIELD chk_connobj.

FIELD chk_inst.

FIELD chk_devloc.

<b>MODULE modify_screenfields.</b>

ENDCHAIN.

In the Module, Write the Clear statment,

Regards

Sudheer

former_member283648
Participant
0 Kudos

Hi,

Pls. check if you have any statment like module on chain-input or module on chain-request. May be u are doing some validations in this and hence whenver u are clearing, u are ending up in some error.

Former Member
0 Kudos

Hullo,

you probably have the module with clear statement before the CHAIN - ENDCHAIN command.

The problem is that the FIELD command which you are probably using within the chain is waiting with the data transport of those fields until the FIELD statement has been processed.

An example (with a Screen using KNA1 fields).

PROCESS AFTER INPUT.
* Directly after the PAI has been triggered all data from the screen elements
* will be transported to the KNA1 variable in your program.
* Except for those sceen element that are part of a FIELD statement.

MODULE clear_kna1.
* This module will clear the kna1 variable in your program.

CHAIN.
  FIELD kna1-kunnr.
* At this field statement the contents of the screen element kna1-kunnr
* will now be transported to the kna1 variable ni your program.
  Module xxx.
ENDCHAIN.

In this example the kna1 variable will be cleared by the 'clear_kna1' module. However, since the FIELD statement is processed after this module, the kunnr field will be transported into the (now empty) kna1 variable.

The solution to this is to put the ' clear_kna1' module after the FIELD statement (most likely after the chain). That way all the fields of the kna1 variable will be cleared.

Hope this helps.