Skip to Content
author's profile photo Former Member
Former Member

Unable to come out of selection-screen using EXIT ,BACK ,CANin std toolbar

Hello ABAP Gurus

i have 1 selection screen & a custom screen to create a record in Ztable .

Transition is as follows

selection-Screen -> user will enter some value & press execute button-> goes to Custom Screen & here he enters some user i/p values and press save button then -> press BACK button and goes back to selection screen ,now here(selection screen) either he can repeat the same process or press BACK , EXIT , CANCEL to come out this Tcode .

But selection-screen doesnt allow me to come out of this tcode.

Problem : I m looping thru between these 2 selection-screen and screen 0100, not able to come out of selection

Can i make use of this <b>sscrfields-ucomm</b> , any light on this plz .

Plz help .

here is my code

&----


*& Report ZSD_REP_QUOT_BANK_CREATE *

*& *

&----


*& *

*& *

&----


REPORT ZSD_REP_QUOT_BANK_CREATE NO STANDARD PAGE HEADING LINE-SIZE 255.

TABLES: VBAK,VBAP,VBRK,ZSD_TABL_QOTBANK,MARA,KONV.

DATA: OK_CODE LIKE SY-UCOMM,

SAVE_OK_CODE LIKE SY-UCOMM,

WA_ITAB LIKE ZSD_TABL_QOTBANK,

ANSWER TYPE C,

COPIED ,

STS TYPE N,

EMGRP LIKE MARA-EXTWG,

QTY LIKE ZSD_TABL_QOTBANK-QTY,

UPRICE LIKE ZSD_TABL_QOTBANK-UPRICE,

TOT LIKE ZSD_TABL_QOTBANK-TOT,

INO LIKE VBAP-POSNR,

COUNT TYPE I VALUE 0.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.

SELECT-OPTIONS: S_QTNO FOR ZSD_TABL_QOTBANK-QTNO

NO INTERVALS NO-EXTENSION OBLIGATORY,

S_ITNO FOR ZSD_TABL_QOTBANK-ITNO

NO INTERVALS NO-EXTENSION OBLIGATORY.

  • S_MATNO FOR ZSD_TABL_QOTBANK-MATNO

  • NO INTERVALS NO-EXTENSION. "

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN .

CLEAR: VBAK ,VBAP, WA_ITAB, COUNT.

SELECT SINGLE VBTYP

INTO VBAK-VBTYP

FROM VBAK

WHERE VBELN IN S_QTNO.

IF SY-SUBRC EQ 0 AND VBAK-VBTYP NE 'B'.

MESSAGE E005(ZQOTBANK).

ENDIF.

SELECT * FROM VBAP WHERE VBELN IN S_QTNO.

IF VBAP-POSNR = S_ITNO-LOW .

SELECT SINGLE * INTO WA_ITAB

FROM ZSD_TABL_QOTBANK

WHERE QTNO = S_QTNO-LOW

AND ITNO = S_ITNO-LOW.

IF SY-SUBRC EQ 0.

MESSAGE E001(ZQOTBANK).

ENDIF.

  • MESSAGE E006(ZQOTBANK).

COUNT = COUNT + 1.

ENDIF.

ENDSELECT.

IF COUNT EQ 0.

MESSAGE E007(ZQOTBANK).

ENDIF.

SELECT SINGLE QTNO ITNO

INTO WA_ITAB

FROM ZSD_TABL_QOTBANK

WHERE QTNO = S_QTNO-LOW

AND ITNO = S_ITNO-LOW.

IF SY-SUBRC EQ 0.

MESSAGE E001(ZQOTBANK).

ENDIF.

*START-OF-SELECTION.

END-OF-SELECTION.

CLEAR ZSD_TABL_QOTBANK.

CALL SCREEN 0100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

SET PF-STATUS '0100'.

SET TITLEBAR '0100'.

ZSD_TABL_QOTBANK-QTNO = S_QTNO-LOW.

ZSD_TABL_QOTBANK-DOCTYP = 'B'.

SELECT SINGLE BUKRS_VF VKORG VTWEG SPART KUNNR ERDAT BNDDT

KNUMV

INTO (ZSD_TABL_QOTBANK-CCODE,

ZSD_TABL_QOTBANK-SORG,

ZSD_TABL_QOTBANK-DISTCHAN,

ZSD_TABL_QOTBANK-DIV,

ZSD_TABL_QOTBANK-CUSTNO,

ZSD_TABL_QOTBANK-QTDAT,

ZSD_TABL_QOTBANK-QTVALDAT,

VBAK-KNUMV)

FROM VBAK

WHERE VBELN IN S_QTNO

AND VBTYP = 'B'.

IF SY-SUBRC EQ 0.

SELECT SINGLE KWMENG MATNR

INTO (QTY , ZSD_TABL_QOTBANK-MATNO)

FROM VBAP

WHERE VBELN IN S_QTNO.

SELECT SINGLE EXTWG

INTO EMGRP

FROM MARA

WHERE MATNR EQ ZSD_TABL_QOTBANK-MATNO.

ZSD_TABL_QOTBANK-ITNO = S_ITNO-LOW.

ZSD_TABL_QOTBANK-EMATGRP = EMGRP.

ZSD_TABL_QOTBANK-QTY = QTY.

SELECT SINGLE KBETR

INTO UPRICE

FROM KONV

WHERE KNUMV = VBAK-KNUMV

AND KPOSN = S_ITNO-LOW

AND KSCHL = 'PR00'.

ENDIF.

ZSD_TABL_QOTBANK-UPRICE = UPRICE.

TOT = QTY * UPRICE .

ZSD_TABL_QOTBANK-TOT = TOT .

