How to Export data to memory and Import data from memory?

hi
I have the follwoing some code of program.
The data is not filled from memory. I have to find what is the wrong in code.
REPORT ZIFT_TEST1..
SELECT-OPTIONS : so_budat FOR bkpf-budat,
                 sd_saknr FOR ska1-saknr.
  EXPORT so_budat TO MEMORY ID 'ZBUDAT'.
  EXPORT sd_saknr TO MEMORY ID 'ZSAKNR'.
  SUBMIT ZIFT_TEST2 AND RETURN.
REPORT ZIFT_TEST2..
SELECT-OPTIONS so_budat FOR bsis-budat NO DATABASE SELECTION.
SELECT-OPTIONS: SD_SAKNR    FOR  SKA1-SAKNR MATCHCODE OBJECT SAKO.
  import so_budat = so_budat from memory id 'ZBUDAT'.
  import sd_saknr from memory id 'ZSAKNR'.
Regards
Iftikhar Ali
Islamabad.

Program1----
REPORT demo_program_rep3 NO STANDARD PAGE HEADING.
DATA: number TYPE i,
itab TYPE TABLE OF i.
SET PF-STATUS 'MYBACK'.
DO 5 TIMES.
number = sy-index.
APPEND number TO itab.
WRITE / number.
ENDDO.
TOP-OF-PAGE.
WRITE 'Report 2'.
ULINE.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'MBCK'.
EXPORT itab TO MEMORY ID 'HK'.
LEAVE.
ENDCASE.
Program2----
REPORT demo_programm_leave NO STANDARD PAGE HEADING.
DATA: itab TYPE TABLE OF i,
num TYPE i.
SUBMIT demo_program_rep3 AND RETURN.
IMPORT itab FROM MEMORY ID 'HK'.
LOOP AT itab INTO num.
WRITE / num.
ENDLOOP.
TOP-OF-PAGE.
WRITE 'Report 1'.
ULINE.
end of program 2----
Now you copy this programs with same name as i mentioned and execute demo_programm_leave Program.you will understnad clearly.
Notes::: A logical memory model illustrates how the main memory is distributed from the view of executable programs. A distinction is made here between external sessions and internal sessions .
An external session is usually linked to an R/3 window. You can create an external session by choosing System/Create session, or by entering /o in the command field. An external session is broken down further into internal sessions. Program data is only visible within an internal session. Each external session can include up to 20 internal sessions (stacks).
Every program you start runs in an internal session.
To copy a set of ABAP variables and their current values (data cluster) to the ABAP memory, use the EXPORT TO MEMORY ID statement. The (up to 32 characters) is used to identify the different data clusters.
If you repeat an EXPORT TO MEMORY ID statement to an existing data cluster, the new data overwrites the old.
To copy data from ABAP memory to the corresponding fields of an ABAP program, use the IMPORT FROM MEMORY ID statement.

