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

Similar Messages

  • 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

  • ABAP OO Doubt - validate call method.

    Hi experts
    I'm beginer in ABAP OO and i created this code :
    output-cep = ch_adrc_struc-post_code1.
                 TRY.
                     CREATE OBJECT lr_cep.
                   CATCH cx_ai_system_fault .
                 ENDTRY.
                 TRY.
                     CALL METHOD lr_cep->si_servico_cep_out
                       EXPORTING
                         output = output
                       IMPORTING
                         input  = input.
                   CATCH cx_ai_system_fault .
                 ENDTRY.
    My doubt is : How to know the call method worked?
    In call function i use = if sy-subrc = 0 for check the return but can i use it after call method ?
    thanks a lot.

    there is an importing which is used to get back data.
    once you process input then you can decide whether method worked or not.

  • Wht is UPDATE TASK functionality in CALL FUNCTION??

    Hi Experts,
    Pls. clarify one of my simple doubt that, Wht is the functionality of UPDATE TASK, in following sttement?
    <i><b>call function 'Z_FM_1' in update task</b></i>
    I found SAP help as follow, but not understood??
    <i>Flags the function module func for execution in the update task. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task. Update function modules must be flagged as such in the Function Builder
    The return value is not set.</i>
    thanq

    Hi,
    It sounds like the FM was not called but it was (rollback process).
    And what is the difference between an update attribute assigning FM and this?
    You control the FM update process by setting the update module attribute.
    - Update with immediate start
    Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions can be restarted by the update task in case of errors.
    - Update w. imm. start, no restart
    Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions may not be restarted by the update task.
    - Update with delayed start
    Set this option for low priority ("V2") functions that run in their own update transactions. These functions can be restarted by the update task in case of errors.
    Regards,
    Ferry Lianto

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

  • Behaviour of CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE'

    As per ABAP help documentation, the statement CALL FUNCTION fname  STARTING NEW TASK DESTINATION 'NONE' should create a new main session in  same user session.The behaviour is wrong as per documentation.
    But  current behaviour:
    The statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE'   is creating a new user session.
    Any reason?

    Hi Prakash,
    I'd agree with Suhas, that you're reading the documentation wrong. Here's your quote:
    As per ABAP help documentation, the statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE' should create a new main session in current user session.
    If you look at the help, you can see that it says:
    When the destination NONE is used, a new main session is opened for the current user session.
    Do you see the difference? Also, note that in this context main session basically means that we're talking about a new external session:
    Each task ID defines a separate RFC connection with its own context, meaning that, in the case of repeated function module calls of the same task ID, the global data of the relevant function group can be accessed, if the connection still exists.
    In dialog processing, note that the maximum number of six main sessions cannot be exceeded, else an error message is displayed.
    If you're still in doubt, check out the online ABAP documentation for [CALL FUNCTION - STARTING NEW TASK|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm]. So I'd say the documentation is in line with the actual behavior.
    Cheers, harald

  • CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

    Hi experts,
                     I have a doubt in fn module..
    i gave the flat file data as
    matnr     mbrsh  mtart    maktx   meins
    z58723     m         roh    dfsdfsd    kg
    z57934     m         roh     rsdrss    ea
    when i am uploading from excel to mm01 t.code
    in matnr  it takes z58723 and in
    mbrsh  it takes z not m and in mtart it takes z587 not roh....
    i think u can understand.....help me please.....

    Hello,
    Check with this sample.
    DATA: G_T_FILE LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    *download the excel data into an internal table
      IF NOT P_FILE IS INITIAL.
        CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
             EXPORTING
                  FILENAME                = P_FILE
                  I_BEGIN_COL             = G_C_START_COL
                  I_BEGIN_ROW             = G_C_START_ROW
                  I_END_COL               = G_C_END_COL
                  I_END_ROW               = G_C_END_ROW
             TABLES
                  INTERN                  = G_T_FILE
             EXCEPTIONS
                  INCONSISTENT_PARAMETERS = 1
                  UPLOAD_OLE              = 2
                  OTHERS                  = 3.
        IF SY-SUBRC <> 0.
          MESSAGE E000(SU) WITH TEXT-004.
        ENDIF.
      ENDIF.
      LOOP AT G_T_FILE.
        IF G_T_FILE-COL = '1'.
          G_T_DEBI-KUNNR = G_T_FILE-VALUE.
        ENDIF.
        IF G_T_FILE-COL = '2'.
          G_T_DEBI-LAND1 = G_T_FILE-VALUE.
        ENDIF.
        IF G_T_FILE-COL = '3'.
          G_T_DEBI-VBUND = G_T_FILE-VALUE.
        ENDIF.
        IF G_T_FILE-COL = '4'.
          G_T_DEBI-AKONT = G_T_FILE-VALUE.
        ENDIF.
        AT END OF ROW.
          APPEND G_T_DEBI.
          CLEAR G_T_DEBI.
        ENDAT.
      ENDLOOP.
    Cheers,
    Vasanth

  • Doubt in Call Transaction

    Hi All,
    CALL FUNCTION 'GUI_UPLOAD '
    EXPORTING
    FILENAME = 'C:\Documents and Setting\shri\Desktop\Order.txt'
    FILETYPE = 'ASC'
    HAS_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = ITAB.
    When i use this function module to create a sales order VA01, It showing error for the first record,that is the first line in the text file,but when i give the same line in any other row in the text file it is taking properly.So I want to know in the generated text field what should be the first line? Whether the first line should have only the field names or what?
    Thanks .

    hi Shri,
    the problem may be the conversion exit.
    After uploading the text file into your internal table . Please use the conversion exit for all the mandatory fields.
    Thanks
    Sekhar

  • Call function POPUP_TO_CONFIRM after Excel close

    Good morning
    I have written code like this
    DATA: EXCEL TYPE OLE2_OBJECT.
      DATA: BOOKS TYPE OLE2_OBJECT.
      DATA: BOOK  TYPE OLE2_OBJECT.
      DATA: CELL  TYPE OLE2_OBJECT.
      DATA: FONT  TYPE OLE2_OBJECT.
      DATA: FILE  TYPE OLE2_OBJECT.
      CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
      CALL METHOD OF EXCEL 'WORKBOOKS' = FILE.
      CALL METHOD OF FILE 'OPEN'
        EXPORTING
          #1 = 'C:temp8D.xls'
          #2 = 1.
    CALL METHOD OF EXCEL 'CELLS' = CELL
        EXPORTING
          #1 = 6
          #2 = 'C'.
      SET PROPERTY OF CELL 'VALUE' = zak_pomoc.
    CALL METHOD OF EXCEL 'QUIT'.
      FREE OBJECT EXCEL.
    If user has modified the 8D file I want display this file on the screen, but first function POPUP_TO_CONFIRM  should ask him if he really wants to show file.
    I make it like this.
      call function 'POPUP_TO_CONFIRM'
        EXPORTING
          TITLEBAR              = 'Display report'
          TEXT_QUESTION         = 'Display report 8D?'
          DEFAULT_BUTTON        = '1'
          DISPLAY_CANCEL_BUTTON = 'X'
          START_COLUMN          = 25
          START_ROW             = 6
        IMPORTING
          answer                = ans.
             if ans eq '1'.
    DATA gs_excel TYPE ole2_object .
      DATA gs_wbooks TYPE ole2_object .
      DATA gs_wbook TYPE ole2_object .
      DATA gs_application TYPE ole2_object .
      CREATE OBJECT gs_excel 'EXCEL.APPLICATION' .
      SET PROPERTY OF gs_excel 'Visible' = 1 .
      GET PROPERTY OF gs_excel 'Workbooks' = gs_wbooks .
      GET PROPERTY OF gs_wbooks 'Application' = gs_application .
    *--Opening the existing document
      CALL METHOD OF gs_wbooks 'Open' = gs_wbook
        EXPORTING
          #1 = 'c:temp8D.xls'.
    endif.
    But there is my problem because two windows: first- asking about saving the file and the second- asking about showing the file, pop up in this same time.
    What condition should I write to call second window after this first one?
    Please, any suggestions?
    Thank you.

    Hello
    I'm just beginner and there is one thing I don't understand. Between lines
    CALL METHOD OF EXCEL 'QUIT'
    and
    FREE OBJECT EXCEL
    the window 'Do you want save changes' appears. And in that moment what is the value that says if the user chooses OK or QUIT?
    If I would know that value, I could call function POPUP_TO_CONFIRM in the right moment.

  • Call Function Destination in a background job

    I am having a problem using:
      CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
             DESTINATION p_dest
    in a background job.
    I am working on a program that would compare the same table in 2 different systems and write the differences.  It works when I run it in the foreground.  However, I want to run this in a nightly background job.  However, it is failing and I beleive that it is the result of the program needing a user to interactively logon to the remote system.
    How can I bypass the logon screen or enter information into the logon screen using a background job?
    Thanks.
    Jon

    Hi Jonathan,
    Would you like to reward some points to the poster to thank them as a part of SDN Contributor Recognition Program?
    You can click on the yellow star on the right of each post header to reward points.
    For more information:
    https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
    John.

  • Uncatchable exception: BSP calling Function Module

    Hi all,
    currently i'm facing a very weird problem. My application class calls function module
    HR_INFOTYPE_OPERATION. Normally, in case of an error, the function module gives you back a return parameter. But if i call it from my BSP, the processing doesn't leave the function module. It directly throws an exception ERROR_MESSAGE_STATE instead of writing the message into parameter return.
    If i call the function module with the same parameters from a report, it works fine and the error message is written to return parameter without throwing an exception.
    What am i doing wrong? I don't want that exception and need to go on with filled parameter result.
    Regards
    Mark-André

    Hi MA,
    try using ERROR_MESSAGE in the exceptions list, like this.
    CALL FUNCTION 'func_name'
         EXPORTING
              string            = text
              pos               = position
         IMPORTING
              string1           = text1
              string2           = text2
         EXCEPTIONS
              string1_too_small = 1
              string2_too_small = 2
              ERROR_MESSAGE     = 3
              OTHERS            = 4.
    Cheers
    Graham Robbo

  • What is the use of CALL FUNCTION MODULE - AT BACKGROUND TASK?

    Hi experts,
    I found Call functional module in background task will make the FM run at the next commit work as some people said. So I have some questions:
    1 if we use COMMIT WORK commend, the pending FM will be called? If there are several FMs called at background task, what is the sequence of them? How many conditions will trigger the running of these FMs?
    2 Where can I find the log of this pending FMs? In SAP library, it says there are 2 tables. But I checked these tables and can only find the FM name and user of it. And I can not understand content of these tables. It seems one is for the main information of FM, and the other is for the data of the FM, maybe the parameters.
    3 If I call a FM in this way, Can I canncel it before the next commit work in some way?
    Finally, thanks for reading and help.

    HI,
    When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
    If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days

  • How to fill data when call function of sap standard script form?

    Hi every experts,
    <Priority Normalized>
    In our system, when we log in 'FR', we can print purchase order in language Franch,in t_code:ME22N.  And when logging in 'EN', we can print it in language English, in ME22N. The English form is just only translated from Franch, with all same structure and frame.  The form is done by script form.
    And when logging in 'ZH', we create a new program, calling function smartform, instead of translating from EN language. Because of different structure and frame, I don't know the way to write script, so  I print puchase order by smartform, when logging in 'ZH'.
    But I have a new issue. Our MM module consultant needs me to print Chinese form if one condition, print English form in other condition.
    So I have no idea to solve it. Because in my program, I get data to fill smartform and call function of smartform. And I don't know how to get data to fill script form. I only know the function name, 'OPEN_FORM' 'WRITE_FORM' 'CLOSE_FORM'.....
    If I only call the several functions, I will get only frame without no data. So who can tell me how to do????
    <Urgency downgraded>
    Edited by: Suhas Saha on Jul 26, 2011 3:34 PM
    Edited by: Vinod Kumar on Jul 26, 2011 4:09 PM

    Hi,
    Normally if we look in NACE transaction, you can see that upto five different FORMS can be assigned to a single output type . i.e. for each form there will be a seperate routine through which it gets called. But it all start from the first form only.
    so you need to write your code in the ENTRY of the first form and if it does not satisfy do not go for processing of it but just exit of that form ENTRY. so that it will take you to next form.
    hope this helps.
    Thanks,
    Venkatesh

  • Function Module CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'

    Hello All,
    While using CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH' to download to Unix file in GLD (Version 4.5b) the F.M is working fine, but in KLD(Version ECC 6.0)  CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH' is not working & the error message is displayed saying incomplete filename.
    Could you let me know any alternate Function Module/ Method in this regard.
    Thanks

    Hi,
    In ECC6 also Its Working fine only.
    1. Go to SE37 -> Enter FM Name  -> Test(F8).
    2.  Give any file path and test it.
    Thanks,
    Reward If Helpful.

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

Maybe you are looking for