Doubt in keyPressed() function!

Hi to all,
Im doing project in J2ME. In my source code, i used keyPressed() function to get the user's choice by using switch case.Now my doubt is, should i use one more keyPressed() function in inside my previous keyPressed() func.(i.e. nested keypressed() func)?.. For eg: In my application, there will be four choices.. 1.Cars 2. Bikes 3.Mobiles 4.exit...If an user press the key '3' means, i need to giv him one more choice screen like 1.Nokia 2.Sony ericsson 3.Motorola.. If an user press '2' means, have to display the info about sony ericsson...Right now im using code like the following:
public void keyPressed(int key)
switch(key)
case KEY_NUM1:
break;
case KEY_NUM2:
break;
case KEY_NUM3:
break;
case KEY_NUM4:
break;
Now my doubt is....Should i use like the following:
public void keyPressed(int key)
switch(key)
case KEY_NUM1:
break;
case KEY_NUM2:
break;
case KEY_NUM3:
public void keyPressed(int key)
switch(key)
case KEY_NUM1:
break;
case KEY_NUM2:
break;
case KEY_NUM3:
break;
case KEY_NUM4:
break;
break;
case KEY_NUM4:
break;
}

My doubt is how to write code to insert data to table. I have written code like this.
try{
         String str1= wdContext.currentTestElement().getCode();
          String str2= wdContext.currentTestElement().getDesc();
          boolean str3= wdContext.currentTestElement().getAct();
          String str4= wdContext.currentTestElement().getOpt();
          String str5;
          if(str3)
          str5=new String("x");
          else
          str5=new String(" ");
          Zup_Desig12_Input input=new Zup_Desig12_Input();
          input.setDesg_Code(str1);
          input.setDesg_Desc(str2);
          input.setDesg_Act(str5);
          input.setDesg_Opt(str4);
          wdContext.nodeZup_Desig12_Input().bind(input);
          wdContext.currentZup_Desig12_InputElement().modelObject().execute();
    }catch(Exception e)
         wdComponentAPI.getMessageManager().reportSuccess(e.toString());
But i am getting      java.lang.ArrayIndexOutOfBoundsException: -1
in line
input.setDesg_Act(str5);
can any one help me plz

