Call function within rfc

Hi,
i´ve developed an RFC FM and within this FM i use    
CALL FUNCTION '
NUMBER_GET_NEXT'
in order to get a sequential number each time the FM is called.
When this RFC FM is called from XI
i get exception 1 (INTERVAL_NOT_FOUND) 
Why is this happening?
How can i solve this problem?
Best regards.

Hi,
i just do this:
  DATA: l_number(15) TYPE C.
  IF l_number IS INITIAL.
    CALL FUNCTION 'NUMBER_GET_NEXT'
      EXPORTING
        NR_RANGE_NR             = '00'
        OBJECT                  = 'ZVLBSOLICI'
      IMPORTING
        NUMBER                  = l_number
      EXCEPTIONS
        INTERVAL_NOT_FOUND      = 1
        NUMBER_RANGE_NOT_INTERN = 2
        OBJECT_NOT_FOUND        = 3
        QUANTITY_IS_0           = 4
        QUANTITY_IS_NOT_1       = 5
        INTERVAL_OVERFLOW       = 6
        BUFFER_OVERFLOW         = 7
        OTHERS                  = 8.
ENDIF.
Best regards.

Similar Messages

  • Call Function - Dest "RFC"

    Hello,
    i have a big problem.
    I´ve written a web dynpro programm.
    In this program i call a function:
    CALL FUNCTION 'READ_DAT' DEST 'Z_READ_DAT".
    Z_READ_DAT is a RCF which points on a exe file on my pc.
    When is use this Function in SAPGUI all works fine, but when i call it in WDA there is a dump.
    "Cannot open RFC". ST22 says EXEC_SAPGUI : cannot open sapgui.
    What can i do?

    Hi Benjamin Pfahl  ,
                                   there are cetain RFCs that cannot be used with Webdynpro, like gui_upload and all. the Fm 'READ_DAT' DEST 'Z_READ_DAT, since its working fine in normal abap means it cannot be used with wda, the Fm might be using sap gui to fetch from your pc.
    Regards
    Sarath

  • Call function with rfc or not ?

    How can I know that an function is called by rfc or not ?
    info : The caller is not R/3 system. This web interface...
    thanks in advance

    Hi Stephan,
    Try this FM
    TRANSACTION_CALL_VIA_RFC
    Data : v_bdi_line type bdi_line.
    Call Function 'TRANSACTION_CALL_VIA_RFC'
         Exporting
             tcode = sy-tcode.
         importing
             transaction_data = v_bdi_line.
         Exceptions
             tcode_not_exist = 1.
    if sy-subrc ne 0.
       It means it is RFC call.
    endif.
    Reward points if it helps you.
    Regards,
    Sudhakar.

  • Strange error of CALL FUNCTION within Method

    Hi all,
    i'm facing a very strange problem. Some Function Modules can't be called from within a method and a dump appears with the following message CALL_FUNCTION_CONFLICT_LENG (CX_SY_DYN_CALL_ILLEGAL_TYPE).
    Here's an example: I've created a normal class with only one static method.
    Class: ZCL_TEST
    Method: CHECK_EMPLOYEE
    Importing Parameter: IV_PERNR TYPE PERNR_D
    Coding:
      DATA gt_return TYPE TABLE OF bapireturn1.
      CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'
        EXPORTING
          number        = iv_pernr
          validitybegin = sy-datum
        IMPORTING
          return        = gt_return.
      CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'
        EXPORTING
          number        = iv_pernr
          validitybegin = sy-datum.
    If i call this method a dump appears and if the same code of that method is implemented directly in a normal report everything works fine.
    Why can't i call this function module from within a method?
    Regards
    Mark-André

    Hi,
    the dump even appears by testing the method from Class Builder with F8!
    In my test report iv_pernr isn't declared as follows:
    REPORT  z_test.
    PARAMETERS p_pernr TYPE pernr_d.
    zcl_test=>check_employee( p_pernr ).
    The reason of the dump is parameter RETURN. But i don't understand it why it only doesn't work from within a method.
    Dump Message:
    In the function module interface, you can specify only  
    fields of a specific type and length under "RETURN".    
    Although the currently specified field                  
    "GT_RETURN" is the correct type, its length is incorrect.
    Regards
    Mark-André

  • Calling function within function as parameter

    We're planning to switch from MS-OLEDB to Oracle OLEDB and are expecting several troubles.
    One of these is that MS supports calling functions with another function within whilst Oralce does not?
    Example (works fine with MS):
    {? = call *<FUNCTION_1>* ( ?, ?, *<FUNCTION_2>* ( ?, ?, ? ) + 1, ?, 1 )}
    This raises ORA-01036: Variablenname/-nummer ungültig with Oracle's OLEDB.
    Any ideas?
    Thanks in advance!
    Edited by: user617919 on 04.11.2011 01:28

    Hi,
    Whenever you have a problem, please post a complete test script that people can run to re-create the problem and test their ideas. In this case, include complete CREATE PACKAGE and CREATE PAGKAGE BODY statements, CREATE TABLE and INSERT statements for any tables needed, some test calls to the the package, and the results you want from those test calls gibven that data.
    Always say which versin of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    LostNoob wrote:
    --Calculate salary minus before tax deductions
    FUNCTION sal_mns_btd (emp_no IN NUMBER)
    RETURN NUMBER
    IS
    tot_mns_btd Number;
    BEGIN
    SELECT e.sal - bef_tax_ded(bef_ded_tot)
    INTO  tot_mns_btd
    FROM  emp
    WHERE empno = emp_no;
    RETURN tot_mns_btd;
    END sal_mns_btd;
    If bef_tax_ded is a function in the same package, then what you posted is a correct way to call it.
    What is bef_ded_tot? If it's a NUMBER column in emp, then what you posted makes sense. If bef_ded_tot is a local variable inside some other function, then it doesn't make sense.. How to do what you want depends on what you want, and I can't tell you how to do it unless I understand what you want.
    Also, the table alias e isn't defined. It doesn't look like you need a table alias.

  • Calling function through RFC

    Hi Colleagues,
    I need to make a function call from 1 SAP system to another SAP system. Please let me know if I should create a new ABAP RFC connection between the 2 systems. If so please let me know the procedure to create a new ABAP connection. Should I make use of the transaction SM59 or can make use of some customizing/system table?
    I need to complete this asap today. Kindly help me.
    Thanks & Regards,
    Srilakshmi B

    Hi Lakshmi,
    Go to SM59 and create a new connection by clicking on the create Button, Specify the RFC Destination that is your Target System and test the Connection. Save the Connection settings. You can login to the RFC System by clicking on Remote Logon.
    Connection should be specified as an ABAP Connection.
    If you go to Logon and Security Tab you can specify the User Also.
    Regards,
    Sai
    Edited by: Sai Krishna Kowluri on Mar 4, 2008 8:35 AM

  • Call Function with RFC  dynamic table

    Hi all
    I create a function compare TABLE_ENTRIES_GET_VIA_RFC and CTVB_COMPARE_TABLES, everything is.dynamic
    it works well but, how could i create a dynamic output parameter for table.
    the system show me that RFC and dynamic table don't work.
    i don't want line by line i would like to have the real structure inside of the Function i have everything but i can't move the data to the output parameter table .
    could somebody help ?

    Thx RE (and Mani) for the feedback.
    I think that this URL is sufficient to understand how to pass dynamic internal table via RFC function module, whatever it is input or output. This URL says to use a STRING to store the table content in XML format, via CALL TRANSFORMATION ID, and pass this string as parameter. In the calling program, we have to "decode" the XML back into abap data, Just notice that we don't need to create an XSLT, ID is sufficient.
    For any other information, open a new thread, or ask a precise question.

  • PL/SQL Anonymous Block - Trying to Call Function within Cursor

    Hello -
    I need to create an anonymous block that contains a cursor and a function. I want to call the function from within the cursor, and the function will basically take an ID as its IN parameter, and will return a comma separated list of values.
    However, when I try to do this I get the error " function 'GET_PAYMENT_DATES' may not be used in SQL".
    Does anyone know of a workaround? I'm trying to avoid having to store this function.
    Thanks,
    Christine

    Exploring Keith's suggestion of using the function code inline in your SQL:
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> drop table t;
    Table dropped.
    test@ORA10G> drop table monetary_trans;
    Table dropped.
    test@ORA10G>
    test@ORA10G> create table monetary_trans as
      2  select 1 household_id, trunc(sysdate)-10 received_date from dual union all
      3  select 1, trunc(sysdate)-9 from dual union all
      4  select 1, trunc(sysdate)-8 from dual union all
      5  select 2, trunc(sysdate)-7 from dual union all
      6  select 2, trunc(sysdate)-6 from dual;
    Table created.
    test@ORA10G>
    test@ORA10G> create table t as
      2  select rownum x, rownum*10 y from dual connect by level <= 4;
    Table created.
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> select * from monetary_trans;
    HOUSEHOLD_ID RECEIVED_
               1 28-DEC-08
               1 29-DEC-08
               1 30-DEC-08
               2 31-DEC-08
               2 01-JAN-09
    test@ORA10G> select * from t;
             X          Y
             1         10
             2         20
             3         30
             4         40
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> -- the function code could be rewritten as follows
    test@ORA10G> --
    test@ORA10G> select household_id,
      2         ltrim(sys_connect_by_path(rd,','),',') payment_dates
      3    from
      4  (
      5  select household_id,
      6         to_char(received_date,'mm/dd/yy') as rd,
      7         row_number() over (partition by household_id order by 1) rn,
      8         count(*) over (partition by household_id) cnt
      9    from monetary_trans
    10    -- and the constraints here in the where clause
    11  )
    12  where level = cnt
    13  start with rn = 1
    14  connect by prior household_id = household_id
    15  and prior rn = rn - 1
    16  and household_id = 1 -- <== this is the input parameter value
    17  ;
    HOUSEHOLD_ID PAYMENT_DATES
               1 12/28/08,12/29/08,12/30/08
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> -- and can be used as an inline view when joined with other tables
    test@ORA10G> --
    test@ORA10G> select t.y,
      2         fn.payment_dates
      3    from t,
      4         (select household_id,
      5                 ltrim(sys_connect_by_path(rd,','),',') payment_dates
      6          from (select household_id,
      7                       to_char(received_date,'mm/dd/yy') as rd,
      8                       row_number() over (partition by household_id order by 1) rn,
      9                       count(*) over (partition by household_id) cnt
    10                  from monetary_trans)
    11          where level = cnt
    12          start with rn = 1
    13          connect by prior household_id = household_id
    14          and prior rn = rn - 1
    15         ) fn
    16   where t.x = fn.household_id
    17  ;
             Y PAYMENT_DATES
            10 12/28/08,12/29/08,12/30/08
            20 12/31/08,01/01/09
    test@ORA10G>
    test@ORA10G>HTH
    isotope

  • Call function within select statement

    Hi
    I would appreciate if someone help me with the below package. I need to call the function in my select statement and have to insert the results into the table
    Thanks in advance
    Regards
    Sriram
    create or replace package my_tables
    AS
    procedure pop_staff_info_tab;
    -- FUNCTION get_emergency_contact(pn_person_id IN NUMBER);
    end my_tables;
    create or replace package body pop_staff_info_tab
    is
    cursor crs_pri_staff is
    select
    papf.party_id
    ,papf.person_id
    ,papf.employee_number
    ,papf.first_name
    ,papf.middle_names
    ,papf.last_name
    ,papf.known_as
    ,papf.full_name
    ,papf.previous_last_name
    ,papf.title
    ,get_emergency_contact(pn_person_id) as PRIMARY_EMERGENCY_CONTACT_NAME
    from per_all_people_f papf
    where trunc(sysdate) between papf.effective_start_date and
    papf.effective_end_date;
    procedure pop_staff_info_tab is
    begin
    for my_cursor_staff in crs_pri_staff
    loop
    insert into staff_info
    PARTY_ID
    ,PERSON_ID
    ,EMPLOYEE_NUMBER
    ,FIRST_NAME
    ,MIDDLE_NAME
    ,LAST_NAME
    ,PREFERRED_NAME
    ,FULL_NAME
    ,PREVIOUS_LAST_NAME
    ,TITLE_CODE
    ,PRIMARY_EMERGENCY_CONTACT_NAME
    values
    my_cursor_staff.party_id
    ,my_cursor_staff.person_id
    ,my_cursor_staff.employee_number
    ,my_cursor_staff.first_name
    ,my_cursor_staff.middle_names
    ,my_cursor_staff.last_name
    ,my_cursor_staff.known_as
    ,my_cursor_staff.full_name
    ,my_cursor_staff.previous_last_name
    ,my_cursor_staff.title
    ,my_cursor_staff.PRIMARY_EMERGENCY_CONTACT_NAME);
    end loop;
    end pop_staff_info_tab;
    FUNCTION get_emergency_contact(pn_person_id IN NUMBER)
    RETURN VARCHAR2 IS
    lv_emergency_contact_name VARCHAR2(2000);
    BEGIN
    SELECT ppf.full_name
    INTO lv_emergency_contact_name
    FROM per_person_types_tl pttl
    ,per_person_types pt
    ,per_all_people_f ppf
    ,per_contact_relationships con
    ,hr_lookups hl
    WHERE con.contact_person_id = ppf.person_id
    AND ppf.person_type_id = pt.person_type_id
    AND pt.person_type_id = pttl.person_type_id
    AND pt.user_person_type = 'Emergency Contact'
    AND con.contact_type = hl.lookup_code
    AND hl.lookup_type(+) = 'CONTACT'
    AND con.contact_type = 'EMRG'
    AND con.primary_contact_flag = 'Y'
    AND trunc(SYSDATE) BETWEEN
    nvl(con.date_start,
    trunc(SYSDATE) - 1) AND
    nvl(con.date_end,
    trunc(SYSDATE) + 1)
    AND
    trunc(SYSDATE) BETWEEN nvl(ppf.effective_start_date,
    SYSDATE - 1) AND
    nvl(ppf.effective_end_date,
    SYSDATE + 1)
    AND con.person_id = pn_person_id;
    RETURN lv_emergency_contact_name;
    END get_emergency_contact;*/
    END my_tables;

    hi,
    You don't have to call the function inside the select statement. You can do as below:
    procedure pop_staff_info_tab is
    m_emrncy_cntct varchar2(1000); /*Added by Sri_Raghav*/
    begin
    for my_cursor_staff in crs_pri_staff
    loop
    m_emrncy_cntct := get_emergency_contact(my_cursor_staff.person_id); /*Added by Sri_Raghav*/
    /* This above memory varaible(m_emrncy_cntct) can be used to insert into ur new table */ /*Comment added by Sri_Raghav */
    insert into staff_info
    PARTY_ID
    ,PERSON_ID
    ,EMPLOYEE_NUMBER
    ,FIRST_NAME
    ,MIDDLE_NAME
    ,LAST_NAME
    ,PREFERRED_NAME
    ,FULL_NAME
    ,PREVIOUS_LAST_NAME
    ,TITLE_CODE
    ,PRIMARY_EMERGENCY_CONTACT_NAME
    values
    my_cursor_staff.party_id
    ,my_cursor_staff.person_id
    ,my_cursor_staff.employee_number
    ,my_cursor_staff.first_name
    ,my_cursor_staff.middle_names
    ,my_cursor_staff.last_name
    ,my_cursor_staff.known_as
    ,my_cursor_staff.full_name
    ,my_cursor_staff.previous_last_name
    ,my_cursor_staff.title
    ,my_cursor_staff.PRIMARY_EMERGENCY_CONTACT_NAME);
    end loop;
    end pop_staff_info_tab;

  • Call a functions within a function ?

    Hi
    Is there anyway to call my functions within a function ?
    function musicPlayer() {
         trace("Music");
         function pauseMusic(){
              trace("Pause");
    if i call musicPlayer function i will get Music in output now how can i call pauseMusic from outside of parent function !?
    is this possible ?
    thanks in advance

    You can call functions within other functions, but you don't want define functions inside other functions... they will only have scope within the function if they work at all.
    function pauseMusic(){
         trace("Pause");
    function musicPlayer() {
         trace("Music");
         pauseMusic();
    musicPlayer();

  • Making an RFC call from within the VM container

    Hi all,
    since a long time I am searching for information on how to implement an RFC call from within the VMC. The problem is that we have implemented several (p)functions in ABAP and we need to implement them in JAVA.
    Now I am searching for a way how to just call the already existing pfunctions???
    Is it possible to read CRM DB tables too?
    Thank you in advance
    Boris

    Hi Freeto,
    This may be due to the Network Failures.
    If you have triggered a job then because of the Network fluctuations the system may not respond properly and cannot execute the job.
    So, this is the cause for the failure.
    Hope you understood.
    With Regards,
    Ravi Kanth

  • Call Function Module within an Extractor

    Hello Experts.
    We have a requirement where a function module needs to be called from within an extractor to retrieve the data. The function module exists in the HR box. What would be the steps to follow? We can't create a generic data source based on the function module in the HR box. Do I create the extractor in BW?
    Appreciate your help.
    Thanks!

    Since the FM on the HR box is remote-enabled, as you've stated, then any SAP application (e.g. BW, R3/ECC, et. al.) that has an RFC connection to that HR box can execute that FM.
    Executing a remote-enabled FM is exactly like executing any FM, with one exception. Like any FM, you pass a set of values or internal tables to the FM, through the EXPORTING or TABLES section of the FM,  and receive back a set of values or internal tables from the FM, through the IMPORTING or TABLES section of the FM. The exception is that you will have one additional parameter to pass, namely DESTINATION. So, the call to the FM would look something like this:
    CALL FUNCTION
      'ZREMOTE_FM'
    DESTINATION
      l_dest            "This is the environment where the FM sits - e.g. HRP100 or similar)
    EXPORTING
      logical_system = l_logical               "This is the calling environment - e.g. BWP100)
      ifield1 = l_ifield1
      ifield2 = l_ifield2
    IMPORTING
      efield1 = l_efield1
      efield2 = l_efield2
    TABLES
      t_itab1 = t_itab1
      t_itab2 = t_itab2
    EXCEPTIONS
      NO_DATA_FOUND = 1.
    You can code it so that l_dest is derived based on the value in l_logical. The values to be populated in l_dest and l_logical, however, are dependent on how your Basis team names the RFC connections. This assumes your landscape for HR is HRD100, HRQ100 and HRP100 for the development, quality and production, respectively and BWD100, BWQ100 and BWP100 for the BW landscape:
    CONCATENATE: sy-sysid sy-mandt INTO l_logical.
    CASE l_logical.
      WHEN 'BWD100'.
        l_dest = 'HRD100'.
      WHEN 'BWQ100'.
        l_dest = 'HRQ100'.
      WHEN 'BWP100'.
        l_dest = 'HRP100'.
      WHEN OTHERS.
    ENDCASE.

  • Is it possible to call custom designed RFC function module, apart from BAPI

    Hi Friends,
    1.     Is it possible to call custom designed RFC function module, apart from BAPI.
    2.     Why we call it Adaptive RFC layer, Since every time the JCO layer updated with SAP, Why can’t be dynamic.
    Thanx for Ur time.
    Cheers,
    Sam

    Also check <a href="http://help.sap.com/saphelp_nw04/helpdata/en/41/38bc8f813719488ddc9d9b21251ec3/frameset.htm">here</a> for more information on aRFC. Here you can find why it is called adaptive.
    Regards,
    Christophe

  • Can we call a function within a function??????Urgent

    Dear All,
    Like we can call a procedure from another procedure , in the same way can we call a function within a function. Please reply it's urgent.
    Regards

    > Please reply it's urgent.
    My usual soapbox response.
    Saying your posting is urgent is rude and arrogant. Why? Because you are saying that other people who have posted problems here, have less important problems than yours. That despite how complex and critical their problem may be, yours take priority.
    You're also demaning attention and a quick answer from people that provide support here - in their free time... and not getting paid a single cent for their efforts.
    So just how can you demand any urgency to your posting from them?
    Remember that this is a public forum. You cannot demand anything here. This is not Oracle Support. There are no SLA's here. Basic nettiquette applies.

  • Third party system call function module/BAPI through RFC to update Z table

    Dear Friends,
    We have a third party system which directly inserts a Z table in SAP through its programming, which is an auditing issue.
    We want the third party system should call function module/BAPI through RFC so that the Z table gets updated.
    waiting for inputs..
    Thanks,
    Kumar

    if third party system is capable of making Remote Function call, then writing a Function module & making it remote enable is not difficult task in ABAP.
    You may have to prepare specifications first to decide if third party system is going to Read, insert, update, delete records from Zee table.

Maybe you are looking for