Retrieving data from a relational table and CLOB as a whole XML file

I created the table lob_example and I have managed to insert XML document into it using XML SQL Utility. In this document I put contents of <DESCRIPTION> tag into CDATA section.
LOB_EXAMPLE
Name Null? Type
ID NOT NULL NUMBER
DESCRIPTION CLOB
NAME VARCHAR2(40)
But I could not retrieve this data properly. I can think of only one solution - to parse and build the whole XMLDocument. I found the suggestion of another solution to use Oracle8i views to do that in http://technet.oracle.com/tech/xml/infoocs/otnwp/about_oracle_xml_products.htm, but this text is not clear enough for me.
I would like to quote the fragment from document mentioned above, which is ambiguous for me:
"Combining XML Documents and Data Using Views
Finally, if you have a combination of structured and unstructured XML data, but still want to view and operate on it as a whole, you can use Oracle8i views. Views enable you to construct an object on the "fly" by combining XML data stored in a variety of ways. So, you can store structured data (such as employee data, customer data, and so on) in one location within object -relational tables, and store related unstructured data (such as descriptions and comments) within a CLOB. When you need to retrieve the data as a whole, you simply construct the structure from the various pieces of data with the use of type constructors in the view's select statement. The XML SQL Utility then enables retrieving the constructed data from the view as a single XML document."
The main question is - how to use type constructors in the view's select statement?

Hello
Sorry for asking the same question again, but any responses would be greatly appreciated.
How to use type constructors in the view's select statement?
I could not find any answers for this question on Technet. Maybe the other approaches are more efficient to combine the part of data from CLOB with data from other column types?
Thank you

