Skip to Content
avatar image
Former Member

Call transaction and return to my screen

Hi community,

In my custom program I have one dynpro.

In this Dynpro there are 2 button,on click of button there is a "CALL TRANSACTION 'GS02'" and skip first screen.

But the user on click back arrow of 'GS02' return in main Dynpro of 'GS02 Transaction' while I would like to return to my main Dynpro of custom program.

Have any Idea??

Thank's everybody

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Oct 17, 2005 at 06:33 PM

    I don't think that is possible. Once you do a call transaction without the USING BDCTAB option, you cannot control it.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      You must the option of:

      "USING (your_internal_table_of_bdc_screen_data)"

      Something like this:

      CALL TRANSACTION 'ZCPL_SNAX' USING bdcdata

      MODE bdc_mode

      UPDATE bdc_upd.

      where BDCDATA is an internal table of all the screen(s) that will take the user to the desired screen.

      Now, once the user exits the ZCPL_SNAX application, they will be returned to the caller program in the place where they just left.

  • Oct 17, 2005 at 06:20 PM

    Once you pass control to the GS02 transaction, you are at the mercy of that program. The program will behave as it does when you run it as stand alone via the menu. You have no control of this. I would suggest maybe having the user use the yellow "exit" icon. This some times leaves the transaction directly instead of back thru screens.

    Make sense?

    Regards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 18, 2005 at 04:00 AM

    Try this code

    MODULE user_command_9001 INPUT.
      CASE sy-ucomm.
        WHEN 'EXIT' OR  'CANC'.
          PERFORM f9005_free_objects :
                  USING o_alvgrid 'ALV' 'Error in Alv grid destroy' ,
                  USING o_dockingcontainer 'DOCKING'
                  'Error in creating Docking Container'.
          LEAVE PROGRAM.
        WHEN 'BACK'.
          PERFORM f9005_free_objects :
                  USING o_alvgrid 'ALV' 'Error in Alv grid destroy' ,
                  USING o_dockingcontainer 'DOCKING'
                  'Error in creating Docking Container'.
          SET SCREEN '0'.
    <b>    WHEN 'MATNR'.</b>
          IF NOT wa_output-matnr IS INITIAL.
            SET PARAMETER ID 'MAT' FIELD wa_output-matnr.
            SET PARAMETER ID 'WRK' FIELD wa_output-werks.
            CALL TRANSACTION 'MD04' AND SKIP FIRST SCREEN .
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    FORM f9005_free_objects USING pobject
                            value(ptype)
                            value(ptext).
      CASE ptype.
    
        WHEN 'ALV'.
          DATA lobjectalv TYPE REF TO cl_gui_alv_grid.
          lobjectalv = pobject.
          IF NOT ( lobjectalv IS INITIAL ).
            CALL METHOD lobjectalv->free
              EXCEPTIONS
                cntl_error        = 1
                cntl_system_error = 2
                OTHERS            = 3.
            CLEAR: pobject ,
                   lobjectalv.
            PERFORM f9006_error_handle USING ptext.
          ENDIF.
    
        WHEN 'DOCKING'.
          DATA lobjectdock TYPE REF TO cl_gui_docking_container.
          lobjectdock = pobject.
          IF NOT ( lobjectdock IS INITIAL ).
            CALL METHOD lobjectdock->free
              EXCEPTIONS
                cntl_error        = 1
                cntl_system_error = 2
                OTHERS            = 3.
            CLEAR: pobject ,
                   lobjectdock.
            PERFORM f9006_error_handle USING ptext.
          ENDIF.
    
        WHEN 'CONTAINER'.
          DATA lobjectcontainer TYPE REF TO cl_gui_container.
          lobjectcontainer = pobject.
          IF NOT ( lobjectcontainer IS INITIAL ).
            CALL METHOD lobjectcontainer->free
              EXCEPTIONS
                cntl_error        = 1
                cntl_system_error = 2
                OTHERS            = 3.
            CLEAR: pobject ,
                   lobjectcontainer.
            PERFORM f9006_error_handle USING ptext.
          ENDIF.
    
        WHEN OTHERS.
          sy-subrc = 1.
          PERFORM f9006_error_handle USING text-e04.
      ENDCASE.
    ENDFORM.                    " f9005_free_objects
    *&---------------------------------------------------------------------*
    *&      Form  f9006_error_handle
    *&---------------------------------------------------------------------*
    *       Error Handle
    *----------------------------------------------------------------------*
    FORM f9006_error_handle USING value(ptext).
    
      IF sy-subrc NE 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = 'Error Note'
            txt2  = sy-subrc
            txt1  = ptext.
      ENDIF.
    
    ENDFORM.                    " f9006_error_handle
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 18, 2005 at 04:18 AM

    Since you are using ( I guess you are using SET parameter to fill in the SETID field )

    CALL TRANSACTION 'GS02' and <u><b>skip first screen.</b></u>

    you are going one screen beyond . So you will have to press back button twice to come to the calling screen.

    For some transaction like ME23 it works the way you want as may be in the PAI for "BACK" button it is coded differently in the two transactions.

    Cheers.

    Add comment
    10|10000 characters needed characters exceeded