07-04-2007 8:11 AM
Hello Friends,
I have a table control which have some mandantory fields, the issue is, when I click on cancel button, still the msg comes that mandantory fields should be fillied ?
How I can avoid this issue ...
Regards,
07-04-2007 8:15 AM
07-04-2007 8:15 AM
Hello,
Write a module in PAI with <b>at exit command </b>adition.
Write that cancel ok_code capture in that module.
remember the function type of the cancel to be 'E'.
This will surely work.
Reward if found helpfull.
Regards rakesh.
07-04-2007 8:17 AM
hi,
write like this at table control screen,
module exit_prg at exit-command.
and doble click on module, write code like this,
module exit_prg input.
if sy-ucomm = 'CANCEL'.
leave program.
endif.
endmodule. " exit_prg INPUT
and your CANCEL button's Functional type should be E 'Exit command' in the PF-STATUS
reward points if useful,
regards,
seshu.
07-04-2007 8:17 AM
Hi,
Have you tried with at exit command?
In PAI add 'MODULE exit_control at exit-command.'
module exit_control input.
case ok_code.
when 'EXIT'.
leave program.
endcase.
endmodule. " exit_control INPUT
07-04-2007 8:22 AM
Hello All,
On cancel button, I have already given 'Leave Program'....
What I can do further to exit when user press cancel button ?
Regards,
07-04-2007 8:25 AM
The thing is following:
If I do not place any entry in table control, and press cancel button things works fine, but if 1 column is fillied, in table control, but still I want to cancel, then comes the msg, tha all mandantory fields should be filled...
Regards,
I have a module called MODULE USER_COMMAND_0100 INPUT, and there I am leaving the program when is cancel button pressed !
Message was edited by:
Shah H
07-04-2007 8:27 AM
Hello dear,
you shoul write that code inside a module that having AT EXIT-COMMAND addition. Then only it will work. Otherwise it will not work as those are automatic field checks provided by SAP.
Regards,
Rakesh.
07-04-2007 8:29 AM
did you made ur CANCEL button's Functional type as E 'Exit command' in the PF-STATUS of ur screen?
07-04-2007 8:29 AM
Hello,
Thanks I will try with exit command, .... and will let you guys know...
Regards,
07-04-2007 8:30 AM
07-04-2007 8:38 AM
Hi Rakesh,
Unfortunatelly, it did not work, or might be I made some mistake:
Well I did followings:
I created a new PAI module see code pls:
process after input.
*&spwizard: pai flow logic for tablecontrol 'Z_TAB_CTRL'
MODULE EXIT AT EXIT-COMMAND.
loop at g_z_tab_ctrl_itab.
chain.
field zenco_tab_ctrl-videocodec.
field zenco_tab_ctrl-BITC.
field zenco_tab_ctrl-AUDIO.
field zenco_tab_ctrl-kommentar.
field zenco_tab_ctrl-videonorm.
field zenco_tab_ctrl-hdformat.
field zenco_tab_ctrl-bitratemin.
field zenco_tab_ctrl-bitrateave.
field zenco_tab_ctrl-bitratemax.
field zenco_tab_ctrl-videosize.
field zenco_tab_ctrl-aspectratio.
field zenco_tab_ctrl-qc_level.
module z_tab_ctrl_modify on chain-request.
endchain.
endloop.
module z_tab_ctrl_user_command.
*&spwizard: module Z_TAB_CTRL_change_tc_attr.
*&spwizard: module Z_TAB_CTRL_change_col_attr.
module user_command_0100.
process on value-request.
And this is my module:
MODULE EXIT INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'E'.
leave PROGRAM.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.
Any idea what I am doing wrong ?
Regards,
07-04-2007 8:40 AM
07-04-2007 8:43 AM
I try to debug it, but in debug mode, the control is not comming to exit module ?
Why, even the first line of my PAI is exit module...
<b>
Well what I notice is when I do double click on moduel exit, it gives me msg that, "PAI mdoule EXIT is not used in Screen of the program SAPLZ_popup"</b>
Any idea, what is going on ?
Message was edited by:
Shah H
07-04-2007 8:56 AM
go to your PF-STATUS, click on the CANCEL icon, there it will ask for Functional type, give E in it, it will solve your problem
07-04-2007 8:59 AM
Hello Tripat,
my cancel button is on screen, and using screen painter, I have place the fctcode to 'E'
Regards,
07-04-2007 9:02 AM
buddy, its Functional type not Function Code, Functional type should be E, and function code can be any name you want to pass to SY-UCOMM, which u have given as E but i'll prefer to give Function Code as CANCEL
Message was edited by:
Tripat Pal Singh
07-04-2007 9:06 AM
Well it was before CANCEL I do not understand your point, ...
What I want is, when user press the cancel button on screen, the screen should be cancelled, and not asked for mandantory fields to be filled.....
THE PF-STATUS relation with cancel button, can you pls explain a bit more, mean while I will set the PF_STATUS
Regards,
07-04-2007 9:14 AM
Hello Tripat,
I now even set the PF-STATUF for cancel button ( it did not work for me ) , but I think there is one mis-understanding going on I guess you are talking about the cancel button on top menu ? right, .,,,
Actually, as I said I have my own button on screen, which I created using screen painter, and this is the button which should exit when user press it, ( and even when mandantory fields are not filled )...
Regards,
07-04-2007 9:18 AM
see, if one wants to exit screen programing, then one must write MODULE EXIT AT EXIT-COMMAND. if u write LEAVE TO SCREEN 0 in MODULE USER_COMMAND, then all the code will be processed before this module as in ur case the code is
oop at g_z_tab_ctrl_itab.
chain.
field zenco_tab_ctrl-videocodec.
field zenco_tab_ctrl-BITC.
field zenco_tab_ctrl-AUDIO.
field zenco_tab_ctrl-kommentar.
field zenco_tab_ctrl-videonorm.
field zenco_tab_ctrl-hdformat.
field zenco_tab_ctrl-bitratemin.
field zenco_tab_ctrl-bitrateave.
field zenco_tab_ctrl-bitratemax.
field zenco_tab_ctrl-videosize.
field zenco_tab_ctrl-aspectratio.
field zenco_tab_ctrl-qc_level.
module z_tab_ctrl_modify on chain-request.
endchain.
endloop.
module z_tab_ctrl_user_command.
*&spwizard: module Z_TAB_CTRL_change_tc_attr.
*&spwizard: module Z_TAB_CTRL_change_col_attr.
and will throw the message.
MODULE EXIT AT EXIT-COMMAND is processed directly without processing any other code whenever a button EXIT,BACK,CANCEL is pushed, but given that ((((((Functional Type is E))))))))
07-04-2007 9:23 AM
Hello Tripat,
Okey, thanks for your descriptive answer
<b>MODULE EXIT AT EXIT-COMMAND is processed directly without processing any other code whenever a button EXIT,BACK,CANCEL is pushed, but given that ((((((Functional Type is E))))))))</b>
But the button you are talking about are in PF-STATUS, I am talking about my own button, which is created using screen painter ? ( right ?.... well I have even set the PF-STATUS but the thing is my screen is displayed as a pop-up, and in pop-up those buttons which you are refering in PF-STATUS are not avaiable... )
<b>I have to exit the program when user press the cancel button which I have created using screen painter.</b>
07-04-2007 9:27 AM
when you double click on your screen button in screen painter, an attribute window will open, give whatever code you wanna give in FctCode, this will be value OK_CODE will b carrying when that button is pushed, on it's right side is FctType with dropdown, select E from dropdown. now when u r running this program and u push this button, MODULE EXIT AT EXIT-COMMAND will be processed, in that module write LEAVE TO SCREEN 0, thats it
07-04-2007 11:07 AM
Change name of module 'EXIT' to some other name like 'ON_EXIT'.
Write code for ON_EXIT by double clicking and creating the Module - End module statememts.
regards.
Manjunatha
07-04-2007 8:21 AM
*write a module in ur PAI. write it as the very first line in PAI.
MODULE EXIT AT EXIT-COMMAND.
in this module write LEAVE TO SCREEN 0.
and make sure that ur CANCEL button's Functional type should be E 'Exit command' in the PF-STATUS
07-04-2007 8:52 AM
In PAI of screen you should use this module.. only then this will be called
PROCESS AFTER INPUT.
MODULE MODULE_EXIT at exit-command.
07-04-2007 8:57 AM
hi Srinivasa,
I have tried to change the name of the module as well, but still it did not work ?
Any one has any idea, what I am doing wrong ?
Regards,
07-04-2007 9:32 AM
yes, mean time I tried the same as you mentioned in your post...
And it works, ... thanks for your reply,..