Similar Messages

  • Doubt in ABAP function

    Hi,
    I have a doubt in one of the abap function module i use.
    This contain code to retrieve ,update and delete and create values in table. I am using this function  module to
    retrieve ,update and delete and create values in table.  This is the ABAP code.
    FUNCTION ZUP_DESIG12.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(DESG_CODE) TYPE  ZUP_DESIG-DESG_CODE OPTIONAL
    *"     VALUE(DESG_DESC) TYPE  ZUP_DESIG-DESG_DESC OPTIONAL
    *"     VALUE(DESG_ACT) TYPE  ZUP_DESIG-DESG_ACT OPTIONAL
    *"     VALUE(DESG_OPT) TYPE  ZUP_DESIG-DESG_OPT OPTIONAL
    *"  EXPORTING
    *"     VALUE(DESG_CODE_C) TYPE  ZUP_DESIG-DESG_CODE
    *"     VALUE(DESG_DESC_C) TYPE  ZUP_DESIG-DESG_DESC
    *"     VALUE(DESG_ACT_C) TYPE  ZUP_DESIG-DESG_ACT
    *"     VALUE(DESG_OPT_C) TYPE  ZUP_DESIG-DESG_OPT
    *"  TABLES
    *"      WA STRUCTURE  ZMSTR_DESIG
    DATA CNT TYPE I.
    SELECT MANDT DESG_CODE DESG_DESC DESG_ACT FROM ZMSTR_DESIG
      INTO TABLE WA.
    IF DESG_OPT = 'U'.
    UPDATE ZMSTR_DESIG
        SET DESG_DESC = DESG_DESC
        DESG_ACT = DESG_ACT
        WHERE DESG_CODE = DESG_CODE.
    MESSAGE 'Updated Successfully' TYPE 'I'.
    ELSEIF DESG_OPT = 'C'.
    SELECT COUNT( * ) FROM ZMSTR_DESIG INTO CNT
       WHERE DESG_CODE = DESG_CODE.
       IF CNT > 0.
       MESSAGE 'Duplicate Designation code' TYPE 'I'.
       ELSE.
      WA-DESG_CODE = DESG_CODE.
      WA-DESG_DESC = DESG_DESC.
      WA-DESG_ACT = DESG_ACT.
      MODIFY ZMSTR_DESIG FROM WA.
       MESSAGE 'Inserted successfully' TYPE 'I'.
    ENDIF.
    ELSEIF DESG_OPT = 'D'.
       DELETE FROM ZMSTR_DESIG WHERE DESG_CODE = DESG_CODE.
       MESSAGE 'Deleted successfully' TYPE 'I'.
    ENDIF.
    ENDFUNCTION.
    can any one what is  wrong in this function.
    Regards,
    H.V.Swathi

    My doubt is how to write code to insert data to table. I have written code like this.
    try{
             String str1= wdContext.currentTestElement().getCode();
              String str2= wdContext.currentTestElement().getDesc();
              boolean str3= wdContext.currentTestElement().getAct();
              String str4= wdContext.currentTestElement().getOpt();
              String str5;
              if(str3)
              str5=new String("x");
              else
              str5=new String(" ");
              Zup_Desig12_Input input=new Zup_Desig12_Input();
              input.setDesg_Code(str1);
              input.setDesg_Desc(str2);
              input.setDesg_Act(str5);
              input.setDesg_Opt(str4);
              wdContext.nodeZup_Desig12_Input().bind(input);
              wdContext.currentZup_Desig12_InputElement().modelObject().execute();
        }catch(Exception e)
             wdComponentAPI.getMessageManager().reportSuccess(e.toString());
    But i am getting      java.lang.ArrayIndexOutOfBoundsException: -1
    in line
    input.setDesg_Act(str5);
    can any one help me plz

  • Doubt in using :Function Module : MS_CONVERT_TO_OTHER_CURRENCY

    Hi ,.
    In the Function Module :MS_CONVERT_TO_OTHER_CURRENCY.
    I have to export following parametes:
    DATE            
    FROM_CURRENCY   
    FROM_AMOUNT     
    TO_CURRENCY     
    COMPANY_CURRENCY
    RATE  (optional)    .
    Here my doubt is :what is the purpose of COMPANY_CURRENCY .What value i have to populate here , how i have to find the  company currency?
    I think we have to find this COMPANY_CURRENCY  based on the sales organization.
    Please update me regarding this COMPANY_CURRENCY .
    Thanks,
    Suresh.

    Have you tried using 'CONVERT_TO_FOREIGN_CURRENCY' instead?
    DATA: v_amount TYPE p DECIMALS 2.
    CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
    EXPORTING
    date = sy-datum
    foreign_currency = 'INR'
    local_amount = '1.00'
    local_currency = 'USD'
    IMPORTING
    foreign_amount = v_amount
    EXCEPTIONS
    no_rate_found = 1
    overflow = 2
    no_factors_found = 3
    no_spread_found = 4
    derived_2_times = 5
    OTHERS = 6.
    IF sy-subrc = 0.
    WRITE: / 'US dollar to Indian rupees - ', v_amount.
    ENDIF.

  • Doubt in Analytical Functions

    Hi,
    I am new to oracle , i have a doubt : I have written a query using analytical functions to get the desired , but i wanted the same in a normal query .
    INPUT TABLE :
    NAME AMOUNT
    A 100
    A 200
    A 300
    B 200
    B 300
    C 300
    Query : SELECT name,AMOUNT,ROW_NUMBER( ) OVER (PARTITION BY name order by name NULLS LAST) SRLNO
    FROM data ORDER BY name, SRLNO;
    output table:
    NAME AMOUNT SRLNO
    A 100 1
    A 200 2
    A 300 3
    B 200 1
    B 300 2
    C 300 1
    QUESTION: I wanted the same output table with normal SQL quey , but i don't want to use any partition statement here (nor any analytical functions) .
    Please provide solution for this .

    i don't want to use any partition statement here (nor any analytical functions) .Why not? What you want to do is what analytics does. I get suspicious when anybody - but especially somebody who's new to Oracle - aks how to do something different from using the built-ins provided by Oracle.
    I wanted the same output table with normal SQL queySo you're ruling out Pipelined functions and MODEL clauses? Or not?
    Cheers, APC
    blog : http://radiofreetooting.blogspot.com

  • Doubt in enqueue_array functionality

    Hi,
    I am using enqueue_array function to insert multiple rows in the queue. Payload type is user defined object (obj) containing one attribute: JMS Message. If I create a type (tbl) which is table of obj at the schema level then enqueue_array works perfectly and inserts all the rows into the queue.
    But If I don't declare a type at the schema level and instead declare it in the pl/sql block, then enque_array function doesn't work. I don't get any error but no row gets inserted in the queue.
    My doubt is why no row is getting inserted in the 2nd case? Does Oracle treats the 2 types in different ways? Please clarify. Thank you.

    Hi,
    I am using enqueue_array function to insert multiple rows in the queue. Payload type is user defined object (obj) containing one attribute: JMS Message. If I create a type (tbl) which is table of obj at the schema level then enqueue_array works perfectly and inserts all the rows into the queue.
    But If I don't declare a type at the schema level and instead declare it in the pl/sql block, then enque_array function doesn't work. I don't get any error but no row gets inserted in the queue.
    My doubt is why no row is getting inserted in the 2nd case? Does Oracle treats the 2 types in different ways? Please clarify. Thank you.

  • Canvas - controlling object with js keypress function

    Hi,
    Using Flash CC and a HTML5 Canvas I am trying to control a ball (instance name ball_mc) on stage with the arrow keys using JS. Tried a few variations, but no luck. Any suggestions?
    ty
    this.addEventListener("keypress", keyDownHandler.bind(this), true);
    function keyDownHandler(event) {
              // get which key the user pressed
              var key = event.which;
              switch (key) {
                             case 37: // left key
                                            // move the ball 1 left by subtracting 1 from ballX
                 this.ball_mc.x -= 1;
                 break;
                             case 39: // right key
                     // move the ball 1 right by adding 1 to ballX
                     this.ball_mc.x += 1;
                      break;

    Hi,
    You can try the following code .This will help you acheive the desired movement on key down .
    document.onkeydown = keyHandler.bind(this);
    function keyHandler(event) {
                var e = event||window.event;
               switch (e.keyCode) {
                             case 37: this.ball_mc.x-= 1;
                                                 break;
                             case 39: this.ball_mc.x += 1;
                                                 break;
    Thanks,
    Sangeeta      

  • Doubt in GUI_UPLOAD function

    Hi friends,
    CALL FUNCTION 'GUI_UPLOAD '
    EXPORTING
    FILENAME = FILE
    FILETYPE = 'ASC'
    *HAS_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = ITAB.
    In the GUI_UPLOAD function what the filetype should be and has_field_separator should be given what value? What does it mean.How should i prepare the file for example for VA01 transaction if i have a file like this it is not working. What is the problem. I am new to BDC so i need your help on this.
    Thanks in Advance.

    try the following.
    DATA: begin of ITAB occurs 0,
          field1 type char10,
          field2 type char10,
          end of itab.
    data: filename type string value 'C:\TMP.TXT'.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      = filename
       FILETYPE                      = 'ASC'
      TABLES
        DATA_TAB                      = itab.
    loop at itab.
      write:/ itab-field1, 20 itab-field2.
    endloop.
    create a file with tab-delimitations.

  • Doubt in update function module

    dear friends..
    i have created an UPDATE function module with Processing type- Update Module, Start Immediate. i have handled the exceptions using Raise statement in the function module..
    the call function looks as..
      CALL FUNCTION 'ZFI_LCTXN_TABLES_UPDATE'
        in update task
        EXPORTING
          ZLCTMB1  = p_lctmb1
          NU_ENTRY = p_global-ins_zlctmb1
        TABLES
          UPD_PO   = UPD_PO
          UPD_SH   = UPD_SH
        EXCEPTIONS
          ERROR    = 1
          OTHERS   = 2.
      p_subrc = sy-subrc.
      commit work.
    but if the update fails, and even though the RAISE ERROR works, and update termination message is registered in SM13, i dont get the value for sy-subrc as 1 .
    is it the right way..if yes please tell me how to generate an error message within the transaction..so that the user knows the update has failed..
    thank you for your time
    Nivin

    Hi,
    Maybe it's usefull  for you.
    <b>
      IF sy-subrc EQ 4.
        MESSAGE e001 RAISING not_found.
      ELSEIF sy-subrc EQ 8.
        MESSAGE e002 RAISING not_found.
      ELSE.
      ENDIF.</b>
    Using this to create a message and raise in the same time !
    Regards.
    Marcelo Ramos

  • Doubt in RFC Function module

    Hi,
    I am creating one RFC in that i need to declare one import parameter whose length is is.
    when i am giving like i_exclide like kna1-loevm is not accepting.
    when i am declaring like i_exclude like char1.
    it is giving error like reference parameters are not allowed in RFC.
    anybody can tell me how to declare.
    thanks,
    maheedhar

    Hi,
    Go to se37,
    Give ur RFC function module and click change.
    Go to "Import" tab , you can find a checkbox "Pass Value" , check this checkbox.
    Now you try to compile the code , you wont get that error.
    Reward points for useful answer.
    Thanks,
    Jey

  • Doubt in Read_text function

    Hi all
    I have created one support message in crmd_order solution manager. In that i have entered Description (Su99). I can see the description in SUZZ LOG. but i can read the text using function module READ_TEXT
    How can i access.
    Parameters
    CLIENT 900
    ID SUZZ
    LANGUAGE EN
    NAME 469D18B8C04721CFE10000000A210107
    OBJECT CRM_ORDERH
    ARCHIVE_HANDLE 0
    LOCAL_CAT
    Export parameters Value
    HEADER
    Tables Value
    LINES 0 Entries
    Result: 0 Entries
    anybody help me

    Hi Muthu,
    check the code,
    DATA: it_lines LIKE TABLE OF tline WITH HEADER LINE.
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    id = 'LTXT'
    language = sy-langu
    name = '000001100184'
    object ='AUFK'
    IMPORTING
    HEADER =
    TABLES
    lines = it_lines
    EXCEPTIONS
    id = 1
    language = 2
    name = 3
    not_found = 4
    object = 5
    reference_check = 6
    wrong_access_to_archive = 7
    OTHERS = 8.
    Thanks.

  • Doubt pertaining Partner Function Role ES..

    Hi,
    What is the significance of the Role ES defined as a Partner Function in a One time customer.
    I am using the default system created Account assignement Group: CPD.
    THNX n Regards,
    Subbzz..

    Hi Raghav,
    While creating a One Time customer Using the Account Group CPD what value should be entered against the PF-ES??
    The system prompts me to enter the PF and doesnt allow me to save without the data.
    Where do we need to create it for assigining here.
    Cheerzz..
    Subbzz.

  • Doubt in Generating Function!!!!!:(

    Hi All,
    It is said that
    "A target field with maxOccurs=<n> that is assigned a generating function is generated <n> times in the target structure. if maxOccurs=unbounded for the target field, then exactly 5 target field are created".
    But if we have done Message Mapping, we could realise that this statement does not hold.
    Could anyone please help me out by explaining what this statement actually means.
    Regards,
    Sundar.

    Hi,
    Are you sure it is said like that?
    Because in help.sap it says
    http://help.sap.com/saphelp_nw04/helpdata/en/e4/82cf0ec8b9494db92e27e2be69524f/frameset.htm
    +If generating functions are assigned to a target field, the attributes minOccurs and maxOccurs determine how frequently a value is generated:
    If minOccurs = 0 the value of the function is generated once.
    · Otherwise, the value of the function is generated as often as is specified by minOccurs.
        ( This applies regardless of the value set in maxOccurs. Even if maxOccurs = “unbounded“, the mapping runtime will still only generate the value as often as is specified by minOccurs.)+
    Regards
    Suraj

  • Doubt in call function

    Hi,
    Call Function 'FM' starting new task task-name
    Exporting
    What does this statement does.

    Hi
    chk this out
    CALL FUNCTION STARTING NEW TASK
    Variant 2
    CALL FUNCTION func ...STARTING NEW TASK task name.
    Extras:
    1. ... DESTINATION dest
    2. ... DESTINATION IN GROUP group name
    3. ... DESTINATION IN GROUP DEFAULT
    4. ... PERFORMING form ON END OF TASK
    5. ... EXPORTING  p1 = f1    ... pn = fn
    6. ... TABLES     p1 = itab1 ... pn = itabn
    7. ... EXCEPTIONS syst_except = rc MESSAGE mess
    Effect
    Starts the function module func asynchronously in a new session. In contrast to normal function module calls, the calling program resumes processing as soon as the function module is started in the target system. It does not wait until the function module has finished. Using CALL SCREEN, the called function module can, for example, display a screen and thus interact with the user. Note that taskname must be a valid string of at least 2 characters, preferably fewer than 8 characters. You cannot use either ' ' or SPACE as tasknames.
    Notes
    Note that under certain circumstances, an RFC may cause a database commit. For this reason, do not insert an RFC between two OpenSQL statements that open and close a database cursor (such as SELECT...ENDSELECT).
    This variant applies only from R/3 Release 3.0, so both the client system and the server system must have Release 3.0 at least.
    With this variant, the called function module must also be flagged in the Function Builder as externally callable, even if it is executed locally (without the addition Destination).
    There can be no function call to the destination 'BACK' in the called function module (for more information about the destination 'BACK', see CALL FUNCTION func DESTINATION dest).
    This variant does not allow you to execute external programs that you access from a TCP/IP-type detination asynchronously. (See the Transaction Tools -> Administration, Administration -> Network -> RFC destinations for maintaining destinations).
    Neither does this variant allow you to display images such as lists or screens in a separate window during RFC communication using a SAProuter.
    From Release 4.0 onwards, you can carry out a new, stricter system load check on RFC destinations. (In RFC destination maintenance of an R/3 connection, choose Destination -> ARFC-Optionen). Before the function module is executed, the system checks that the destination has sufficient resources available. If not, the system delays execution of the function module for a given period of time. The algorithm used to determine the system load on the target machine is the same as that used for an asynchronous RFC with the DESTINATION IN GROUP addition. Note that this option is only available for target systems from Release 3.1H onwards. This procedure is active as default.
    In principle, parallel processing makes sense whenever application servers have the necessary resources. In this case, the application servers must be configured with at least 3 dialog work processes.
    A program that is run in the background and uses RFC parallel processing requires at least 1 dialog work process per application server (because parallel processing takes place in a dialog work process).
    If the instance profile parameter 'auth/rfc_authority_check' is set to 1, the system automatically performs an RFC authorization check. The authorization check refers to the relevant function group for the function module to be called. If no authorization is found, a runtime error occurs. You can check the authorization in advance with the function module AUTHORITY_CHECK_RFC. If the RFC communication takes places in one system and in the same user context (that is, the same client and User ID) the system does not perform an RFC authority check. For more information, see: RFC Authorization Concept.
    When you are using asynchronous RFC to implement parallel windows, all these windows are closed if the caller session is the only session and terminates.
    Note that asynchronous tasks that have been started are not necessarily closed when the calling program ends.
    See also RFC Logons to the Target System (Remote Logon).
    Addition 1
    ... DESTINATION dest
    Effect
    Executes the function module externally as a Remote Function Call (RFC); dest can be a literal or a variable. The R/3 System where the function module is executed depends on the specified destination. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
    Note
    If the destination is not explicitly specified, the system uses the default destination 'NONE'.
    Note
    If, during a Remote Function Call, an error occurs in the target system, details of the error message are passed back to the calling system in the following system fields: SY-MSGNO, SY-MSGID, SY-MSGTY, SY-MSGV1, SY-MSGV2, SY-MSGV3, and SY-MSGV4. These fields are initialized before every RFC. If a short dump or a type X message occurs, the short text of the dump is transferred to the caller, and the contents of SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 assigned by the system.
    In RFC-enabled function modules, no ABAP statements are allowed that would end the RFC connection (for example, either LEAVE or SUBMIT without the AND RETURN addition).
    Note
    Note that a database commit occurs at each Remote Function Call (RFC). Consequently, you cannot use Remote Function Calls between pairs of statements that open and close a database cursor (such as SELECT ... ENDSELECT).
    Addition 2
    ... DESTINATION IN GROUP group name
    Addition 3
    ... DESTINATION IN GROUP DEFAULT
    Effect
    You use this addition to perform parallel execution of function modules (asynchronous calls) on a predefined group of R/3 System application servers.
    You use addition 2 (DESTINATION IN GROUP group name) to perform parallel execution of function modules on a predefined group of application servers. To maintain the RFC groups, choose Tools -> Administration -> Administration ->Network -> RFC destinations -> RFC -> RFC groups. The application programmer is responsible for the availability of RFC groups in the production system. In this case the group name variable must be of the type RZLLITAB-CLASSNAME
    You use addition 3 (DESTINATION IN GROUP DEFAULT) to perform parallel execution of function modules (asynchronous calls) on all currently available R/3 System application servers. However, instead of this variant, you are recommended to use an RFC group with appropriate resources for parallel processing of asynchronous calls (at least for performance reasons). Please note that the addition DESTINATION IN GROUP ' ' has the same effect as the addition DESTINATION IN GROUP DEFAULT.
    When you first call a function module with these additions, the system initializes the specified RFC group (unless the group has already been explicitly identified).
    To obtain current information about resources (that is, the resources available to process function modules), you can also initialize the RFC group explicitly in the program using the function module SPBT_INITIALIZE. You must perform this action before the first function module call.
    In both cases, the system first ascertains the currently available resources (work processes) on the available application servers (either a group of servers or all servers). By checking the current system load of each application server, the system determines how many work processes are available to execute asynchronous calls.
    After ascertaining the available resources, the asynchronous call is executed to one of the
    destinations. If no resources are available at that particular time, the system executes the
    exception routine RESOURCE_FAILURE (see the addition EXCEPTIONS). In the case of
    an asynchronous function module call, this exception must be handled by the application
    program (see example).
    No resources are made available by the system if resource availability limits are exceeded:
    Notes
    To be taken into consideration for RFC parallel processing, an application server must have at least 3 free dialog processes.
    The system triggers the exception RESOURCE_FAILURE only for asynchronous RFCs with the additions DESTINATION IN GROUP group name and DESTINATION IN GROUP DEFAULT.
    At present, only one RFC group per program environment is supported for parallel execution of asynchronous calls. Using both the additions DESTINATION IN GROUP group name and DESTINATION IN GROUP DEFAULT in a program is thus not allowed.
    To find out which destination was automatically selected, call the function module SPBT_GET_PP_DESTINATION immediately after the function module call with the two additions. This returns the selected RFC destination.
    If you want to delete an application server from the list of the configured RFC group at runtime (for example, when the application server is not accessible for technical reasons), use the function module SPBT_DO_NOT_USE_SERVER.
    Addition 4
    ... PERFORMING form ON END OF TASK
    While the parameters for receiving results (that is IMPORTING and TABLES parameters) are specified directly as additions in the case of "conventional" function modules (see variant 2), these are logged in the FORM routine form when making an asynchronous call (see RECEIVE).
    Notes
    If a function module returns no result, and you are not interested in error messages that arise when executing the function module, this addition (... PERFORMING form ON END OF TASK) can be omitted.
    If you want to handle the error messages that arise when executing the asynchronous function module call, you must use this addition. Also, when receiving the results in the FORM routine (see RECEIVE), you must react accordingly to the system exceptions SYSTEM_FAILURE and COMMUNICATION_FAILURE.
    With asynchronous RFC, the task name uniquely identifies the asynchronous connection and thus the context called.
    If several asynchronous function modules are executed consecutively to the same destination, you must assign a different task name to each.
    A calling program that starts an asynchronous RFC with the PERFORMING form ON END OF TASK addition cannot switch roll areas or change to an internal mode. This is because the asynchronous function module call reply cannot be passed on to the relevant program. You can perform a roll area switch with SUBMIT or CALL TRANSACTION.
    If a calling program makes asynchronous calls, finishes, and then expects responses, it cannot receive these responses.
    To wait for the reply to a started asynchronous function module, use the WAIT command with the addition PERFORMING form ON END OF TASK. Here, WAIT must be in the same program context (mode).
    Note that executing asynchronous calls is subject to a roll area change.That is, subroutines performed to receive asynchronous calls can take place while other asynchronous calls are being made. Thus as a developer you must ensure that subroutines can be executed at any time. You must not make assumptions about the implicit processing sequence.
    Addition 5
    ... EXPORTING p1 = f1 ... pn = fn
    Effect
    Passes values of fields and field strings from the calling program to the function module. In the function module, the formal parameters are defined as import parameters.
    Addition 6
    ... TABLES p1 = itab1 ... pn = itabn
    Effect
    Passes references to internal tables.
    Addition 7
    ... EXCEPTIONS syst_except = rc MESSAGE mess
    Effect
    While any exceptions arising in the called function module are handled by the second
    addition (see the FORM subroutine RETURN_INFO), this addition can handle two special
    system exceptions, (as with function module calls with the DESTINATION addition):
    SYSTEM_FAILURE
    is triggered, if a system crash occurs on the receiving side.
    COMMUNICATION_FAILURE
    is triggered if there is a connection or communication problem.
    In both cases, you can get a description of the error with the optional ... MESSAGE messaddition
    Note
    In principle, you should always react to these two system exceptions, whether you are making an asynchronous function module call or receiving results.
    Examples
    Calling a transaction in a seperate session.
    DATA: MSG_TEXT(80) TYPE C. "Message text
    Asynchronous call to Transaction SM59 -->
    Create a new session
    CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'TEST'
      DESTINATION 'NONE'
      EXPORTING
          TCODE = 'SM59'
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
        SYSTEM_FAILURE        = 2 MESSAGE MSG_TEXT.
      IF SY-SUBRC NE 0.
        WRITE: MSG_TEXT.
      ELSE.
        WRITE: 'O.K.'.
      ENDIF.
    Using RFC groups to parallelize function module calls(RFC parallel processing)
    TYPES: BEGIN OF TASKLIST_TYPE,
             TASKNAME(4) TYPE C, "Verwaltung der Tasks
             RFCDEST     LIKE RFCSI-RFCDEST,
          END OF TASKLIST_TYPE.
    DATA: INFO LIKE RFCSI, C,  "Message text
          JOBS TYPE I VALUE 10,  "Number of parallel jobs
          SND_JOBS TYPE I VALUE 1,  "Sent jobs
          RCV_JOBS TYPE I VALUE 1,  "Received replies
          EXCP_FLAG(1) TYPE C,  "Number of RESOURCE_FAILUREs
          TASKNAME(4) TYPE N VALUE '0001',  "Task name administration
          TASKLIST TYPE TABLE OF TASKLIST_TYPE,
          WA_TASKLIST TYPE TASKLIST_TYPE.
    DO.
      CALL FUNCTION 'RFC_SYSTEM_INFO'
           STARTING NEW TASK TASKNAME DESTINATION IN GROUP DEFAULT
           PERFORMING RETURN_INFO ON END OF TASK
           EXCEPTIONS
             COMMUNICATION_FAILURE = 1
             SYSTEM_FAILURE        = 2
             RESOURCE_FAILURE      = 3.
      CASE SY-SUBRC.
        WHEN 0.
    Administration of asynchronous tasks
            WA_TASKLIST-TASKNAME = TASKNAME.
            CLEAR WA_TASKLIST-RFCDEST.
            APPEND WA_TASKLIST TO TASKLIST.
            WRITE: /  'Started Task: ', WA_TASKLIST-TASKNAME COLOR 2.
          TASKNAME = TASKNAME + 1.
          SND_JOBS = SND_JOBS + 1.
          JOBS     = JOBS - 1.  "Number of existing jobs
          IF JOBS = 0.
            EXIT.  "Job processing finished
          ENDIF.
        WHEN 1 OR 2.
    Handling of communication and system failure
        WHEN 3.  "No resources available at present
    Receive reply to asynchronous RFC calls
          IF EXCP_FLAG = SPACE.
             EXCP_FLAG = 'X'.
    First attempt for RESOURCE_FAILURE handling
             WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.01' SECONDS.
          ELSE.
    Second attempt for RESOURCE_FAILURE handling
             WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.1' SECONDS.
          ENDIF.
          IF SY-SUBRC = 0.
            CLEAR EXCP_FLAG.  "Reset flag
          ELSE.  "No replies
            "Endless loop handling
          ENDIF.
        ENDCASE.
    ENDDO.
    Receive remaining asynchronous replies
    WAIT UNTIL RCV_JOBS >= SND_JOBS.
    LOOP AT TASKLIST INTO WA_TASKLIST.
        WRITE:/   'Received Task:', WA_TASKLIST-TASKNAME COLOR 1,
              30  'Destination: ', WA_TASKLIST-RFCDEST COLOR 1.
    ENDLOOP.
    FORM RETURN_INFO USING TASKNAME.
      RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
        IMPORTING RFCSI_EXPORT = INFO
        EXCEPTIONS
          COMMUNICATION_FAILURE = 1
          SYSTEM_FAILURE        = 2.
      RCV_JOBS = RCV_JOBS + 1.  "Receiving data
        IF SY-SUBRC NE 0.
    Handling communication and system failure
       ELSE.
         READ TABLE TASKLIST WITH KEY TASKNAME = TASKNAME
                    INTO WA_TASKLIST.
         IF SY-SUBRC = 0. "Daten registrieren
           WA_TASKLIST-RFCDEST = INFO-RFCDEST.
           MODIFY TASKLIST INDEX SY-TABIX FROM WA_TASKLIST.
         ENDIF.
       ENDIF.
    ENDFORM.
    plz reward if useful

  • Doubt in CALL FUNCTION 'CALCULATE_TAX_ITEM'

    HI All.
    Iam using function module
    CALL FUNCTION 'CALCULATE_TAX_ITEM',but iam gettting sy-subrc = 1.why its happening,i am unable to "Display message" from TCODE:ME9F.Help me to resolve the problem.
    Regards.
    Jay

    HI All.
    Iam using function module
    CALL FUNCTION 'CALCULATE_TAX_ITEM',but iam gettting sy-subrc = 1.why its happening,i am unable to "Display message" from TCODE:ME9F.Help me to resolve the problem.
    Regards.
    Jay

  • Doubt in the function module POPUP_GET_VALUES

    Hi,
    i am using the function module POPUP_GET_VALUES. I am giving the table name and field name but the field name shows in display mode i am not able to enter any values in the given popup. What is the problem

    Hi,
    U can go through the FM documentation:
    Dialog box for the display and request of values, without check
    Preliminary comment
    This function module has been released.
    The documentation is being revised so that it conforms to the requirements for released function modules.
    Function
    This function module sends a dialog box and includes the fields specified in the FIELDS interface table. The fields specified in the FIELDS table must be defined in the ABAP Dictionary.
    If no text is specified for a field, the ABAP Dictionary key word is displayed. The key words and fields can be displayed normally or highlighted. You must also define whether the fields are ready for input or not, and whether they are mandatory or not. Defaults can be defined for the fields.
    After the display, the values entered by the user in the date and time fields are checked for formatting and plausability. Otherwise, the values entered are returned to the user unchecked.
    The function module can be used, for example, to:
    Display information
    Request values which do not need to be checked
    Request values to limit data accesses ( from - to)
    Support prototyping
    Examples
    For examples, see the program RSSPO410.
    Notes
    Conversion exits are handled normally.
    References from CURR and QUAN fields are handled if the reference fields are also specified. The display of the reference fields can be suppressed.
    If a currency field (type CURR) is specified, then the field assigned in the ABAP Dictionary for the currency key (type CUKY) must also be specified. The display of the currency key field can be suppressed (if filled initially).
    Dates are checked according to the definition in the user master data.
    Times must be entered using the '__:__:__' template.
    F1 help and F4 help are supported.
    Each field can be specified once only. Repeated fields or field groups are not supported. Table names preceded by an asterisk are an exception to this.
    Only fields wih the ABAP type C, N, T, D, P, or Integer are permitted.
    No updates are performed.
    A maximum of ten fields can be displayed in a dialog box. If there are more than ten fields, a dialog box with a scroll bar is sent. You can use the POPUP_GET_VALUES_SET_MAX_FIELD function module to change the maximum number of fields in a dialog box.
    If you use this function module, remember that ABAP Dictionary tables are sent implicitly using variables. A cross-reference across tables used in programs cannot determine these tables. For this reason, declare the tables under TABLES in the calling program.
    Hope this helps.

Maybe you are looking for

  • IPhoto 11 doesn't load my old photo library

    I have an old iphoto library and my new iphoto 11 allows me to locate and load the 1.5 GB file, but when it loads there ia nothing? No events or photos? The library doesn't upgrading, so how do I load my old photos? Thanks Ant.

  • Install stuck

    I downloaded Yosemite from the app store. Started the install and then it gets stuck. I make it through picking my HDD and hit continue and agree. NowI see the Install OS X white box with a blue progress bar that goes away when i move my mouse. nothi

  • E440 16GB SSD u 110 sandiisk drive, what does it do?

    Hi, I just bought e440 with 500GB 7200rpm drive and additional 16GB SSD. What does this drive do? Is it for cache, for system or what? Can I mount it as a standard drive? I ahve installed Samsung EVO 840, 256GB drive. If the small ssd is for cache, I

  • How do I get itunes to reconize my ipod to transfer music I've purchased??

    How do I get itunes to reconize my ipod to transfer music I've purchased?

  • Photos From Computer To Touch, help!

    Hello all! Whenever I plug in my ipod touch and it starts to sync, it automatically starts to take all of my pictures that are on my computer and copies them to my touch. I have thousands of photos, I don't want them all to be transfered to my ipod.