Similar Messages

  • How to export data from a Oracle table to a delimited file?

    I know how to load delimited file into a table, but how to export
    data from a Oracle table to a delimited file?
    Thanks in advance.

    Try looking at this link, it's long but there's three different solutions discussed in it. If you look at Barbara Boehmer's
    solution in her posts in the link below you'll see that she's addressed your concerns with spool files.
    Re: utl_smtp and triggers

  • How to export data from a spread sheet which has multiple work sheets?

    How to export data from a spread sheet which has multiple work sheets to a single text file with fixed length fields?

    Hello s1,
    saving them as CSV will not give a fixed legth output but, as the naming says, a Character Separated Value file.
    Regards
    Marcus

  • How to Export data from webdynpro using Jecxcel

    Hi ,
    Can anyone help me how to export data from web dynpro using Jexcel. kindly send me the related links.
    Thanks

    Hi Sandeep,
    Have you refered in the blogs?
    U can find may more document related to this.the below blog helps u in
    Exporting Data from Web Dynpro in Different Formats Using Open Source (POI, JExcel, iText) APIu2019s.
    https://www.sdn.sap.com/irj/sdn/index?rid=/library/uuid/b030e7fb-2662-2b10-0dab-c4aa52c3550b
    Regards
    Supraja

  • How to export data from a Dynpro table to Excel file?

    Hi
    Here I go again. I read the post <b>Looking for example to export data from a DynPro table to Excel file</b> and put the code lines into a Web Dynpro Project where we need to export a dynpro table to Excel file but exactly at line 23 it doesn't recognize <b>workBook = new HSSFWorkbook();</b>
    1     //Declare this in the end between the Begin others block.
    2     
    3     private FileOutputStream out = null;
    4     private HSSFWorkbook workBook = null;
    5     private HSSFSheet hsSheet = null;
    6     private HSSFRow row = null;
    7     private HSSFCell cell = null;
    8     private HSSFCellStyle cs = null;
    9     private HSSFCellStyle cs1 = null;
    10     private HSSFCellStyle cs2 = null;
    11     private HSSFDataFormat dataFormat = null;
    12     private HSSFFont f = null;
    13     private HSSFFont f1 = null;
    14     
    15     //Code to create the Excel.
    16     
    17     public void onActionExportToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    18     {
    19     //@@begin onActionExportToExcel(ServerEvent)
    20     try
    21     {
    22     out = new FileOutputStream("C:/mydirectory/myfiles/testexcel.xls");
    23     workBook = new HSSFWorkbook();
    24     hsSheet = workBook.createSheet("My Sheet");
    25     cs = workBook.createCellStyle();
    26     cs1 = workBook.createCellStyle();
    27     cs2 = workBook.createCellStyle();
    28     dataFormat = workBook.createDataFormat();
    29     f = workBook.createFont();
    30     f1 = workBook.createFont();
    31     f.setFontHeightInPoints((short) 12);
    32     // make it blue
    33     f.setColor( (short)HSSFFont.COLOR_NORMAL );
    34     // make it bold
    35     // arial is the default font
    36     f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    37     
    38     // set font 2 to 10 point type
    39     f1.setFontHeightInPoints((short) 10);
    40     // make it red
    41     f1.setColor( (short)HSSFFont.COLOR_RED );
    42     // make it bold
    43     f1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    44     f1.setStrikeout(true);
    45     cs.setFont(f);
    46     cs.setDataFormat(dataFormat.getFormat("#,##0.0"));
    47     
    48     // set a thick border
    49     cs2.setBorderBottom(cs2.BORDER_THICK);
    50     
    51     // fill w fg fill color
    52     cs2.setFillPattern((short) HSSFCellStyle.SOLID_FOREGROUND);
    53     cs2.setFillBackgroundColor((short)HSSFCellStyle.SOLID_FOREGROUND);
    54     // set the cell format to text see HSSFDataFormat for a full list
    55     cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));
    56     cs2.setFont(f1);
    57     cs2.setLocked(true);
    58     cs2.setWrapText(true);
    59     row = hsSheet.createRow(0);
    60     hsSheet.createFreezePane(0,1,1,1);
    61     for(int i=1; i<10;i++)
    62     {
    63     cell = row.createCell((short)i);
    64     cell.setCellValue("Excel Column "+i);
    65     cell.setCellStyle(cs2);
    66     }
    67     workBook.write(out);
    68     out.close();
    69     
    70     //Read the file that was created.
    71     
    72     FileInputStream fin = new FileInputStream("C:/mydirectory/myfiles/testexcel.xls");
    73     byte b[] = new byte[fin.available()];
    74     fin.read(b,0,b.length);
    75     fin.close();
    76     
    77     wdContext.currentContextElement().setDataContent(b);
    78     }
    79     catch(Exception e)
    80     {
    81     wdComponentAPI.getComponent().getMessageManager().reportException("Exception while reading file "+e,true);
    82     }
    83     //@@end
    84     }
    I don't know why this happen? Any information I will appreciate it.
    Thanks in advance!!!
    Tokio Franco Chang

    After test the code lines appears this error stacktrace:
    [code]
    java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
         at com.sap.tc.webdynpro.progmodel.api.iwdcustomevent.ExportToExcel.onActionAct1(ExportToExcel.java:232)
         at com.sap.tc.webdynpro.progmodel.api.iwdcustomevent.wdp.InternalExportToExcel.wdInvokeEventHandler(InternalExportToExcel.java:147)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:252)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:392)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:159)
    Thanks in advance!!!
    Tokio Franco Chang
    [/code]

  • How to Export data from a Table to Excel using PL/SQL Code

    Hi,
    I need to export data from a table to the excel sheet using PL/SQL script.
    could you pls provide with custom codes or sample procedures.
    Bobby

    http://asktom.oracle.com/pls/ask/f?p=4950:8:7947129213057862756::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:728625409049

  • How to export data from webdynpro to Excel and start a Excel macro

    Hello All
    I want to export data displayed in the Web dynpro ALV into Excel. I have tried the ALV export function but my problem with it is when it does export to excel the data loses formatting and I have long text in columns which display with wrapping in ALV but when exported to excel it loses formatting.
    So I want to define a custom button and when user presses on this button the excel export is called with a macro. Can you kindly share ideas how I can do this from a webdynpro.
    Thanks
    Karen

    Hi friends!
    I have followed the following:
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417300)ID1487994050DB10407586481486749551End?blog=/pub/wlg/5522
    ...in order to create standard ALV with Export to Excel.
    However what is exported into excel is awful. It does not contain my data in nice columns... Instead it shows a lot of meta-data.
    Please let me know what to do to kick the standard Export button in the correct direction.. that is...to have my nice table in same way in Excel, because that is my intention with "Export to excel"
    Best reg
    Henrik

  • How to export data from one DB to another?

    Hi everyone,
    I have 2 oracle db A and B. And I want to transfer data from table aa in A to table aa in B. These 2 tables have the identical structure. How can I do it? Thanks.
    Houmin

    use the EXP utility to export the table, then use the IMP utility to import it again.

  • How to export data from MS Project 2010 to MS Excel 2010 with formatting

    I have created a Project 2010 export map to Excel 2010.  It works fine.  I have two questions that I cannot determine an answer.  I'm not sure if its a project or excel setting.  I have spend hours trying to make it
    work with little success.
    1.  When the task name field is exported to excel it losses summary/task indent.  Is there a way to set it up so it works via the export map?
    2.  The Start & Finish fields in project is setup as 5/26/11 when they exports to excel it shows up as 5/26/11 8:00 AM.  Is there a way to set it up either in project export map or excel so its formated as a date field. 
    Excel's Format Cell function does not seem to work converting them back to just 5/26/11.
    How can I keep the outlines and formatting in my data while exporting it to Excel.
    I would appreciate any guidance.
    Yogesh

    Rameshchandra --
    Two things I would recommend:
    Do not add your question at the end of a post that is marked as Answered.  In the future, please post your question as a new question so that everyone will notice it and be able to answer it.
    Because this is a programming question, please repost your question as a new post in the Project Customization and Programming user forum at:
    http://social.technet.microsoft.com/Forums/projectserver/en-US/home?forum=project2010custprog&filter=alltypes&sort=lastpostdesc
    Hope this helps.
    Dale A. Howard [MVP]

  • How to Export Data from a table in database directly to Excel.

    Hi,
    I have some sqls that i need to run on a daily basis.My client wants them to be scheduled through a job and the result output of the query should be in the form of Excel.
    Now i am no sure how to do this.Is there any in-built function in the DBMS package that can export data drectly from table to Excel. ?
    Please Help me !!

    SQL> spool exlfile.cvs
    SQL> set colsep ','
    SQL> set lines 300
    SQL> set pages  9999
    SQL> set trimspool on
    SQL>
    SQL> select * from DEPARTMENTS
      2  /
    DEPARTMENT_ID,DEPARTMENT_NAME               ,MANAGER_ID,LOCATION_ID
               10,Administration                ,       200,       1700
               20,Marketing                     ,       201,       1800
               30,Purchasing                    ,       114,       1700
               40,Human Resources               ,       203,       2400
               50,Shipping                      ,       121,       1500
               60,IT                            ,       103,       1400
               70,Public Relations              ,       204,       2700
               80,Sales                         ,       145,       2500
               90,Executive                     ,       100,       1700
              100,Finance                       ,       108,       1700
              110,Accounting                    ,       205,       1700
              120,Treasury                      ,          ,       1700
              130,Corporate Tax                 ,          ,       1700
              140,Control And Credit            ,          ,       1700
              150,Shareholder Services          ,          ,       1700
              160,Benefits                      ,          ,       1700
              170,Manufacturing                 ,          ,       1700
              180,Construction                  ,          ,       1700
              190,Contracting                   ,          ,       1700
              200,Operations                    ,          ,       1700
              210,IT Support                    ,          ,       1700
              220,NOC                           ,          ,       1700
              230,IT Helpdesk                   ,          ,       1700
              240,Government Sales              ,          ,       1700
              250,Retail Sales                  ,          ,       1700
              260,Recruiting                    ,          ,       1700
              270,Payroll                       ,          ,       1700

  • How to export data from Elimination Value dimension member by HAL HFM adapter?

    Good day!<BR><BR>Is it possible to export HFM 4.0.5 data with HAL from the <Elimination> Value dimension member?<BR><BR>In 3.* versions it wasn't and there is Known Issue in the "HFM 3.* Adapter Read Me" file: "The Hyperion Financial Management Adapter exports data using the <entity currency> Value dimension member. The documentation erroneously states that there is a port available for the Value dimension"<BR>But there is not such point in the same file for HFM 4.0.5 AND there is Value port in the HFM 4.0.5. Adapter.<BR><BR>Thanks!<BR><BR>Regards,<BR>Georgy<BR>

    In the first approch, try to change the exporting parameter type REF TO DATA.
    Try like:
    CLASS lcl_test DEFINITION.
      PUBLIC SECTION.
        DATA: t_mara TYPE HASHED TABLE OF mara WITH UNIQUE KEY matnr.
        METHODS:
          constructor,
          get
            IMPORTING
              if_matnr TYPE matnr
            EXPORTING
              ea_mara  TYPE REF TO data.
    ENDCLASS.                    "lcl_test DEFINITION
    START-OF-SELECTION.
      DATA: lo_test TYPE REF TO lcl_test,
            lr_data TYPE REF TO data.
      FIELD-SYMBOLS: <fa_mara> TYPE ANY,
                     <f_field> TYPE ANY.
      CREATE OBJECT lo_test.
      lo_test->get(
        EXPORTING
          if_matnr = '000000000077000000'   " << Replace Your Material
        IMPORTING
          ea_mara  = lr_data ).
      ASSIGN lr_data->* TO <fa_mara>.
      ASSIGN COMPONENT 'ERSDA' OF STRUCTURE <fa_mara> TO <f_field>.
      <f_field> = space.
      WRITE: 'Done'.
    CLASS lcl_test IMPLEMENTATION.
      METHOD constructor.
        SELECT * INTO TABLE t_mara
               FROM mara
               UP TO 10 ROWS.
      ENDMETHOD.                    "constructor
      METHOD get.
        FIELD-SYMBOLS: <lfs_mara> LIKE LINE OF me->t_mara.
        READ TABLE me->t_mara ASSIGNING <lfs_mara> WITH KEY matnr = if_matnr.
        GET REFERENCE OF <lfs_mara> INTO ea_mara.
      ENDMETHOD.                    "get
    ENDCLASS.                    "lcl_test IMPLEMENTATION
    Regards,
    Naimesh Patel

  • How to export data from report to excel using report 10g

    Hi,
    usnig report 10g, can we export the data from report to excel.
    Regards
    Randhir

    Hi,
    have a look at metalink note 209770.1: Getting Reports Ouput to MS Excel - Techniques and References
    Regards
    Rainer

  • How to export data from a string to a CSV file

    Hello,
    i do have a string in a Livecycle Designer script object with a couple of rows with different entries divided by a semicolon:
    COLUMN1;COLUMN2;COLUMN3
    Entry1;Entry2;Entry3
    Entry4;Entry5;Entry6
    The goal is now to export this string from Livecycle Designer into a CSV file by clicking a button. Is there any solution suggested?
    Thank you very much.

    Hi,
    You can try creating a dataObject and then exporting it, you might get some warning messages popup but try this;
    var csvData = "COLUMN1;COLUMN2;COLUMN3\r\n";
    csvData += "Entry1;Entry2;Entry3\r\n";
    csvData += "Entry4;Entry5;Entry6\r\n";
    var pdf = event.target;
    pdf.createDataObject("Data.csv", csvData);
    pdf.exportDataObject({cName: "Data.csv"});
    If you replace the last line with
    pdf.exportDataObject({cName: "Data.csv", nLaunch: 2});
    It will open in whatever .csv is registered for (Excel on my system)
    Regards
    Bruce

  • How to export data from ODS through Open hub destination ?

    Hello Expert,
    I ahve some data in ODS.I want to export that data to some thirdt party application through Open Hub destination .How will I do that ??
    Eary reply is appreciated .

    HD IS :
             1.DATASOURCE
             2.INFOSOURCE
             3.DATASTORE OBJECT
             4.INFOCUBE
             5.INFOOBJECT
    1.Assume that info cube existing  with data
    2.Create openhuB services
        GO FOR OHD---->select Any  info area ->CONTEXTMENU>Create OHD
         Give the 'OBJECT NAME'----Continue
    In OHD Destination type Depends upon 3 types
       1.DB-TABLE
       2.FILE
       3.THIRD PARTY TOOL
      3.Go for the Defination Tab give the File name
    4.Create Transfermations
    5.Create DTP
    OPEN HUB SERVICES WITH -
    INFOSOURCE:OHD---DB TABLE SPECIFY:/BIC/OH
    1.Assume that info cube existing  with data
    2.Create openhuB services
        GO FOR OHD---->select Any  info area ->CONTEXTMENU>Create OHD
        Give the 'OBJECT NAME'----Continue
    3.Select Dbfile----->Continue
       Select file location where you want to store file .
        O.Semantic key
    4.Create Transfermations
    5.Create DTP
    Regards ,
    Praveenyagnamurthy.

  • How to export data from DB to flat file with ODI?

    we want to export DB2 tables to flat files.
    Who can tell me how to do it with ODI?
    Please give me a simple example or steps.
    Thank you.

    There are two ways
    Either use IKM Sql to File Append
    (or)
    OdiSqlUnload
    For OdiSqlUnload you can use this technique to provide the connection parameters - http://odiexperts.com/?p=1985

  • [b]export data from a table to a csv or .txt file[/b]

    hi plz i need help in how to export data from a table to a csv or .txt file

    If you are using TOAD, then you can execute the statement like SELECT * FROM TABLE1
    Then, you can go to Output Grid and you can say save as and you can save it as you want, excel, tab delimited or whatever.
    Thanx,
    Cheers,

