Application Development 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: 

Navigation issue

Former Member
0 Kudos

Hello,

I wrote an ABAP report which display BOMs in an ALV list. I also have write some code for double click at an ALV line, so that the user when double clicks a line, the corresponding BOM is displayed.

My problem is with the "Back" button. Instead of going back to the ALV list it goes back to the main screen of SAP. Why is that ?

Here is the code for double click:

CLASS GCL_HOTSPOT_HANDLER DEFINITION.
  PUBLIC SECTION.
    METHODS:
      HANDLE_REPORT

        FOR EVENT DOUBLE_CLICK OF CL_SALV_EVENTS_TABLE
          IMPORTING
            ROW
            COLUMN.
ENDCLASS.                

CLASS GCL_HOTSPOT_HANDLER IMPLEMENTATION.

*Method used for handling navigation
  METHOD HANDLE_REPORT.

    CLEAR: GW_CSIN, GW_WU_LIST.
    READ TABLE GT_WU_LIST INTO GW_WU_LIST INDEX ROW.
    MOVE-CORRESPONDING GW_WU_LIST TO GW_CSIN.
    GW_CSIN-DATUB = P_DATUB. GW_CSIN-DATUV = P_DATUV.

    GW_CSIN-CMODE = '08'.
BREAK-POINT.

    IF GW_WU_LIST-VWALT IS INITIAL.
      GW_CSIN-STLAL = '01'.
    ELSE.
      GW_CSIN-STLAL = GW_WU_LIST-VWALT.
    ENDIF.

    GW_CSIN-STUEZ = GW_WU_LIST-STPOZ.
    GW_CSIN-TRTYP = 'B'.

    CLEAR: GW_CSIN-AENNR, GW_CSIN-EMENG, GW_CSIN-POSNR, GW_CSIN-STPOZ.
	
    CALL FUNCTION 'CS_DI_INIT'.
	
    CALL FUNCTION 'CS_BOM_CALL_DIALOG'
      EXPORTING
        ECSIN  = GW_CSIN
        EDYNNR = '0120'.

  ENDMETHOD.
ENDCLASS.

10 REPLIES 10

MarcinPciak
Active Contributor
0 Kudos

I think the function CS_BOM_CALL_DIALOG calls new screen so creates new call sequence . Once you press BACK it most probably usues LEAVE TO SCREEN 0, which ends the current sequence. The next screen to be displayed is taken from NEXT SCREEN AVL screen attribute. As long as it equals 0 it lands up in selection screen.

So try setting this next screen for same screen number.

Regards

Marcin

0 Kudos

Thanks for your reply.

I am not so familiar with dialog programs in ABAP, so can you tell me in more detail where and what commands should i write ?

thanks in advance

0 Kudos

Actually you don't need to write any command. It is called somewhere in the function.

All you need to do is go to ALV screen -> Attributes tab -> find Next screen input field -> and type same screen number. I.e if ALV screen is 100 then type 100.

Regards

Marcin

0 Kudos

I find that the ALV screen is the "500" of the GUI program "SAPLSLVC_FULLSCREEN" and in its attributes has the field "next screen" 500.

Is this the right screen ?

i also noticed that in transaction CS15 which uses the same function, the back button works just fine!

so what's going on here ?

Edited by: stratos_chm on Aug 25, 2010 10:22 AM

MarcinPciak
Active Contributor
0 Kudos

This time I don't follow.

You said you are using ALV to display report. Which screen is this ALV placed in? Are you using FM 'REUSE_ALV....' or ALV OO? If the second you should use next screen of this screen.

If the first I am not sure then how to help you.

Regards

Marcin

0 Kudos

I use the OO ALV,

where i have to go to change the ALV attributes ?

0 Kudos

This is not an attribute for ALV but for screen .

You display your ALV in PBO of some screen, don't you? So you have something like


CALL SCREEN 100.  "your screen where you display ALV in

MODULE pbo OUTPUT.   "PBO of this screen
   "here you create and display ALV
ENDMODULE.

So you have to go to this screen 100 (by double clicking on 100 ) and go to Attributes tab -> find Next screen and set it for 100 .

0 Kudos

I dont use anywhere 'CALL SCREEN". I built the OO ALV

CL_SALV_TABLE=>FACTORY( IMPORTING R_SALV_TABLE = LC_TABLE
                                CHANGING T_TABLE = ITAB

.

and then i used the double click event to display the BOM screen with the F.M

CALL FUNCTION 'CS_BOM_CALL_DIALOG'
      EXPORTING
        ECSIN  = GW_CSIN
        EDYNNR = '0120'.

As i described above. The "CALL SCREEN" commands are in the above function.

So i cant change the standard SAP screen attributes...

Edited by: stratos_chm on Aug 25, 2010 11:02 AM

0 Kudos

My Friend,

As long as you are using SALV in fullscreen mode, you indeed lose ability to control the screen it uses. In this case you rely on standard funcionality so you might not achieve what you want.

I think the alternative solution could be using SALV but not in fullscreen mode but placing it on custom screen and container. This way you keep the control on the screen and are able to set the attribute I am talking about. This would go like


DATA: 
      r_cust TYPE REF TO cl_gui_custom_container,
      r_salv TYPE REF TO cl_salv_table.

START-OF-SELECTION.
  CALL SCREEN 100.


MODULE pbo OUTPUT.

    CREATE OBJECT r_cust
      EXPORTING
        container_name              = 'CUSTOM_CONTROL'.  "give name of custom control placed on screen canvas

  "now use this custom container as a place for SALV control
    CALL METHOD cl_salv_table=>factory
      EXPORTING
        r_container  = r_cust
      IMPORTING
        r_salv_table = r_salv
      CHANGING
        t_table      = it_sflight.


  r_salv->display( ).

ENDMODULE.                    

PS: I think saying at the very beginning that you are using SALV (not general saying ALV, which is ambigous) would just spare our time and would let us avoid unnecessay discussion. Please remember about that in the future.

Thanks and regards

Marcin

Former Member
0 Kudos

thanks