Reg:RFC &TRFC

hi,
we have 2 clients 800 and 810 in the same server.
we have created a function module in 800 and wrote a simple select statement to fetch data from VBAK table and made it REMOTE.And i am fetching the data from 810 to  update a table in 800.
    When executed with SRFC its fetching the data.but with TRFC data is not being fetched. why
the code as follows:
DATA : zpexport1 TYPE TABLE OF  zpexport .
PARAMETERS p_kunnr TYPE kunnr.
CALL FUNCTION 'ZP_EXAMPLEBAPI'
DESTINATION 'ISPCLNT810'
  EXPORTING
    kunnr           = p_kunnr
  TABLES
    zpexport1       = zpexport1
IF zpexport1[] IS NOT INITIAL.
  MESSAGE 'SUCCESS' TYPE 'S'.
ENDIF.
regards

hi,
we have 2 clients 800 and 810 in the same server.
we have created a function module in 800 and wrote a simple select statement to fetch data from VBAK table and made it REMOTE.And i am fetching the data from 810 to  update a table in 800.
    When executed with SRFC its fetching the data.but with TRFC data is not being fetched. why
the code as follows:
DATA : zpexport1 TYPE TABLE OF  zpexport .
PARAMETERS p_kunnr TYPE kunnr.
CALL FUNCTION 'ZP_EXAMPLEBAPI'
DESTINATION 'ISPCLNT810'
  EXPORTING
    kunnr           = p_kunnr
  TABLES
    zpexport1       = zpexport1
IF zpexport1[] IS NOT INITIAL.
  MESSAGE 'SUCCESS' TYPE 'S'.
ENDIF.
regards

