ABAP Client proxies: extract data from the response and update Z table

Hi All,
I have following ABAP code for client proxies:
We have DT_Req, MT_Req, DT_Res, MT_Res and MI_Sync_OB (O/p Message: MT_Req, I/P message:MT_Res)
Proxy Objects generated:
ZCO_MI_SYNC_OB
ZMT_REQ
ZDT_REQ
ZDT_REQ_RECORDS
ZDT_REQ_RECORDS_TAB
ZMT_RES
ZDT_RES
ZDT_RES_RECORDS
ZDT_RES_RECORDS_TAB
ABAP Code:
REPORT ZTEST_DELETE.
DATA:
lo_history TYPE REF TO ZCO_MI_SYNC_OB,
lo_sys_exception TYPE REF TO cx_ai_system_fault,
Structures to set and get message content
lv_history_req_mt TYPE ZMT_REQ OCCURS 0 WITH HEADER LINE,
lv_history_res_mt TYPE ZMT_RES,
lv_history_req_rec TYPE ZDT_REQ_RECORDS,
lv_history_res_rec TYPE ZDT_RES_RECORDS.
lv_history_req_rec-VLAUE = SY-DATUM.
APPEND lv_history_req_rec TO lv_history_req_mt-MT_REQ-RECORDS.
CREATE OBJECT lo_history.
TRY.
Call outbound Proxy
CALL METHOD lo_history->execute_synchronous
EXPORTING
output = lv_history_req_mt
IMPORTING
<b>input = lv_history_res_mt.</b>
Error handling
CATCH cx_ai_system_fault INTO lo_sys_exception.
SKIP 2.
WRITE:/ lo_sys_exception->errortext.
RETURN.
ENDTRY.
<b>Now I have my response data in the internable "lv_history_res_mt-MT_REQ-RECORDS" which is deep structure.
How do I extract data records (multiple) from the above internal table and update to Z table??</b>
Thanx
Navin

Hi Navin,
go to SPROXY, flag structure and search for your table definition. You will find a table definition a field "line" or something, where you find the right structure. Create a new structure with DATA: myStructure type tableStructure. Define a second structure type with your Ztable. Next Loop at internal table into the structure. Inside that loop fill the Zstructure. Insert the Zstrucure (Press F1 on insert to have the syntax you need)
loop at internalTable into intStructure.
zstructure-myField = intStructure-myField.
INSERT ztable FROM zstructure.
endloop.
Regards,
Udo

