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: 

Getting back to ALV output screen from modal dialog box screen.

Former Member
0 Kudos

Hello everyone.

I have a main selection screen, where i'm using the select-options value to display an ALV report. In the ALV report screen, I have a button 'Release'. When the Release button is pressed, a modal dialog box appears like pop up with a drop down list  to select the reasons of releasing the document.

But the problem here is after I select the reason from drop down and press OK or CANCEL (These are the gui status icons I created), the pop up doesnt get closed and go back to the ALV report screen. My code is as follows.

FORM user_command_alv USING ucomm TYPE sy-ucomm selfield TYPE slis_selfield.

   REFRESH: i_zsdwclaim_gts.

   CLEAR k_zsdwclaim_gts.

   CASE ucomm.

     WHEN 'BACK'.

       LEAVE PROGRAM.

     WHEN 'EXIT'.

       LEAVE PROGRAM.

     WHEN 'CANCEL'.

       LEAVE PROGRAM.

     WHEN 'RELEASE'.

***Modifying the ZSDWCLAIM_GTS table from gts_status 'B' to 'R'.

       CALL SCREEN 0200 STARTING AT 4 10 ENDING AT 50 20.          "This is my modal dialog box screen

       LOOP AT i_zsdwclaim INTO k_zsdwclaim WHERE mark = 'X'.

         k_zsdwclaim-zgts_status = 'R - Released'.

         k_zsdwclaim-z_reason = v_reason.

         MODIFY i_zsdwclaim FROM k_zsdwclaim.

         MOVE-CORRESPONDING k_zsdwclaim TO k_zsdwclaim_gts.

         k_zsdwclaim_gts-zgts_rld_dt = sy-datum.

         k_zsdwclaim_gts-zgts_rld_by = sy-uname.

         APPEND k_zsdwclaim_gts TO i_zsdwclaim_gts.

         CLEAR k_zsdwclaim_gts.

         MODIFY zsdwclaim_gts FROM TABLE i_zsdwclaim_gts.

       ENDLOOP.

       IF sy-subrc <> 0.

         MESSAGE ' Select the document to be released' TYPE 'E'.

       ENDIF.

       IF sy-subrc = 0.

         MESSAGE ' The selected documents are released successfully' TYPE 'S'.

         PERFORM display_alv_report.

       ENDIF.

   ENDCASE.

ENDFORM.


*&---------------------------------------------------------------------*

*&      Module  PBO_DROPDOWN_REASON  OUTPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE PBO_DROPDOWN_REASON OUTPUT.

   DATA: l_i_list TYPE TABLE OF  vrm_value,

         l_k_list LIKE LINE OF l_i_list.

   TYPES: BEGIN OF t_reason,

          z_reason TYPE zreason,

          END OF t_reason.

   DATA: i_reason TYPE TABLE OF t_reason,

         k_reason TYPE t_reason.

   l_k_list-key = ' '.

   l_k_list-text = ' '.

   APPEND l_k_list TO l_i_list.

   CLEAR l_k_list.

   SELECT z_reason FROM zsdwty_reason INTO TABLE i_reason.

   LOOP AT i_reason INTO k_reason.

     l_k_list-key = k_reason-z_reason.

     l_k_list-text = k_reason-z_reason.

     APPEND l_k_list TO l_i_list.

     CLEAR l_k_list.

   ENDLOOP.

**Populate drop down list

   CALL FUNCTION 'VRM_SET_VALUES'

     EXPORTING

       id              = 'K_ZSDWCLAIM_GTS-Z_REASON'

       values          = l_i_list

     EXCEPTIONS

       id_illegal_name = 1

       OTHERS          = 2.

   IF sy-subrc <> 0.

* Implement suitable error handling here

   ENDIF.

ENDMODULE.                 " PBO_DROPDOWN_REASON  OUTPUT



*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_0200  INPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE USER_COMMAND_0200 INPUT.

   CASE v_okcode_200.

     WHEN 'OK'.

       v_reason = K_ZSDWCLAIM_GTS-Z_REASON.

       LEAVE TO LIST-PROCESSING.

  

WHEN 'CANCEL' OR 'X' OR 'EXIT'.

       LEAVE TO LIST-PROCESSING.

    ENDCASE.

ENDMODULE.                 " USER_COMMAND_0200  INPUT



*&---------------------------------------------------------------------*

*&      Module  STATUS_0200  OUTPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE STATUS_0200 OUTPUT.

   SET PF-STATUS 'GUI_200'.

*  SET TITLEBAR 'xxx'.

ENDMODULE.                 " STATUS_0200  OUTPUT



1 ACCEPTED SOLUTION

Patrick_vN
Active Contributor
0 Kudos

Have you tried the command LEAVE TO SCREEN 0 instead of the LEAVE TO LIST-PROCESSING?

2 REPLIES 2

Patrick_vN
Active Contributor
0 Kudos

Have you tried the command LEAVE TO SCREEN 0 instead of the LEAVE TO LIST-PROCESSING?

0 Kudos

It worked. Thank you so much.