Similar Messages

  • RFC,TRFC

    hi all,
    what are the different types of RFCs and difference between them(RFC,TRFC etc)
    Regards
    raj

    Dear Raj,
    what are the different types of RFCs and difference between them(RFC,TRFC etc)
    RFC Basics
    This section gives a brief overview of the Remote Function Call (RFC) within an SAP System, that is
    · How the RFC Interface works
    · The functionality that is provided by the RFC and
    · It explains the technical requirements for RFC on R/2, R/3 and external systems on all currently supported platforms.
    The following background topics are available:
    1. The RFC Interface
    2. RFC in SAP Systems
    The RFC Interface
    A remote function call is a call to a function module running in a system different from the caller's. The remote function can also be called from within the same system (as a remote call), but usually caller and callee will be in different systems. In the SAP System, the ability to call remote functions is provided by the Remote Function Call interface system . RFC allows for remote calls between two SAP Systems (R/3 or R/2), or between an SAP System and a non-SAP System.
    RFC consists of the following interfaces:
    · A calling interface for ABAP programs
    Any ABAP program can call a remote function using the CALL FUNCTION...DESTINATION statement. The DESTINATION parameter tells the SAP System that the called function runs in a system other than the caller's. RFC communication with the remote system happens as part of the CALL FUNCTION statement. RFC functions running in an SAP System must be actual function modules, and must be registered in the SAP System as "remote”. When both caller and called program are ABAP programs, the RFC interface provides both partners to the communication. The caller may be any ABAP program, while the called program must be a function module registered as remote.
    o The topic Calling Remote Function Modules in ABAP provides details on calling function modules registered as remote.
    o The topic Writing Remote Function Modules in ABAP provides information on writing function modules that you want to call remotely.
    · Calling interfaces for non-SAP programs
    When either the caller or the called partner is a non-ABAP program, it must be programmed to play the other partner in an RFC communication. To help implement RFC partner programs in non-SAP Systems, SAP provides
    External Interfaces
    External programs to call function modules in SAP R/2 or R/3 systems and execute them in these systems can use rFC-based and GUI-based interfaces. Vice versa, ABAP programs in R/2 or R/3 can use the functions provided by external programs via these interfaces.
    RFC in SAP Systems RFC is an extension of CALL FUNCTION in a distributed environment. Existing function modules can be executed from within a remote system (R/2 or R/3) via an RFC call. Adding a DESTINATION clause to the CALL FUNCTION statement does this:
    The destination parameter displays an entry in the RFCDES table (which is defined with transaction SM59). This entry contains all necessary parameters to connect to and log in the destination system. The RFC API on OS/2, Windows, Windows NT and all R/3-based UNIX platforms makes it possible to use the RFC functionality between an SAP System (R/3 from Release 2.1 and R/2 from Release 5.0D onwards) and a C program on the above platforms. It is of no significance to the caller whether the remote function is provided in an SAP System or in a C program. RFC frees the ABAP programmer from having to program his own communications routines. When you make an RFC call, the RFC interface takes care of:
    ·     Converting all parameter data to the representation needed in the remote system. This includes character string conversions, and any hardware-dependent conversions needed (for example, integer, floating point). All ABAP data types are supported.
    ·     There is no support for Dictionary structures.
    ·     Calling the communication routines needed to talk to the remote system.
    ·     Handling communications errors, and notifying the caller, if desired. (The caller requests notification using the EXCEPTIONS parameter of the CALL FUNCTION statement.)
    The RFC interface is effectively invisible to the ABAP programmer. Processing for calling remote programs is built into the CALL FUNCTION statement. Processing for being called is generated automatically (in the form of an RFC stub) for every function module registered as remote. This stub serves as an interface between the calling program and the function module.
    A distinction is made between an RFC client and RFC server. RFC client is the instance that calls up the Remote Function Call to execute the function that is provided by an RFC server. In the following, the functions that can be executed remotely will be called RFC functions and the functions provided via RFC API will be called RFC calls.
    All RFC functions available in a remote RFC server system, which are called by an RFC client, are processed transactionally. This means that after execution of the first RFC function in the RFC server system the complete context (all globally defined variables in the RFC server program or in the main program of a function module) is available for further RFC functions. The RFC connection is closed only
    ·     When the context of the calling ABAP program has ended or
    ·     Explicitly by RfcAbort or RfcClose in the external program.
    Until Release 3.0 the connection to an R/3 System must be established to a previously defined application server. From Release 3.0 onwards, it is also possible to have an application server assigned by the message server on the basis of a load balancing procedure. This applies both for RFC between R/3 systems and between external systems and R/3 systems.
    To make the execution of RFC functions reliable, safe and independent from the availability of the RFC server or RFC server system, the transactional RFC (tRFC) was introduced for R/3 systems from Release 3.0 onwards. This ensures that the called function module is executed only once in the RFC server system. In transactional RFC calls, the data that belongs to an RFC function must first be stored temporarily on the SAP database in the RFC client system. When processing is completed, this must be reported back to the calling ABAP program. Everything else is handled by the tRFC component in the R/3 System. Since a database is not always available on external systems, the link to the tRFC interfaces is implemented such that the client or server programs based on RFC API must take on some administrative functions to ensure that the respective function module is executed "only once".
    Best Regards,
    Srikanth
    Reward the useful answers and you will get one point yourself<a href="/people/baris.buyuktanir2/blog/2007/04/04/point-for-points-reward-yourselfyourself

  • Reg:rfc

    Hai to all,
    I am created one below rfc function module. that is ZTEST_FUNC.
    Expert Forums » ABAP Development » ABAP Dictionary
    Thread: reg:fm
    Welcome, chaitu sumi   
    Your Control Panel 
    Your Reward Points 
    Your Questions 
    There are new replies to your question.
    Mark question as still not answered.
    Mark question as answered.
    Use the radio buttons to award points to replies.
      You are watching this thread. To stop watching this thread, click "Stop Watching Thread" below. (Watch Options) 
    This watch sends emails by default. If you don't want to receive emails on changes in this thread, go to the watch options, un-mark the "Email" checkbox next to the thread's entry and click "Update". 
    Reply to this Thread   Search Forum    Stop Watching Thread    Back to Thread List 
      Replies: 2 - Pages: 1 - Last Post: Aug 6, 2007 5:03 PM by: Sudheer Junnuth...  Threads: Previous  
    chaitu sumi  
    Posts: 9
    Questions: 9
    Registered: 7/13/07
    Forum points: 0 
       reg:fm  
    Posted: Aug 6, 2007 4:47 PM         Reply      E-mail this post 
    I created below function module, which is having below import parameters and tables:
    FUNCTION ztest_func.
    ""Local interface:
    *" IMPORTING
    *" VALUE(S_LFDAT1) LIKE LIKP-LFDAT
    *" VALUE(S_LFDAT2) LIKE LIKP-LFDAT OPTIONAL
    *" VALUE(RAIL_ROAD) TYPE CHECKBOX
    *" TABLES
    *" IT_FINAL STRUCTURE ZTLC_SAL
    data: it_cond type n,
    loop_index like sy-tabix .
    select zdelv~vkorg
    zdelv~vbeln
    zdelv~lfart
    zdelv~lfdat
    zdelv~wadat
    zdelv~vtweg
    zdelv~spart
    zdelv~vkbur
    zdelv~vkgrp
    zdelv~kunnr
    zdelv~vsbed
    zdelv~ntgew
    zdelv~route
    zdelv~lgort
    zdelv~inco1
    zdelv~matnr
    zdelv~mvgr1
    zdelv~vsart
    zdelv~rwerks
    zdelv~dwerks
    into corresponding fields of table IT_FRGT
    From zdelv WHERE zdelv~wadat = s_lfdat1 " and s_lfdat2
    AND zdelv~lfart IN ('ZGDP','ZGRR','ZRLF','ZGLF').
    if Sy-subrc = 0.
    Sort it_frgt
    by vbeln dwerks lgort route kunnr regio vkbur vkgrp bran1 cityc.
    Delete adjacent duplicates from it_frgt
    Comparing vbeln dwerks lgort route kunnr
    regio vkbur vkgrp bran1 Cityc.
    Loop_index = 1.
    Loop at it_frgt." to wa_frgt.
    *select kunnr regio from kna1 into kna1 where kunnr = it_frgt-kunnr.
    *select bland from t005u into corresponding fields of table it_regio where Bland = kna1-regio.
    *endselect.
    IF RAIL_ROAD = 'I'.
    IF IT_FRGT-VSBED <> '04'.
    DELETE IT_FRGT.
    clear it_frgt.
    CONTINUE.
    ENDIF.
    ENDIF.
    IF RAIL_ROAD = 'R'.
    IF IT_FRGT-VSBED = '04'.
    DELETE IT_FRGT.
    clear it_frgt.
    CONTINUE.
    endif.
    endif.
    clear wa_frgt.
    select single lifnr from vbpa into vbpa
    where vbeln eq it_frgt-vbeln and
    parvw eq 'ZD'.
    move-corresponding it_frgt to wa_frgt.
    move vbpa-lifnr to wa_frgt-lifnr.
    If wa_frgt-lfart eq 'ZGND' OR
    wa_frgt-lfart eq 'ZGNL' OR
    wa_frgt-lfart eq 'ZGNS'.
    wa_frgt-LVTEXT = 'STA'.
    if wa_frgt-lfart eq 'ZGNS'.
    delete it_frgt.
    continue.
    endif.
    select mseg~werks
    mseg~lgort
    into (wa_frgt-rwerks,wa_frgt-rlgort)
    from vbfa join mseg
    on mseg~mblnr = vbfa~vbeln
    where vbfa~vbelv eq wa_frgt-vbeln and
    vbfa~vbtyp_n = 'i'.
    Endselect.
    wa_frgt-netwr = 0.
    if wa_frgt-netwr = 0.
    select single regio region plant lgobe cityc from zsta
    into corresponding fields of it_zfrgt
    where werks = it_frgt-dwerks
    and lgort = it_frgt-lgort
    and vkorg = it_frgt-vkorg
    and kunnr = it_frgt-kunnr.
    if sy-subrc <> 0.
    select single regio region plant lgobe cityc from zsta into corresponding fields of it_zfrgt
    where werks = it_frgt-dwerks
    and lgort = it_frgt-lgort
    and vkorg = it_frgt-vkorg.
    select single cityc from kna1 into wa_frgt-cityc
    where kunnr = wa_frgt-kunnr.
    it_zfrgt-cityc = wa_frgt-cityc.
    endif.
    select single regio region plant lgobe cityc from zsta into corresponding fields of it_zfrgt1
    where werks = it_frgt-rwerks
    and lgort = it_frgt-rlgort
    and vkorg = it_frgt-vkorg
    and kunnr = it_frgt-kunnr.
    if sy-subrc <> 0.
    select single regio region plant lgobe cityc from zsta into corresponding fields of it_zfrgt1
    where werks = it_frgt-rwerks
    and lgort = it_frgt-rlgort
    and vkorg = it_frgt-vkorg.
    endif.
    else.
    select single regio region plant lgobe cityc from zsta into corresponding fields of it_zfrgt
    where werks = it_frgt-dwerks
    and lgort = it_frgt-lgort
    and vkorg = it_frgt-vkorg.
    endif.
    else.
    select single * from zsta into it_zfrgt
    where werks = it_frgt-dwerks
    and lgort = it_frgt-lgort
    and vkorg = it_frgt-vkorg.
    endif.
    wa_frgt-regio = it_zfrgt-regio.
    wa_frgt-region = it_zfrgt-region.
    wa_frgt-plant = it_zfrgt-plant.
    wa_frgt-lgobe = it_zfrgt-lgobe.
    wa_frgt-cityc = it_zfrgt-cityc.
    wa_frgt-soffice = it_zfrgt1-Plant.
    STA *
    endif.
    if wa_frgt-lfart eq 'ZGDP' OR
    wa_frgt-lfart eq 'ZGDR' OR
    wa_frgt-lfart eq 'ZGRR' OR
    wa_frgt-lfart eq 'ZRLF' OR
    wa_frgt-lfart eq 'ZGLF' OR
    wa_frgt-lfart eq 'ZGLR' .
    if wa_frgt-lfart eq 'ZGLR'.
    delete it_frgt.
    continue.
    endif.
    if wa_frgt-lfart eq 'ZGDR'.
    delete it_frgt.
    continue.
    endif.
    select single WBSTK from LIKPUK into Likpuk-wbstk
    where vbeln = wa_frgt-vbeln.
    if sy-subrc = 0.
    if likpuk-wbstk <> 'C'.
    delete it_frgt.
    clear wa_frgt.
    continue.
    endif.
    endif.
    wa_frgt-LVTEXT = 'SALES'.
    wa_frgt-netwr = 0.
    if wa_frgt-netwr = 0.
    Select single * from ZFRGT into it_zfrgt2
    where werks = it_frgt-dwerks
    and lgort = it_frgt-lgort
    and vkorg = it_frgt-vkorg
    and kunnr = it_frgt-kunnr.
    if sy-subrc <> 0.
    clear it_zfrgt2.
    Select single * from ZFRGT into it_zfrgt2
    where werks = it_frgt-dwerks
    and lgort = it_frgt-lgort
    and vkorg = it_frgt-vkorg.
    if sy-subrc <> 0.
    select single * from t001w
    where werks = it_frgt-dwerks.
    if sy-subrc = 0.
    wa_frgt-plant = t001w-name1.
    select single * from t001l
    where werks = it_frgt-Dwerks and
    lgort = it_frgt-lgort.
    if sy-subrc = 0.
    wa_frgt-lgobe = t001l-lgobe.
    endif.
    it_zfrgt2-lgobe = wa_frgt-lgobe.
    it_zfrgt2-plant = wa_frgt-plant.
    endif.
    Endif.
    Select single * from kna1 where kunnr = it_frgt-kunnr.
    wa_frgt-cityc = kna1-cityc.
    wa_frgt-regio = kna1-regio.
    wa_frgt-bran1 = kna1-bran1.
    select single vtext from tbrct into tbrct where braco = it_frgt-bran1.
    wa_frgt-vtext = tbrct-vtext.
    endselect.
    select single bezei from t005u into t005u where bland = wa_frgt-regio
    and land1 = 'IN'.
    wa_frgt-region = t005u-bezei.
    it_zfrgt2-cityc = wa_frgt-cityc.
    it_zfrgt2-regio = wa_frgt-regio.
    it_zfrgt2-region = wa_frgt-region.
    it_zfrgt2-vtext = wa_frgt-vtext.
    it_zfrgt2-bran1 = wa_frgt-bran1.
    endif.
    endif.
    endif.
    wa_frgt-regio = it_zfrgt2-regio.
    wa_frgt-region = it_zfrgt2-region.
    wa_frgt-plant = it_zfrgt2-plant.
    wa_frgt-lgobe = it_zfrgt2-lgobe.
    wa_frgt-cityc = it_zfrgt2-cityc.
    wa_frgt-vtext = it_zfrgt2-vtext.
    wa_frgt-bran1 = it_zfrgt2-bran1.
    select single * from tvkbt into tvkbt where vkbur = wa_frgt-vkbur.
    if sy-subrc = 0.
    wa_frgt-soffice = tvkbt-bezei.
    endif.
    select single * from tvgrt where vkgrp = wa_frgt-vkgrp.
    if sy-subrc = 0.
    wa_frgt-district = tvgrt-bezei.
    endif.
    endif.
    select single * from zdest into zdest where
    vkorg = wa_frgt-vkorg and
    regio = wa_frgt-regio and
    cityc = wa_frgt-cityc and
    actvt = 'A'.
    if sy-subrc = 0.
    wa_frgt-vtext = zdest-vtext1.
    wa_frgt-bran1 = zdest-ibraco.
    wa_frgt-vkgrp = zdest-ivkgrp.
    select single * from tvgrt into tvgrt where vkgrp = wa_frgt-vkgrp.
    if sy-subrc = 0.
    wa_frgt-district = tvgrt-bezei.
    endif.
    else.
    wa_frgt-vtext = ' '.
    wa_frgt-bran1 = ' '.
    wa_frgt-district = ' '.
    endif.
    endselect.
    *endselect.
    *IF kna1-regio IS NOT INITIAL.
    Read table it_regio with key BLAND = wa_FRGT-REGIO.
    IF SY-SUBRC <> 0.
    DELETE IT_FRGT.
    clear it_frgt.
    CONTINUE.
    ENDIF.
    ENDIF.
    if wa_frgt-lfart eq 'ZGDR'.
    wa_frgt-NQGEW = wa_frgt-NTGEW.
    wa_frgt-NQGEW = wa_frgt-NQGEW * 1.
    else.
    wa_frgt-NQGEW = wa_frgt-NTGEW.
    wa_frgt-NQGEW = wa_frgt-NQGEW * 1.
    endif.
    if wa_frgt-vsbed <> '04'.
    Wa_frgt-t_mode = 'Road'.
    else.
    Wa_frgt-t_mode = 'Rail'.
    endif.
    it_cond = 0.
    if wa_frgt-netwr eq 0.
    if wa_frgt-vsbed <> '04'.
    select * from a531 into a531
    where werks eq wa_frgt-dwerks and
    zzlgort eq wa_frgt-lgort and
    cityc eq wa_frgt-cityc
    order by datbi DESCENDING.
    if sy-subrc = 0.
    it_cond = 1.
    if ( a531-datbi >= sy-datum and
    a531-datab <= sy-datum ).
    wa_frgt-knumh = a531-knumh.
    exit.
    endif.
    endif.
    endselect.
    if it_cond = 0.
    select * from a524 into a524
    where werks eq wa_frgt-dwerks and
    ZZTRANSP eq wa_frgt-lifnr and
    cityc eq wa_frgt-cityc
    order by datbi DESCENDING.
    if sy-subrc = 0.
    it_cond = 1.
    if ( a524-datbi >= sy-datum and
    a524-datab <= sy-datum ).
    . wa_frgt-knumh = a524-knumh.
    exit.
    endif.
    endif.
    endselect.
    endif.
    if it_cond = 0.
    select * from a530 into a530
    where werks eq wa_frgt-dwerks and
    ZZLGORT eq wa_frgt-lgort and
    inco1 eq wa_frgt-inco1 and
    cityc eq wa_frgt-cityc
    order by datbi DESCENDING.
    if sy-subrc = 0.
    it_cond = 1.
    if ( a530-datbi >= sy-datum and
    a530-datab <= sy-datum ).
    wa_frgt-knumh = a530-knumh.
    exit.
    endif.
    endif.
    endselect.
    endif.
    if it_cond = 0.
    select * from a527 into a527
    where werks eq wa_frgt-dwerks and
    ZZLGORT eq wa_frgt-lgort and
    ZZTRANSP eq wa_frgt-lifnr and
    cityc eq wa_frgt-cityc
    order by datbi DESCENDING.
    if sy-subrc = 0.
    it_cond = 1.
    if ( a527-datbi >= sy-datum and
    a527-datab <= sy-datum ).
    wa_frgt-knumh = a527-knumh.
    exit.
    endif.
    endif.
    endselect.
    endif.
    endif.
    else.
    select * from a519 into a519
    where vsbed eq wa_frgt-vsbed and
    rke_route eq wa_frgt-route
    order by datbi DESCENDING.
    if sy-subrc = 0.
    it_cond = 1.
    if ( a519-datbi >= sy-datum and
    a519-datab <= sy-datum ).
    wa_frgt-knumh = a519-knumh.
    exit.
    endif.
    endif.
    endselect.
    endif.
    if wa_frgt-knumh is not initial.
    select single * from konp into konp
    where knumh = wa_frgt-knumh.
    move konp-kbetr to wa_frgt-netwr.
    if konp-KMEIN = 'BAG'.
    wa_frgt-NQTWR = wa_frgt-NETWR *
    ( wa_frgt-ntgew * ( 20 / konp-kpein ) ).
    else.
    wa_frgt-NQTWR = wa_frgt-NETWR * wa_frgt-ntgew.
    endif.
    else.
    delete it_frgt.
    clear wa_frgt.
    continue.
    endif.
    else.
    wa_frgt-NQTWR = wa_frgt-NETWR.
    endif.
    CLEAR ZFREIGHT.
    if wa_frgt-vsbed = '04'.
    select single distn frgt from Zfreight into Zfreight
    Where Werks eq wa_FRGT-DWERKS
    AND LGORT eq wa_FRGT-LGORT
    AND route eq wa_FRGT-route.
    else.
    if ( it_frgt-lfart = 'ZGNL' ) OR ( it_frgt-lfart = 'ZGLF' ).
    Select single * from Zfreight into Zfreight
    Where Werks eq wa_FRGT-DWERKS
    AND cityc eq wa_FRGT-cityc
    AND route eq wa_FRGT-route.
    else.
    Select single * from Zfreight into Zfreight
    Where Werks eq wa_FRGT-DWERKS
    AND LGORT eq wa_FRGT-LGORT
    AND cityc eq wa_FRGT-cityc
    AND route eq wa_FRGT-route.
    endif.
    endif.
    if sy-subrc = 0.
    wa_FRGT-RRKM = ZFREIGHT-DISTN.
    if wa_frgt-rrkm > 0.
    wa_frgt-NKTWR = wa_frgt-rrkm * wa_frgt-ntgew.
    endif.
    IF ZFREIGHT-FRGT = 'P'.
    wa_frgt-BEZEI = 'Primary Freight'.
    Endif.
    IF ZFREIGHT-FRGT = 'S'.
    wa_frgt-BEZEI = 'Secondary Freight'.
    Endif.
    endif.
    modify it_frgt from wa_frgt index loop_index .
    Loop_index = loop_index + 1.
    endloop.
    endif.
    Sort it_frgt by Regio dwerks lgort Vkbur district bran1 mvgr1 t_mode.
    Clear:WA_frgt.
    Loop at it_frgt.
    If wa_frgt is initial.
    move-corresponding it_frgt to wa_frgt.
    wa_frgt-NQGEW = 0.
    wa_frgt-NQTWR = 0.
    wa_frgt-NKTWR = 0.
    endif.
    if it_frgt-lfart eq 'ZGDR' .
    it_frgt-NQGEW = it_frgt-NQGEW * -1.
    it_frgt-NQTWR = it_frgt-NQTWR * -1.
    it_frgt-NKTWR = it_frgt-NKTWR * -1.
    endif.
    if it_frgt-regio = wa_frgt-regio and
    it_frgt-dwerks = wa_frgt-dwerks and
    it_frgt-lgort = wa_frgt-lgort and
    it_frgt-vkbur = wa_frgt-vkbur and
    it_frgt-district = wa_frgt-district and
    it_frgt-bran1 = wa_frgt-bran1 and
    it_frgt-t_mode = wa_frgt-t_mode.
    wa_frgt-NQGEW = wa_frgt-NQGEW + it_frgt-NQGEW.
    wa_frgt-NQTWR = wa_frgt-NQTWR + it_frgt-NQTWR.
    wa_frgt-NKTWR = wa_frgt-NKTWR + it_frgt-NKTWR.
    else.
    Append wa_frgt to it_sfrgt.
    Clear wa_frgt.
    move-corresponding it_frgt to wa_frgt.
    wa_frgt-NQGEW = 0.
    wa_frgt-NQTWR = 0.
    wa_frgt-NKTWR = 0.
    wa_frgt-NQGEW = WA_frgt-NQGEW + it_frgt-NQGEW.
    wa_frgt-NQTWR = wa_frgt-NQTWR + it_frgt-NQTWR.
    wa_frgt-NKTWR = wa_frgt-NKTWR + it_frgt-NKTWR.
    endif.
    AT LAST .
    Append wa_frgt to it_sfrgt.
    Clear wa_frgt.
    ENDAT.
    endloop.
    sort it_sfrgt by regio dwerks lgort Vkbur district bran1 t_mode rrkm nqgew nqtwr nktwr avg_frt.
    Loop At IT_SFRGT.
    IT_SFRGT-RRKM = 0 .
    IF IT_SFRGT-NQGEW > 0 AND IT_SFRGT-NQTWR > 0.
    IT_SFRGT-AVG_FRT = IT_SFRGT-NQTWR / IT_SFRGT-NQGEW.
    ENDIF.
    IF IT_SFRGT-NQGEW > 0 AND IT_SFRGT-NKTWR > 0.
    IT_SFRGT-RRKM = IT_SFRGT-NKTWR / IT_SFRGT-NQGEW.
    ENDIF.
    IF IT_SFRGT-RRKM > 0 AND IT_SFRGT-AVG_FRT > 0.
    IT_SFRGT-FRT_RT = IT_SFRGT-AVG_FRT / IT_SFRGT-RRKM.
    ENDIF.
    MODIFY IT_SFRGT .
    Endloop.
    Sort it_sfrgt by REGION vkorg dwerks lgort t_mode rwerks mvgr1.
    loop at it_sfrgt.
    move-corresponding it_sfrgt to itab1.
    append itab1.
    endloop.
    loop at itab1.
    move-corresponding itab1 to IT_FINAL.
    append it_final.
    endloop.
    ENDFUNCTION.
    AND I created another function module ZTEST_RFC.
    In ZTEST_RFC MODULE I AM CALLING ABOVE FUNCTION MODULE ZTEST_FUNC.
    NOW its going to dump its showing the error CALL_FUNCTION_UC_STRUC RUNTIME ERROR IS COMING.
    how can i solve this problem could any body tell me its very urgent.
    In ZTEST_FUNC  function module only i am collecting the data and put into IT_FINAL INTERNAL TABLE.

    According to
    http://help.sap.com/saphelp_nw04/helpdata/en/f9/3f69fd11a80b4e93a5c9230bafc767/content.htm
    The reason for the Runtime error: CALL_FUNCTION_UC_STRUCT is that "Type conflict while transferring structure ".
    I'd suggest therefore that you check the definition of the variables in ZTEST_RFC where it calls ZTEST_FUNC as there would seem to be a mismatch.  If you are editing ZTEST_RFC, try using the Check > Extended check functionality as this will typically pinpoint such problems for you.

  • Reg RFC to JDBC scenario

    Hi Techies,
    This is inregard of RFC to JDBC Scenario.
    Iam having an old RFC to JDBC scenarion which is working fine.
    I want to call other BAPI programme using the same RFC connection.
    I have changed  BAPI and ABAP Programmes.
    But Still in my integration builder, Still the RFC is calling the old stucture.
    How flush the buffer and call the new structure using the same RFC.
    Regards,
    Kiran

    But Still in my integration builder, Still the RFC is calling the old stucture.
    what about the RFC structure that is imported in IR/ ESR....was it re-imported?

  • Reg: RFC call in same system

    Hello All,
    There is a Function module which is remote enabled (RFC) and can that same FM can be called in R3?
    Thanks In Advance
    Regards,
    Suganya.

    Hi Suganya,
    Yes, you can call an RFC function module within the same SAP application server environment. Just use one of the following options when you call the FM:
    - SPACE
    - NONE
    Using these options in combination of CALL FUNCTION..... DESTINATION will allow you to invoke the FM. However, it is not required to call the FM in RFC mode, in general. But this really depends on the logic.
    Shahram

  • Help reg RFC Destination

    Hi Folks,
        I have send send IDoc from XI system to R3 system. For this I am creating RFC Destination in XI system using txn SM59. Also the name of RFC Destination in XI is same as Logical System Name in R3 system for that client.
      After creating RFC Destination I did 'Test Connection' , which was successful. But on doing 'Remote Logon' it in neither giving any error nor opening Remote Session.
      Can anybody tell me why remote session is not opening?
    Thanks in Advance.
    Swamy

    Hi swamy,
    if it does not open the remote session the reason is that the user you are using is a non dialog (correct) user so it cannot logon in dialog mode but is used for communications.
    To check if the logon parameters (user/pwd) are correct use from the menu  of SM59 test->authorization.
    Regards,
    Sergio

  • Reg: RFC FM

    Hi,
    I have to create a RFC enabled function module which will be called by a different system.
    The function moudule will have a date parameter as an importing parameter and a table in the tables parameter to store the results.
    However when I tried to reference the importing date parameter as p_date type syst-datum there is a message which is being displayed that "Reference Parameters are not allowed with RFC".
    I am unable to understand why this message appears.The FM is not getting activated.I tried referencing the date parameter to other data types but with no success.
    Please help me.
    Thanks,
    Sandeep

    Hi,
    RFC are have more checks. Here you use P_DATE LIKE SYST-DATUM. It is just data type define problem.
    Regards,
    Dhanunjaya Reddy.

  • REG: RFC lookup

    Hi all,
                 In my scenario i need to use RFC lookup for the receiver system . Can u guys suggest me a method how to implement the RFC lookup.
    Thanks,
    Siva.

    Hi,
    Check this blogs for the steps:
    1)Use this crazy piece for any RFC Mapping Lookups!
    2)The specified item was not found.
    Regards,
    Ramya Iyer

  • Reg rfc & idoc

    hai all,
    i want to know exactly the reason why RFC resides on Java stack and where as IDoc resides on Abap stack, as they both belongs to SAP R/3.
    Thanking You All,
    Mohammed Akmal.

    Hey,
    Same topic was discusssed y'day check this thread.
    Process Integration (PI) & SOA Middleware
    Prateek asnwer is most near same as it think of.
    <b>Cheers,
    *RAJ*
    *REWARD POINTS IF FOUND USEFULL*</b>

  • Reg : RFC Lookups

    Hi..
    Now i have a scenario for u instead :
    this is what gimme a solid realistic approach : 
    i have records in this format lets say :
    RecordID   ordertype
    900           0305
    900           0305
    920           DS01
    900           0304
    900           0305
    920           DS02
    Now here is what i have look into :
    for all 900's whose Ordertype is same i have to make a call and then to decide to create/change by an RFC Lookup, with this RFC Lookup i have to then decide on which IDOC i have to map to . So that means i have to sort all the records of 900's based on ordertype with in the mapping itself and then make a call to IDOC .
    I am not expecting whether to use XSLT / Java mapping ,  I can only use custom functions. Lemme know whatz the best approach?
    for all 920's its not that complex but all 920 goes to one IDOC.
    Any clue?
    regards..sankar

    Hi Michal,
    >>>>>I'd go with Shravan's approach for sure
    please send link for this, i do not have shravan's approach?
    Hope you got my problem: or else see follow:
    I am outlining the scenarios here :
    I have a flat file with a following type of records:
    RecordID   ordertype
    900           0305    ..............................
    900           0305    .............................
    920           DS01 .............................
    900           0304 .........................................
    900           0305 .....................................
    920           DS02 .......................
    930    -->not concerned with these type of records
    Now here is what i have look into :
    for all 900's whose Ordertype is same i have to make a call and then to decide to create/change by an RFC Lookup, with this RFC Lookup (i.e. i have to group all the records with ordertype same ) i have to then decide on which IDOC i have to map to .
    i.e. For all 900's with one ordertype if i find that there exists an OPEN_PO then i have to call one IDOC with one set of values along with values returned from that RFC
    if its OPEN_PO is blan that i should send values to another IDOC
    for all 920 records i have to call another IDOC .
    I am not expecting whether to use XSLT / Java mapping ,  I can only use custom functions.  well lemme know whatz the best approach?
    Please help
    thanks,
    regards
    sankar

  • Reg: RFC / IDOC required for doing CIDX Scenario

    Hi! Gurus,
    This is Amar Srinivas Eli. I have task here to work and implement CIDX Scenario succesfully. There are some business cases as per the CIDX standards from that I was selected one Business case i,,e, FORECASTING.
    But inorder to implement that scenario I need some RFC's or  IDOC lists from SAP side whether it may be a source or target side..what ever it may be...and other side will be CIDX format.
    Here I need your help in the below mentioned tasks. Kindly help me out in a detailed step by step guide and do the needful to me.
    1. How to get RFC / IDOC name from R3 System and I know that I can get RFC from SE37 and IDOCs 
        from WE05 but I need whether all the required fileds are statisfying in the RFC's or not.
    2. My first preference is only for STANDARD SAP RFCs or IDOCs.
    3. Please let me know how to see the inner fields present in those RFC's
    4. ALso please provide any configuration guide which contains screen shots if you already worked
        earlier on CIDX Scenario I mean step by step and also for testing
    5... tell me if there is any other tool other than STK kit for testing CIDX messages.
    6.  Is there any Freeware STK tool kit is there or not...
    Also share your experience and errors that you have faces while doing this CIDX Scenario.
    Regards:
    Amar Srinivas Eli

    Hi! All,
    Thanks for your fast response..
    Hi! Raja,
    I gone through your points. Here I have few doubts on those please clarify that.
    1. Coming to testing i didt used any testing tool , but you can comre your output using XML Spy or Stylus studio.*
    *CIDx Documents,you wil find in SDN please search in SDN.
    Means Without using STK Tool or else some other tool How can I get the CIDX response for my request in the Testing environment. See I am not doing this in  real time I am trying to findout the solution for Business cases so I need one testing environment tool right ? Is that ALTOVA XML spy will give no right ?
    Note: You told that you have done that business case IDOC--CIDX Order change / req Will you please share the information documentation I mean step  by step procedure for end to end doc...based on your scenario ?
    2. I know those R3 and PI settings I mean configurations means ports and RFC destinations and all those..but only thing I dono is "How you got that IDOC I mean on what basis and how did u search the IDOC?"
    3.  See Here I am working on topic FORECASTING it includes so many sub tasks like Deman PLan req and response, supply plan req and response and replenishment order and etc....so based on that how can I get those related RFC's or IDOC's in order to communicate from R3 Side
    If Suppose I have seen one RFC/IDOC and for example out of 10 fields few are there in one IDOC and another few are there in another IDOC then in that case I need to go for Multimapping IDOCs I mean 2 Senders to one Receiver if yes Is it possible?
    My first requirement is based on the above mentioned business cases how can I get the corresponding RFC's or IDOCs ?
    Regards:
    Amar Srinivas Eli
    Edited by: Amar Srinivas Eli on Jan 5, 2009 12:19 PM

  • Reg RFC TO SOAP Scinario

    Hi Friends,
                  I am using synchronous RFC<->PI<->SAOP scinario. In this RFC is getting dump in the R/3 system itself for some data and got excuted for data.I chcked both channel are fine ( i mean both RFC and SOAP communications are showing green color). there is no error message on MONI for that particular inetrface. RFC connection is fine between R/3 to PI. Is theer any problem from PI if the problem is ther what is that. Is theer any chance to see the messages which comming to PI  in the R/3 itself.

    Hi Ramakrishana,
    -->The problem might be with your RFC check it once.
    -->Whether you are testing the scenario by using the RFC or using the Program?
    -->If you are testing the scenario using the program make sure that the data type which yuo maintained are compatable.
    Thanks

  • Reg RFC to JDBC "Parsing an empty source. Root element expected!"

    Hi techies,
    This in regard of RFC to JDBC.
    in integration test iam getting the error.
    "com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_mm_mapping_: Parsing an empty source. Root element expected!"
    My Mapping and interface mapping tests are working fine, while testing the configuration Iam getting this error.
    My interface Mapping test result is as mentioned below
    Sender Interface (RFC Sender)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ZTEST_PI_ZHRT002 xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
       <ZHRT002>
          <item>
             <MANDT/>
             <PERNR>1234</PERNR>
             <PERID>kiran</PERID>
             <SHOPN>test</SHOPN>
          </item>
       </ZHRT002>
    </ns0:ZTEST_PI_ZHRT002>
    Reciver Interface after test
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:mt_receiver xmlns:ns1="urn:sap-com:RFC2JDBC"><Statement><dbTableName action="INSERT"><table>ZHRT002</table><access><PERNR>1234</PERNR><PERID>kiran</PERID><SHOPN>test</SHOPN><access></dbTableName></Statement></ns1:mt_receiver>
    My message Mapping is as mentioned below
    ZTEST_PI_ZHRT002 is my BAPI which is mapped to mt_receiver.
    ZHRT002 it my table which is mapped to Statement of reciver
    item of sender is floating ( not mapped to any reciver node)
    subsequently feilds are mapped.
    Reciver action is atribute (required) calling INSERT
    table is "ZHRT002" (constant) (1...1)
    This is my scenario.
    Thanks in advance,
    Regards,
    Kiran

    This is RFC to JDBC. Is it Synchronous or Asynchronous?
    Some tips:
    Create JDBC target data structure something similar to this
    <StatementName>
    <dbTableName action=u201DINSERTu201D>
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    </dbTableName> 
      </StatementName>
    Map  Table name and action using Constant.
    >>item of sender is floating ( not mapped to any reciver node)
    What is that? you have to map source item node fields to target access fields.
    Please go through the below sap link . This might be very helpful.
    http://help.sap.com/saphelp_nw70/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

  • REG: RFC 's

    I am created one rfc like ZTEST_func_call.
    which is having import and table parameters.
    now i call this rfc function moudule in another rfc function module
    like:
    call function 'ZTEST_FUNC_CALL' in background task.
    but its no tworking
    would you give me any suggestion
    regards,
    Chaitanya

    have u passed the required variables to the import parameters and table parameters of the called FM. If u have passed correctly, then it should work fine.

  • Reg:rfc function modules

    can i call below functionmodule in within the rfc function module.
    CALL FUNCTION 'ZTEST_FUNC' in background task
    here ztest_func is the rfc function module.
    could any body please tell me its very urgent.
    Regards,
    Chaitanya

    Yes you can call it but, you have to ensure that you do a COMMIT WORK after the LUW for the function module to get executed in the background.
    CALL FUNCTION 'ZTEST_FUNC' in background task
    COMMIT WORK. ( This kicks off the function module).
    hith
    Sunil Achyut