Similar Messages

  • Retrieve xml data from a relational table(oracle) with datatype as xmltyp

    Hello Avijit, any resolution for this issue?

    hi .... I am trying to retrieve xml data from a relational table with datatype as xmltyp. The SQ is retrieving rows but the xml parser give transformation error . The transformation retrieve xml data from a relational table(oracle) with datatype as xmltyp returned a row error status on receiving an input row on group retrieve xml data from a relational table(oracle) with datatype as xmltyp.  ERROR : An XML document was truncated and thus not processed. Input row from SQ_XMLTYPE_TEST: Rowdata: ( RowType=0(insert) Src Rowid=5 Targ Rowid=5 DOCUMENT (DataInput:Char.64000:): "<?xml version='1.0' encoding='UTF-8'?><main><DATA_RECORD> <OFFER_ID>434345</OFFER_ID> <ADDR>sec -2 salt lake</ADDR> <CITY>kolkata</CITY> (DISPLAY TRUNCATED)(TRUNCATED)" )  thanks in advance Avijit

  • Retrieve data from a large table from ORACLE 10g

    I am working with a Microsoft Visual Studio Project that requires to retrieve data from a large table from Oracle 10g database and export the data into the hard drive.
    The problem here is that I am not able to connect to the database directly because of license issue but I can use a third party API to retrieve data from the database. This API has sufficient previllege/license permission on to the database to perform retrieval of data. So, I am not able to use DTS/SSIS or other tool to import data from the database directly connecting to it.
    Here my approach is...first retrieve the data using the API into a .net DataTable and then dump the records from it into the hard drive in a specific format (might be in Excel file/ another SQL server database).
    When I try to retrieve the data from a large table having over 13 lacs records (3-4 GB) in a data table using the visual studio project, I get an Out of memory exception.
    But is there any better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?
    Any help on this problem will be highly appriciated.
    Thanks in advance...
    -Jahedur Rahman
    Edited by: Jahedur on May 16, 2010 11:42 PM

    Girish...Thanks for your reply...But I am sorry for the confusions. Let me explain that...
    1."export the data into another media into the hard drive."
    What does it mean by this line i.e. another media into hard drive???
    ANS: Sorry...I just want to write the data in a file or in a table in SQL server database.
    2."I am not able to connect to the database directly because of license issue"
    huh?? I never heard this question that a user is not able to connect the db because of license. What error / message you are getting?
    ANS: My company uses a 3rd party application that uses ORACLE 10g. And my compnay is licensed to use the 3rd party application (APP+Database is a package) and did not purchased ORACLE license to use directly. So I will not connect to the database directly.
    3.I am not sure which API is you are talking about, but i am running an application of the visual studio data grid or similar kind of controls; in which i can select (select query) as many rows as i needed; no issue.
    ANS: This API is provided by the 3rd party application vendor. I can pass a query to it and it returns a datatable.
    4."better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?"
    ANS: As I get a system error (out of memory) when I select all rows in a datatable at a time, I wanted to retrieve the data in multiple phases.
    E.g: 1 to 20,000 records in 1st phase
    20,001 to 40,000 records in 2nd phase
    40,001 to ...... records in 3nd phase
    and so on...
    Please let me know if this does not clarify your confusions... :)
    Thanks...
    -Jahedur Rahman
    Edited by: user13114507 on May 12, 2010 11:28 PM

  • Query Report:To Retrieve Data from A/R Invoice and A/P Invoice

    Hii Experts,
          I am a new Sap B1 Trainee.I am facing a problem when retrieving data from A/R Invoice and A/P Invoice in order to track
    Expenditure and Revenue according to a Bussiness partner,
    I am using union to retrieve the information,but it is saying a error that  Error Converting Varchar to Numeric and also
    i would like to know how can i show the total final payment by reflecting Downpayments in A/R Invoice and A/P Invoice
    With Regards
    Cherry.

    Hii.
    My Sap B1 version is 8.8.1 and patch level is 20. Actully i need a scenario where i can able to show both Expenditure and Revenue of a particular bussiness partner and profit/loss in a single query report.
    I need some tips regarding this,When i am doing union i am getting conversion error converting varchar to numeric when i take
    Sum(Line Total) from OINV and Sum(line total) OPCH group by docdate and docentry and BP .
    and another scenario is how to deduct A/P downpayment or A/R downpayment from A/P invoices and A/R invoice to get the final Revenue and Expenditure ..
    Thanks & Regards
    Cherry

  • Unable to retrieve data from a nested table in Oracle 8i from JSP

    How do i retrieve data from a nested table in Oracle 8i from my JSP code?
    When i try to execute the query , a general error is thrown.
    Kindly advice as soon as possible.

    How do i retrieve data from a nested table in Oracle 8i from my JSP code?
    When i try to execute the query , a general error is thrown.
    Kindly advice as soon as possible.

  • Error while retrieving data from PL/SQL Table using SELECT st. (Urgent!!!)

    Hi Friends,
    I am using Oracle 8.1.6 Server, & facing problems while retrieving data from a PL/SQL Table:
    CREATE or REPLACE PROCEDURE test_proc IS
    TYPE tP2 is TABLE of varchar2(10); --declared a collection
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST(dt2 as tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    While executing the above procedure, I encountered foll. error:
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [],
    ORA-06544: PL/SQL: internal error, arguments: [pfrrun.c:pfrbnd1()], [], [], [], [], [], [], []
    ORA-06553: PLS-801: internal error [0]
    Can anyone please help me, where the problem is??
    Is it Possible to retrieve data from PL/SQL TABLE using SELECT statement? & How ?
    Thanks in advance.
    Best Regards,
    Jay Raval.

    Thanks Roger for the Update.
    It means that have to first CREATE TYPE .. TABLE in database then only I can fire a Select statement on that TYPE.
    Actually I wanted to fire a Select statement on the TABLE TYPE, defined & declared in PLSQL stored procedure using DECLARE TYPE .. TABLE & not using CREATE TYPE .. TABLE.
    I was eager to know this, because my organization is reluctant in using CREATE TYPE .. TABLE defined in the database, so I was looking out for another alternative to access PL/SQL TABLE using Select statement without defining it database. It would have been good if I could access a PLSQL TABLE using Select statement Declared locally in the stored procedure.
    Can I summarize that to access a PL/SQL TABLE using SELECT statement, I have to first CREATE TYPE .. TABLE?
    If someone have any other idea on this, please do let me know.
    Thanks a lot for all help.
    Best Regards,
    Jay Raval.
    You have to define a database type...
    create type tP2 is table of varchar2(10)
    CREATE OR REPLACE PROCEDURE TEST_PROC
    IS
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST (dt2 AS tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    This will work.
    Roger

  • Deletion of data from change log table and PSA

    Hi,
    For a DSO  I want to delete data from "Chnage log table"  and " PSA Tabel".
    For the DSO manage screen I have seen " Environment-> " Delete changelog table" from this we can delete chnage log table data as per my understanding.
    at PSA Level Mange screen also I have seen " Environment-> " Delete changelog table" from this option also it deletes the data from change log table or it deletes data from PSA table?.
    if this option also deletes data from changelog table then how we can delete data from PSA table?
    Please clarify me

    Hi,
      I am not sure what are you referring to from your point "PSA Level Mange screen also I have seen " Environment-> " Delete changelog table". When ever you click on manage for your psa you will be routed to a popup where you can see all your requests in the PSA table & there after if you click on any single request you will get Environment menu option but there wotn be any change log deletion option available. Please check again? Right clicking on your data source will take you to the manage requests for PSA. You can selectively delete the requests as required.
    For DSO when you right click on manage you can directly find Delete change log data option in the Environment tab. there you can select the requests you want to delete.
    Also if you want to automate the deletion process then you can simply create a chain and include the steps for PSA deletion & change Log deletion accordingly.
    Also it is recommended to keep on clearing the PSA table & Chage log data at regular intervals as it saves the disk space & thus helping in performance optimization
    Please refer the below doc at SDN, it will be helpful for you in automating the process of change log deletion & PSA deletion.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02ba9e7-bb6f-2c10-09b4-e86b9fcbad41?QuickLink=index&overridelayout=true
    Hope it clears your doubts
    Thanks

  • Crystal Report error trying to retrieve data from a user table

    Hi,
    I'm making crystal report application with VS 2005 and I need to retrieve data form a user table. I'm using Pull method, I configure the connection and parameters by code.
    I think that the problem could be the @ that is used to identify these tables. Please, if some body had this problem before and have a solution, please let me know asap.
    Thanks

    Hi Andrea,
    I had the same problem today. I upgraded from Crystal Version 8 to 11 and the problem was solved. Maybe it is too late for you, but I wanted to post the solution if anybody else has the same problem.
    Regards
    Guillermo

  • PROBLEM IN EXPORTING DATA FROM A RELATIONAL TABLE TO ANOTHER RELATIONAL TAB

    Hi,
    While trying to export data from a source table to a target table, problem occurs with loading the data in the work table(SrcSet0)[As shown in the operator]. The Work Table has been dropped and created successfully, the problem is coming with loading the data( in this work table(SrcSet0)). The error details as mentioned below. Please advise:-
    ODI-1227: Task SrcSet0 (Loading) fails on the source ORACLE connection ORACLE_SOURCE.
    Caused By: java.sql.SQLException: SQL string is not Query
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1442)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3806)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1667)
         at oracle.odi.query.JDBCTemplate.executeQuery(JDBCTemplate.java:189)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:89)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:1)
         at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:67)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:537)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:662)
    Thanks
    Anindya

    Hi actdi,
    This is my KM_IKM SQL Incremental Update.xml code:-
    and I have find it(for (int i=odiRef.getDataSetMin(); i <= odiRef.getDataSetMax(); i++)) and high lighted it(Bold Text).
    So, please advise.
    Here is the main part of this code because the code is too long to post.It exceeds maxlength for the msg.
    So here it is:
    <Object class="com.sunopsis.dwg.dbobj.SnpTxtHeader">
    <Field name="Enc" type="java.lang.String">null</Field>
    <Field name="EncKey" type="java.lang.String">null</Field>
    <Field name="ITxt" type="com.sunopsis.sql.DbInt"><![CDATA[1695003]]></Field>
    <Field name="ITxtOrig" type="com.sunopsis.sql.DbInt"><![CDATA[102]]></Field>
    <Field name="SqlIndGrp" type="java.lang.String"><![CDATA[2]]></Field>
    <Field name="Txt" type="java.lang.String"><![CDATA[insert into <%=odiRef.getTable("L","INT_NAME","A")%>
    <%=odiRef.getColList("", "[COL_NAME]", ",\n\t", "", "(((INS or UPD) and !TRG) and REW)")%>,
    IND_UPDATE
    *<%for (int i=odiRef.getDataSetMin(); i <= odiRef.getDataSetMax(); i++){%>*
    <%=odiRef.getDataSet(i, "Operator")%>
    select <%=odiRef.getPop("DISTINCT_ROWS")%>
    <%=odiRef.getColList(i,"", "[EXPRESSION]", ",\n\t", "", "(((INS or UPD) and !TRG) and REW)")%>,
    <% if (odiRef.getDataSet(i, "HAS_JRN").equals("1")) { %>
    JRN_FLAG IND_UPDATE
    <%} else {%>
    'I' IND_UPDATE
    <%}%>
    from <%=odiRef.getFrom(i)%>
    where (1=1)
    <%=odiRef.getJoin(i)%>
    <%=odiRef.getFilter(i)%>
    <%=odiRef.getJrnFilter(i)%>
    <%=odiRef.getGrpBy(i)%>
    <%=odiRef.getHaving(i)%>
    <%}%>
    ]]></Field>
    </Object>
    <Object class="com.sunopsis.dwg.dbobj.SnpLineTrt">
    <Field name="AlwaysExe" type="java.lang.String"><![CDATA[0]]></Field>

  • AQ or Streams to replicate data from a database table and put it on a queue

    If was tasked with the above if I was using AQ I'd think about publishing to queue via insert trigger on a table that's the destination end of a replication.
    Given that there's replication involved it sounds like if you want to replicate data from A to B and also push it to a queue you should be thinking Streams with a transform and not just AQ.
    However, how do you get Streams to replicate from A to B and at the same time and in the same transaction transform a message and put it on a queue?
    Also, if you are to build the message in XML and use an XML payload what do you use to construct the message? PL/SQL by hand? Are there API's in PL/SQL to build a DOM and then stringify the DOM you've built such that everything is entity encoded correctly and the payload can be published to a queue as an XML payload?

    Oh yes sorry I lost track of which thread this was. I was thinking Streams but I forgot the original suggestion was to use triggers.
    We have many use cases today where data arrives via inserts into some table and a process polls this table and processes the data. This approach does not scale very well. Currently these polling processes are polling the same database that is constantly inserting data as it arrives via multple processes.
    I am trying to move away from this approach by introducing queuing. In addition to the above we also have an approach where as the data arrives it's placed on a queue and the process processes these messages asynchonously from the queue. Currently this queue based implementation does not use Oracle. I am trying to move to a solution where if the data must arrive via inserts into a database the processing of the data doesn't necessarily have to be by fetching those records out of the table thru polling. The general idea is that as the messages are inserted they are subsequently enqueued and processed off a queue. There is no desire to have a process which simply polls the database and enqueues what I find in the table. The goal is to remove constant polling of the database.

  • Fetch data from a R3 Table and send to XI

    Hello XI Experts,
                     I am involved in a scenario where i need to read some data from a Transparent table in R3 send to xi and post a CSV File.
    I have worked on look ups at the XI abap stack but i want to know which is the best solution to do this.
    What's the best way to read a table from R/3 and send to xi server. Is there any other ways besides Look ups? 
    Regards,
    Anirban.

    Hi,
    >>>1. When is look ups advised .
    a lookup is when somewhere in your
    interface flow you have to lookup some data
    for example you send data from one system to another but you have to change material numbers before
    sending the data to the target system
    you know that material numbers are inside some other server so you have to call this sever (very often in a sync way) to lookup the material numbers
    so this would be difficult with IDOC for instance
    >>> 2. Which is a better solution, if i have very few data to fetch with WAS >= 6.20 . Abap Proxy Or a 'Z' Idoc.
    you'll be able to do it quicker with ABAP proxy
    if you use a scheduled report that will send the data from r3 then use ABAP proxies
    Regards,
    michal

  • How to save, update and retrieve data from two diffrent table

    Hi,
    I can save and retrieve data into an user defined SBO form from one database table only. How can I save retrieve and update records from two or more different tables in a single screen?
    Regards,
    Sudeshna.

    Sudeshna,
    Are these tables external to SAP Business One and do not have a Business Object?  If there is a Business Object available such as if you were to enter an order, that order would use the Documents object which abstracts you, the programmer, from the underlying tables that need to be updated.  If you are handling multiple business objects you would need to wrap the transaction with the StartTransaction - EndTransaction methods.  This information is detailed in the SAP Business One SDK Help Center that comes with the SDK.
    HTH,
    Eddy

  • UCCX DB Get Step - Retrieving data from a Temp Table

    Hello All,
    I have a situaion where I am running a stored procedure from a DB Read step and this stored procedure creates a temporary table that holds the data from SQL. I need assistance in determining how to retrieve this data as the table is dropped once the SP has finished. I am sure there will be additional information requested for you to help me out, but I appeciate everyone's help in advance.
    Chris G

    Hi Chris,
    I am trying to achieve the same. Did you manage to figure this out?
    Thanks.

  • Gurus...Need help....extract data from BKPF header table and BSEG line item

    Gurus,
    I have to write the logic to fetch data from bkpf and bseg. Need help on how can i do that..
    I have to get bukrs  belnr gjahr ldgrp from BKPF for a given date and company code. For all these documents, then i have to get the line items from BSEG if the ldgrp is I1 or SPACE.
    If the ldgrp is not I1 or SPACE then i have to fetch the records from BSEG_ADD and then generate a ALV report with all the data including the data that was fetched from BKPF.
    So, it wil be a combined ALV report that displays header as well as LINE item data together...
    Can u please help me with the code...I am not sure how can everything go all together in one internal table....Becoz once its there in one table then only a ALV list can be generated.......
    Cheers:
    Sam

    hi Sam, this may be of some similar thing.
    Use this program, I got this prog from a source and we added a small conditional check in the program which checks document numbers in BSEG and also comapres in BKPF and sees if the output from BSEG falls under the posting data range specified in the initial selection.
    Now just so you know, this output is kinda messed up, so you will have to play with it in Excel to extract the document numbers, if that is what you want.
    ============================
    PROGRAM....... ZFI_BSEG_DOWNLOAD
    TITLE......... Download BSEG
    PROGRAM TYPE.. Download
    ======================================================================
    GENERAL DOCUMENTATION AND COMMENTS
    <...>
    ======================================================================
    ASSOCIATED PROGRAMS
    <Program>..... <Description>
    ======================================================================
    CHANGE HISTORY
    Date By Ticket Description
    REPORT zfi_bseg_download.
    TABLES: bseg, bkpf.
    TYPES: BEGIN OF ty_output,
    line(6000) TYPE c,
    END OF ty_output.
    TYPES: ty_tab_output TYPE TABLE OF ty_output,
    ty_tab_nametab TYPE TABLE OF x031l.
    CONSTANTS: c_delimiter(04) TYPE c VALUE '"%%"',
    c_records TYPE i VALUE 10000.
    SELECTION-SCREEN
    SELECT-OPTIONS: p_bukrs FOR bseg-bukrs,
    p_belnr FOR bseg-belnr,
    p_buzei FOR bseg-buzei,
    p_gjahr FOR bseg-gjahr,
    p_budat for bkpf-budat.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_append AS CHECKBOX DEFAULT 'X'.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM get_records.
    *& Form get_records
    FORM get_records.
    DATA: l_cursor TYPE cursor,
    lt_bseg TYPE TABLE OF bseg,
    ls_bseg LIKE LINE OF lt_bseg,
    lt_output TYPE ty_tab_output,
    ls_output LIKE LINE OF lt_output,
    lt_nametab TYPE ty_tab_nametab,
    ls_nametab LIKE LINE OF lt_nametab,
    l_field(30) TYPE c,
    l_output(50) TYPE c,
    l_date(10) TYPE c,
    l_len TYPE i.
    FIELD-SYMBOLS: <field>.
    IF p_append NE space.
    OPEN DATASET p_file FOR APPENDING IN TEXT MODE.
    ELSE.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE.
    ENDIF.
    Retrieve BSEF fieldnames and data types
    PERFORM get_fields CHANGING lt_nametab.
    OPEN CURSOR l_cursor FOR
    SELECT * FROM bseg
    WHERE bukrs IN p_bukrs
    AND belnr IN p_belnr
    AND buzei IN p_buzei
    AND gjahr IN p_gjahr.
    Write out fieldnames
    IF p_append IS INITIAL.
    LOOP AT lt_nametab INTO ls_nametab.
    CONCATENATE ls_output ls_nametab-fieldname
    INTO ls_output SEPARATED BY c_delimiter.
    ENDLOOP.
    IF ls_output+0(4) = c_delimiter.
    SHIFT ls_output LEFT BY 4 PLACES.
    ENDIF.
    l_len = strlen( ls_output ).
    TRANSFER ls_output TO p_file LENGTH l_len.
    ENDIF.
    Process BSEG records
    DO.
    CLEAR lt_bseg.
    FETCH NEXT CURSOR l_cursor
    INTO TABLE lt_bseg
    PACKAGE SIZE c_records.
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    LOOP AT lt_bseg INTO ls_bseg.
    SELECT single * FROM BKPF
    WHERE BUKRS = ls_bseg-BUKRS
    AND BELNR = ls_bseg-BELNR
    AND GJAHR = ls_bseg-GJAHR
    AND BUDAT in p_budat.
    if syst-subrc 0.
    continue.
    endif.
    CLEAR ls_output.
    Process individual fields of BSEG record
    LOOP AT lt_nametab INTO ls_nametab.
    CONCATENATE 'LS_BSEG-' ls_nametab-fieldname INTO l_field.
    ASSIGN (l_field) TO <field>.
    CLEAR l_output.
    Process by field data types
    CASE ls_nametab-exid.
    WHEN 'C' OR 'N' OR 'I'.
    Character, Numeric & Integer
    l_output = <field>.
    WHEN 'D'.
    Dates
    WRITE <field> TO l_date DD/MM/YYYY.
    l_output = l_date.
    WHEN 'P'.
    Packed decimals
    WRITE <field> TO l_output.
    WHEN OTHERS.
    MESSAGE a000(zs) WITH 'Data type error - ' ls_nametab-exid.
    ENDCASE.
    SHIFT l_output LEFT DELETING LEADING space.
    CONCATENATE ls_output l_output
    INTO ls_output SEPARATED BY c_delimiter.
    ENDLOOP.
    IF ls_output+0(4) = c_delimiter.
    SHIFT ls_output LEFT BY 4 PLACES.
    ENDIF.
    l_len = strlen( ls_output ).
    TRANSFER ls_output TO p_file LENGTH l_len.
    ENDLOOP.
    IF sy-subrc = 0.
    ENDIF.
    ENDDO.
    CLOSE CURSOR l_cursor.
    CLOSE DATASET p_file.
    ENDFORM. " get_records
    *& Form get_fields
    FORM get_fields CHANGING pt_nametab TYPE ty_tab_nametab.
    CALL FUNCTION 'RFC_GET_NAMETAB'
    EXPORTING
    tabname = 'BSEG'
    TABLES
    nametab = pt_nametab
    EXCEPTIONS
    table_not_active = 1
    OTHERS = 2.
    IF sy-subrc 0.
    ENDIF.
    ENDFORM. " get_fields
    hope this helps.
    cheers,
    Hema.

  • Retrieve data from the same table

    i have a table with following fields
    emp_no,name,salary,department,dept_prev,prev_emp_no.
    now i want retrieve emp_no,name,salary,department, from the data base for a perticular employeee number along with dept_prev
    but dept_prev is the prev_emp_no dept_prev
    now iam doing two query like this
    first query to retreive name,salary,department
    select name,salary,department from employee where emp_no = 10
    second to retrieve the dept_prev from the same table but this
    dept_prev must be based on prev_emp_no
    select dept_prev from employee where emp_no in(select prev_emp_no from employee where emp_no =10)
    can any one suggest to combine these two queries in a single sql statements, because all the fieldds are from the same table.
    Thanks

    Would this one solve it?
    SELECT emp.NAME, emp.salary, emp.department,
           prev_emp.dept_prev
      FROM employee emp,
           employee prev_emp
    WHERE emp.emp_no      = 10
       AND prev_emp.emp_no = emp.prev_emp_no;
    not tested
    C.

Maybe you are looking for

  • Error in generating reference number of process

    Hi All Masters, I'm new in HCM P&F. Currently I have a problem. I was running a sample process or copied process from the sample. Clicking 'check and send'. Still OK. But when I clicked 'Send' button, I got an error message displayed 'Error in genera

  • Weird characters in controls

    Has anyone encountered this? (See attached). Characters in my controls have changed. Also noticed that when creating probes, the font is really large (136!) In the properties tab for the control the correct label text is shown, but the front panel sh

  • BO Designer SDK

    Hi, We have an old piece of software, written in Visual Basic 6, which uses the BO Designer SDK (COM API) in order to build big universes from scratch. We've been asked to develop another sofware providing the same features. It will have to work with

  • [SOLVED] Fixed channel mon0: -1 with aircrack-ng

    Just wanting to know if anyone else is experiencing this issue with aircrack-ng (I have iwlagn). Googled for a while and the solution seems to be re-compiling compat-wireless with a patch. I compiled both compat-wireless-patched and compat-wireless-p

  • Address book locking

    Is there option to lock notes in Address Book. Say that with a contact write a note, and after I can see this note only when enter the code? Maybe some master code for all the notes in address book? If not, it would be a great option for the upgrade.