CANCEL button processing

hi all,
       what is the code for cancel button meance without process of current screen leave to another transaction.
thanx in advance.

Define functional type = E for this 'CANCEL' button in gui status.
In the PAI of the screen add MODULE EXIT_SCREEN at EXIT_COMMAND.
Inside this module you should enter the following code:
case sy-ucomm.
  when ''CANC'.
   If you want you can add a warning  here
     set screen 0. " This will take you back to the calling screen
     leave screen.
  when others.
endcase.
if you overwrote old values (from previous screen) in the current screen (that you are exiting) then make sure these changes are reverted. I am guessing this happends automatically, its been a while since I worked on screen ...
Raj

Similar Messages

  • Af:dialog model-restore / cancel-button processing best practice ?

    Using JDev 11.1.1.3; if I have an af:dialog running in an af:popup which contains auto-submit components (for cross-component enablement, validation etc.). My question is what are the preferred ways of discarding the model submitted changes made through popup processing if/when the af:dialog cancel button is pressed by user ? Figured that using a task flow for the content that is the popup could be an option, and using the task flow savepoint restore feature, but that looks more like database restore than model restore. I want to be able to restore the model content to the way it looked before the popup executed, without necessitating a submit to the database. How is this most commonly and best achieved ?
    Thanks,

    Taskflow savepoints are not database savepoints. Transactional BTF can be configured to issue automatic savepoints at TF entry and eventually to "rollback" to them at the TF exit. The internal implementation uses the ApplicationModule's passivation/activation mechanism to passivate the AM state at the TF entry and eventually to activate the AM state at the TF exit back to the passivated state at the entry. In this way it is simulated that you have not made any modifications in ADF BC, so your model layer will be restored to the state before TF entry. (Of course, you must not perform any DB commits durring the lifetime of this TF). I have used successfully this mechanism for the same goal you are asking about.
    Also there are savepoints managed by the ADF Controller, but I could be of little help here because I have never used them. I suspect that this mechanism could be what you need, so you may have a look here for more details:
    Adding Save Points to a Task Flow
    and in this thread:
    {thread:id=2128956}
    Dimitar

  • [JS CS4] ScriptUI Cancel button inoperant during process

    Hi,
    I made a small interface for exporting PDF. I create two buttons, one for launching the export, one to stop it.
    The launch button calls the exportPDF() function. This function sets two the values of the progressbar.
    The problem is that once the export is launched, the cancel button is no more cliackable. I would like my users to have the opportunity to stop the export process.
    I saw this thread but can't succeed in applying it.
    http://forums.adobe.com/message/1909296#1909296
    TIA Loic
    The script is build like this :
    win = new Window(...)
    +button export
    +button cancel
    +progressbar
    button export onClick > exportPDF();
    function exportPDF()
           doc.export(...);
           progressbar.value=...;

    Hi steven and thanks a lot for input.
    I was starting feeling desperate to get a hint on that topic.
    I tried your lead but it didn't do it. (I can assume I misused it however)
    I create the window on clicking the green button. The cancel window appears fine but I am still unable to switch the button. It's frozen like any other interactrive elements.
    That's ok, I am giving up this cancel button issue. It would be nice to get it but that's ok.
    For the record :
    main win
    green button
    onClick > Make new Window with cancel button and own interactive function
                    exportPDF(...)
    I wasn't any longer as the canceling window appears but still without interactivity.
    Thanks a lot for trying to help me anyway.
    Loic

  • Stop a script process with a "Cancel" button

    Hi,
    I display a progress bar with a "Cancel" button while the  script is running. I can stop the script by pressing the "Esc" key but I  would like to stop the script process with the "Cancel" button. What  kind of command/event can I add to the button for doing this ?
    Thanks

    -> Update All your Firefox Plugins
    * https://www.mozilla.org/en-US/plugincheck/
    * '''When Downloading Plugins Update setup files, Remove Checkmark from Downloading other Optional Softwares with your Plugins (e.g. Toolbars, McAfee, Google Chrome, etc.)'''
    * Restart Firefox
    Check and tell if its working.

  • Processing Page with cancel button.

    Hi,
    I have implement Processing Page but client wants to have cancel button to cancel the process.
    Can anyone give suggestions how to implement this?
    SC

    My requirement is that i have a custom base page with submit button. When user clicks on submit button it would start long running process
    And I should show a dialog page with clock saying process in progress message and a cancel button. User should be able to stop the process by clicking cancel button and back to base page. OAF gives the processing page that i want but without cancel button.
    I try to add cancel button on the processing page programmatically but while it is processing and when i click on cancel button i cannot capture the event.
    how to add cancel button on it and capture event? Is this correct approach?
    Can any body could suggest the best approach and solution?
    Thanks
    SC

  • Delete From Table on Cancel Button.

    Hi,
    i am facing funny problem.
    i have created form with report page and i have implement send email option on Page so i am attach more document with email.if i attach document then it's going in DUMY_DOC_FILE table .
    i have create a process
    delete from DUMY_DOC_FILE .
    Process Point IS ON Submit -After Conmputation and Validation
    On Page No 6.if i press Cancel Button.This button is redirect on page No 4.My Code on Page no 6.
    page is redirect to 4 but doc don't delete from DUMY_DOC_FILE Table.
    How to delete Doc From Table If I press Cancel Button.
    Thanks
    Edited by: 805629 on Jan 13, 2011 5:25 AM
    Edited by: 805629 on Jan 13, 2011 11:49 PM
    Edited by: 805629 on Jan 14, 2011 12:43 AM

    <li>Change Cancel Button in page 6 so that it submits.
    <li>If u have conditions on that delete PLSQL process, make sure that it runs when CANCEL button is pressed also. If it is unconditional, let it be.
    <li>Add a branch for the Cancel button which redirect to page 4
    So effectivelly instead of *[CANCEL] -> [Redirect to page 4]* , it becomes *[CANCEL] -> [SUBMIT] -> [DELETE PROCESS] -> [Branch: redirect to page 4]*

  • Cancel button on form of type form on a table or view

    I am a newbie for apex. I am using 10g. I have created form on table emp(empno , name , salary ) . Form is of type Form on a Table or View.
    Cancel & Save(Apply changes) button are not working at all. so I copied process reset page and execute on condition save button click. But still cancel button is not working. applcation has some other forms of type Form with a Report and are working properly. I have wasted 2 days on this problem.

    Hi,
    You can do that. If you have the branch to in the same form what you have to do use clear cache for that page. Click on the edit page, click on the cancel button in the left button section. scroll down to bottom and type the page 32 in the Clear cache field. However it is better to have branch to the report page (different page from the form).
    Hope this will help.
    M Tajuddin
    http://tajuddin.whitepagesbd.com

  • How to disable the cancel button in the ProgressMonitor

    hi,
    I need to know, is there any way to disable/remove the (cancel)button in the ProgressMonitor?
    One more problem is,
    Once i click the cancel button, isCanceled() return true, how to make it false again so that the process continue....
    It is very urgently.....
    please help me out.
    Thanks in advance.
    Regards,
    Deepa Raghuraman

    I don't think that's a good solution, because Cancel button itself is not disabled, so user is tempted to click it and nothing happens.
    A better but dangerous solution is this:
    progressMonitor = new ProgressMonitor(ProgressMonitorDemo.this,
                                         "Running a Long Task",
                                         "", 0, 100);
    progressMonitor.setMillisToDecideToPopup(0);
    progressMonitor.setMillisToPopup(0);
    progressMonitor.setProgress(0);
    JDialog dialog = (JDialog)progressMonitor.getAccessibleContext().getAccessibleParent();
    JOptionPane pane = (JOptionPane)dialog.getContentPane().getComponent(0);
    pane.setOptions(new Object[]{});Refer to the same question here [http://stackoverflow.com/questions/512151/how-do-i-disable-the-cancel-button-when-using-javax-swing-progressmonitor] .

  • After forgetting the password for my iPhone, I am trying to restore it through iTunes, however, during the process, the phone keeps turning on and asking for the password, thus canceling the process. Any advice?

    After forgetting the password for my iPhone, I am trying to restore it through iTunes, however, during the process, the phone keeps turning on and asking for the password, thus canceling the process. Any advice?

    Yes, you will still get the prompt.
    I meant reset then try the recovery mode restore again.
    You can also try DFU Mode.
    DFU (Device Firmware Update) Mode is different than Recovery Mode.
    DFU Mode is a special mode where the device can still interface with iTunes, yet it does not load the iBoot bootloader.
    DFU Mode:
    Plug your device into your computer.
    Turn off the device.
    Hold the Power button for 3 seconds
    Hold the Home button without releasing the Power button for 10 seconds
    Release the Power Button but keep holding the Home button
    Keep holding the Home button until you are alerted by iTunes saying that it has detected a device in Recovery Mode
          NOTE: Make sure the device screen is blank and no logos are present. Be patient, it make take several trys.

  • Drag drop and ProgressBar cancel button

    Hi,
    I have a class that extends CDragDropTargetFlavorHelper, during ProcessDragDropCommand I want to show a ProgressBar (the code that does this is actually in another, model only, plugin - might be significant), however, though the progress bar shows the cancel button doesn't.  Unless I delay the processing until after the drop is complete by scheduling the command - if I either process the command or schedule and process scheduled commands the cancel button doesn't show.
    Scheduling the command gives a bit of a delay to the user (even with highest priority) and also no ability to feedback 'drop failed'.  So I'd like to:
    - preferably get the cancel button to show without scheduling the command
    - know immediately when a drop has been completed and process scheduled commands.
    Thanks in advance
    Ian

    Thanks Ned,
    I have since been continuing to research this and it would seem that implementing the HitTest could be the way to go. If anyone has any experience or advice to support this I would be grateful.
    Regards
    Chris

  • How to Cancel Event processing

    I have integrated a WD-ABAP application in Portal. I want to change the behaviour of Close button (By default it closes the browesr window !!). I am able to catch the FPM_CLOSE event and execute my custom code, but the problem is, after my code gets executed, the standard handler for FPM_CLOSE also gets executed. Is there any way to cancel the processing of standard handler. In debug mode I was able to do it by clearing the mv_event_id. It's a readonly parameter and I cannot do it programmatically.
    Thanks
    Prashant

    Solved it by changing the ev_result parameter to failed after executing my custom handler.
      ev_result = if_fpm_constants=>gc_event_result-failed
    Thanks
    Prashant

  • How to cancel the process in initiator of human task in 11g?

    human task as the initiator of the process, by default there is only a SUBMIT button, how to cancel the process then?
    if I just close the form, a task will still created in the task list, still in initiator step. what if I don't want this?
    I tried to add an "CANCEL" output for this , if the output is CANCEL then go to then end activity, but seems it doesn't work. anyone got a better solution? thank you.

    You should be able to use the "Withdraw" action for this - available from the task Actions button/drop down on the human task form.

  • Problem when press CANCEL button

    Hello Everyone,
    I have created the block which having the LOV and this is the mandatory field. There are two buttons placed on this block canvas "OK" and "Cancel".
    This new block is calling from main block, if user don't want to choose LOV item and he simply click on "Cancel" button then control should transfer to main block. But when user press the "Cancel" button automatically control transfers to "On-Commit" trigger.
    On cancel button i have written GO_BLOCK('BLOCK_NAME'); but it does not works.
    Please suggest the way how i can close the block.
    Regards,
    JAK

    JAK,
    It sounds like you have not terminated further processing in the form. Try adding 'RAISE Form_Trigger_Failure;' after your GO_BLOCK(); call. This should ensure no further processing is done after you navigate to the specified block.
    Hope this helps.
    Craig...

  • Cancel Button To Be Invoked On Escape KeyPress

    In my application i have OK and Cancel Buttons. I have set OK as default button(invoked on Enter Press). How do i make the Cancel invoked when i press Escape Key.

    Hi, I don't know if this is the way you would like ;-) but this will work very easily:
    jTextField.addKeyListener(new java.awt.event.KeyAdapter() {
                        public void keyPressed(java.awt.event.KeyEvent e) {
                             //if enter was pressed process the ok-method
                             if (e.getKeyCode()==KeyEvent.VK_ENTER)handleOk();
    You can add a KeyListener to the active Component(here it is a JTextField) and ask if the Enter (Escape)key was pressed. And in this case, you can call the method you also call by pressing "OK".
    If you have more than one Component which could be active than add a listener to each Component.

  • Regarding Module Pool's Cancel button

    Hi Guys,
    Please help me I have created on Module Pool and now this module pool is called through a a UserExit .
    now the thing is if i cancel button which is placed on my popup screen then it is still going into the output which is wrong it should show up the previous screen.
    My code for the Sy-ucomm = cancel is
    IF SY-UCOMM = 'CANC'.
        SET SCREEN 0.
        LEAVE SCREEN.
      ENDIF.
    Can you please provide me some code by which i can go to the previous screen.

    I am calling the Module pool through User exit and inside user exit i am calling FM which calls my screen.
    Userexit -> FM -> ModulePool
    here is the code :
    ***INCLUDE LZRMA_NOTIFO01 .
    *&      Module  STATUS_0150  OUTPUT
    *       text
    MODULE STATUS_0150 OUTPUT.
    *  SET PF-STATUS SY-DYNNR.
    *  SET TITLEBAR SY-DYNNR.
    ENDMODULE.                 " STATUS_0150  OUTPUT
    *&      Module  CUA_STATUS  OUTPUT
    *       text
    MODULE CUA_STATUS OUTPUT.
    *  SET PF-STATUS SY-DYNNR.
    *  SET TITLEBAR SY-DYNNR.
    ENDMODULE.                 " CUA_STATUS  OUTPUT
    *&      Module  EXIT_SCREEN  INPUT
    *       text
    MODULE EXIT_SCREEN INPUT.
      DATA:      C_FCODE_ABBR   LIKE SY-PFKEY  VALUE 'ABBR' .
    break-point.
      CASE OK-CODE.
        WHEN C_FCODE_ABBR.
    *-- Abbrechen
    *   Daten zurücknehmen
          CLEAR RQM01.
    *      RAISE CANCEL.
          set screen 0.
          LEAVE TO SCREEN 0.
            call transaction 'QM01'.
      ENDCASE.
    IF SY-UCOMM = 'CANC'. "  Here is the SY-UCOMM Where i have to handle the CANC BUTTON
    *    SET SCREEN 0.
    *    LEAVE SCREEN.
       LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.                 " EXIT_SCREEN  INPUT
    *&      Module  CHECK_NOTIF_NO  INPUT
    *       text
    MODULE CHECK_NOTIF_NO INPUT.
    *& Below condition checks if the user enter a Notification Num and Porduction
    *  Order Then Message comees Please enter a Prod Order or RMA Notif Num only
    *  Process cannot accept both.
      IF NOT VIQMEL-QMNUM IS INITIAL.
        IF NOT RQM01-FERTAUFNR IS INITIAL.
          MESSAGE E904(QM).    "  Please enter a Prod order or RMA Notif Num only.
                                  "  Process can't accept both
        ENDIF.
      ENDIF.
    *& If Production order is entered, then check if the Order type is 'AES1' or *
    *&  'AES3'AES2,AES4, AES5, AES6,ICSO, PM01, PM02, RMA, SM01, SM02, ZEXR,
    *&   Message flashes ' Please enter only enter RMA Notif Number.       *
      data: v_dauat like afpo-dauat.
      SELECT SINGLE DAUAT INTO V_DAUAT FROM AFPO WHERE AUFNR = RQM01-FERTAUFNR.
      if sy-subrc = 0.
        IF V_DAUAT = 'AES1' OR V_DAUAT = 'AES3' OR
           V_DAUAT = 'AES2' OR V_DAUAT = 'AES4' OR
           V_DAUAT = 'ICSO' OR V_DAUAT = 'PM01' OR
           V_DAUAT = 'PM01' OR V_DAUAT = 'RMA' OR
           V_DAUAT = 'SM01' OR V_DAUAT = 'SM02' OR V_DAUAT = 'ZEXR'..
          MESSAGE E905(QM).    " Please Only enter a RMA Notif Number.
        ENDIF.
      endif.
    ENDMODULE.                 " CHECK_NOTIF_NO  INPUT
    *&      Module  FEAUF_SAAUF_CHECK  INPUT
    *       text
    MODULE FEAUF_SAAUF_CHECK INPUT.
      OK-CODE = SY-UCOMM.
    *Added by CChauhan
      IF VIQMEL-QMNUM IS INITIAL.
    *& End of Addition by CChauhan
        IF  NOT RQM01-FERTAUFNR IS INITIAL
        AND ( NOT RQM01-VERID IS INITIAL
             OR NOT RQM01-RM_WERKS IS INITIAL
             OR NOT RQM01-RM_MATNR IS INITIAL ).
    *   only production order or manufacturing version meaningfully
          MESSAGE E902(QM).
        ENDIF.
    *Added by CChauhan
      ENDIF.
    *& End of Addition by CChauhan
    ENDMODULE.                 " FEAUF_SAAUF_CHECK  INPUT
    *&      Module  FEAUF_FEPOS_CHECK  INPUT
    *       text
    MODULE FEAUF_FEPOS_CHECK INPUT.
      IF VIQMEL-QMNUM = ''.
        IF      RQM01-FERTAUFNR = ''
        AND RQM01-FERTVORNR <> ''.
          MESSAGE E903(QM).
        ENDIF.
      ENDIF.
      IF SY-UCOMM = 'CANC'.
        LEAVE SCREEN.
      ENDIF.
    ENDMODULE.                 " FEAUF_FEPOS_CHECK  INPUT
    *&      Module  FAUF_LESEN  INPUT
    *       text
    MODULE FAUF_LESEN INPUT.
    *& Added by CChauhan  Date: 01/23/2007
    *& Execute further if RMa_Notif(VIQMEL-QMNUM)ield is blank.
    IF VIQMEL-QMNUM IS INITIAL.
    *&End by CChauhan     Date: 01/23/2007
        PERFORM FAUF_LESEN USING RQM01-FERTAUFNR
                                 RQM01-FERTVORNR
                        CHANGING CAUFV
                                 AFVC.
    *   Belegdaten an Qualitätsmeldung übergeben
        PERFORM FAUF_TO_QMEL USING CAUFV
                                   AFVC
                          CHANGING RQM01.
    *& Added by CChauhan  Date: 01/23/2007
    ENDIF.
    *&End by CChauhan     Date: 01/23/2007
    ENDMODULE.                 " FAUF_LESEN  INPUT
    *&      Form  FAUF_LESEN
    *       text
    *      -->P_RQM01_FERTAUFNR  text
    *      -->P_RQM01_FERTVORNR  text
    *      <--P_CAUFV  text
    *      <--P_AFVC  text
    FORM FAUF_LESEN USING VALUE(P_AUFNR) LIKE RQM01-FERTAUFNR
                          VALUE(P_VORNR) LIKE RQM01-FERTVORNR
                 CHANGING VALUE(P_CAUFV) LIKE CAUFV
                          VALUE(P_AFVC)  LIKE AFVC .
      CALL FUNCTION 'QMHL_HELP_FAUF'
        EXPORTING
          I_AUFNR             = P_AUFNR
          I_VORNR             = P_VORNR
          I_FOLGE             = G_FOLGE
        IMPORTING
          E_CAUFV             = P_CAUFV
          E_AFVC              = P_AFVC
        EXCEPTIONS
          ORDER_NOT_FOUND     = 1
          OPERATION_NOT_FOUND = 2
          OTHERS              = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " FAUF_LESEN
    *&      Form  FAUF_TO_QMEL
    *       text
    *      -->P_CAUFV  text
    *      -->P_AFVC  text
    *      <--P_RQM01  text
    FORM FAUF_TO_QMEL USING VALUE(P_CAUFV) LIKE CAUFV
                            VALUE(P_AFVC)  LIKE AFVC
                   CHANGING       P_RQM01  LIKE RQM01.
    * zunächst Berechtigung für Meldungsart/Werk prüfen
      PERFORM CHECK_QAUT_QMEL USING SY-TCODE
                                    TQ80-QMART
                                    P_CAUFV-WERKS.
    * Materialnummer des Fertigprodukts ermitteln
      SELECT * FROM AFPO
      WHERE AUFNR = P_CAUFV-AUFNR.
    * Materialnummer steht in der ersten Auftragsposition
        EXIT.
      ENDSELECT.
      IF SY-SUBRC IS INITIAL.
    *   Materialnummer übernehmen
        P_RQM01-MATNR  = AFPO-MATNR.
        IF NOT AFPO-MATNR IS INITIAL.
          PERFORM MATERIAL_CHECK USING AFPO-MATNR.
        ENDIF.
    *   Charge
        P_RQM01-CHARG     =  AFPO-CHARG.
    *--- Lieferantencharge bestimmen
        IF NOT P_RQM01-CHARG IS INITIAL.
          SELECT SINGLE * INTO MCHA FROM MCHA
                  WHERE MATNR =  P_RQM01-MATNR
                  AND   WERKS =  P_RQM01-MAWERK
                  AND   CHARG =  P_RQM01-CHARG.
          IF SY-SUBRC EQ 0.
            MOVE MCHA-LICHA TO P_RQM01-LICHN.
          ENDIF.
        ENDIF.
        P_RQM01-LGORTCHAR =  AFPO-LGORT.
      ENDIF.
      P_RQM01-MAWERK    =  P_CAUFV-WERKS.
      IF NOT AFPO-MATNR IS INITIAL
        AND  NOT P_CAUFV-WERKS IS INITIAL.
        PERFORM MATERIAL_WERK_CHECK USING AFPO-MATNR
                                          P_CAUFV-WERKS.
      ENDIF.
    * Revisionsstand
      P_RQM01-REVLV     =   P_CAUFV-REVLV.
    * reklamierte Menge
      P_RQM01-RKMNG     =   P_CAUFV-GAMNG - P_CAUFV-GASMG.
      P_RQM01-BZMNG     =   P_CAUFV-GAMNG - P_CAUFV-GASMG.
      P_RQM01-MGEIN     =   P_CAUFV-GMEIN.
    * Arbeitsplatz
      P_RQM01-ARBPL = P_AFVC-ARBID.
    * eindeutiger Schluessel fuer Vorgang
      P_RQM01-FERTAUFPL = P_AFVC-AUFPL.
      P_RQM01-PNLKN     = P_AFVC-APLZL.
    * Info über automatische Datenübernahme
      MESSAGE S026(QM) WITH P_CAUFV-AUFNR RQM01-FERTVORNR.
    ENDFORM.                    " FAUF_TO_QMEL
    *&      Form  CHECK_QAUT_QMEL
    *       text
    *      -->P_SY_TCODE  text
    *      -->P_TQ80_QMART  text
    *      -->P_P_CAUFV_WERKS  text
    FORM CHECK_QAUT_QMEL USING VALUE(P_TCODE)
                               VALUE(P_QMART)
                               VALUE(P_WERK).
      CHECK NOT P_WERK IS INITIAL.
      MOVE-CORRESPONDING RQM01 TO H_VIQMEL.
      CALL FUNCTION 'QAUT_QMEL'
        EXPORTING
          I_WERKS  = P_WERK
          I_QMART  = P_QMART
          I_TCODE  = P_TCODE
          I_VIQMEL = H_VIQMEL.
    ENDFORM.                    " CHECK_QAUT_QMEL
    *&      Form  MATERIAL_CHECK
    *       text
    *      -->P_AFPO_MATNR  text
    FORM MATERIAL_CHECK USING  VALUE(P_MATNR).
    *-- lokale Daten
      DATA : BEGIN OF L_DUMMY_TAB OCCURS 0,
               DUMMY(1),
             END   OF L_DUMMY_TAB.
    * Prüfung nur, falls Materialnummer und Werk gefüllt
      CHECK NOT P_MATNR IS INITIAL.
    * Verprobung auf MARA-Segment
      MOVE C_MARA_SEGMENT TO MTCOM-KENNG.
      MOVE P_MATNR        TO MTCOM-MATNR.
      TABLES: MTCOR.
      CALL FUNCTION 'MATERIAL_READ'
        EXPORTING
          SCHLUESSEL           = MTCOM
        IMPORTING
          MATDATEN             = MARA
          RETURN               = MTCOR
        TABLES
          SEQMAT01             = L_DUMMY_TAB
        EXCEPTIONS
          ACCOUNT_NOT_FOUND    = 01
          BATCH_NOT_FOUND      = 02
          FORECAST_NOT_FOUND   = 03
          LOCK_ON_ACCOUNT      = 04
          LOCK_ON_MATERIAL     = 05
          LOCK_ON_PLANT        = 06
          LOCK_ON_SALES        = 07
          LOCK_ON_SLOC         = 08
          LOCK_SYSTEM_ERROR    = 09
          MATERIAL_NOT_FOUND   = 10
          PLANT_NOT_FOUND      = 11
          SALES_NOT_FOUND      = 12
          SLOC_NOT_FOUND       = 13
          SLOCNUMBER_NOT_FOUND = 14
          SLOCTYPE_NOT_FOUND   = 15
          TEXT_NOT_FOUND       = 16
          UNIT_NOT_FOUND       = 17.
      CASE SY-SUBRC.
        WHEN C_RC00.
    *       alles o.k.
          RQM01-MATKL = MARA-MATKL.
          RQM01-PRDHA = MARA-PRDHA.
        WHEN C_RC10.
          MESSAGE E005(QM) WITH P_MATNR.
      ENDCASE.
    * Beim Material sitzt Loeschvormerkung.
      IF NOT MTCOR-LVORM IS INITIAL.
        MESSAGE W008(M3).
      ENDIF.
    ENDFORM.                    " MATERIAL_CHECK
    *&      Form  MATERIAL_WERK_CHECK
    *       text
    *      -->P_AFPO_MATNR  text
    *      -->P_P_CAUFV_WERKS  text
    FORM MATERIAL_WERK_CHECK USING VALUE(P_MATNR)
                                   VALUE(P_WERK).
    *-- local data
      DATA : BEGIN OF L_DUMMY_TAB OCCURS 0,
               DUMMY(1),
             END   OF L_DUMMY_TAB.
    * Examination only, if materials number and work filled
      CHECK (    NOT P_MATNR IS INITIAL
             AND NOT P_WERK  IS INITIAL ).
    * Checking on MARC segment
      MOVE C_MARC_SEGMENT TO MTCOM-KENNG.
      MOVE P_MATNR        TO MTCOM-MATNR.
      MOVE P_WERK         TO MTCOM-WERKS.
      CALL FUNCTION 'MATERIAL_READ'
        EXPORTING
          SCHLUESSEL           = MTCOM
        IMPORTING
          MATDATEN             = MARC
        TABLES
          SEQMAT01             = L_DUMMY_TAB
        EXCEPTIONS
          ACCOUNT_NOT_FOUND    = 01
          BATCH_NOT_FOUND      = 02
          FORECAST_NOT_FOUND   = 03
          LOCK_ON_ACCOUNT      = 04
          LOCK_ON_MATERIAL     = 05
          LOCK_ON_PLANT        = 06
          LOCK_ON_SALES        = 07
          LOCK_ON_SLOC         = 08
          LOCK_SYSTEM_ERROR    = 09
          MATERIAL_NOT_FOUND   = 10
          PLANT_NOT_FOUND      = 11
          SALES_NOT_FOUND      = 12
          SLOC_NOT_FOUND       = 13
          SLOCNUMBER_NOT_FOUND = 14
          SLOCTYPE_NOT_FOUND   = 15
          TEXT_NOT_FOUND       = 16
          UNIT_NOT_FOUND       = 17.
      CASE SY-SUBRC.
        WHEN C_RC00.
    *       alles o.k.
          RQM01-KZDKZ = MARC-KZDKZ.
          RQM01-KZKRI = MARC-KZKRI.
        WHEN C_RC11.
          MESSAGE E004(QM) WITH P_MATNR
                                P_WERK.
        WHEN C_RC10.
          MESSAGE E005(QM) WITH P_MATNR.
      ENDCASE.
    ENDFORM.                    " MATERIAL_WERK_CHECK
    *&      Module  FCODE  INPUT
    *       text
    MODULE FCODE INPUT.
    *& Inserted by CC  01/24/2007
      II_VIQMEL-FERTAUFNR = RQM01-FERTAUFNR.
    *& End by CC   01/24/2007
      PERFORM FCODE USING OK-CODE.
    ENDMODULE.                 " FCODE  INPUT
    *&      Form  FCODE
    *       text
    *      -->P_OK_CODE  text
    FORM FCODE USING VALUE(P_FCODE) LIKE SY-TCODE.
      CASE P_FCODE.
        WHEN C_FCODE_ENT1.
    *-- Weiter
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
      IF SY-UCOMM = 'CANC'.
        SET SCREEN 0.
        LEAVE SCREEN.
      ENDIF.
    ENDFORM.                    " FCODE

Maybe you are looking for