Export / Import  from Memory in background.

Hi,
I have a trouble and I dont know very well how to solve it.
I have a Z report running in background, and this report uses a SUBMIT to call another one.
Before the SUBMIT, there is an EXPORT to memory sentence; and the second report read this memory cluster and works with the data; but it doesnt work.
When I execute online, there is no problem, and the 2nd report shows an ALV with data exported in 1st report, but in background, nothing is shown.
Could you give me some help?
A lot of thanks!

Hello Alvaro,
This is simple. There are two types of memories in SAP. ABAP and SAP memory. These memories have some properties. ABAP memory remains active as long as the program is in the same session. When ever there is a new session the old ABAP memory get refreshed, and a new ABAP memory comes into picture.
In your case, before submitting the program to some other program you are exporting the value. Export will transfer the value to the ABAP memory. And after that you are submitting the program so a new session is being created and the ABAP memory is refreshed and so when you import that value you will get nothing.
So in order to solve the matter. Find a data element whose parameter ID you can set or you can create a custom data element witha  custom parameter id and use that parameter id. Use the GET / SET parameter id to set or get the values. In that case the value is being stored at the SAP memory instead of ABAP memory.
You can have a look the following site for the custom parameter ID creation:
http://www.****************/Tutorials/ABAP/ParameterID/custom.htm
Rewards points if found useful.
Regards.
Abhijit.