Similar Messages

  • Manupulate the data from the database and update it back

    hi. i was wondering if it is possible to manupulate the data that we get from the resuletSet and do some manupulation and and again update it back to the same row and column. i tried to do it but could not get it. eg. i want to increase the salary by 10% for all the employee in the salary table. i dont want to use the SQL statement. instead i want to use the java program to increase the salary by 10%.
    what i did was, i selected all the records in the table in the resultset and then i stored the salary one by one through the loos using rs.next() and manupulated the salary by the formula
    salary=salary + salary*10/100.
    then i want to update all the employee with this new salary. i dont know whether it is possible or not.
    i tried to have an UPDATE statement in the while loop with rs.next with the condition but the loop gets terminated once it tries to execute the UPDATE statment and doesnot give any result.
    any help or suggestion will be highly appreciated.

    Here's the general long hand way of doing it. You should also look into your JDBC driver and the use of updateable ResultSets for more effeciency.
    public class SalaryObject {
        private int rowId = 0;
        private double salary = 0.0;
        public void setRowId(int rowId) {
            this.rowId = rowId;
        public int getRowId() {
            return rowId;
        public void setSalary(double salary) {
            this.salary = salary;
        public double getSalary() {
            return salary;
    }Withing your dataccess class:
    Vector salaries = new Vector();
    ResultSet rs = statement.executeQuery("SELECT rowId, salary FROM YOUR_SALARY_TABLE)
    if (rs != null) {
        while(rs.next()) {
            SalaryObject salaryObject = new SalaryObject();
            salaryObject.setRowId(rs.getInt("rowId"));
            double newSalary = rs.getDouble("salary");
            newSalary += newSalary*10/100;
            salaryObject.setSalary(newSalary);
            salaries.add(salaryObject);
        Iterator iter = salaries.iterator();
        while(iter.hasNaxt()) {
            SalaryObject salaryObject = (SalaryObject) iter.next();
            updateSalary(salaryObject.getRowId, salaryObject.getSalary);
        public int updateSalary(int rowId, double newSalary) {
            Connection con = new java.sql.Connection();
            String sql = "UPDATE YOUR_SALARY_TABLE SET salary = ? WHERE rowId = ?"
            PreparedStatement pStmt = con.prepareStatement(sql);
            int success = 0;
            try {
                pStmt.setDouble(1, newSalary);
                pStmt.setInt(2, rowId);
                success = pStmt.executeUpdate();
            } catch (SQLException sqle) {
                // handle exception
            } finally {
                try {
                    if (pStmt != null) pStmt.close();
                    if (con != null) con.close();
                } catch (SQLException sqle) {}
        }

  • How to extract data from info cube into an internal table using ABAP code

    HI
    Can Anyone plz suggest me
    How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
    Thankx in advance
    regds
    AJAY

    HI Dinesh,
    Thankq for ur reply
    but i ahve already tried to use the function module.
    When I try to Use the function module RSDRI_INFOPOV_READ
    I get an information message "ERROR GENERATION TEST FRAME".
    can U plz tell me what could be the problem
    Bye
    AJAY

  • Looking for SAP solution to extract data from the production system

    Hello,
    we are looking for the SAP standard tool to extract data from the production system and copy it to the development system. It should be as functional as some kind of partial client copy. The data, which we need to replicate is master and transactional data from FI, CO, AA MM and nice to have FS-RI modules. There is a product offered by the IntelliCorp called "Data Management" but we would like to know if SAP offers its own product.
    Kind regards,
    Krzysztof Murkowski

    Hi,
    SAP offers a solution called 'Test Data migration Server' or TDMS.
    You can access the master guide from the below link:
    https://service.sap.com/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700006332942006E
    Cheers !!
    Satya.
    PS: Pls reward points if the answer was helpful...Thx.

  • How to extract data from the fields present in two or three tables

    Hi Experts,
          I have a scenario where i have to extract data from the fields of different tables. e.g. let there 2 tables which have some number of fields . I want the data of 3 fields each from these 2 tables. How can i get that??
    Sam

    Hi
    You can create view in tcode se11..
    here you include all tables from which you want to fetch the data..
    you need to give selection condition here
    eg..
    say select empname from table A, select empadd from table B.. where empno(from A)=empno(from B)
    (note that you dont need to write queries like this.. i have just given u the example)
    After creating the view you can create datasource in RSO2..
    Regards
    Swati

  • How to extract data from generic view and function module

    hi experts,
    can anybody give me the steps to extract data from generic view and  functon modules.
    thanks and regards
    venkat

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
    https://websmp103.sap-ag.de/~sapidb/011000358700007535452002
    Hope it Helps
    Chetan
    @CP..

  • Hi, extract data from xml file and insert into another exiting xml file

    i am searching code to extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
    1st xml file which has two lines(text1.xml)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xs:PrintDataRequest xmlns:xs="http://com.unisys.com/Anid"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    <xs:Person>
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    These two lines has to be inserted in the existing another xml(text 2.xml) file(at line 3 and 4)
    Regards,
    bubbly

    Jadz_Core wrote:
    RandomAccessFile? If you know where you want to insert it.Are you sure about this? If using this, the receiving file would have to have bytes inserted that exactly match the number of bytes replaced. I'm thinking that you'll likely have to stream through the second XML with a SAX parser and copy information (or insert new information) as you stream with an XML writer of some sort.

  • Extract data from xml file and insert into another exiting xml fil

    hello,
    i am searching extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
    Regards,
    Zhuozhi

    If the files are small, you can load the target file in a DOM document, insert the data from the source file and persist the DOM.
    If the files are large, you probably want to use a StAX or SAX.

  • 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

  • Can I use LabVIEW to load data directly into system memory? The serial card I'm using isn't supported by NI nor does VISA recognize it. I'm using a Win32 function to read the data from the card and now I want it to go directly to system memory.

    Can I use LabVIEW to load data directly into system memory from a VI? The serial card I'm using isn't supported by NI nor does VISA recognize it. I'm using a Call Library function to read the data from the card and now I want it to go directly to system memory.
    The data is being received at 1Mbps.
    Thanks

    Two questions:
    One, if it's a serial card, then presumably it gives you more serial ports, like COM3, COM4, etc. If so, VISA would see the COM ports, and not the card directly. The drivers for the card should make it so that you see the extra serial ports from the OS. If you don't see the extra COM ports from VISA, then it sounds like the drivers for the card are not installed properly. Do the extra COM ports show up in Device Manager?
    Two, you said that you're using a Call Library function to get the data and you want to put it into system memory. Errr.... you just read the data and you have it in memory by definition. Are you saying you need a way to parse the data so it shows up on a graph or something?

  • How to Extract Data from the PDF file to an internal table.

    HI friends,
    How can i Extract data from a PDF file to an internal table....
    Thanks in Advance
    Shankar

    Shankar,
    Have a look at these threads:-
    extracting the data from pdf  file to internal table in abap
    Adobe Form (data extraction error)
    Chintan

  • Extracting data from Oracle GL and importing to FDM using ERPI adapter

    Hi,
    I am also trying to use ERPI adapter to directly extract data from Oracle GL. I am not finding sufficient information on this. It would be great if anyone can help me in this.
    I have one more doubt: Can we call the stored procedures in the FDM custom scripts, If so can I get the syntax of the script...I really don't have idea on this FDM part. I was working till now with the Flatfile input, But my client wants to make this change in the existing system. Accessing/Extracting data from Oracle GL. Experts who knows it can pls guide me.
    I am using FDM 11.1.2 and ERPI associated with 11.1.2.
    Thanks in Advance.
    [email protected]

    Hi,
    Is it possible to execute the stored procedures in FDM. Currently we are extracting data from oracle GL using SQl procedures (constaller tool is user to create the inteface) and storing the required data in the intermediate table in oracle GL, From which we are extracting data into a flat file and then loading it to FDM.
    So my question: is it possible to invoke the stored procedure from FDM scripts, If so can you pls let me know how to do that...
    Thanks In Advance,
    [email protected]

  • How to extract data from xml file and store that data inti data base table

    Hii All
    I have one table that table contains one column that column contain an XML file
    I want to extract data from that XML file and want to store that extracted data into an other table.
    That xml file has different different values
    I want to store that values into table in diff diff columns

    Hi,
    I am also facing the same problem.I have a .xml file and i need to import the data into the custom table in oracle database.
    Can you please let me know if you know the solution how to do it in oracle apps.
    Thanks,

  • How to get the data from the model node like a table ?

    I want to get the data from the model node  once a record ,and the node  is bound to a internal table in the RFM which I called in the R/3 system. Who can give me some advice to achive it?Thank you!!

    Hi,
    To get the data from the node:
    wdContext.node[your node name].current[node name]_InputElement().get[specific element in the node];
    or you van use:
    wdContext.current[your node]Element().get[your element in the node];
    examples:
    wdContext.nodeZ_Mepro_Po_Detail_Stock_Distri_Input().currentZ_Mepro_Po_Detail_Stock_Distri_InputElement().getUcpd_Flag();
    wdContext.currentT_Delv_ReqsElement().getShelflife();
    regards,

  • Kinect Explorer WPF C# read depth data from the file and conversion to skeleton

    Hello,
    I am using Kinect sensor to do some research on biometrics. Since it is impossible to find people to collect some samples, I would like to use samples from the TUM - GAID database, where there exist Color View and Depth View (in .raw format) samples. Therefore,
    I need to read these samples from the file and do a batch processing, instead of performing real-time collecting of samples (where I can take automatically the Skeleton view using the Kinect SDK). So, I need help on
    1. Reading the data from the file (instead of activating the Kinect sensor) and give this data as an input for conversion to a skeleton
    2. Read the .raw files 
    Thank you very much
    Kind regards

    Hiya,
     I doubt this forum, C Sharp, will provide much help. You are asking about the Kinects system not C#
    language. However, you can try this link; http://kinectforwindows.codeplex.com/
    Hope this help. Thanks :)

Maybe you are looking for