2005 Aug 09 12:56 AM
Hi Everyone,
I have a menu bar for my screen, with certain buttons, my requirement is if i press one of the button another screen must pop up.
Where should I implement this code.
Any help will be greatly appreciated.
Thanks in advance,
Prabs.
2005 Aug 09 4:42 AM
Hi Prabhakaran,
In the PAI of this screen, where the menu bar is present, you should have a module which is meant for user command.
In this u should track the function code of the button pressed, and accordingly call the screen you r interested in calling.
Remember 2 reward suitable points to replies that helped answer ur question.
Reg,
PP.
2005 Aug 09 1:02 AM
Hi Prabs,
What sort of program are you doing this for?
If it is for a ALV report you should put it in the subroutine defined in the 'I_CALLBACK_USER_COMMAND'.
If it is for a dialog program, it should go in the PAI event . eg.
Proces after input.
module user_command.
module user_command input.
case sy-ucomm.
when 'XXXX'.
call screen....
endcase.
endmodule.
Hope this helps.
Cheers,
Pat.
2005 Aug 09 4:42 AM
Hi Prabhakaran,
In the PAI of this screen, where the menu bar is present, you should have a module which is meant for user command.
In this u should track the function code of the button pressed, and accordingly call the screen you r interested in calling.
Remember 2 reward suitable points to replies that helped answer ur question.
Reg,
PP.
2005 Aug 11 1:50 PM
If ur question is answered, kindly reward suitable points and close the thread.
2005 Aug 09 9:13 AM
Hi,
In the PAI of the screen
DATA: i_fieldrows TYPE lvc_t_row,
MODULE user_command_9001 INPUT.
CALL METHOD o_alvgrid->get_selected_rows
IMPORTING
et_index_rows = i_fieldrows.
LOOP AT i_fieldrows INTO w_fieldrows.
READ TABLE i_output INTO w_output INDEX w_fieldrows-index.
ENDLOOP.
CASE sy-ucomm.
WHEN 'XX'.(function code in application tool bar)
.Perform to pop up
.
ENDCASE.
2005 Aug 09 9:23 AM
Hi praba,
i'm bit confused whether u r asking for menu button on ordinary screen or on ALV screen?
If it's alv then wat judi selvi told is rite. If it is ordinary screen, then u would have assigned a ok-code for ur button in menu painter. In PAI of ur screen u ahve check for the sy-ucomm value. If sy-ucomm = ur button's ok-code, then perform desired coding.
for example,
module check_ucomm INPUT
data l_ucomm = sy-ucomm.
CASE l_ucomm.
when <ur button's ok-code>.
perform some operation.
endcase.
thats it.
with regards,
praveen.
2005 Aug 10 7:06 AM
Hi Prabhakaran
Go to se41: menu editor
create button in menu bar,and assign function code to that button.
Now use this code in your program.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
MODULE CANCEL INPUT.
IF SY-UCOMM EQ 'BACK'. (please note that BACK should be defined as a function of type EXIT COMMAND)
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
TITEL = 'TEST'
TEXTLINE1 = 'Do you want to exit without saving ?'
IMPORTING
ANSWER = LV_ANSWER.
ENDIF.
ENDMODULE.
Now it is up to ur requiremnet How you want a pop up,there are lot of function modules that are used for
POP UP.
Examples:
<b>POPUP_TO_CONFIRM_LOSS_OF_DATA</b>
Create a dialog box in which you make a question whether the user wishes to perform a processing step with loss of data.
<b>POPUP_TO_CONFIRM_STEP</b>Create a dialog box in which you make a question whether the user wishes to perform the step.
<b>POPUP_TO_CONFIRM_WITH_MESSAGE</b>
Create a dialog box in which you inform the user about a specific decision point during an action.
<b>POPUP_TO_CONFIRM_WITH_VALUE</b>
Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.
<b>POPUP_TO_DECIDE</b>
Provide user with several choices as radio buttons
<b>POPUP_TO_DECIDE_WITH_MESSAGE</b>
Create a dialog box in which you inform the user about a specific decision point via a diagnosis text.
<b>POPUP_TO_DISPLAY_TEXT</b>
Create a dialog box in which you display a two line message
<b>POPUP_TO_SELECT_MONTH</b>
Popup to choose a month
<b>POPUP_WITH_TABLE_DISPLAY</b>
Provide a display of a table for user to select one, with the value of the table line returned when selected.
I think this will fulfill your Requirement.
Regards
Vijay Raheja.