CLEAR: QTY, UPRICE, TOT.

QTY = ZSD_TABL_QOTBANK-CGL_QTY.

UPRICE = ZSD_TABL_QOTBANK-CGL_UPRICE .

TOT = QTY * UPRICE .

ZSD_TABL_QOTBANK-CGL_TOT = TOT .

CLEAR: QTY, UPRICE, TOT.

QTY = ZSD_TABL_QOTBANK-BHEL_QTY.

UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .

TOT = QTY * UPRICE .

ZSD_TABL_QOTBANK-BHEL_TOT = TOT .

CLEAR: QTY, UPRICE, TOT.

QTY = ZSD_TABL_QOTBANK-BHEL_QTY.

UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .

TOT = QTY * UPRICE .

ZSD_TABL_QOTBANK-BHEL_TOT = TOT .

CLEAR: QTY, UPRICE, TOT.

QTY = ZSD_TABL_QOTBANK-ALSTOM_QTY.

UPRICE = ZSD_TABL_QOTBANK-ALSTOM_UPRICE .

TOT = QTY * UPRICE .

ZSD_TABL_QOTBANK-ALSTOM_TOT = TOT .

CLEAR: QTY, UPRICE, TOT.

QTY = ZSD_TABL_QOTBANK-SIEMENS_QTY.

UPRICE = ZSD_TABL_QOTBANK-SIEMENS_UPRICE .

TOT = QTY * UPRICE .

ZSD_TABL_QOTBANK-SIEMENS_TOT = TOT .

CLEAR: QTY, UPRICE, TOT.

QTY = ZSD_TABL_QOTBANK-TELK_QTY.

UPRICE = ZSD_TABL_QOTBANK-TELK_UPRICE .

TOT = QTY * UPRICE .

ZSD_TABL_QOTBANK-TELK_TOT = TOT .

CLEAR: QTY, UPRICE, TOT.

QTY = ZSD_TABL_QOTBANK-OTH_QTY.

UPRICE = ZSD_TABL_QOTBANK-OTH_UPRICE .

TOT = QTY * UPRICE .

ZSD_TABL_QOTBANK-OTH_TOT = TOT .

CLEAR: QTY, UPRICE, TOT.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

CASE OK_CODE.

WHEN 'SAVE'.

INSERT ZSD_TABL_QOTBANK.

IF SY-SUBRC EQ 0.

MESSAGE I000(ZQOTBANK).

COMMIT WORK.

CLEAR: ZSD_TABL_QOTBANK, S_QTNO-LOW ,S_ITNO-LOW.

ELSE.

MESSAGE E001(ZQOTBANK).

ENDIF.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

*& Module EXIT_COMMAND INPUT

&----


  • text

----


MODULE EXIT_COMAND INPUT.

SAVE_OK_CODE = OK_CODE.

CLEAR OK_CODE.

CASE SAVE_OK_CODE.

WHEN 'BACK'.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'Quotation Bank Entry'

TEXT_QUESTION = 'Do you want to Go BacK ?'

TEXT_BUTTON_1 = 'Yes'

TEXT_BUTTON_2 = 'No'

DEFAULT_BUTTON = '2'

IMPORTING

ANSWER = ANSWER.

IF ANSWER = '1'.

CALL SELECTION-SCREEN 1000.

ELSE.

ENDIF.

WHEN 'EXIT'.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'Quotation Bank Entry'

TEXT_QUESTION = 'Do you want to Exit ?'

TEXT_BUTTON_1 = 'Yes'

TEXT_BUTTON_2 = 'No'

DEFAULT_BUTTON = '2'

IMPORTING

ANSWER = ANSWER.

IF ANSWER = '1'.

LEAVE PROGRAM.

ELSE.

ENDIF.

ENDCASE.

ENDMODULE. " EXIT_COMMAND INPUT

thnx in advance

MONI

Message was edited by: md monirujjaman

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2005 at 12:20 PM

    As I had quoted in your earlier post, avoid calling Dynpro in end-of-selection event.

    Call dynpro in AT SELECTION-SCREEN.

    AT SELECTION-SCREEN.
    *** Do validation here
    
    CASE SY-UCOMM.
    WHEN 'ONLI'.
    
    CALL SCREEN 100.
    
    ENDCASE.

    In your dynpro screen, avoid CALL SELECTION SCREEN , to go back.

    Instead use, LEAVE TO SCREEN 0.

    PBO of Screen 100.

    CASE OK_CODE.
    WHEN '%EX' OR 'BACK' or 'RW'.
    LEAVE TO SCREEN 0.
    ENDCASE.

    Regards,

    Subramanian V.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Buddy

      It has solved my problem ,i have awarded you with 10 points .many many Thanks for your valuable suggestions.

      Undoubtedly you people are very sound technically .

      Keep it up and make our nation great .

      thanx Mr Subramanian.

      Warm regards

      moni

      Message was edited by: md monirujjaman

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2005 at 11:53 AM

    Hi,

    Try this

    WHEN 'BACK'.

    CALL FUNCTION 'POPUP_TO_CONFIRM'

    EXPORTING

    TITLEBAR = 'Quotation Bank Entry'

    TEXT_QUESTION = 'Do you want to Go BacK ?'

    TEXT_BUTTON_1 = 'Yes'

    TEXT_BUTTON_2 = 'No'

    DEFAULT_BUTTON = '2'

    IMPORTING

    ANSWER = ANSWER.

    IF ANSWER = '1'.

    SET SCREEN <VALUE>

    LEAVE TO SCREEN <VALUE>

    ELSE.

    Thanks and Regards,

    Kathirvel Balakrishnan.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.