Function module Global variables not cleared from memory?

Hi,
This is may be simple & stupid question ( after posting  4242 posts ):)
" Declaration in TOP
data : begin of i_y1yatt occurs 0.
        include structure y1yatt.
data : end of i_y1yatt.
types: begin of t_yatt71.
       include structure yatt71.
types: tcode like sy-tcode.
types: dflag type c.
types: end of t_yatt71.
data : i_yatt71 type standard table of t_yatt71
               with default key  with header line  initial size 0.
This is code in the function module.
  loop at i_y1yatt.
    move-corresponding o_y1yatt to i_yatt71.
    if i_y1yatt-werks eq 'N501'.
       move space to i_yatt71-werks.
    endif.
    append i_yatt71. 
    " Here this internal contains the previous entry
    clear i_yatt71.
  endloop.
This function module is called 25 times in a minute.
My problem is this
For example : 1st tranmission is called this fm with 50 records,
and 2nd tranmission is called fm with 10 records.
My results are showing
last record in the 1st transmission is still on the memory while calling 2nd transmission.  ( Here in int table I_YATT71 still contains the 1st transmission's last records during the 2nd tranmission call)
As per my knowledge if each time calls comes in to fm all gloabl variables get cleared. but some how this not happening.
Anybody come across this scenario.
PS. I know i need to use clear statement within the loop as first statement.

You must understand that when calling a FM, you load the entire function group into memory. IF there are global variables, then they are "alive" for the entire duration of the program execution. Meaning if you call the function numerious times, or even if you call another function within the same function group, the functions still have access to that same global variable space, so it must always be cleared manually by the developer at the required points.  You can not rely on the runtime to clear the global variables at the end of the function call.  So you should clear all you globals as the first operation in your function module call, if that is what is required.
Is this clear?
Regards,
Rich Heilman

Similar Messages

  • Function module to EXPORT/IMPORT to/from MEMORY?

    Hi Gurus,
    As EXPORT /IMPORTstatements come under obsolete statements.SO i am getting error in code when i compile using code inspector.
    PLease let me know if there is any function module that does the work of EXPORT and IMPORT.
    It woukl be kind if you explain how to put values in those function module to get desired output.
    Thanks

    Hi ,
      You can use these FM
    Export  to Memory
    C14Z_EXPORT_field_TO_MEMORY
    C14Z_EXPORT_TO_MEMORY
    Import From Memory
    C14Z_IMPORT_FIELD_FROM_MEMORY
    C14Z_IMPORT_FROM_MEMORY
    Regards,
       Seema

  • Can i pass parameter or global variable in view from 6i form

    hi master
    sir can i pass parameter or global variable in view from 6i form
    i use view for some diff column calculation within the date then i use
    where date between data1 and date2
    in view but view not create
    please give me idea how i pass external value in view
    thank
    aamir

    Hi Antony!
    I feel it may not produce the right results if you
    dont include the where clause and using only group by
    in view.You felt? Please clear, logical thoughts put here, not feelings.
    (It may very well have all the Debit, Credit
    for all the Accid where as the user wants only for
    r some date range)Data range is determinated in Form by user, so if view should give final data set then you must back
    on Ranjana first question: How to pass parameter or global variable to view from 6i form?
    And also as Ranjit pointed out, If you have only
    accid, sum(debit), sum(credit) in View, wheres this
    enddate ??Of course, column entdate (or enddate?) must be included in view...
    Cheers!

  • [svn] 2692: Bug: BLZ-227 - When using JMS Destination, MessageClient and FlexClient not released from memory when the session times out .

    Revision: 2692
    Author: [email protected]
    Date: 2008-07-31 13:05:35 -0700 (Thu, 31 Jul 2008)
    Log Message:
    Bug: BLZ-227 - When using JMS Destination, MessageClient and FlexClient not released from memory when the session times out.
    QA: Yes
    Doc: No
    Checkintests: Pass
    Details: Fixed a memory leak with JMS adapter. Also a minor tweak to QA build file to not to start the server if the server is already running.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-227
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/services/messaging/adapters/J MSAdapter.java
    blazeds/branches/3.0.x/qa/build.xml

    Revision: 2692
    Author: [email protected]
    Date: 2008-07-31 13:05:35 -0700 (Thu, 31 Jul 2008)
    Log Message:
    Bug: BLZ-227 - When using JMS Destination, MessageClient and FlexClient not released from memory when the session times out.
    QA: Yes
    Doc: No
    Checkintests: Pass
    Details: Fixed a memory leak with JMS adapter. Also a minor tweak to QA build file to not to start the server if the server is already running.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-227
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/services/messaging/adapters/J MSAdapter.java
    blazeds/branches/3.0.x/qa/build.xml

  • BAPI function module 'BAPI_PO_CHANGE' is not updating aacural condition

    Dear All,
    BAPI function module 'BAPI_PO_CHANGE' is not updating aacural condition in PO pricing. Please give me a right solution on this query.
    Below I have given my code.
    Thanks and Regards
    Makarabd
    poitem-po_item = '00010'.
    poitem-net_price = '1060.00'.
    poitem-period_ind_expiration_date = 'D'.
    APPEND poitem.
    poitemx-po_item = '00010'.
    poitemx-po_itemx = 'X'.
    poitemx-net_price = 'X'.
    APPEND poitemx.
    select single * from ekko where ebeln = po_no.
    pocond-itm_number = '00010'.
    pocond-cond_type = 'ZVCU'.
    pocond-cond_value = 10.
    pocond-currency = '%'.
    pocond-STAT_CON = 'X'.
    pocond-accruals = 'X'.
    pocond-change_id = 'I'.   " I - Add , U - Update , D - Delete
    APPEND pocond.
    pocondx-itm_number = '00010'.
    pocondx-itm_numberx = 'X'.
    pocondx-cond_type = 'X'.
    pocondx-cond_value = 'X'.
    pocondx-currency = 'X'.
    pocondx-change_id = 'X'.
    pocondx-STAT_CON = 'X'.
    pocondx-accruals = 'X'.
    APPEND pocondx.
       CALL FUNCTION 'BAPI_PO_CHANGE'
            EXPORTING
              purchaseorder          = po_no
            TABLES
              return                 = return
              poitem                 = poitem
              poitemx                = poitemx
              pocond                 = pocond
              pocondx                = pocondx.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'.

    Hi ,
    Are you trying to pass the non char fields in CI_COBL. Please look at the link below .
    [http://forums.sdn.sap.com/thread.jspa?threadID=1137795] .
    Also serach for the similar threads when and notes while transferring currency and quantity field in different custom includes of the EKPO ...
    Thanks,
    Anjaneya .

  • ABAP Function Module Example to move data from one Cube into Another

    Hi experts,
    Can any please help out in this ..?
    A Simple ABAP Function Module Example to move data from one Cube into Another Cube
    (How do i send the data from one client to another client using Function moduel).
    Thanks
    -Upen.
    Moderator message: too vague, help not possible, please describe problems in all technical detail when posting again, BI related? ("cube"), also search for information before asking.
    Edited by: Thomas Zloch on Oct 29, 2010 1:19 PM

    This is the start routine to duplicate records in two currencies.
    DATA: datew   TYPE /bi0/oidateto,
          datew2  TYPE rsgeneral-chavl,
          fweek   TYPE rsgeneral-chavl,
          prodhier TYPE /bi0/oiprod_hier,
          market  TYPE /bic/oima_seg,
          segment TYPE /bic/oizsegment.
    DATA: BEGIN OF S_DATA_PACK OCCURS 0.
            INCLUDE STRUCTURE /BIC/CS8ZSDREV.
    DATA: END OF S_DATA_PACK.
    S_DATA_PACK[] = DATA_PACKAGE[].
      REFRESH DATA_PACKAGE.
      LOOP AT S_DATA_PACK.
        move-corresponding s_data_pack to DATA_PACKAGE.
        if DATA_PACKAGE-loc_currcy = 'EUR'.
          DATA_PACKAGE-netval_inv = DATA_PACKAGE-/bic/zsdvalgrc.
          DATA_PACKAGE-CURRENCY = 'USD'.
          APPEND DATA_PACKAGE.
          DATA_PACKAGE-netval_inv = DATA_PACKAGE-/bic/zsdvalloc.
          DATA_PACKAGE-CURRENCY = 'EUR'.
          APPEND DATA_PACKAGE.
        else.
          DATA_PACKAGE-netval_inv = DATA_PACKAGE-/bic/zsdvalgrc.
          DATA_PACKAGE-CURRENCY = 'USD'.
          APPEND DATA_PACKAGE.
        endif.
      ENDLOOP.
    This is to load Quantity field
    RESULT = COMM_STRUCTURE-BILL_QTY.
    This is to load Value field
    RESULT = COMM_STRUCTURE-NETVAL_INV.
    UNIT = COMM_STRUCTURE-currency.

  • Function Module " /Crystal/GET_FUNCAREA_CATALOG" not found

    Good day Masters
    I am not able to connect to our SAP ECC6.0 because of the below error
    Function Module " /Crystal/GET_FUNCAREA_CATALOG" not found
    is this function modules exists on the transport files ? do you think by executing the transport this problem will be resolved ?
    and how we can execute the transport files from Basis perspective ,,, our basis tried to execute this transport to they got belw error
    " file might be currapted "
    Regards

    Hi
    your BASIS administrator should copy the transport files in the import queue and use the STMS transaction to import them in your system. Make sure to import the UNICODE version in the order as shown in the transports_<your language>.txt file.
    Make sure that the files are indeed imported.
    Which version of BOBJ are you using?
    Regards,
    Stratos

  • Preview error function module "CRYSTAL/MDX_GET_STREAM_INFO" not found

    Hi,
    I cannot preview the report I created in Crystal Report 2008. Here is 1st error message "Failed to retrieve data from the database. Then the 2nd error message is "Database connector error: : Function module 'CRYSTAL/MDX_GET_STREAM_INFO' not found. My data source is from MDX query.
    Thanks in advance.
    Rose

    Hi
    Contact your basis administrator to ensure
    - All the transports have been installed properly.
    - Check the version of Crystal Reports and BusinessObjects and the SAP MDX driver version.
    For CRXIR2 +BOXIR2 this issue was resolved in CHF15.
    Regards
    Sourashree

  • Function module RSD_ZIO_ALM02_TXT_GET does not exist

    Hi
    I am trying to copy the data from one info cube to another info cube with the read master data in transformation rule for some of the info object. This exercise I have done many times successfully for the same structure but suddenly I am getting this error without doing any changes
    'Function module RSD_ZIO_ALM02_TXT_GET does not exist'
    After getting this error I have delete the transfer rule for above object than the some error are coming for the another info object which also used for read master data.
    Kindly help me .(we are working on ECC 6)
    Thanks and Regards
    Vinay

    Hi Vis
    I tried this one also but it’s not working. All the info objects are active and I tried after reactivating also but still error exits.
    Thanks and regards
    Vinay

  • Function module RSD_ZBCSASSET_TXT_GET does not exist

    Hi,
    We are working with SEM-BCS 6.0 (SAP BI 7.0), and I want to trasfer master data of a infoobject from BI to SEM BCS through load from data stream task.
    When I going to execute the task the system display the next message Function module RSD_ZBCSASSET_TXT_GET does not exist.  Message no. EU802.
    Thanks in advanced
    Carlos

    Same error occured in a planning sequence of mine. The related characteristic did not have texts.
    The error occured after the addition of a navigational attribute to the MultiProvider.
    Solution: re-activate the aggregation level.
    Late, but hope that helps...

  • Functional module to Copy measurement points from one equipment to another

    HI,
    Please give some body function module to Copy measurement points from one equipment to another which is not assign to functional location.

    To Copy Measuring Points from one equipment to another , Go to transaction IE10 and copy all the relevant data that need to be copied Check the measuring point check box, it would copy the characteristic for measuring point to the newly created equipment and would create a system generated number for the measuring point. Both the measuring points would have the same characteristics and if they are attached to each other in a hierarchy then the measurement document readings could also be transferred from one measuring point to another.. You could use the following Function Module "EQUIPMENT_COPY" to copy the measuring point from one equipment to another if equipment has already been created.
    Regards...
    Edited by: Usman Kahoot on Jun 9, 2010 2:37 PM

  • Calling a remote enabled function module which does not exist in caller sys

    Hi,
    I have a a system ABC from which I am trying call a rfc enabled fm(Test) present in system XYZ.
    The fm(Test) does not exist in the system ABC so I am getting generation errors and dumps.
    Is there a way for me to call these remote enabled function modules which does not exist in the caller system without the obvious errors etc.
    Is there any special way.
    Thanks

    Hi,
    please check this sample:
    REPORT  zcallfm                                 .
    DATA: xv_return TYPE sysubrc.
    CALL FUNCTION 'DOESNOTEXIST'
    DESTINATION   'NOWHERE'
    EXPORTING     caller                = sy-sysid
    IMPORTING     return                = xv_return
    EXCEPTIONS    system_failure        = 1
                  communication_failure = 2
                  OTHERS                = 4.
    It shouldn't throw any generation errors in your system!
    Regards,
    Klaus

  • Function module to convert date format from yyyymmdd to mmddyyyy format

    function module to convert date format from yyyymmdd to mmddyyyy format

    Hi Rajitha,
    Do like this
    Data: Var1 type sy-datum,
             var2(8) type c.
    var1 = sy-datum.
    Concatanate var1+4(2) var1+6(2) var1+0(4) into var2.
    write var2.
    Reward Points if this helps,
    Satish

  • Function module to get the dates from the year and the period

    Is there a function Module to get the dates from the year and the period

    Check with :
    To get last day of period use .
    LAST_DAY_IN_PERIOD_GET.
    To get last of month Use :
    RE_LAST_DAY_OF_MONTH
    HRVE_LAST_DAY_OF_MONTH
    LAST_DAY_OF_MONTHS
    ISB_PREVIOUS_PERIOD_DATE_GET
    Thanks
    Seshu

  • Request having function group released but function module attribute shows not released

    Hi experts,
                   I am a beginner.
                  There is a transport request in which my function group and other objects were present . This transport request and its task were released . But if i check the attributes section of the function module that is present in that function group , it shows not released .
    Is there some problem ? did the function module not get released with its group? It wasn't showing anywhere in the request even though i had added it during creation.
    Here is the image :
    Thanks,
    Unnati

    Hi,
    Those two meanings of 'released' are unrelated. Don't worry about it.
    Also, a function module sometimes does not explicitly appear in a transport request, if the function group is already in there.
    cheers
    Paul

Maybe you are looking for