Maybe you are looking for

  • How do I get my iTunes transfered to a new hard drive?

    I used iTunes on my C drive and stored the music on an external hard drive. My C drive crashed, but I am able to access all of the data. I also had iTunes on another computer I use and will now be my main computer. This "new" computer had its own mus

  • Setting up a TIME dimension in OBIEE

    Hi, We have an Oracle OLAP Cube built using AWM v10.2.0.3A. We have also created a relational view for this cube (using the OLAP view generator) and are now using this view as a data source in OBIEE v.10.1.3.3.2. As part of defining the Time dimensio

  • Distiller Crashing

    I am using Mac 10.4.11 my acrobat distiller is 7.0.  On Thursday distiller was working fine.  I was off two days and when I came back everytime I try to distil a file it crashes my distiller. Any suggestion how to fix this problem?

  • I ACCIDENTLY REMOVED AND THREW AWAY WHATEVER IT IS THAT LETS YOU SEE YOUR PICS AND DOWNLOADS? HOW CAN I FIX IT SO I CAN SEE MY PICS AGAIN?

    i cant see any of my photos unless i click on them same goes with downloads all i see is the document looking icon that says jpeg , i can see  the pics in my i photo but not in my folders ? i think i threw a folder away out of application supp0rt ? r

  • Help required in Index Question

    Hi, This is an interview question that i faced. Theres a table Statistics having more than 300 columns. It has normal indexes on say five columns col1, col2, col3, col4, col5. Queries involving the first four columns give excellent performance but th