‎2009 Dec 10 6:08 AM
Hi All,
I have a custom GUI status with an added refresh button in the application toolbar.
Now my problem is the back button.
I want it to go back to the programs selection-screen, not to the last program display.
What is happening now is let's say i click the refresh button 5 times, it took me another 5 click on the back button before it goes to the selection-screen.
How to do that?
Thanks.
‎2009 Dec 10 7:02 AM
What is happening now is let's say i click the refresh button 5 times, it took me another 5 click on the back button before it goes to the selection-screen.
You problem may not relate with BACK function code but with REFRESH, how did you manage it, don't call another ALV but refresh the display using rs_selfield-refresh = 'X' in the ALV user_command, then the back button should work perfectly. (You may also get memory problem, try to refresh 100 times, and check memory usage...)
Regards,
Raymond
‎2009 Dec 10 6:17 AM
Hi ..
Use
LEAVE LIST PROCESSING. " In the code of back button
Nag
‎2009 Dec 10 6:26 AM
There's no code for back button because it's a copy of the STANDARD_FULLSCREEN.
Only the refresh button is customized. When I tick the back button, the user command for the alv grid is not trigerred.
Take note that this is not dialog programming.
‎2009 Dec 10 6:30 AM
Hi Navi..
I got your problem..
Also implement the code for Back (&F03) and write the above logic..
Nag
‎2009 Dec 10 6:33 AM
‎2009 Dec 10 6:38 AM
you need to code sy-ucomm &F03, if you are using the standard.
leave list processing will work in that case.
like in my case frm selection screen execution i am calling the ALV FM, and it automatically controls the same..
regards
Yadesh
‎2009 Dec 10 6:39 AM
If its ALV LIST/GRID
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM ........................
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = FCAT[]
IT_EVENTS = IT_EVENTS[]
TABLES
T_OUTTAB = LT_TAB.
FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
IF F_UCOMM = '&F03'.
LEAVE LIST PROCESSING.
ENDIF.
ENDFORM.
If its report program
AT USER-COMMAND.
IF SY-UCOMM = '&F03'.
LEAVE LIST PROCESSING.
ENDIF.
Nag
‎2009 Dec 10 6:44 AM
if you are using the standard ALV FM..then it is not required to give the code in the call back routine...
standard program automatically controls the behaviour of back button.
‎2009 Dec 10 6:50 AM
i place a break-point on the user-command, but it wasn't trigerred whenever i click 'back' it's only trigerred when i click refresh.
once again, refresh is a custom button while back is not.
did i miss something?
do i need to change something in SE41 for the back attribute?
it seems that i'm not in control of the back button.
‎2009 Dec 10 6:51 AM
‎2009 Dec 10 6:52 AM
Trying changing Fcode of back and use the same in User_command.
Nag
‎2009 Dec 10 6:53 AM
if you have the Global trade active in your system ...you can refer to a program "RWB2_EXPENSE_WORKBENCH"
i think this is the same scenario...and its working for me..
‎2009 Dec 10 6:59 AM
can you tell me in which report event you are using the FM to display the ALV??
‎2009 Dec 10 7:02 AM
i changed the fcode and the breakpoint is now triggered. but the LEAVE LIST PROCESSING is not working, my code now won't exit from the main alv display.
‎2009 Dec 10 7:06 AM
i think raymond suggestion might be right..
when you are refreshing it...just change the data in the internal tables that you were passing in the FM...
‎2009 Dec 10 7:13 AM
I am using the global tables to pass the data to the ALV...
once i press the refresh button..i update the data in the global tables...
that is all is required...it automatically updates the data in the ALV...
i think that will solve you issue..
‎2009 Dec 10 7:02 AM
What is happening now is let's say i click the refresh button 5 times, it took me another 5 click on the back button before it goes to the selection-screen.
You problem may not relate with BACK function code but with REFRESH, how did you manage it, don't call another ALV but refresh the display using rs_selfield-refresh = 'X' in the ALV user_command, then the back button should work perfectly. (You may also get memory problem, try to refresh 100 times, and check memory usage...)
Regards,
Raymond
‎2009 Dec 10 7:15 AM
yup i call a new alv.
because in the refresh, i also need to capture the new created PO (in my case).
so in the refresh button, i call the subroutines that retrieves data and then call the alv back again.
‎2009 Dec 10 7:23 AM
case fcode = 'REFRESH'
- ALV refresh
p_rs_selfield-refresh = yes.
p_rs_selfield-col_stable = yes.
p_rs_selfield-row_stable = yes.
PERFORM select_data_from_db_expense "... "REFRESH
TABLES gt_wbrk_list "...
gt_selected_doc_key.
..here gt_wbrk_list ..gets updated...and will update the ALV.
and GT_WBRK_LIST is the global internal table that i used firstly to pass the data to the ALV
‎2009 Dec 10 7:23 AM
In the user_command, you may have some code like
WHEN 'REFRESH'.
PERFORM load_full_data.
rs_selfield-refresh = 'X'.
WHEN 'CREATE'.
PERFORM create_new_record CHANGING record retcode.
IF retcode = 0.
ADD record TO itab.
rs_selfield-refresh = 'X'.
ENDIF.
WHEN 'DELETE'.
PERFORM delete_old_record USING p_index CHANGING retcode.
IF retcode = 0.
DELETE itab INDEX p_index.
rs_selfield-refresh= 'X'.
rs_selfield-col_stable= 'X'.
rs_selfield-row_stable= 'X'.
ENDIF.
WHEN OTHERS...Regards,
Raymond
‎2009 Dec 10 7:36 AM
hi raymond
you are right. i should not be calling another alv. it's enough that i update internal table for output.
thank you so much.
‎2009 Dec 10 7:47 AM
‎2009 Dec 10 8:14 AM
‎2009 Dec 10 7:32 AM
I think this is what you need to do, i had similar scenario.
FORM f_alv_user_comm USING i_ucomm TYPE syucomm
i_rs TYPE slis_selfield."here you are catching the okcode from second creen to go to initial
* Display ALV2 (This list shows the list blocked/unblocked customers)
PERFORM f_display_alv2 CHANGING i_ucomm.
IF i_ucomm EQ '&F03'. " here you can use the back button code
* Return to seletion screen
LEAVE TO SCREEN 0.
ENDIF.
endform.
In f_display_alv2 do like this :
FORM f_display_alv2 CHANGING e_ucomm TYPE syucomm. "here you are sendin the okcode from second creen to go to initial
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_bypassing_buffer = c_mark
i_callback_program = w_repid
is_layout = lws_layout
it_fieldcat = int_fieldcat2[]
it_events = int_events_alv2
TABLES
t_outtab = int_alv2_out
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
e_ucomm = '&F03'. " This will take the back button code
ENDIF.
endform.
This is the right way to do it.
same reference :
Regards,
Salil Sonam
‎2009 Dec 10 7:36 AM