Similar Messages

  • Export/Import from Memory

    Sometimes after I export from one program, user exit, etc., then I import in another program, user exit, etc. the field value does not show up. It is usually in two totally unrelated programs, or other, that are in different function groups, but sometimes it works? I need to capture a value in a PAI screen, that later  goes into another user exit. Has anyone had this issue with Import/Export? Is there another way I can tru to pass this parameter to the second program?
        Thank-You.

    Hi TMM,
    You have to consider that the Memory Variables from Program 1 will be released if the session is over and that's why maybe our Program 2 might not get them correctly. If that is the scenario you will need to save your data in maybe a table then use it in program 2.
    Regards,
    Gilberto Li

  • EXPORT/IMPORT  to MEMORY

    Hi,
    I want to know if a parameter ID  of "export/import to memory" instruction is available in two differents session with different user's login?
    tks
    Carlos

    The use of the shared buffer may be of some interest to you.
    <b>From F1 help</b>
    <i>EXPORT obj1 ... objn TO SHARED BUFFER dbtab(ar) ID key.
    Additions:
    1. ... = f (for each field you want to export)
    2. ... FROM f (for each field you want to export)
    3. ... CLIENT g (before ID key)
    4. ... FROM wa (as last addition or after dbtab(ar))
    In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Implicit field names not allowed in clusters and Table work areas not allowed.
    Effect
    Stores a data cluster in the cross-transaction application buffer.The specified objects obj1 ... objn (fields, structures, or tables) are stored as a single cluster in the buffer.
    The specified table dbtab must have a standard structure.
    The buffer area for the table dbtab is divided into various logically-related areas (ar, two-character ID).
    You can export a collection of data objects (data cluster) to an area of the buffer under a key of your own choosing (key field).
    You can import individual data objects from this collection using the IMPORT statement (as long as the data has not been deleted from the buffer).
    Notes
    In classes, you must always specify explicit names for the data objects. Addition 1 or addition 2 is therefore obligatory.
    In classes, you must always specify the work area explicitly. Addition 4 is therefore obligatory.
    The table dbtab that you specify after SHARED BUFFER must be declared under TABLES (except in addition 4).
    You cannot export the header line of an internal table. If you specify the name of an internal table with a header line, the system always exports the actual table data.
    You cannot export data, object, and interface references.
    Please consult Data Area and Modularization Unit Organization documentation as well.
    Example
    Exporting two fields and an internal table to the buffer with structure INDX:
    TABLES INDX.
    TYPES: BEGIN OF ITAB3_TYPE,
              CONT(4),
           END OF ITAB3_TYPE.
    DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
          F1(4), F2 TYPE P,
          ITAB3 TYPE STANDARD TABLE OF ITAB3_TYPE WITH
                     NON-UNIQUE DEFAULT KEY INITIAL SIZE 2,
          WA_INDX TYPE INDX.
    Fill data fields before CLUSTR
    before the actual export
    INDX-AEDAT = SY-DATUM.
    INDX-USERA = SY-UNAME.
    Export data.
    EXPORT F1    FROM F1
           F2    FROM F2
           ITAB3 FROM ITAB3
           TO SHARED BUFFER INDX(ST) FROM WA_INDX ID INDXKEY.
    Addition 1
    ... = f (for each object you want to export)
    Effect
    Exports the contents of the field f and stores them under the specified name.
    Addition 2
    ... FROM f (for each field you want to export)
    Effect
    Exports the contents of field f and stores them under the specified name.
    Addition 3
    ... CLIENT g (before ID key)
    Effect
    The data objects are stored in client g (as long as the import/export table dbtab is client-specific).
    Addition 4
    ... FROM wa (as last addition or after dbtab(ar))
    Effect
    Use this addition if you want to store user data fields in the application buffer. Instead of the table work area, the system uses the specified work area wa. The specified work area must have the same structure as the table dbtab.
    Example
    DATA WA LIKE INDX.
    DATA F1.
    WA-AEDAT = SY-DATUM.
    WA-USERA = SY-UNAME.
    WA-PGMID = SY-REPID.
    EXPORT F1 = F1 TO SHARED BUFFER INDX(AR)
                   CLIENT '001' ID 'TEST'
                   FROM WA.
    Note
    Catchable runtime error
    EXPORT_BUFFER_NO_MEMORY: The EXPORT data cluster is too big for the application buffer. This error should not occur often, since the buffer uses a procedure similar to the LRU(Least Recently Used) procedure to monitor the buffer contents. However, if the error does occur, you can increase the profile parameter rsdb/obj/buffersize (see Profile Parameter Attributes), which may help.</i>
    Regards,
    Rich Heilman

  • IMPORT FROM MEMORY ERROR

    When ever i run a driver program of Sap-Scrip i get an abend msg statin IMPORT FROM MEMORY ERROR: Program canceled. what should i do to get over this error...???

    Hi Kunal,
    Once again u check out the parameters u passed  correctly or not in FM.
    Give first &  next page in script layout.

  • IMPORT FROM MEMORY from a report painter.

    Hi experts.
    I have a report painter that calls an ABAP program.
    In the abap code, am I able to get the data shown on the report painter? Or the selections performed?
    I know that this might be with some kind of IMPORT FROM MEMORY but i cannot find any documentation about that. Cone someone please help me with that?
    Thank.you very much,
    Artur.

    Finally i found it myself, i share this with all of you:
    CONSTANTS:
          con_sel_data_mem_id(32)   VALUE 'COMMUNICATION-HANDLER-SELDATA'.
    DATA: it_sel    LIKE TABLE OF rstisel    WITH HEADER LINE.
    DATA: it_fields LIKE TABLE OF rstifields WITH HEADER LINE.
    IMPORT it_sel it_fields FROM MEMORY ID con_sel_data_mem_id.

  • Confusion re: photostream, import from memory card, events, etc.

    confusion re: photostream, import from memory card, events, etc.
    Up until a few weeks ago, my travel-photo-handling went like this:
    Each night, I download photos to my iPad for safekeeping. They, of course, wind up in Photostream.
    When I return home, I connect my camera card to my iMac (where I have my iPhoto library), and I can "see" the photos on my memory card - the photos which, although in Photostream, I have not yet manually downloaded.
    I select and ownload them.
    New Events are created in my Library automatically, as I have my preference set to Autosplit Events.
    This week, I came home from a trip during which I had downloaded to iPad during my time away.
    I connected my memory card to the iMac.
    iPhoto did not "see" any photos to import - as far as iPhoto was concerned, those photos were already in my Library.
    I had iPhoto show all photos on my card, selected the photos from my trip (I shot over 1000) and clicked "Import Selected"
    iPhoto says they're duplicates.
    However, the photos have NOT been downloaded manually and there are NO Events in my Library for those days.
    Note: yeah, they're in Photostream, but IN THE PAST - and I mean literally up until 3 weeks ago - the photos have ALWAYS been "visible" and importable even if in Photostream, as long as I had not yet manually downloaded to the computer.
    So my question, I guess, is multi-part:
    What changed in iPhoto and/or Photostream in the past couple of weeks?
    Why are Photostream photos suddenly considered to be the same as the photos on my card which have not yet been manually downloaded to the computer?
    What the heck is going on?
    I hate having duplicates, but I also hate being confused by something that used to be really easy, then - with Photosream - became annoying, and is now simply perplexing and sometimes imcomprehendable.

    Check iPhoto's Photo Stream preference pane to see if the highlighted checkbox in the screenshot below is checked.  If it is then all photos taken by the iPad are automatifdally being imported into your library.
    Go the the Events mode and check the View ➙ Sort menu option to verify where new Evens will be located, at the top of the window or the bottom.  Then check to see if your PS pictures are there.
    As a test launch iPhoto with the Option key held down and create a new, test library.  Connect your iPad and import all photos.  Dismount the iPad, close and reopen the test library, connect the iPad again and test to see if the same problem persists. Does it?
    If it does'nt then your current library is damaged and needs to be repaired.
    OT

  • Import From Memory Id  . Where is Export ?

    i have standard FM there is code for Import memory like below
    DATA : Zget(10) TYPE C.
    IMPORT zget FROM MEMORY ID 'ZPQR' .
    Now i want to Know from where its value comming i.e . What & where is its Export parameter.
    What is ZPQR ? Is it Program or table  ?
    in Which table i will find Memory Id 'ZPQR' ?

    >
    Monica wrote:
    > This is J_1I7_GET_BUSINESS_PLACE FM . Only Import statement is there not Export..statement  ?
    Well, in ECC 6, this has no exectuable statements at all. But what I meant was - start the program that executes this FM in debug mode. when the debugger comes up, use the menu options:
    Breakpoints -> Breakpoint at -> Breakpoint at Statement
    Then enter 'export' in the popup.
    Rob

  • Problems with EXPORT TO MEMORY / IMPORT FROM MEMORY

    Hello.
    we've just made a SAP OS/DB migration of our 46C system from UNIX/Oracle to Windows/SQL.
    Our FI consultant has realized a processs failed.
    The ABAP program that files (it is a Z program) is using EXPORT TO MEMORY and IMPORT TO MEMORY.
    It seems the import is failing because the export to memory fails also.
    Of course we have changed memory parameters ..do you know what memory parameters are involved?
    Thanks very much for your help.

    It seems the import is failing because the export to memory fails also.
    Can you explain?
    Did you check the extended debugger facilities like memory areas?
    What is the structure/amount of data for ex- and import, same name, same data object?
    Just reveal what you are really doing, post a few code lines.
    Or not.
    Regards,
    Clemens

  • IMPORT FROM MEMORY in job submitted program

    Hi experts,
    In a method I do:
          SUBMIT zemr0044 USER sy-uname
                         VIA JOB lc_jobname
                         NUMBER lv_jobcount
                         AND RETURN.
    Before this submit I have done:
      IMPORT ls_header = ls_header FROM DATABASE.
      IMPORT iv_distr = iv_distr from DATA BUFFER.
      IMPORT lt_items = lt_items FROM DATA BUFFER.
    In program ZEMR0044 I do:
      IMPORT ls_header = ls_header FROM MEMORY ID 'ls_header'.
      IMPORT iv_distr = iv_distr from MEMORY ID 'iv_distr'.
      IMPORT lt_items = lt_items FROM MEMORY ID 'lt_items'.
    ---> Unfortunatly it doesn't work.
    If I do  SUBMIT zemr0044 AND RETURN it works fine.
    It seems that the data import doesn't works in background.
    How can I transfer data from my method to my program ?
    Program must be launched in background.
    Thanks guys.

    > Before this submit I have done:
    >
    >   IMPORT ls_header = ls_header FROM DATABASE.
    >   IMPORT iv_distr = iv_distr from DATA BUFFER.
    >   IMPORT lt_items = lt_items FROM DATA BUFFER.
    >
    > In program ZEMR0044 I do:
    >
    >   IMPORT ls_header = ls_header FROM MEMORY ID 'ls_header'.
    >   IMPORT iv_distr = iv_distr from MEMORY ID 'iv_distr'.
    >   IMPORT lt_items = lt_items FROM MEMORY ID 'lt_items'.
    Doesn't fit together...are you EXPORTING to MEMORY ID before the submit? This will store data in "ABAP memory" in the context of a user session. I strongly believe by submitting in background this context is lost.
    Check out all the other options of the IMPORT and EXPORT statements for alternatives like shared memory.
    Thomas

  • Import  from Memory id is not working

    Hi All,
    In the program SAPF110V for Tcode : F110 , I have written an enhancement where when user clicks printout button then a popup will come which will ask for whether date should be printed in the check or not. for this i have used FM : POPUP_TO_CONFIRM . here i am exporting the value if user clicks no (value is 2 for NO).
    exoprt statemnt written :
    export l_v_answer from l_v_answer to memory ID 'ANS'.
    In the driver program for check printing i am importing the value .if value = 2 then i am clearing the date that has to be printed in the check.
    import stmt :
    Import l_v_answer to l_v_answer from memory ID 'ANS'.
    however the value is not getting imported here.
    not able to find the reason why the value is not getting picked with import. please let me know the solution.
    Thanks,
    Preethi.

    called program
    REPORT  ZTEST7.
    selection-screen begin of block b1.
    parameters: a like mara-matnr.
    selection-screen end of block b1.
    types: begin of tp_sel_tab.
          include structure zstr2.
    types: end of tp_sel_tab.
    data: t_sel_tab type standard table of tp_sel_tab with header line.
    data: w_t_sel_tab type tp_sel_tab.
    *call screen 9100.
    start-of-selection.
    select ernam from mara into corresponding fields of table t_sel_tab where matnr = a.
    export t_sel_tab to memory id 'ZTEST7'.
    loop at t_sel_tab into w_t_sel_tab.
    write:/ w_t_sel_tab-ernam.
    endloop.
    calling program
    REPORT  ZTEST8.
    *types: begin of tp_sel_tab.
         include structure zstr2.
    *types: end of tp_sel_tab.
    data: begin of t_sel_tab occurs 0,
          ernam like mara-ernam,
          end of t_sel_tab.
    data: begin of sel_tab occurs 0,
          ernam like mara-ernam,
          end of sel_tab.
    *data: t_sel_tab type standard table of tp_sel_tab.
    *types:  begin of tp_sel_tab1,
           ernam like mara-ernam,
    end of tp_sel_tab1.
    *data: sel_tab type standard table of tp_sel_tab .
    data: w_sel_tab type zstr2.
    submit ztest7 with a = '000000000000000939' and return.
    import  sel_tab = t_sel_tab from memory id 'ZTEST7'.
    loop at sel_tab into w_sel_tab..
    write:/ w_sel_tab-ernam.
    endloop.
    please reward points

  • CATS report  RCATSP01:  Problem with statement IMPORT FROM MEMORY ID.

    Hi Guys,
    I am trying to create a Z custom report using SAP template RCATSP01. In template report there is an IMPORT statement as below.
    IMPORT icatsd
           catsfields
           fieldtab
    FROM MEMORY ID 'LR2'.
    When I run the report in debug mode, I found there is no data in ICATSD, CATSFIELDS & FIELDSTAB.
    What should I do to get the data in these internal tables.
    Thanks,
    Mini

    I don't think this report is meant to be used as a stand-alone report; it's called within CATS time entry (e.g. CAT2 when user select print time sheet) which would export the info to 'LR2' memory prior to calling this report.

  • Import from Memory ID

    Hi,
       In a program, I am getting a short dump at statement,
    IMPORT T_DOWN_NOTPAYED HSDPN HIVDPN
             HIVDPV HCURR FROM MEMORY ID 'ZDOW2'.
    Short dump details given below.
    <i>Error when attempting to IMPORT object "T_DOWN_NOTPAYED".
    When attempting to import data, it was discovered that the data type of the stored data was not the same as that specified in the      
    program.</i>                                                          
    The object T_DOWN_NOTPAYED has the following declaration.  
    DATA : BEGIN OF T_DOWN_NOTPAYED OCCURS 0,
             VBELN  LIKE VBRP-VBELN,
             POSNR  LIKE VBRP-POSNR,
             CMPRE  LIKE VBRP-CMPRE,
             CMWAE  LIKE VBRK-CMWAE,
           END OF T_DOWN_NOTPAYED.
    How can we know where is the corresponding export statement and the structure of the exported parameters. Please suggest how to solve this problem.
    Thanks & Regards,
    Vishnu Priya.

    to find out where export is used, one method is,
    find the where used list for the report name.
    because normally after export statement, they should use
    submit <report name> statement.
    and that report name and the report in which import u r using will be same.

  • Export- Import to Memory Query

    Hello Everyone,
    I have 2 FMs where one exports variable to memory and other FM imports the same .
    FM A:
      DATA: id    TYPE c LENGTH 10 VALUE 'SWITCH_WO',
            id1   TYPE c LENGTH 10 VALUE 'SWITCH_OP'.
      EXPORT   g_workorder from g_workorder  TO MEMORY ID  id.
      EXPORT   g_operation from g_operation  TO MEMORY ID  id1.
    FM B:
    DATA: id    TYPE c LENGTH 10 VALUE 'SWITCH_WO',
            id1   TYPE c LENGTH 10 VALUE 'SWITCH_OP'.
      IMPORT g_workorder   FROM MEMORY ID  id.
      IMPORT g_operation   FROM MEMORY ID  id1.
    When it export Sy-subrc is 0 but when i import it is 4 , where  can i check memory variable in new debugger.
    Please let me know ,
    Regards,
    Raj

    Hello,
    You can use the Import and export to Memory Id only with the programs and FM which runs in the same session, because that memory is only available in the same session of the memory. Once you have imported say a internal table/work area to some memory id and the session ends the memory is cleared by the Garbage Collector.
    In your case you are using 2 FM each running in different session, Import and Export to memory id will not work for you (as said it works in a single session). Try to use concepts of Shared Memory Object or populate a table (Custom table) and try to retrieve the same from 2nd FM.
    Hope it helps.
    Thanks,
    Jayant

  • Importing from Memory Id

    Hi All,
    Please tell me how the following command works and how can we see the contents which are being returned from this memory Id.
    IMPORT /ICO/MO_RUP-BERNR TO WLV_BERNR FROM MEMORY ID 'ZOR'.
    Also,
    GET PARAMETER ID 'ZOR' FIELD WLV_BERNR.
    Thanks,
    Archana.

    Hi Archana,
      If you want to see what you're importing, if it's correct, you can start debugging in the start os the transaction and create a breakpoint related to the command EXPORT. Then you probably can see if the content exported to memory it's correct.
      If you use this solution, don't stop debugging at the 1st EXPORT command, because it can be repeated before you import it.
    I hope it helps.
    Regards,
    Paulo Sousa

  • Import from memory from BADI

    Hi all,
    I have to export a value from a BADI to a Z program.
    In the Z program, it is found that the system code returns 4 and the value is not passed.
    In BADI:
    Data ans type c.
    EXPORT ans = ans TO MEMORY ID 'ANS'.
    In Z program:
    Data ans type c.
    IMPORT ans = ans FROM MEMORY ID 'ANS'.
    Any advice? Thanks!

    Hi,
    check out the purpose & how to use import export in below link wiki written by me.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/passing%2bdata%2bfrom%2bone%2babap%2bprogram%2bto%2banother
    Thanks,
    Krishna

Maybe you are looking for

  • Business Partner Code when using *

    Hi all, In Business Partner code when the user want's to see all Business Partner and makes "*" appears the BP code, BP Name and Foreign Name. All user see this information except one that doesn't see the Foreign Name. Why?

  • No Microsoft Dynamics CRM User Exists

    Hi We are in the process of deploying UPK 3.5.1 to a number of users in the business. Once they have entered the library location in the Profile Wizard and click next they receive the following Server Error message. "No Microsoft Dynamics CRM User ex

  • How to PROMOTE your iWeb site...............

    iWeb is soooooooo user friendly. I'm new to creating a web site and I was wondering, how you go about promoting my website on search engines such as Yahoo and Google. Any suggestions? Cheers

  • Wish list for lrt224

    would be nice to have a wishlist here also. Some wishes are possibly worth looking at. Here I go: 1. I would like to have also VLAN support on the WAN and WAN/DMZ port, as I have explained inanother post. 2. Instead of saving the configuration as a w

  • Trouble with dreamweaver integration

    I installed Dreamweaver CS3 a while ago and was using it with Fireworks 8. I just upgraded to fireworks cs3. I changed the preferences so Dreamweaver looks for cs3 instead of 8. But when I go to edit a png from the link in dreamweaver, I don't have f