Sy-ucomm

hi, may i know how to write the below syntax.
if the first sy-ucomm is 'CON' and the following sy-ucomm is 'SAVE' then only will continue the processing. the first sy-ucomm happens is when a dialog box asking for confirmation. after user click a button which is 'CON' and the next button in gui status to click is 'SAVE' then only will continue.
either if will continue else exit
if sy-ucomm = 'CON' and the next sy-ucomm triggered is 'SAVE' then will continue
or
if sy-ucomm = 'SAVE' then will continue
thanks

Hi,
Create a globle variable..WHich means in the top include of the module pool program..
**IN THE TOP INCLUDE..
DATA: GV_UCOMM TYPE SYUCOMM.
GV_UCOMM = SY-UCOMM.
**CALL THE POPUP..
IF GV_UCOMM = 'SAVE'.
ENDIF.
Thanks,
Naren

Similar Messages

  • User exit ZXPADU02 - evaluating SY-UCOMM

    Hello everyone,
    I am trying to display an error message whenever someone tries to create a new work schedule rule (P0007-SCHKZ) in infotype 7. However, the error message should just come up when the user is trying to save his data.
    I am using user exit ZXPADU02 for this purpose. My problem is that SY-UCOMM does not seem to hold reliable data in this user exit, and SSCRFIELDS does not seem to be supported at all.
    My code looks like this (only the relevant code snippet in ZXPADU02):
    CASE INNNN-INFTY.
            WHEN '0007'.
          CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
            EXPORTING PRELP = INNNN
            IMPORTING PNNNN = P0007.
          CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
            EXPORTING PRELP = PSAVE
            IMPORTING PNNNN = P0007_ALT.
          IF P0007_ALT-SCHKZ <> P0007-SCHKZ
          AND IPSYST-MASSN IS INITIAL " do not warn within an info group of a personnel action
          AND SY-UCOMM = 'UPD'. " only warn when saving the data -> problem here <-
            MESSAGE 'Do not change IT7 directly or else.' TYPE 'I' DISPLAY LIKE 'E'.
            SHOW_DATA_AGAIN = 'X'.
          ENDIF.
    At first glance, the above works nicely.  But this is what happens when I test more thoroughly:
    I create a new period in IT 7, enter a P0007-SCHKZ other than the one that was previously valid, press F11. Some warnings appear (for different reasons), which I dismiss using the Enter key. Afterwards, the above code fires, the error message is being displayed, and I am thrown back into the data screen. So far, so good.
    Now I simply alter the value in the field "Weekly hours" (P0007-WOSTD) and press Enter (!). Again a series of warnings appear, including one that a dataset is going to be deleted (seeing that an IT 7-period with just the same date range already exists). I confirm that with Enter, and the data is being saved. The above code does not fire because I have only pressed Enter - but the data is being saved anyway!
    Looks like a pretty erroneous behavior on the side of the SAP system. The question is whether I have a chance to do something about it in the code.

    Mihir Nagar wrote:
    Dear Petersen,
    Your IF condition seems ok. I doubt on the message statement. Can you replace your message statement with type E.
    MESSAGE 'Do not change IT7 directly or else.' TYPE 'E'.
          ENDIF.
    Hope this works.
    Regards,
    Mihir.
    I did not expect this to work, because normally you use type 'E'-messages only in certain PAI-environments, but it does the job, thank you!
    make use of  field IOPER of the structure  PSYST to check on the infotype actions INS, MOD, COP, DEL...
    In this particular case I did not care, so I did not check that. IT 7 should only be maintained through personnel actions in our case.
    Next you can check with sy-ucomm field the different between "enter" and "save". With "save" sy-ucomm will be 'UPD'.
    That is what I did, but as I described, there was a situation when SY-UCOMM is SPACE, but the system saved anyway due to a prior save attempt.

  • Unable to capture sy-ucomm in BDC

         Hello Everyone, 
    I have created a BDC for CG3Y everything is working fine after creating a log when sy-subrc eq 0. when user hits SAVE I have given a message stating 'LOG HAS BEEN GENERATED' but when the pop for overwrite appears and I hit NO, it should give a different message for that i am not able to capture SY-UCOMM.
    please help.

    Actually the issue was just had to get the file(Error log) from Application Server to Presentation, Here is the code for it.
    data: i_fl_openerror type boolean,
    i_os_message(100) type C,
    i_flg_continue type boolean.
    CALL FUNCTION 'C13Z_FILE_DOWNLOAD_ASCII'
    EXPORTING
    i_file_front_end          = 'C:\ERROR_LOG.XLS'
    i_file_appl               = '/USR/SAP/TMP/FILE3.XLS'
    *   I_FILE_OVERWRITE          = ESP1_FALSE
    IMPORTING
    E_FLG_OPEN_ERROR          = i_fl_openerror
    E_OS_MESSAGE              = i_os_message
    EXCEPTIONS
    FE_FILE_OPEN_ERROR        = 1
    FE_FILE_EXISTS            = 2
    FE_FILE_WRITE_ERROR       = 3
    AP_NO_AUTHORITY           = 4
    AP_FILE_OPEN_ERROR        = 5
    AP_FILE_EMPTY             = 6
    OTHERS                    = 7
    IF sy-subrc <> 0.
    case sy-subrc.
    when 2.
    CALL FUNCTION 'C14A_POPUP_ASK_FILE_OVERWRITE'
    IMPORTING
    E_FLG_CONTINUE       = i_flg_continue
    if i_flg_continue eq true.
    CALL FUNCTION 'C13Z_FILE_DOWNLOAD_ASCII'
    EXPORTING
    i_file_front_end          = 'C:\ERROR_LOG.XLS'
    i_file_appl               = '/USR/SAP/TMP/FILE3.XLS'
    I_FILE_OVERWRITE          = ESP1_TRUE
    IMPORTING
    E_FLG_OPEN_ERROR          = i_fl_openerror
    E_OS_MESSAGE              = i_os_message
    EXCEPTIONS
    FE_FILE_OPEN_ERROR        = 1
    FE_FILE_EXISTS            = 2
    FE_FILE_WRITE_ERROR       = 3
    AP_NO_AUTHORITY           = 4
    AP_FILE_OPEN_ERROR        = 5
    AP_FILE_EMPTY             = 6
    OTHERS                    = 7
    IF sy-subrc <> 0.
    write : / 'CANNOT DOWNLOAD' , '/USR/SAP/TMP/FILE3.XLS' .
    else.
    write : / 'LOG HAS BEEN GENERATED C:\ERROR_LOG.XLS'.
    endif.
    else.
    write : / 'LOG NOT GENERATED'.
    endif.
    when others .
    write : / 'CANNOT DOWNLOAD FILE1', '/USR/SAP/TMP/FILE3.XLS'.
    endcase.

  • Unable to capture UCOMM for cancel & Exit

    Hi,
    From the fbv2 transaction(Invoice Change) invoice change, we need to capture the User Command (SY-UCOMM) for the exit & cancel, but we are not able to find any BTE,Enhancements for capturing that.Kindly let me know if any other solution is possible for capturing the UCOMM value.
    Thanks,
    Mohan.

    I am not sure if I got your question correctly but if you go inside in FBV2 and click on 'exit' button and debug, you can see sy-ucomm (ok-code) as 'END'.  It goes to program MF05AFEENJ  (main program SAPMF05A).

  • How to capture sy-ucomm BACK EXIT or CANCEL button in webdynpro from inbox

    I have a webdynpro which is triggerd by a inbox item (the inbox item is now reserved), on pressing BACK EXIT or CANCEL i want  to release the inbox item.
    In de webdynpro view methode WDDOEXIT i can do this butr i need to know if one of the three buttons ( BACK EXIT or CANCEL) is pressed by the user.
    sy-ucomm is empty.
    Is there a way to find out if a GUI button is preesed??
    Grtz and thanks
    RIchard

    hi, thanks for your response!
    I can't use your hint, because with the code:
    SELECTION-SCREEN BEGIN OF screen 100 as window.
    there will be a "GENERATED" screen. This means, there
    is a screen with all the input fields und the label 100 which I can't
    edit! Because if I edit this screen and activate my source again,
    my changes will be undone!
    So is my question, if there is another system-field than sy-ucom?

  • How to use sy-ucomm in one time in the report

    Hi guru,
    I developed a z report when i am executing the report one screen is didplaying and here and here i have to delect some check boxes (update) and then click the click the toolbar stage (which was created using sy-ucomm) and we are getting some output.
    Now the requirement is when user second time clicking the  botton stage the report shaould not execute it self.How to do it means how to restrict .Please help me .May be it is easy for you but I am facing a severe probleam to achieve this.
    needs yours cooperation and patience.

    Hi subhassikan
    I am not very clear about what you want to say.
    1. you want the sy-ucomm to be executed once right, then you can use a flag in that case.
    one it executed first time
    make flag = 'X'.
    and next time check the value of flag if it is 'X' then the code under sy-ucomm should not be executed.
    2. Secondly is there some buttton or something that you click, check function code for only that button and should not execute for any other button and function codes must be different.

  • What will be the Structure of itab created with "LIKE TABLE OF sy-ucomm"

    Data fcode like table of sy-ucomm
    The table thus created will have one column but it will not have any structure.
    How can I write a code with this effect:
    LOOP AT fcode.
      WRITE:/ fcode-????.
    ENDLOOP.
    This question is just out of my curiosity I undertsand that by altering the declaration like
    Data begin of fcode occurs 0,
    data ucomm like sy-ucomm,
    end of fcode.
    I will be able to name it. But out of the academic interest I want to know that without altering the decalation part can we do it

    Hello Flora,
    There are two points to be noted here -
    1. the table you have created doesn't have a header line.
    2. The table you have created doesn't have a "structure".
    All internal tables declared with reference to a non-structural type / object have got only one field.
    for example -
    Data ITAB TYPE I OCCURS 0.
    These internal tables have certain limitations. They cannot be displayed in an ALV Grid, for instance.
    And since they do not have a <i>structure</i>, the hypen operator '-' doesn't really make sense. When you say SYST-UCOMM, you are referring to the field UCOMM in the structure SYST.
    Hope that's clear.
    Regards,
    Anand Mandalika.

  • Sy-ucomm Vs  OKcode

    Hi
    What is the difference between sy-ucomm and okcode????

    Hi,
    sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using <pfstatus>
    ok_code is generally used in screen as of I have used. You will define the function in the screen. and you can use it in the main program.
    ok_code acts just as a temporary variable that stores the value of sy-ucomm.
    When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE.
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
    Diff bet OK-CODE and SY-UCOMM
    Difference Between SY-UCOMM and OK_CODE
    ok_code/ sy-ucomm usage in dialog program
    Thanks.

  • Difference between ok_code and sy-ucomm

    Hi,
    Can any one tell me the difference between ok_code and sy-ucomm

    Hi,
    Actually OK_CODE and SY-Ucomm are the same. But experts suggest use of OK code for following reason:
    In each PAI event that a user triggers by choosing either a pushbutton on the screen or an element in a GUI status, the corresponding function code is placed into the system field SYST-UCOMM or SY-UCOMM and placed in the OK_CODE field (as long as the function code is not empty). Empty function codes are placed in neither the SY-UCOMM field nor the OK_CODE field.
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.

  • Difference Between SY-UCOMM and OK_CODE

    Hello ,
    What is the Exact difference between <b>SY-UCOMM and Ok-Code</b>?

    Hello,
    sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using <pfstatus>
    ok_code is generally used in screen as of I have used.  You will define the function in the screen. and you can use it in the main program.
    ok_code acts just as a temporary variable that stores the value of sy-ucomm.
    When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE.
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
    Regs,
    Venkat Ramanan N

  • Difference b/w ok_code and sy-ucomm in module pool ?

    hai abap gurus,
    ok_code and sy-ucomm store the function code of the element.. then y do v use ok-code in the program. y dont v use sy-ucomm... pls clear my doubt...

    hi,
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.

  • Wht is diff b/w sy-ucomm and ok code

    hi,
    what is diff b/w sy-ucomm and ok-code
    Regards,
    Rani.

    Hi,
    sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using <pfstatus>
    ok_code is generally used in screen as of I have used. You will define the function in the screen. and you can use it in the main program.
    ok_code acts just as a temporary variable that stores the value of sy-ucomm.
    When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE.
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
    Diff bet OK-CODE and SY-UCOMM
    Difference Between SY-UCOMM and OK_CODE
    ok_code/ sy-ucomm usage in dialog program

  • Difference b/w ok_code and sy-ucomm

    Can any one tell Difference b/w ok_code and sy-ucomm

    sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using <pfstatus>
    ok_code is generally used in screen as of I have used. You will define the function in the screen. and you can use it in the main program.
    ok_code acts just as a temporary variable that stores the value of sy-ucomm.
    When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE.
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
    Diff bet OK-CODE and SY-UCOMM
    Difference Between SY-UCOMM and OK_CODE
    ok_code/ sy-ucomm usage in dialog program
    Please give me reward points...

  • Regarding Sy-ucomm value for Enter.

    Hi All, In PAI of screen i have the following code, BUt when i press enter , the conttrol did not go in the following case .
    case sy-ucomm
    WHEN  'ENTR' OR ''.
          IF b_unit IS NOT INITIAL.
            CLEAR  wa_tbgl.
            SELECT SINGLE * FROM zf112409gl_map INTO wa_tbgl
              WHERE b_unit = b_unit.
            glaccount = wa_tbgl-l_gl_acc .
            gldesc = wa_tbgl-desc_lgl .
            b_unit = wa_tbgl-b_unit .
            sapglaccount =  wa_tbgl-saknr .
            SELECT SINGLE txt50 FROM skat INTO txt50
              WHERE saknr = sapglaccount
              AND spras = 'EN'.
         sapgldesc = txt50.
            else .
              MESSAGE 'Please enter the required field' type 'I'.
          endif.
    Please give me the  step to follow.
    rgds,
    Premraj

    Try as;
    When 'ENTER' OR SPACE.
    Regards
    Karthik D

  • Regarding SY-UCOMM from a subscreen.

    Hi All,
    I am calling a screen from a subscreen by using a push button.
    Issue : suppose SY_UCOMM when push button is pressed is TEST.
    When I press it , it takes to called sceen and in this screen SY_UCOMM changes.
    But , when I return control to my subscreen, I get SY_UCOMM as TEST.
    Please let me know the cause for the same.
    Thanks in advance.

    hi,
    first clear the Sy-ucomm or ok_code in PBO..
    and check again..
    and also check for enter do you assigned and function code or not in se41...
    if you donot any function key or code for enter the old sy-ucomm will be still there.
    soclear the Sy-ucomm or ok_code in PBO..
    i think from sub screen you can not call the another screen..
    but you can call the transaction..
    Regards,
    Prabhudas

  • Regarding  ok_code and sy-ucomm.

    hi experts ,
                    regarding the difference between ok_code and sy-ucomm i searched and found this lines......
    answer:::
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM <b>receive the contents of the corresponding screen fields</b> in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event.
    cud u plz tell me what is the meaning of contents of corresponding screen fields...plz explain it ...and second thing can i declare another variable name instead of ok_code ..is it necessary to write ok_code....thnx in advance...

    <b>sy-ucomm</b> is for doing the functions what the user wishes to do at that particular event.
    You use it in menus and other place . this mainly in using <pfstatus>.
    ok_code is generally used in screen as of I have used.  You will define the function in the screen. and you can use it in the main program.
    ok_code acts just as a temporary variable that stores the value of sy-ucomm.
    When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE.
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
    Regards,
    Pavan

