Okcode

how many okcode u can create in modulepool and how to clear okcode?

Hi
In case of dialog programs , each screen has an okcode field associated with it.
okcode captures the user command on PAI .
plz take a look at the code below for further clarification :
Data :  ok_code type sy-ucomm.
" in the PAI module MODULE_USER_COMMAND for screen XXX
module module_user_command .
   ok_code = sy-ucomm.
   CASE ok_code.
   WHEN ' ' .
         " write the code for the operation to b performed
   WHEN ' ' .
         " write code 2 for another command
  ENDCASE.
endmodule.
use CLEAR ok_code to clear the value  of ok_code.
One screen in a module pool program can have a maximum of 1 okcode.
In the same lines , a module pool program can have as many okcode as the number of screens in it.
i hope it helps u..in case of further queries plz revert.
Regards
Pankaj

Similar Messages

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

  • How to find out all the OKCODEs for a particular screen?

    I am working on t-code CL20N and trying to record with t-code SHDB, in the second screen when I press enter it is coming out, but when I run CL20N without SHDB it is going through all the screens perfectly, SHDB is not working for CL20N.
    Is there any other way to find out all the OKCODEs for a particular screen/s?

    Hi,
    First look for any push button or menu item which can take you to the second screen instead of hitting enter directly in tcode CL20N . If any such button exist in the TCode, u can use the same button in SHDB also for moving to the  second screen.
    Thanks,
    Rajinikanth G

  • Bdc for reverse settlement using VA88 okcode 'stor ' not working

    Hi ,
      I have done recording of the VA88 transaction to write a program for reverse settlement of some sales orders for particular controlling area and Co business transaction.i am using call transaction method,the issue i am facing is when i execute , reversing is not happening , when i checked with mode A in call transaction i can see the values are populated in the VA88 screen and the bdc_okcode '=STOR' which is meant for reverse  is coming , but when i click it nothing is happening.
    any idea what is wrong here. is it because the okcode is not working as desired?..what will be a solution.
    thanks & regards.
    Ras.

    I think the problem in recording..can you please do the recording again and cross check your BDCDATA internal table with the recorded one
    Nabheet

  • How to get rid of OKCODE Box on WebSAPConsole

    The RF devices we are using are SYMBOL MC9090. We are running WebSAPConsole and there are two problems that are killing us right now:
    1- We can't seem to program the ENTER key (to affect navigation) into the RF devices. We want the bar code scan to have a suffix with an ENTER key to navigate to the next field. This doesn't appear to be working.  Anyone have this working that can tell us how they did it?
    2- We want to get rid of the OKCODE box which is now displayed at the bottom of all our screens. I noticed that others have examples of their screens without this box displayed so I assume it can be turned off....
    I realize I may have used the wrong terms and these problems may have already been addressed. Anyone that can point me in the right direction?

    We need to get rid of the OKCODE Box on the bottom of the screens. My programs are standard SAP screens and I have tried modal dialog screens with the STARTING AT and ENDING AT commands. All behave the same way.
    I have no OKCODE on these screens and none is present when we run in the standard GUI. However, the OKCODE is present when we run on the handhelds.
    The handhelds are MC9090 (Symbol) running Windows Mobile, we are running WebSAPConsole and we just want to get rid of the OKCODE Box on the bottom of the screens.
    The SAP standard RF transactions behave the same way as the custom transactions. Can we just get rid of the OKCODE box on the bottom of the screens?
    Thansk again for the help.... this is killing us right now....
    Steve

  • Hide bdc okcode popup screen in tthe processing

    HI all,
    I am calling the bdc call transaction from report.At that time bdc okcode come along with popup screen.How i have to hide popup screen.but the bdcokcode fiel;d should be passed to commnad field.Then only the next screen will be coming.
    My requirement is all screen mode,because after running the report ,depends on the selected entry i am going to show the some sap inherent screen to user.its working fine.but i dont need the popup screen,the bdc ok code available in popup screen as well as command field .I need only in command field only.i have seen command field technical properties.But it shows no tables and data elements.
    thanx,
    raja

    Hi Raja,
    This should help you
    CALL TRANSACTION <tcode>
                           USING  <bdc_data_table>
                           MODE   <A/E/N>
                           UPDATE <S/A/L>
                           MESSAGES INTO <message_table>.
       MODE -> mode of transaction
               A - interactive
               E - Screen only on Error
               N - Background
       UPDATE -> udate for transaction
                 S - Synchronous
                 A - Asynchronous
                 L - Local
    Regards,
    Reema.

  • HELP ME IN OKCODE

    HI ALL,
             HOW TO FIND OKCODE FOR A PARTICULAR BUTTONS IN THE MENUBAR,APP TOOL BAR AND STANDARD TOOL BAR?
    WITH WARM REGARDS,
    KHADAR.

    Hi,
    you can find in a Simple ways,
    1) Just enter /H(Debugging) in the Command bar and press the button, then it will goes to debugging mode, see the Sy-UCOMM there, you will fidn the Ok Code
    2) Goto SE51 and enter the program name and the Screen No and see the Attributes of that button, there you will fidn the OK_Code
    3) In Scrren press that button and hold it and press F1.
    Regards
    Sudheer

  • Pass Okcode through URL in ITSmobile service

    Hi all ,
    we have  2 itsmobile services  serA and serB
    SerA calls serB using redirect URL (in  specified path below) at some action.
    SICF->service ->errorpage->LOGOFFpage-> RedirectURL.
    SerB have a transaction code which holds a screen and a pushbutton in the screen.
    While calling serB i want to press the push button , by passing the okcode with the URL.
    I tried by passing ( http://splhrd398.com:8035/sap/bc/gui/sap/its/zserB?sap-client=100&~okcode=enter)
    it doesn't work .
    Please throw some lights.

    You have a plain HTML page that loads with a url with something like ?field=value
    And you want "value" to show on your page, correct?
    <html>
    <body>
    <script>
    var qsParm = new Array();
    function qs() {
    var query = window.location.search.substring(1);
    var parms = query.split('&');
    for (var i=0; i<parms.length; i++) {
       var pos = parms<i>.indexOf('=');
       if (pos > 0) {
          var key = parms<i>.substring(0,pos);
          var val = parms<i>.substring(pos+1);
          qsParm[key] = val;
    qsParm['field'] = null;
    qs();
    if (qsParm['field'])
         document.write('You selected ' + qsParm['field'] );
    </script> 
    </body>
    </html>
    Call that as test.html?field=Hello
    Here's a nice link that explains it in detail: http://www.eggheadcafe.com/articles/20020107.asp

  • ITS & Transaction Input Field (OKCODE)

    Hello,
    We just configured the internal ITS on a Netweaver 2004s SP13 Solution Manager SR3, but we can't see the transaction input field on webgui when accesing the system using the web client.
    We have been looking around, and it seems that it should be displayed by default, but in our case it's not.
    Any ideas?
    Thanks in advance,
    jmiturbe

    Hello Jmiturbe,
    The okcode field is sometimes collapsed (hidden).  There should be a right arrow button, if you click on this then the okcode field should expand.
    Edgar

  • Please tell the okcode for hotspot double click if exists ?

    Please tell the okcode for hotspot double click if exists in alv grid display

    Hi,
    ok code is &IC1

  • Wat is fcode and okcodes?

    wat is fcode and okcodes?

    Hi Chaitra,
    FCODE : Function Code
    This is mainly used in dialog program.
    You go to SE51-Screen Painter.
    Say you create a button and give a Fcode (eg. 'HOME '-you can give anything) for that button....
    In your  PAI (Process after input) when that button is clicked some operation is to be performed....
    So this Fcode captures the event(mouse click) and the required operation can be performed.............
    Take a look at the syntax in PAI (0501 is the screen number)......
    module user_command_0501 input.
    case ok_code.
      when 'HOME'.
        DO THE REQUIRED OPERATION.........
    endcase.
    endmodule.
      ok_code is the sy-ucomm value
    (to capture the user command)
    syntax:
    data: ok_code like sy-ucomm             
    Hope I have answered your question!!!!
    Please reward points if answered.
    thanks and regards,
    Vinod Samuel.

  • Okcode pass while calling the ITS .

    Hi Friends,
    I am calling one ITS url from my webdynpro application. I am able to pass the parameter to the ITS screen but i want to pass the okcode also i did it but its not working .
    Basically what i want to skip the first screen by passing the input value and ok code .But i dont know why the okcode is not working . Below is the URL where i have pass the parameter and ok code . I have declared the ok code on the screen.
    Please suggest if i missed some thing .
    Thanks,
    Satya

    Hello Satya,
    Please have a look at [this Wiki|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=22375]. It might help.
    I hope this helps.
    Best regards,
    Cristiano

  • Pass okcode through URL

    Hi all ,
    we have  2 itsmobile services  serA and serB
    SerA calls serB using redirect URL (in  specified path below) at some action.
    SICF->service ->errorpage->LOGOFFpage-> RedirectURL.
    SerB have a transaction code which holds a screen and a pushbutton in the screen.
    While calling serB i want to press the push button , by passing the okcode with the URL.
    I tried by passing ( http://splhrd398.com:8035/sap/bc/gui/sap/its/zserB?sap-client=100&~okcode=enter)
    it doesn't work .
    Please throw some lights.

    You have a plain HTML page that loads with a url with something like ?field=value
    And you want "value" to show on your page, correct?
    <html>
    <body>
    <script>
    var qsParm = new Array();
    function qs() {
    var query = window.location.search.substring(1);
    var parms = query.split('&');
    for (var i=0; i<parms.length; i++) {
       var pos = parms<i>.indexOf('=');
       if (pos > 0) {
          var key = parms<i>.substring(0,pos);
          var val = parms<i>.substring(pos+1);
          qsParm[key] = val;
    qsParm['field'] = null;
    qs();
    if (qsParm['field'])
         document.write('You selected ' + qsParm['field'] );
    </script> 
    </body>
    </html>
    Call that as test.html?field=Hello
    Here's a nice link that explains it in detail: http://www.eggheadcafe.com/articles/20020107.asp

  • Bdc okcode for save

    Hello experts. please tell me the bdc okcode for save. what actually the bdc okcode yes means? ie
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.

    Hi Shiva,
    It depends on the transactions. But generally for save it is '=SAVE'.
    Regards,
    Atish

  • BDC OKCODE LIST

    Hai all,
    I need BDC OKCODE Value List.
    For example:
    OKCODE Value for NEW ENTRIES in table fields.
    PERFORM bdc_field       USING 'BDC_OKCODE' '=NPE'.
    Please give me the list of BDC OKCODE Value and function of like '=NPE'.
    Regards
    Naga

    Thanks, Andreas.
    Your reply is really helpful.
    But I still have a question:
    When coding using BDC OKCODE, some of those function codes require a "=" sign prefix, while others requires the '/' sign.
    Let's take a look at PA30, for example:
    PERFORM bdc_field USING 'BDC_OKCODE'  '=INS'. " for Create
    PERFORM bdc_field USING 'BDC_OKCODE'  '/E'.   " for Cancel
    I don't see this info in the Menu Painter (trans. SE41).
    How can I know, without recording using SHDB, what is the required prefix for each function code?
    Thanks,
    Isaac

Maybe you are looking for