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

Similar Messages

  • 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 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.

  • 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...

  • What is the diff between OK_CODE and SY-UCOMM

    Dear All,
    I am trying to develop on module pool program using push buttons to pass the data to input/out filed. When I do the debugging the sy-ucomm is showing the data but not OK_CODE in case statement.
    Case OK_CODE.
    When 'one'.
    num = '1'.
    call function 'ZCA_INPUT_OUT'.
    Import
    numz = num
    export
    number = inputi. " input/output field in screen painter
    end case.
    Can you pls give me a solutions what is the main mistake I did here.
    I could not able to pass the data through push button to input/out field.
    Regards,
    Chandra.

    Hi all,
    still I have same problem.
    below is my program code.
    REPORT  ZCA_CALCULATOR_DEMO.
    DATA INPUTI TYPE string.
    Data num type string.
    DATA: OK_CODE TYPE SY-UCOMM,
          save_ok like ok_code.
    call screen '100'.
    INCLUDE ZCA_CALCULATOR_DEMO_STATUS_O03.
    ***INCLUDE ZCA_CALCULATOR_DEMO_STATUS_O03 .
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'GUI100'.
      SET TITLEBAR 'ZCHAR'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    INCLUDE ZCA_CALCULATOR_DEMO_USER_COI01.
    ***INCLUDE ZCA_CALCULATOR_DEMO_USER_COI01 .
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    save_ok = ok_code.
    clear ok_code.
    CASE save_ok.
        WHEN 'one'.
          num = '1'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
        WHEN 'two'.
          num = '2'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
        WHEN 'three'.
          num = '3'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
    WHEN 'FOUR'.
          num = '4'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
    WHEN 'FIVE'.
          num = '5'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
    WHEN 'SIX'.
          num = '6'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
    WHEN 'SEVEN'.
          num = '7'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
    WHEN 'EIGHT'.
          num = '8'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
    WHEN 'NINE'.
          num = '9'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
    WHEN 'ZERO'.
          num = '0'.
          CALL FUNCTION 'ZCA_CAL_INPUT'
            EXPORTING
              NUM    = num
            IMPORTING
              NUMBER = inputi.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    function zca_cal_input.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(NUM) TYPE  STRING
    *"  EXPORTING
    *"     REFERENCE(NUMBER) TYPE  STRING
    data: nextnum type string,
          currnum type string.
    loop at screen.
    if screen-name = 'inputi'.
    nextnum = num.
    concatenate currnum nextnum into currnum.
    number = currnum.
    endif.
    endloop.
    endfunction.
    this is my entire program code. 
    now I have mention OK_code type ok in screen painter attribute also.
    but still haveing sample problem .......
    can you pls some one will explain what need to be done in this case.
    Regards,
    Chandra V

  • The "always allow" button is grayed out in settings regarding cookies, and I can not find where to change the setting.  (Restrictions are not on.)

    The "always allow" button is grayed out in settings regarding cookies, and I can not find where to change the setting.  (Restrictions are not on.)  Do you know where I go to change the setting to allow me to "always allow" cookies?

    Hi lisaarnett111,
    If you are having issues turning on Always Allow for cookies in Safari on your iPad, you may want to check to make sure that you don't have Private Browsing enabled, as noted in the following article:
    Turn Private Browsing on or off on your iPhone, iPad, or iPod touch - Apple Support
    Regards,
    - Brenden

  • Question regarding selectOneMenu and PROCESS_VALIDATIONS(3) phase

    Hi im a bit lost regarding selectOneMenu and how validation phase all works together.
    The thing is that i have a simple selectOneMenu
    <h:form id="SearchForm">                                                  
         <h:panelGrid columns="3"  border="0">
              <h:outputLabel id="caseTypeText" value="#{msg.searchCaseCaseType}" for="caseType" />                         
              <h:selectOneMenu id="caseType" value="#{searchCaseBean.caseType}" style="width: 200px;" binding="#{searchCaseBean.caseTypeSelect}">     
                   <f:selectItem itemValue="" itemLabel="#{msg.CommonTextAll}" />                                             
                   <f:selectItems value="#{searchCaseBean.caseTypes}"  />                              
              </h:selectOneMenu>
              <h:message for="caseType" styleClass="errorMessage" />
              <h:panelGroup />
              <h:panelGroup />
              <h:commandButton action="#{searchCaseBean.actionSearch}" value="#{msg.buttonSearch}" />
         </h:panelGrid>
    </h:form>Now when i hit submit button i can see that the bean method searchCaseBean.caseTypes (used in the <f:selectItems> tag) is executed in the PROCESS_VALIDATIONS(3) phase. How come? I dont whant this method to be executed in phase 3, only in phase 6.
    If i add the this in the method if (FacesContext.getCurrentInstance().getRenderResponse())
    public List<SelectItem> getStepStatuses(){
         List<CaseStep> caseSteps = new ArrayList<CaseStep>();
         if (FacesContext.getCurrentInstance().getRenderResponse()) {
              caseSteps = getCaseService().getCaseStep(value);     
         List<SelectItem> selectItems = new ArrayList<SelectItem>(caseSteps.size());
         for(int i=0; i < caseSteps.size(); i++){
              CaseStep step = caseSteps.get(i);               
              String stepStatus = step.getStatus() + "_" + step.getSubStatus();           
              selectItems.add(new SelectItem(stepStatus, step.getShortName()));
         return selectItems;
    } Now i get a validation error (javax.faces.component.UISelectOne.INVALID) for the select field and only phase1, phase2, phase 3 and phase 6 is executed.
    Im lost?

    I see. Many thanxs BalusC. Im using your blog very often, and its very helpfull for me.
    I changed now to use the constructor load method instead. But know im getting problem of calling my service layer (Spring service bean). Its seems they havent been init when jsf bean is calling its constructor.
    Can i init the spring service bean from the faces-config file?
    JSF Bean
        public SearchCaseBean() {
              super();
                    //caseService need to be init
              if(getCaseService() == null){
                   setCaseService((CaseService)getWebApplicationContextBean("caseService"));
              fillCaseTypeSelectItems();
              fillCaseStatusSelectItems();
    .....faces-config
    <managed-bean>
              <managed-bean-name>searchCaseBean</managed-bean-name>
              <managed-bean-class>portal.web.SearchCaseBean</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>          
              <managed-property>
                   <property-name>caseService</property-name>
                   <value>#{caseService}</value>
              </managed-property>
         </managed-bean>

  • Question regarding roaming and data usage

    I am currently out of my main country of service, and as such I have a question regarding roaming and data usage.
    I am told that the airplane mode is sufficient from keeping the phone off from roaming, but does this apply to any background data usage for applications and such?
    If the phone is in airplane mode, are all use of the phone including wifi and application use through the wifi outside of all extra charges from roaming?

    Ann154 wrote:
    If you are getting charged to use the wifi, then it is possible.  Otherwise no
    Just to elaborate here, Ann154 is referring to access charges for wifi, which is nothing to do with Verizon, so if you are using it in a plane, hotel, an internet cafe etc that charges for Wifi rather than being free .   Verizon does not charge you (or indeed know about!) wifi usage, or any other usage that is not on their cellular network (such as using a foreign SIM for example in global phones)  So these charges, if any, will not show up on the verizon bill app.  Having it in airplane mode prevents all cellular data traffic so you should be fine

  • Question regarding MM and FI integration

    Hi Experts
    I have a question regarding MM and FI integration
    Is the transaction Key in OMJJ is same as OBYC transaction key?
    If yes, then why canu2019t I see transaction Key BSX in Movement type 101?
    Thanks

    No, they are not the same.  The movement type transaction (OMJJ) links the account key and account modifier to a specific movement types.  Transaction code (OBYC) contains the account assignments for all material document postings, whether they are movement type dependent or not.  Account key BSX is not movement type dependent.  Instead, BSX is dependent on the valuation class of the material, so it won't show in OMJJ.
    thanks,

  • **question regarding 3G and wif**.

    I have a question regarding 3G and wifi. I have #G activated as well as wifi, when I go to retrieve mail for example I get a pop up asking me if I want to connect to a wifi network…should I have wifi and 3G activated at the same time, and why am I getting the pop up…
    Thanks

    You can have them on at the same time, but they will not be used at the same time for data. The order of preference for data is WiFi > 3G > EDGE > GPRS. You're getting the pop up, most likely, because you have Settings > Wi-Fi > Ask to Join Networks set to ON. You can set that to OFF, and the iPhone will still join known (i.e. previously used) WiFi networks automatically.

  • Question regarding Dashboard and column prompt

    My question regarding Dashboard and column prompt:
    1) Dashboard prompt usually work with only for columns which are in subject area. In my report I've created some of the columns which are based on other columns. Like I've daysNumber column that is based on two other columns, as it calculates the difference of two dates. When I create dashboard prompt I can't find this column there. I need to make a prompt on this column.
    2)For one of the column I've only two values 1 and 0. When I create prompt for this column, is it possible that in drop down list It shows 'Yes' for 1 and 'No' for 0 and still filter the request??

    Hi Toony,...
    I think there was another way of doing this...
    In the dashboard prompt go to Show option > select SQL Results from dropdown.
    There you need to write your Logical SQL like...
    SELECT CASE WHEN 1=0 THEN PERIODS.YEAR ELSE difference of date functionality END FROM SubjectAreaName
    Here.. Periods.Year is the column which is already exists in repository's presentation layer..
    and difference of date functionality is the code or formula of column which you want to show in drop-down...
    Also write the CASE WHEN 1=0 THEN PERIODS.YEAR ELSE difference of date functionality END code in fx of that prompt.
    I think it helps you in doing this..
    Just check and inform me if it works...
    Thanks & Regards
    Kishore Guggilla
    Edited by: Kishore Guggilla on Oct 31, 2008 9:35 AM

  • Few questions regarding Training and event management

    Dear All,
    Can you please help me with the following queries regarding Training and Event Management:
    1. How to freeze a completed business event so that no changes to its record (like delete/update attendee details or event detail) is possible?
    2. How to get feedback from attendee/faculty with a predefined format with rating (1-4 scale)
    3. How to maintain department and category wise training man/hrs or training man/days?
    Any help will be appreciated.
    Regards,
    Toa

    Hi Toa,
    1. Run report RHHISTO0 via SA38. Once the business event is flagged as "historical" no further changes can be done.
    3. SM30 - T77S0 - Make the following swtiches active:
    SEMIN AINST
    SEMIN APART
    Then when events are followed up, these training data is recorded to employee 2002 infotype. You can report on it via PT90 (for department-based selection use "Further selections")
    Regards,
    Dilek

  • I am having a dought regarding import and export.

    I am having a dought regarding import and export.
    I am having one table called login_table where 40k rows are present and in production server. Now i want to take a export dump of login_table and want to import it into a table called table_login which has zero rows but having same table structure and it is present in another database. Please reply soon.

    Please reply soonWhy?
    This is a forum of volunteers, so no one is under any obligation to you. Please stop to be demanding and consequently insulting.
    Also what doubt do you have? It wouldn't work? This begs the question why you just didn't try? No one ever died from working.
    Sybrand Bakker
    Senior Oracle DBA

  • Web dynpro documents regarding dynpro and Portal

    Hi,
    I am new in web dynpro so i need some documents regarding dynpro and portal. So please provide it and if possible send it my personal mail [email protected]
    I am also looking for some examples applications .If any budy have links of it provide it.
    Regards,
    gurprit

    Hi Gurprit,
    I have sent Complete Webdynpro Examples to your mail.
    And also please check the following links for more clear understanding
    Programming UI and Navigation
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9214b1e5-0601-0010-fdb0-ec32d43b06e0
    Webdynpro for Java
    http://help.sap.com/saphelp_nw2004s/helpdata/en/15/0d4f21c17c8044af4868130e9fea07/frameset.htm
    Webdynpro Samples
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/web%20dynpro%20sample%20applications%20and%20tutorials.htm
    Web Dynpro User Interface
    https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/webcontent/uuid/ce44a14c-0a01-0010-af89-d7dbd944f176 [original link is broken]
    PDf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/library/nw/netweaverdevelopersguide2004s/sap%20netweaver%20developer's%20Guide%202004s/UsingJava_00_PDFsList.ca
    SAP Netweaver Application Server eLearning Catalog
    https://www.sdn.sap.com/irj/sdn/elearn?rid=/webcontent/uuid/b1203f5e-0501-0010-bb88-915402c954f2 [original link is broken]
    give rewards if useful.
    regards
    Anil

  • Need help Regarding Payroll and OM

    Hi All,
    Can any one of you provide me a configuration documents regarding Payroll and OM ..I need it very badly.Can any of you help me out in this.You can mail to my id
    [email protected].
    Thanks in advance,
    Sandeep

    hi friends
    can u anybody have Payroll(PCR) DOC , please help me andn  send to my mail ID. [email protected]
    Thanks in advance
    Regards,
    Ramesh.n

Maybe you are looking for