‎2007 Jul 06 4:44 AM
i have created a push button on my selection screen. i want to call a perform by clicking this pusbutton. now the problem is in my perform, i have called the same screen, in which i have included my push button. i have written this in the event
at selection-screen output. So there is a dump thrown by SAP. the problem is it is going into calling the the screen infinite number of times. moreover i cant use
at selection-screen, as im doing a BDC recording, so the include of BDC, which comes into the program by default, already has at selection-screen event. so if i declare it in my program its also throwing an error.So, can some body help me in giveing a solution to this problem.
eg. i want to do some validation and want to print it by clicking my push button for a given pernr and for a given date.
‎2007 Jul 06 4:50 AM
Hi,
Use event <b>AT USER-COMMAND</b>. Whatever you want to do after clicking the push button, write that code under this event. So, whenever you click on the push button, this event will be triggered and hence your code will be executed.
Reward points if the answer is helpful.
Regards,
Mukul
‎2007 Jul 06 4:47 AM
Try using a flag variable and set it to true and false...so that the iterations happens only once.
‎2007 Jul 06 4:50 AM
Hi,
Use event <b>AT USER-COMMAND</b>. Whatever you want to do after clicking the push button, write that code under this event. So, whenever you click on the push button, this event will be triggered and hence your code will be executed.
Reward points if the answer is helpful.
Regards,
Mukul
‎2007 Jul 06 5:30 AM
hi mukul im calling my perform in at user command. but im not able to do any thing at the clikck of the button. rather i had put a break point on the line at user-command. but at the click of button its not going in the debugging mode. help me out.
‎2007 Jul 06 5:37 AM
Hi Madhvi,
Have you attached a function code to your push button ? If not, please do that, because without that, AT USER-COMMAND event wont be triggered.
Reward points if the answer is helpful.
Regards,
Mukul
‎2007 Jul 06 5:43 AM
yes mukul i have assigned function code.
my code is:
at user-command.
IF SSCRFIELDS-UCOMM = 'ABCD'.
perform information_about.
endif.
where in the declaration of push button i have written:
selection-screen: begin of block b3 with frame title text-tit.
selection-screen: begin of line.
selection-screen PUSHBUTTON 20(20) text-033
USER-COMMAND ABCD MODIF ID SG.
selection-screen: end of line.
selection-screen: end of block b3.
‎2007 Jul 06 4:54 AM
hi
<b>write the following code</b>
data: flag type i value 0.
case sy-ucom.
when 'CLICK'
if flag eq 0,
include
flag = 1.
endif.
endcase.
it will work for u.
regards
ravish
<b>plz dont forget to reward if useful</b>
‎2007 Jul 06 5:09 AM
Hi Madhvi,
This at selection screen output is using for only design the selection screen. based on the user action on the u want to display the output, right? so use event at user command as mentioned in the Mukul suggestion. or mention in the start of selection like
case sy-ucomm.
when 'FCPDE'.
Perform display_output.
endcase.
Hope this helps you. Reply for queries, shall post the updates.
Regards.
Kumar