‎2006 Oct 02 8:42 PM
Hi experts.
I have got a wierd problem. I wrote this report that takes some parameter and option selection and produces a report with ALV control. Now the problem is when I try to go back a blank page appears before taking me back to the input screen. When I started the program I didn't had this problem and I am not sure what changes I made that started this screen and no idea where to look for to solve it.
so I was hoping may be one of you already faced it and know what to do or where to look for the problem.
In case its not clear here is the step by step process
I press F8 from my editor to run the program.
I enter the parameter stuff and hit the F8 again
It runs and shows my report correctly.
Now when I hit the back button or the exit button instead of going back to the input screen it shows a white blank page nothing in it. and i have to hit the back button again to come back to the input screen
‎2006 Oct 02 8:49 PM
Pleae be sure that your USER_COMMAND module is simular to this.
module user_command_0100 input.
case sy-ucomm.
when 'BACK' or 'CANC'.
<b> if not alv_container is initial.
call method alv_container->free.
clear: alv_container.
free : alv_container.
endif.
if sy-subrc = 0.
set screen 0.
leave screen.
else.
leave program.
endif.</b>
when 'EXIT'.
if not alv_container is initial.
call method alv_container->free.
clear: alv_container.
free : alv_container.
endif.
leave program.
endcase.
endmodule.
Regards,
Rich Heilman
‎2006 Oct 02 8:47 PM
Hi,
Check the PF STATUS..
I think you have written code for back and exit buttons in the PF-STATUS.
Go through the link,
http://help.sap.com/saphelp_47x200/helpdata/en/9f/dba34635c111d1829f0000e829fbfe/frameset.htm
Regards,
Azaz Ali.
‎2006 Oct 02 8:49 PM
Could you please explain a bit more. I did it a search with PF-STATUS and no result was found. so its not set in my code.
‎2006 Oct 02 8:49 PM
Pleae be sure that your USER_COMMAND module is simular to this.
module user_command_0100 input.
case sy-ucomm.
when 'BACK' or 'CANC'.
<b> if not alv_container is initial.
call method alv_container->free.
clear: alv_container.
free : alv_container.
endif.
if sy-subrc = 0.
set screen 0.
leave screen.
else.
leave program.
endif.</b>
when 'EXIT'.
if not alv_container is initial.
call method alv_container->free.
clear: alv_container.
free : alv_container.
endif.
leave program.
endcase.
endmodule.
Regards,
Rich Heilman
‎2006 Oct 02 9:04 PM
I used only Form in my program. is this module should be a form too and I just put the whole code at the end of my program as it is and errors I am getting are: ALV_CONTAINER is unknown...
‎2006 Oct 02 9:06 PM
Yes, you need to do more, I can help you with the coding, or you can check out sample programs, any program that starts with BCALV_GRID*.
If you would like help with the coding, post what you have so far. When using an ALV Grid control, you must create a screen and embed the control in a screen container.
Regards,
Rich Heilman
‎2006 Oct 02 9:11 PM
Hi,
Go through the sample codes,
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm
http://www.sapdevelopment.co.uk/reporting/alv/alvscr.htm
Regards,
Azaz Ali.
‎2006 Oct 02 8:53 PM
‎2006 Oct 02 9:11 PM
I am not sure whether you want to see the whole program which is over 1100 lines but here is the part where it interacts with the report when user click on the report to get more details
Use for hotspot drilldown to transaction codes.
form alv_user_command
using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
if rs_selfield-fieldname = 'AUFNR'.
set parameter id: 'ANR' field rs_selfield-value.
call transaction 'IW33' and skip first screen. "Display service order
elseif rs_selfield-fieldname = 'STD_RATE'.
read table REC_ALV index rs_selfield-tabindex.
call transaction 'ZSTDLIST' and skip first screen. "Display standards
elseif ( rs_selfield-fieldname = 'QTY'
or rs_selfield-fieldname = 'COST'
or rs_selfield-fieldname = 'AMT' ).
read table REC_ALV index rs_selfield-tabindex.
mode = 'DRILLDN'.
drill_down-aufnr = REC_ALV-AUFNR.
drill_down-lgort = REC_ALV-LGORT.
clear REC_ALV_DETAIL[].
perform get_data.
perform print_alv_Detail.
mode = 'SUMMARY'.
endif. "if rs_selfield-fieldname = 'AUFNR'
endform. "ALV_USER_COMMAND
BTW how do u select multple line or the whole program to copy it to here. I have been coping one line at a time...
‎2006 Oct 02 9:14 PM
‎2006 Oct 02 9:31 PM
I am sorry if I am answering you wrong I am very new at this.
I am using the following function
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
....
form call_alv.
perform build_field_catalog using field_tab[].
perform build_eventtab using events[].
perform comment_build using header_alv[].
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = field_tab[]
i_callback_user_command = alv_slis_formname
i_structure_name = 'REC_ALV'
i_callback_program = v_repid
is_variant = v_variant
it_events = events[]
i_save = v_save
tables
t_outtab = REC_ALV
exceptions
program_error = 1
others = 2
endform.
‎2006 Oct 02 9:34 PM
ahhhhh.... ok, normally, you will not need to do anything special, when clicking BACK button from ALV, but since you are handling other user-commands, I would suggest check the user command in the form that you mentioned above, I think it may be going in there even when you click the BACK button.
Regards,
RIch Heilman
‎2006 Oct 02 9:36 PM
So in you sample......
form alv_user_command
using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
<b>check r_ucomm = <some_fcode>. <-- check the user actually pressed the right button</b>
if rs_selfield-fieldname = 'AUFNR'.
set parameter id: 'ANR' field rs_selfield-value.
call transaction 'IW33' and skip first screen. "Display service order
elseif rs_selfield-fieldname = 'STD_RATE'.
read table REC_ALV index rs_selfield-tabindex.
call transaction 'ZSTDLIST' and skip first screen. "Display standards
elseif ( rs_selfield-fieldname = 'QTY'
or rs_selfield-fieldname = 'COST'
or rs_selfield-fieldname = 'AMT' ).
read table REC_ALV index rs_selfield-tabindex.
mode = 'DRILLDN'.
drill_down-aufnr = REC_ALV-AUFNR.
drill_down-lgort = REC_ALV-LGORT.
clear REC_ALV_DETAIL[].
perform get_data.
perform print_alv_Detail.
mode = 'SUMMARY'.
endif. "if rs_selfield-fieldname = 'AUFNR'
endform. "ALV_USER_COMMAND
Regards,
Rich Heilman
‎2006 Oct 02 9:44 PM
hi Rich
I have used the following if condition still getting the same thing
if r_ucomm = '&IC1'.
‎2006 Oct 02 9:46 PM
Hi,
Can you please post the code of form <b>alv_slis_formname</b>.
Regards,
Azaz.
‎2006 Oct 02 9:39 PM
Hi,
ok....
check the code...
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
I_callback_user_command = 'USER_COMMAND' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
-
----
FORM USER_COMMAND *
----
--> R_UCOMM *
--> RS_SELFIELD *
----
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
Regards,
Azaz Ali.
Regards,
Azaz.
Message was edited by: Azaz Ali
‎2006 Oct 02 9:48 PM
Ali
Here what I have using
data: alv_slis_formname type slis_formname value 'ALV_USER_COMMAND'.
call function 'REUSE_ALV_GRID_DISPLAY'
.
.
i_callback_user_command = alv_slis_formname
.
.
.
form alv_user_command
using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
if r_ucomm = '&IC1'.
code goes here.
endif.
‎2006 Oct 02 10:06 PM
Guys
I solved it. But I am not sure why it solved it.
I had a skip 1 in one of my method that was gathering all the data. as soon as I desabled that line it went away.
Thanks to every body for trying to help me out. got some good links to learn AVL.
If you know why skip 1 was doing it please let me know thanks.
Message was edited by: Anwarul Kabir
‎2006 Oct 02 10:46 PM
‎2006 Oct 02 10:51 PM
not really
It was within a loop that was filling out my structure that I was using in the ALV function.
I guess some how that skip was overflowing the structure or something.
...
LOOP AT REC.
at new aufnr.
skip 1.
.....
ENDLOOP.
‎2006 Oct 02 10:58 PM
‎2006 Oct 03 1:44 PM
‎2006 Oct 03 2:04 PM