‎2009 Aug 05 3:18 PM
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
‎2009 Aug 06 4:44 AM
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
‎2009 Aug 05 3:20 PM
Can you post your code so that we can help you accordingly.
regards,
lucky
‎2009 Aug 05 3:25 PM
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
‎2009 Aug 05 3:25 PM
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
‎2009 Aug 05 3:33 PM
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!!
‎2009 Aug 05 4:04 PM
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.
‎2009 Aug 05 4:09 PM
Hi Lucky,
negative...
I also tried that event....
The system does not stop..
regards,
Tobias
‎2009 Aug 06 4:22 AM
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.
‎2009 Aug 06 4:44 AM
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
‎2009 Aug 07 6:57 AM
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!!