04-09-2007 5:20 PM
hi all,
in my program back button is working. now i have a button in application tool bar i.e. execution(F8) button when i am executing this button it has to show the data from ztable.
but it is not working fine.
its sy-ucomm is execute in debug it is showing the data correctly but it not showing when i press f8 button anybody can help in this.
i am sending my code .
report zmahi4.
TABLES: sscrfields.
DATA : IT_SECOBJECTS LIKE ZUSER_SECOBJECTS OCCURS 0 WITH HEADER LINE .
selection-screen: begin of block b1.
parameters : p_appln type mara-matnr.
parameters : p_user type marc-werks.
selection-screen: end of block b1.
data: begin of exclude occurs 0,
func(10) type c,
end of exclude.
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'BACK' or 'EXIT'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXECUTE'.
SELECT * FROM ZUSER_SECOBJECTS
INTO TABLE IT_SECOBJECTS.
CHECK SY-SUBRC EQ 0.
LOOP AT IT_SECOBJECTS.
WRITE : IT_SECOBJECTS.
ENDLOOP.
WHEN OTHERS.
ENDCASE.
At selection-screen output.
set pf-status 'SELK'. <-- Comment this line
if sy-dynnr eq '1000'.
call function 'RS_SET_SELSCREEN_STATUS'
exporting
p_status = 'SELK'
tables
p_exclude = exclude
exceptions
others = 1.
endif.
CASE SY-UCOMM.
WHEN 'EXECUTE'.
PERFORM GET_DATA.
endcase.
&----
*& Form GET_DATA
&----
text
----
--> p1 text
<-- p2 text
----
form GET_DATA.
SELECT * FROM ZUSER_SECOBJECTS
INTO TABLE IT_SECOBJECTS.
*CHECK SY-SUBRC EQ 0.
*LOOP AT IT_SECOBJECTS.
*WRITE : IT_SECOBJECTS.
*ENDLOOP.
endform. " GET_DATA
thanks,
maheedhar.t
04-09-2007 6:20 PM
Please use the LEAVE TO LIST-PROCESSING statement.
CASE sscrfields-ucomm.
WHEN 'BACK' or 'EXIT'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXECUTE'.
LEAVE TO LIST-PROCESSING . "<--- RIGHT HERE
SELECT * FROM ZUSER_SECOBJECTS
INTO TABLE IT_SECOBJECTS.
CHECK SY-SUBRC EQ 0.
LOOP AT IT_SECOBJECTS.
WRITE : IT_SECOBJECTS.
ENDLOOP.
REgards,
RIch Heilman
04-09-2007 5:25 PM
Hi..,
change ur code which is in bold letters...
report zmahi4.
TABLES: sscrfields.
DATA : IT_SECOBJECTS LIKE ZUSER_SECOBJECTS OCCURS 0 WITH HEADER LINE .
selection-screen: begin of block b1.
parameters : p_appln type mara-matnr.
parameters : p_user type marc-werks.
selection-screen: end of block b1.
data: begin of exclude occurs 0,
func(10) type c,
end of exclude.
AT SELECTION-SCREEN.
CASE<b> sy-ucomm.</b>
WHEN 'BACK' or 'EXIT'.
<b>leave program.</b>
WHEN 'EXECUTE'.
<b>clear sscrfields-ucomm.</b>
SELECT * FROM ZUSER_SECOBJECTS
INTO TABLE IT_SECOBJECTS.
CHECK SY-SUBRC EQ 0.
LOOP AT IT_SECOBJECTS.
WRITE : IT_SECOBJECTS.
ENDLOOP.
WHEN OTHERS.
ENDCASE.
At selection-screen output.
set pf-status 'SELK'. <-- Comment this line
if sy-dynnr eq '1000'.
call function 'RS_SET_SELSCREEN_STATUS'
exporting
p_status = 'SELK'
tables
p_exclude = exclude
exceptions
others = 1.
endif.
CASE SY-UCOMM.
WHEN 'EXECUTE'.
PERFORM GET_DATA.
endcase.
&----
*& Form GET_DATA
&----
text
----
--> p1 text
<-- p2 text
----
form GET_DATA.
SELECT * FROM ZUSER_SECOBJECTS
INTO TABLE IT_SECOBJECTS.
*CHECK SY-SUBRC EQ 0.
*LOOP AT IT_SECOBJECTS.
*WRITE : IT_SECOBJECTS.
*ENDLOOP.
endform. " GET_DATA
<b></b>
04-09-2007 5:38 PM
hi sai,
still same problem exist in the program.
can you please tell what shall i do .
thanks,
maheedhar.t
04-09-2007 5:59 PM
HI..,
Go to the standard selection of any other program and check in the status of the selection screen by going to SYSTEM--> STATUS.. here u can find out the GUI status for the current screen .. double click on that .. In that OPEN the Function Keys tab.. in that u can find the function codes defined for the Buttons BACK and EXIT.. use these function codes in the CASE .. as
CASE SY-UCOMM.
WHEN '<FCODE OF BACK>' or '<FCODE OF EXIT>'.
leave program.
endcase.
regards,
sai ramesh
04-09-2007 6:05 PM
Hi Maheedhar,
Generally SY-UCOMM contains upto 4 characters only.
Try with this code.
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'BACK' or 'EXIT'.
SET SCREEN 0.
LEAVE SCREEN.
<b>WHEN 'EXEC'.</b>
SELECT * FROM ZUSER_SECOBJECTS
INTO TABLE IT_SECOBJECTS.
CHECK SY-SUBRC EQ 0.
LOOP AT IT_SECOBJECTS.
WRITE : IT_SECOBJECTS.
ENDLOOP.
WHEN OTHERS.
ENDCASE.
At selection-screen output.
set pf-status 'SELK'. <-- Comment this line
if sy-dynnr eq '1000'.
call function 'RS_SET_SELSCREEN_STATUS'
exporting
p_status = 'SELK'
tables
p_exclude = exclude
exceptions
others = 1.
endif.
CASE SY-UCOMM.
<b>WHEN 'EXEC'.</b>
PERFORM GET_DATA.
endcase.
&----
*& Form GET_DATA
&----
text
----
--> p1 text
<-- p2 text
----
form GET_DATA.
SELECT * FROM ZUSER_SECOBJECTS
INTO TABLE IT_SECOBJECTS.
*CHECK SY-SUBRC EQ 0.
*LOOP AT IT_SECOBJECTS.
*WRITE : IT_SECOBJECTS.
*ENDLOOP.
endform. " GET_DATA
Thanks,
Vinay
04-09-2007 6:20 PM
Please use the LEAVE TO LIST-PROCESSING statement.
CASE sscrfields-ucomm.
WHEN 'BACK' or 'EXIT'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXECUTE'.
LEAVE TO LIST-PROCESSING . "<--- RIGHT HERE
SELECT * FROM ZUSER_SECOBJECTS
INTO TABLE IT_SECOBJECTS.
CHECK SY-SUBRC EQ 0.
LOOP AT IT_SECOBJECTS.
WRITE : IT_SECOBJECTS.
ENDLOOP.
REgards,
RIch Heilman