Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

blank screen problem

Former Member
0 Likes
5,306

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

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
3,817

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

22 REPLIES 22
Read only

Former Member
0 Likes
3,817

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.

Read only

0 Likes
3,817

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.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
3,818

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

Read only

0 Likes
3,817

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...

Read only

0 Likes
3,817

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

Read only

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
3,817

Can you please post the entire code of the program?

Regards,

Rich Heilman

Read only

0 Likes
3,817

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...

Read only

0 Likes
3,817

I'm thinking that you are using the Function module ALV grid? Is this correct? Or are you using the class CL_GUI_ALV_GRID?

Regards,

Rich Heilman

Read only

0 Likes
3,817

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.

Read only

0 Likes
3,817

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

Read only

0 Likes
3,817

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

Read only

0 Likes
3,817

hi Rich

I have used the following if condition still getting the same thing

if r_ucomm = '&IC1'.

Read only

0 Likes
3,817

Hi,

Can you please post the code of form <b>alv_slis_formname</b>.

Regards,

Azaz.

Read only

Former Member
0 Likes
3,817

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

Read only

0 Likes
3,817

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.

Read only

0 Likes
3,817

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

Read only

0 Likes
3,817

I think because SKIP statement is primarily for list output, do this SKIP statement forced a list display.

Regards,

RIch Heilman

Read only

0 Likes
3,817

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.

Read only

0 Likes
3,817

When you say it was going to a blank screen, did you mean a list display(like one that you see when using WRITE statement)?

Regards,

Rich Heilman

Read only

0 Likes
3,817

yes its like the one when using WRITE stmnt.

Read only

0 Likes
3,817

The the SKIP statement does force a list display, which is the reason why you where seeing the list display and not when you commented out the SKIP statement.

Regards,

Rich Heilman