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

Create search string dialog box?

Former Member
0 Likes
668

Hi all,

I got a little annoying problems in my dialog box screen. I'm creating a popup for search. Everything went well, but once it execute, I cannot close my dialog box. It's stuck and I have to close the session. I've tried to debug it, and it's looklike after executing sy-ucomm, the screen loop again into the same screen. Hope you can help me, this is my search code.


PROCESS BEFORE OUTPUT.

*&spwizard: pbo flow logic for tablecontrol 'CONTROL1'

  MODULE control1_change_tc_attr.

*&spwizard: module CONTROL1_change_col_attr.

  LOOP AT   it_proc

       INTO wa_proc

       WITH CONTROL control1

       CURSOR control1-current_line.

    MODULE control1_get_lines.

*&spwizard:   module CONTROL1_change_field_attr

  ENDLOOP.

  MODULE status_0555.

  MODULE get_additional_data.

*

PROCESS AFTER INPUT.

*&spwizard: pai flow logic for tablecontrol 'CONTROL1'

  LOOP AT it_proc.

    CHAIN.

      FIELD wa_proc-vbeln.

      FIELD wa_proc-lifnr.

      FIELD wa_proc-gjahr.

      FIELD wa_proc-erdat.

      FIELD wa_proc-fkdat.

      FIELD wa_proc-duedate.

      FIELD wa_proc-awkey.

      FIELD wa_proc-bktxt.

      FIELD wa_proc-ebeln.

      FIELD wa_proc-xblnr.

      FIELD wa_proc-status.

    ENDCHAIN.

    FIELD wa_proc-sel

      MODULE control1_mark ON REQUEST.

  ENDLOOP.

  MODULE control1_user_command.


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

*&      Module  STATUS_0555  OUTPUT

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

*       text

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

MODULE status_0555 OUTPUT.

  IF rb2 EQ 'X' OR rb3 EQ 'X'.

    SET PF-STATUS 'STATUS_555' EXCLUDING 'DELETE'.

  ELSEIF rb4 EQ 'X'.

    SET PF-STATUS 'STATUS_555' EXCLUDING 'SAVE'.

  ENDIF.

*  SET TITLEBAR 'TITLE_555'.

ENDMODULE.                 " STATUS_0555  OUTPUT


MODULE control1_user_command INPUT.

   ok_code = sy-ucomm.

   PERFORM user_ok_tc USING    'CONTROL1'

                               'IT_PROC'

                               'SEL'

                      CHANGING ok_code.

   sy-ucomm = ok_code.

   CLEAR save_code2.

   save_code2 = ok_code.

   CASE save_code2.

     WHEN 'BACK' OR 'EXIT' OR 'CANC'.

       CLEAR: it_proc,wa_proc,it_data,wa_data.

       CLEAR ok_code.

       LEAVE TO SCREEN 500.

     WHEN 'SAVE'.

       PERFORM save_data.

     WHEN 'DELETE'.

       PERFORM save_data. "Same subroutine but accessing RB4

     WHEN 'FIND'.

*      SET USER-COMMAND '%SC'.

      CALL SCREEN 556 STARTING AT 20 10.

  ENDCASE.

  CLEAR: ok_code,save_code.

ENDMODULE.                    "CONTROL1_user_command INPUT



*****Screen Dialog Box *******


PROCESS BEFORE OUTPUT.

  MODULE STATUS_0556.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0556.


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

*&      Module  STATUS_0556  OUTPUT

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

*       text

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

module STATUS_0556 output.

  SET PF-STATUS 'STATUS_FIND'.

*  SET TITLEBAR 'TITLE_556'.

endmodule.                 " STATUS_0556  OUTPUT


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

*&      Module  USER_COMMAND_0556  INPUT

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

*       text

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

MODULE user_command_0556 INPUT.

  DATA c1   LIKE sy-tabix.

  DATA l_tc_new_top_line     TYPE i.

  DATA l_tc_name             LIKE feld-name.

  DATA l_tc_lines_name       LIKE feld-name.

  DATA l_tc_field_name       LIKE feld-name.

  DATA p_tc_name             TYPE dynfnam.

  FIELD-SYMBOLS <tc>         TYPE cxtab_control.

  FIELD-SYMBOLS <lines>      TYPE i.

  FIELD-SYMBOLS <table>      TYPE STANDARD TABLE.

  p_tc_name = 'CONTROL1'.

  ASSIGN (p_tc_name) TO <tc>.

  CONCATENATE 'G_' p_tc_name '_LINES' INTO l_tc_lines_name.

  ASSIGN (l_tc_lines_name) TO <lines>.

  CLEAR: ok_code,save_code.

  ok_code = sy-ucomm.

  save_code = ok_code.

  CASE save_code.

    WHEN 'CONT'.

          CLEAR wa_proc.

            c1 = 0.

            LOOP AT it_proc INTO wa_proc.

              SEARCH wa_proc-vbeln FOR strfind.

         IF      sy-subrc = 0.

           wa_proc-sel = 'X'.

           MODIFY it_proc FROM wa_proc.

           c1 = sy-tabix.

           EXIT.

         ENDIF.

       ENDLOOP.

       IF c1 NE 0.

         c = c1.

         <tc>-top_line = c.

       ELSE.

         MESSAGE e232(ec) WITH strfind.

       ENDIF.

      p  ENDCASE.

  CLEAR save_code.

ENDMODULE.                 " USER_COMMAND_0556  INPUT

If anyone got better idea to create search dialog box, please feel free to share. Because I cannot find any suitable tutorial for this.

Cheers,

Manggala D.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
614

Add a LEAVE TO SCREEN 0 (or SET SCREEN 0 followed by LEAVE SCREEN) to get back to statement following the previous CALL SCREEN. (You could also define the next screen as 0 in dynpro definition so any PAI execution will leave screen)

Regards,

Ramond

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
615

Add a LEAVE TO SCREEN 0 (or SET SCREEN 0 followed by LEAVE SCREEN) to get back to statement following the previous CALL SCREEN. (You could also define the next screen as 0 in dynpro definition so any PAI execution will leave screen)

Regards,

Ramond

Read only

0 Likes
614

thank you, previously I've set next screen to screen 555. It generate new dialog box. when I've set to screen 0, it works the way I want it.