04-24-2006 7:55 AM
hi frnd's,
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = GT_FIELDCAT[]
is_layout = GS_LAYOUT
i_save = 'A'
IT_EVENTS = GT_EVENTS[]
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'ALV_UCOMM'
TABLES
t_outtab = IT_ORDERS.
Using this I am displaying the alvlist , I had given my own pf-status and ucomm.
From alvlist i am calling the dialog program screen using call screen.
Then when i click back in dialog screen it leaves to alvlist , but when i click back in alvlist it again goes to dialog screen.
but i want to leave form that program.
hlp me pls.
04-24-2006 7:58 AM
04-24-2006 7:58 AM
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = IT_FIELDCAT
it_events = it_events
TABLES
T_OUTTAB = ITAB
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.
ENDIF.
FORM TOP_OF_PAGE.
BREAK-POINT.
WRITE: / 'TOP_OF_PAGE'.
ENDFORM.
FORM END_OF_PAGE.
BREAK-POINT.
WRITE: / 'END_OF_PAGE'.
ENDFORM.
&----
*& Form STATUS
&----
text
----
-->P_EXTAB text
----
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
*- Pf status
SET PF-STATUS 'STATUS'.
ENDFORM. " STATUS
&----
*& Form USER_COMMAND
&----
text
----
-->R_UCOMM text
-->RS_SELFIELD text
----
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
case r_ucomm.
when 'BACK' or 'CANC' or 'EXIT'.
<b>leave to screen 0.</b>
when '&IC1'.
set parameter id 'AUN' field rs_selfield-value.
call transaction 'VA03' and skip first screen.
endcase.
ENDFORM. "USER_COMMAND
04-24-2006 8:02 AM
Hi suganya,
Are u checking the function code 'BACK'.
Check sy-ucomm.
If 'BACK'.
exit.
leave to selection-screen or your previous screen.
Endif.
Regards,
Tanveer.
Please mark helpful answers.
04-24-2006 8:06 AM
04-24-2006 8:11 AM
Hi,
what is the Fcode you have assigned for that back button.
Also when comparing use caps letters,
ie
sy-ucomm = 'BACK'
and not 'Back'.
Regards,
Tanveer.
04-24-2006 8:17 AM
I had given in Caps only.This is the user-command .
FORM ALV_UCOMM USING UCOMM LIKE sy-ucomm
SELFIELD TYPE SLIS_SELFIELD.
ENDFROM.
This routine itself doesn't get called when i leave the ALV LIST and come back and when i use F3-BACK.It works for other icons in toolbar.
04-24-2006 8:36 AM
For ALV LIST the user command itself not getting triggered for the back button.
04-24-2006 8:41 AM
ru activated pf status?. first go to pf-status and activate it....
04-24-2006 8:13 AM
Hi Suganya,
refer this :
https://www.sdn.sap.com/irj/sdn/collaboration
Topic : User command in ALV
you will get the solution.
and also you can use this :
case sy-ucomm.
When 'BACK'.
Leave Program.
endcase.
regards,
kunal.