Application Development and Automation 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: 
Read only

regarding selection screen

Former Member
0 Likes
947

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
926

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

7 REPLIES 7
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
926

Try using a flag variable and set it to true and false...so that the iterations happens only once.

Read only

Former Member
0 Likes
927

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

Read only

0 Likes
926

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.

Read only

0 Likes
926

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

Read only

0 Likes
926

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.

Read only

Former Member
0 Likes
926

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>

Read only

Former Member
0 Likes
926

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