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

classical selection screen

Former Member
0 Likes
961

Hi colleagues,

I call a classical selection screen. At the bottom there are several buttons like OK, CANCEL etc. Unfortunately I can not reach the event when pressing the cancel button. I use AT SELECTION SCREEN but the system does not stop. With the OK button it works..

Has anybody an idea?

TAHNKS!!

Tobias

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
928

Hi

Try setting a PF-STATUS

use the EVENTS at user-command or at pf-status

for more info go through the ABAPDOCU examples

Regards

Ramchander Rao.K

9 REPLIES 9
Read only

Former Member
0 Likes
928

Can you post your code so that we can help you accordingly.

regards,

lucky

Read only

0 Likes
928

Hi colleagues,

CALL SELECTION-SCREEN 300 STARTING AT 1 1 ENDING AT 86 13.

Then:

FUNCTION-POOL zlam_selection_lfe. "MESSAGE-ID ..

*DATA w TYPE marc-werks.

*SELECTION-SCREEN BEGIN OF SCREEN 0300.

*PARAMETERS matnr TYPE mara-matnr.

*SELECT-OPTIONS werks FOR w.

*SELECTION-SCREEN END OF SCREEN 0300.

TABLES sscrfields.

DATA selfields TYPE zlam_lfe_data_obj.

DATA lfe_start TYPE zlam_lfe_start.

DATA lfe_end TYPE zlam_lfe_end.

DATA lfe_len TYPE zlam_lfe_len.

DATA lfe_uom TYPE meins.

SELECTION-SCREEN BEGIN OF SCREEN 0300 TITLE text-001.

SELECTION-SCREEN BEGIN OF BLOCK lfe WITH FRAME TITLE text-001.

SELECT-OPTIONS s_start FOR lfe_start.

SELECT-OPTIONS s_end FOR lfe_end.

SELECT-OPTIONS s_len FOR lfe_len.

SELECT-OPTIONS s_uom FOR lfe_uom NO INTERVALS NO-EXTENSION MATCHCODE OBJECT h_t006.

SELECTION-SCREEN END OF BLOCK lfe.

SELECTION-SCREEN END OF SCREEN 0300.

AT SELECTION-SCREEN.

IF s_start IS NOT INITIAL OR s_end IS NOT INITIAL OR s_len IS NOT INITIAL.

IF s_uom IS INITIAL.

MESSAGE e000(zlam).

ENDIF.

ENDIF.

*All other events can be reached here..

AT SELECTION-SCREEN OUTPUT.

  • FIELD LFE_START

  • Field LFE_UOM

IMPORT s_uom-low FROM MEMORY ID 'S_UOM'.

IF s_uom-low IS NOT INITIAL.

MOVE s_uom-low TO s_uom-low.

IF s_uom[] IS INITIAL.

APPEND s_uom.

ENDIF.

FREE MEMORY ID 'S_UOM'.

ENDIF.

THANKS,

Tobias

Read only

0 Likes
928

Maybe you haven't mentioned the code for cancel.

Say you have the function code for cancel button is "CANCEL" then in the user command of PAI module of your screen you will have to write this:

CASE SY-UCOMM.

WHEN 'CANCEL'.

LEAVE TO SCREEN 0.

  • Mention your own screen here on which you want to be after clicking the cancel button.

ENDCASE.

  • also write the code for OK button so as to move forward on next screen.

  • you can also use above buttons of (EXIT,CANCEL,BACK)

  • then you should write in WHEN 'EXIT' OR 'CANCEL' OR 'BACK'.

Regards,

Lucky

Read only

Former Member
0 Likes
928

Hi lucky,

unfortunately this is a selection screen on an dynpro and I can not implement a PAI module or PBO here..

thanks for your prompt answeres!!

Read only

0 Likes
928

Hi

this code might help you

AT USER-COMMAND.
  IF flag = 'X'.
    CASE sy-ucomm.
      WHEN 'EXIT' OR  'BACK' OR 'CALC'.
        LEAVE TO SCREEN 0.
    ENDCASE.
    EXIT.
  ENDIF.
  CASE sy-ucomm.
    WHEN 'SALEORDER'.
      DO.
        READ LINE sy-index LINE VALUE INTO list_line.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
        IF list_line(1) EQ 'X'.
          v_vgbel = sy-lisel+91(10).
          v_vgpos = sy-lisel+102(6).
          READ TABLE lt_final INTO wa_final WITH KEY vgbel = v_vgbel
                                                     vgpos = v_vgpos.
          IF sy-subrc = 0.
            wa_final-box = 'X' .
            MODIFY lt_final FROM wa_final  INDEX sy-tabix TRANSPORTING box.
          ENDIF.
          CLEAR wa_final.
        ENDIF.
      ENDDO.
      PERFORM bcd_vk11.
      PERFORM bdc_message.
      PERFORM creat_bapi .
      PERFORM formate_msg.
*    WHEN 'BILL1'.
*      PERFORM create_invoice.
*      PERFORM formate_msg1.
    WHEN 'EXIT' OR  'BACK' OR 'CALC'.
      LEAVE TO SCREEN 0.
  ENDCASE.

Regards.

Read only

Former Member
0 Likes
928

Hi Lucky,

negative...

I also tried that event....

The system does not stop..

regards,

Tobias

Read only

0 Likes
928

Hi,

Try this.

MODULE user_command_0100 INPUT.
   CASE ok_code.
    WHEN 'F_EXIT'.
      LEAVE PROGRAM.
    WHEN 'F_CANCEL'.
      LEAVE TO SCREEN <screen_number>.
  ENDCASE.
ENDMODULE.

Thanks,

Sri.

Read only

Former Member
0 Likes
929

Hi

Try setting a PF-STATUS

use the EVENTS at user-command or at pf-status

for more info go through the ABAPDOCU examples

Regards

Ramchander Rao.K

Read only

Former Member
0 Likes
928

Hi guys,

thank you very much for your prompt inputs. It turned out that a selection screen within a selection screen is nevertheless a bad solution. The behaviour described above may also be correct as "cancel" in this context simply means: do nothing and exit.

My problem is solved.

THANKS!!