Maybe you are looking for

  • 3D option not showing up for me in Photoshop!?

    Hey guys, I'm using my Photoshop CS6 Extended & I'm trying to utilize the '3D' effect feature, but it's not showing up where it should be.... I been following video tutorials & such online from other users of my same photoshop version, & I'm seeing w

  • Flash quiz templates question

    Hi, I am still using flash 6.0, the version the school gave me, anyway first of all are there any updates available somewhere?  I'm silll with the original 6.0000000 version. Now, my main point, I am creating a flash quiz using the templates availabl

  • Cs3 updates

    In Flash8 you were able to compile a .dll file using codewarrior on mac. Creating an mxi file install the appropriate files. Now in CS3 you have to create .bundle using xcode. mxi files don't support it, the file is installed as a folder. Any ideas a

  • Somewhat Blurry Slideshow

    Hi, I scanned some 4 X 6 print photos in JPEG format. They look quite clear and sharp in Preview. After I imported them into DVDSP for a slideshow and built the project, the photos look like they lost a good deal of their sharpness, at least using DV

  • [svn:fx-trunk] 11449: Adding OSMF to our framework.

    Revision: 11449 Author:   [email protected] Date:     2009-11-04 17:09:57 -0800 (Wed, 04 Nov 2009) Log Message: Adding OSMF to our framework.  The osmf.swc builds automatically as part of our build process.  I'm also adding new video classes that us