Maybe you are looking for

  • Error creating subsite from template - SharePoint 2010

    I appreciate the help from anyone who can help in my situation. I am trying to create a subsite whose parent is a SharePoint Server 2010 website. When I'm doing that, I go to: Site Actions > Create > Sites and Workspaces My purpose is to create a sub

  • Satellite Pro A200: Recovery using a network ghost boot disk

    Hi all, Need to ghost several sat pro a200 machines using a network ghost boot disk. when i use the ghost disk provided by ghost boot wizard and booting into PC dos i get the message "No Fast Ethernet PCI Adapter Found!" Serious Internal Error! (hard

  • Why is my network extender flashing red and pink?

    hi, I have had my Verizon extender for a while, I bought a new Motorola modem/router connected them up and now my network extender isn't blue like it was before. the system band is flashing red and the gps band is solid pink. I have unplugged it more

  • Updated GL7 Site to GL8 - Modified Items All necessary?

    I updated one of my sites from 7 to 8. Upload Modified Items wants to upload all 2000+ items, including large .mov files and tons of jpegs. How should I proceed? Do I need to upload everything, all modified items? I recall I can mark them all so they

  • Regex variables in rereplace

    Is it possible to use regex variables with rereplace? For instance if I wanted to put brackets around the area code in a phone number, I'd like to do the below code, but it doesnt work, just sees the variable as a string