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

About 'back' of Dynpro

Former Member
0 Likes
974

hi , friends,

I created a AVL in dynpro 9100.

the next screen number field velue of 9100 is 9100

I use the [ leave to screen 0]

but some issues happened.

i can't be back select screen after cliking back.

Any advice will be appriciated

thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
884

Hi,

In PAI of the screen 9100 write as belwo

module USER_COMMAND_9001 input.
  CASE sy-ucomm.
    WHEN 'EXIT' or  'CANC'.
  * free the container
  * leave program.
      LEAVE PROGRAM.

    when 'BACK'.
  *  free ALV grid
      set screen '0'.
      leave screen.
* This leaves the program but you may need to re-call the
* transaction to go back to the original screen

    when others.

  ENDCASE.

endmodule.                 " USER_COMMAND_9001  INPUT
module STATUS_9001 output.
*enable the back and cancel buttons
  SET PF-STATUS 'Z_TEMPLATE_STATUS'.

  SET TITLEBAR 'ZTITLE'.

* This form create the Docking container and the ALV grid.
  perform f9000_objects_create.

Hope this solves ur query.

In PBO u will be setting the PF-STATUS and u have to specify the FCODE for BACK, Cancel and Exit.

hi , friends,

I created a AVL in dynpro 9100.

the next screen number field velue of 9100 is 9100

I use the [ leave to screen 0]

but some issues happened.

i can't be back select screen after cliking back.

Any advice will be appriciated

thank you

5 REPLIES 5
Read only

Former Member
0 Likes
884

May be you can use call screen forcibly...

or LEAVE PROGRAM .

or

LEAVE TO SCREEN dynnr.

Assign the points if helpful..

Regards,

Gaurang

Read only

0 Likes
884

Leave program is not good.

if using Leave to screen 1000, the message will be popuped.

Read only

Former Member
0 Likes
885

Hi,

In PAI of the screen 9100 write as belwo

module USER_COMMAND_9001 input.
  CASE sy-ucomm.
    WHEN 'EXIT' or  'CANC'.
  * free the container
  * leave program.
      LEAVE PROGRAM.

    when 'BACK'.
  *  free ALV grid
      set screen '0'.
      leave screen.
* This leaves the program but you may need to re-call the
* transaction to go back to the original screen

    when others.

  ENDCASE.

endmodule.                 " USER_COMMAND_9001  INPUT
module STATUS_9001 output.
*enable the back and cancel buttons
  SET PF-STATUS 'Z_TEMPLATE_STATUS'.

  SET TITLEBAR 'ZTITLE'.

* This form create the Docking container and the ALV grid.
  perform f9000_objects_create.

Hope this solves ur query.

In PBO u will be setting the PF-STATUS and u have to specify the FCODE for BACK, Cancel and Exit.

Read only

0 Likes
884

HI, Judith,

I do it according to you code. it is same to before.

factly i create a alv with class in dynpro 9100.

after back, the head part still be display, in other words, it will not be back to select screen.

Read only

0 Likes
884

Hi,

I think u have some other problem, r u creating the container checking whether it is initial.

I have used the same code in OOPS ALV and its working fine for me.

module USER_COMMAND_9001 input.
  CASE sy-ucomm.
    WHEN 'EXIT' or  'CANC'.

      perform f9600_free_objects:
               using o_Alvgrid 'ALV' text-E02,
               using o_Dockingcontainer 'DOCKING' 
                       TEXT-E01.
* leave program.
      LEAVE PROGRAM.

    when 'BACK'.
      perform f9600_free_objects:
               using o_Alvgrid 'ALV' text-E02,
               using o_Dockingcontainer 'DOCKING'
                       TEXT-E01.
      set screen '0'.
      leave screen.
* This leaves the program but you may need to re-call the
* transaction to go back to the original screen

    when others.

  ENDCASE.

endmodule.                 " USER_COMMAND_9001  INPUT
FORM f9600_free_objects USING pobject
                    value(ptype)
                    value(ptext).

  DATA: l_objectalv TYPE REF TO cl_gui_alv_grid.
* Need to type the field symbol or it does not work

  CASE ptype.
    WHEN 'ALV'.

      l_objectalv = pobject.

      IF NOT ( l_objectalv IS INITIAL ).
        CALL METHOD l_objectalv->free
          EXCEPTIONS
            cntl_error        = 1
           cntl_system_error = 2
            OTHERS            = 3.
        CLEAR: pobject, l_objectalv.
        PERFORM f9700_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 f9700_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 f9700_error_handle USING ptext.

      ENDIF.
    WHEN OTHERS.
      sy-subrc = 1.
      PERFORM f9700_error_handle USING
                                text-e04.
  ENDCASE.

ENDFORM.                    " f9600_free_objects

*&---------------------------------------------------------------------*
*&      Form  f9700_error_handle
*&---------------------------------------------------------------------*
*       This form is used to handle errors
*----------------------------------------------------------------------*
FORM f9700_error_handle USING    value(ptext).

  IF sy-subrc NE 0.
* add your handling, for example
    CALL FUNCTION 'POPUP_TO_INFORM'
         EXPORTING
              titel = text-e03
              txt2  = sy-subrc
              txt1  = ptext.
  ENDIF.

Include these two forms and see whetehr it works or not?