‎2008 Apr 02 12:48 PM
Hi,
I have developed a table-control .
I have certain errors captured in the chain-enchain statement of the program.
When I click on a particular button on the screen,the chain-endchain block is getting skipped and the module user-command is being called .
Due to this,the errors that are captured in the chain-endchain block are not getting displayed .
Please can someone help me out with this.
Regards,
Sushanth H.S.
‎2008 Apr 02 1:07 PM
Hello,
The field modules are only processed when some event occurs in the fields used by the command. The only modules that are always executed are the modules called with the MODULE command (without FIELD or others commands like ON EXIT-COMMAND).
See demo program DEMO_DYNPRO_STRINGS for data transfer betwen screen .
For subscreens see demo program DEMO_DYNPRO_SUBSCREENS .
Regards,
‎2008 Apr 03 9:52 AM
hey....
i wud suggest u a rather simple way to capture the errors in the chain end chain....
first i suppose u dont know wen the errors come... i would suggest you to use breakpoints within the chain end chain and den check wat errors come. To analys the code step by step, use /h in the command line before clicking on the screen... this wil take you to the first line of code that gets executed once u press any button. Moreover, it is obvious that the user command wil get executed as it is insidde the PAI module. So in order to chk errors in the chain end chian, try putting the code in a module and cal that module before the user command in the PAI.
hope this helps, do reward anyways...;)
and do get back if the trouble persists. wil try to help u out.
‎2008 Apr 03 10:49 AM
Hi Sushanth,
Here is one option for you if the module inside chain endchain is being skipped as mentioned ....
in the chain ..endchain....
add all your messages to an internal table..in addition to the existing process of giving messages in the module inside chain..endchain
When the user presses the button....
it will be captured in the sy-ucomm..
so write
Case sy-ucomm.
when 'XXXX' . "XXXX = some function code of a button
if the internal table[] is not initial.
loop at internal table into work area.
so in the work area you have the message
message 'The entry is wrong' type 'S'.
clear sy-ucomm.
exit.
endloop.
else. "if internal table is initial means no error
write code for action of the button here
endif.
*so what happens is that
(1)you will show your first message if there are mutiple messages
(2) then clear the sy-ucomm so that user has to go ansd correct the error
(3)"exit" so that you don't overwrite the current message displayed on the screen with the next....show the messages to him one by one..
you can decide what the structure of the internal table
because messages can be given directly,using message classes,using text-elements for description..etc
The solution is workable and has been tried before....
Reward if it helps ....
Regards
Byju
‎2008 Apr 04 9:52 AM
There may be some mistake in your chan- endchain part.
use like this.
chain.
field <field1>.
field <field2>.
module check_chain on chain-request.
where check_chain is the module where u have to write ur validations.