Returning table without defining structure

Hello, I'm back again, finally I can work with general tables without defining structures but now I found a problem, I want introduce the modified fields into a table for returning it,  but the question is that this table hasn't the structure definition because is for general purpose so I need return it a then work with it.
I was looking for a solution here and into the sap help but I'm not able to find the solution.
How can I work with the fields (field1-a = xxxxx)?
This one is my code:
DATA: itab_spfli TYPE spfli OCCURS 0 WITH HEADER LINE,
          itab1_spfli LIKE itab_spfli OCCURS 0 WITH HEADER LINE,
          wa_spfli LIKE spfli.
SELECT * INTO wa_spfli FROM spfli.
  APPEND wa_spfli TO itab_spfli.
ENDSELECT.
PERFORM read_table TABLES itab_spfli[] USING 'ITAB_SPFLI[]'.
LOOP AT itab1_spfli INTO wa_spfli.
  WRITE: / wa_spfli-carrid.
ENDLOOP.
*& Form read_table
text
-->P_TABLA text
FORM read_table TABLES pe_itspfli USING ti.
  FIELD-SYMBOLS: <f1> TYPE STANDARD TABLE,
                 <f2> TYPE ANY,
                 <f3> TYPE ANY.
  DATA tabla(20).
  tabla = ti.
  CONDENSE tabla NO-GAPS.
  ASSIGN (tabla) TO <f1>[].
Get data into table
  LOOP AT <f1> ASSIGNING <f2>.
    WHILE sy-subrc = 0.
      ASSIGN COMPONENT sy-index OF STRUCTURE <f2> TO <f3>.
    ENDWHILE.
Working with table
    APPEND <f2> TO itab1_spfli.
  ENDLOOP.
ENDFORM. " read_table
Thank You Very Much In Advance.

Hi Jose
ASSIGN COMPONENT sy-index OF STRUCTURE <f2> TO <f3>.
<f3> = <new value>.
This will change the value in the internal table automatically.
Hope this is what you are asking.
Regards
Kathirvel

Similar Messages

  • How To Calculate the % business without Defining Structure

    Hi Experts,
    Report Requirement is displaying the Customer Number, Business  Value, % Business
    %Business = (customer business * 100) / Total Business Value.
    Report Output  sholud Looks
    CNO   Business   Business in %
    C1        100               50%
    C2         50                25%
    C3         50                25%
    How can we achive This without defining the Structure(because we have lot of Records) or  VB macro coding.
    Thanks
    Chandra

    Hi,
    U neednt create any structure. The CNO u can keep in rows. Business in columns. and right click and create a new formula as
    ( business * 100 ) / SUMGT(business)
    This is multiply the value in business for that particular row by 100 and then divide it with the overall sum of business.
    Hoep it helps
    Regards,
    Rathy

  • Defining table from DDIC-structure dynamically

    Hi folks!
    Does anybody know whether it is possible to build an internal table from DDIC-structures dynamically?
    I have a deep structured itab_upload(whose structure is defined in the DDIC), which contains 2 fields(Number Name) and a third field which contains  itab_desc.
    This itab_desc can contain either 2 fields(Number Name) and a third field which contains another itab_desc  <b>or</b>  3 fields for numbers(without any other itab).If itab_desc contains another itab_desc, the second itab_desc contains only 3 fields for numbers and names...
    help will be very appreciated and points will be rewarded!
    Felix

    Hi Felix,
    Please find below the material which will help you to solve your problem :-
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae
    Please reward points if helpful.
    Regards.
    Srikanta Gope.
    [email protected]

  • How to migrate sql server 2000 user defined function returns table

    Hi,
    How do I capture the SQL Server 200 user defined function that returns table? Is this supported in the current version of Oracle Migration Workbench? I am using the latest version - Release 9.2.0.1.0 with SQL SERVER 2000 plug-in.
    I was able to capture the SQL Server 2000 user defined function that returns string and smalldatetime but not the functions return table during the migrate data source stage.
    Thanks in Advance,
    Susan

    Susan,
    This is not currently supported. The next release of the Oracle Migration Workbench (due very soon), will do a better job of catching this mad reporting an error. We are looking into a suitable mapping and have created bug # 2355073 - TABLE DEFINITIONS NOT ACCEPTED FOR TABLE FUNCTIONS to track this issue.
    Once possible solution we are looking into is using the object type to emulate. Here is an example from the bug:
    Original table
    SQL> create table tabela (a number, b number, c number, d number);
    SQL> insert some values...
    SQL> select * from tabela;
    A B C D
    1 1 1 1
    2 2 2 2
    3 3 3 3
    4 4 4 4
    SQL Server 2000 code
    CREATE FUNCTION FUNCRETORNATABELA()
    RETURNS TABLE
    AS
    RETURN SELECT A,B,C,D FROM TABELA
    SELECT A,B,C,D
    FROM FUNCRETORNATABELA()
    ORDER BY A
    Oracle code (workaround)
    SQL> create or replace type MyObjType as object (
    2 a number, b number, c number, d number);
    3 /
    Type created.
    SQL> create or replace type MyTabType as table of MyObjType;
    2 /
    Type created.
    SQL> create or replace function teste return Mytabtype pipelined as
    2 aa MyObjType := MyObjType(null, null, null, null);
    3 cursor c1 is select a,b,c,d from tabela;
    4 begin
    5 open c1;
    6 loop
    7 fetch c1 into aa.a, aa.b, aa.c, aa.d;
    8 exit when c1%NOTFOUND;
    9 pipe row (aa);
    10 end loop;
    11 close c1;
    12 return;
    13 end;
    14 /
    Function created.
    SQL> select * from table(teste);
    A B C D
    1 1 1 1
    2 2 2 2
    3 3 3 3
    4 4 4 4
    SQL> select a, c from table(teste) order by c desc;
    A C
    4 4
    3 3
    2 2
    1 1
    Donal

  • How to Insert data in 3 table without use of join 1table mapped rule define

    1.Table SOL_K
    A B C D – Columns Name
    C D A B –Coulmns Values Defined (Rule --- Defined)
    2.SECOND table SIC_K
    SIC_ K
    A B C D
    Kamal Micky NULL MANOJ
    3 Table SIC_Mapping
    Same Columns A B C D based On Table SOL_K defined rule
    I want to insert values(from table SIC K) into table SICMapping Table with the help of first table(SOL_K)(mapped rule)
    Required Result SIC_Mapping Table
    The output will be come like this.
    A B C D — Columns Name
    NULL MANOJ Kamal Micky ---- Came based on defined Mapping Rule

    This is the forum for issues with the SQL Developer tool. You will get better answers in the SQL and PL/SQL forum.

  • Internal table of unknown structure as a importing parameter of FM

    Hello
    I need to build FM that performs the following operations :
    1. gets the internal table of unknown structure on the input
    Its known that table has key fields of K1 , K2 , K3 and numerical fields of N1, N1.The other fields are unknown
    2. Populate fields N1, N2 with values (logic is clear and simple)
    3. Return table
    Can you please recommend me which way I should go. Some examples are very welcome
    THanks

    Hi,
    In your tables parameter enter the name of the table with out any type. This was you may be able to use it dynamically. Next create another importing parameter as table type. there you will pass the type of the table. Now if you have these information then you should be able to define a field-symbol in the FM and do the manipulation.
    Regards
    Prasenjit

  • Return tables in Update routines

    Hi,
    Can anyone send me some documents on the use of return tables in Update Routines?
    email id: [email protected]
    Thanks in advance,
    RP

    Hi Ram,
    <b>Table as a return</b>                                                                               
    In general, routines in the update rules have only one return code.                                                                               
    If you select this field, the corresponding key figure routine no longer
        has a return code (defined in RESULT), rather a return table (defined in
        RESULT_TABLE). In this case you can create as many key figure values    
        from the data record as you wish. You can find the calculated           
        characteristic values in the structure ICUBE_VALUES.                                                                               
    <b>Activities</b>                                                                               
    If you change these values accordingly, then you fill the field for the 
        relevant key figure and use this to fill RESULT_TABLE.                                                                               
    Regards
    Happy Tony
    <b>Points == Thanks</b>

  • Problem with primary/secondary keys in table with included structures

    Dear ABAPers,
    we have a structure which is supposed to be included in the definition of several tables.
    The problem is the following:
    depending on the application table that includes this structure, 3 or 4 fields of that structure may
    or may not be necessary to enhance the table key. As far as I know included structures can only
    completely be marked as keys. Therefore I suggested to split up the structure into two parts,
    one part with the possible candidates that may become key fields, and the rest, and of course
    a structure that unites both of these substructures. So when it comes to reusing this structure
    the developer would have the choice to select the structure with all of the fields in case no field
    is needed as additional key, or the developer would have to implement both of the substructures
    separately with the option to mark the key-part of it as key in his table.
    But unfortunetaly this suggestion of mine was refused as being too complicated and I am supposed
    to define all the fields in one flat structure and to "enhance" the primary keys (that always will exist)
    by secondary keys.
    Does anybody know how that is supposed to work without defining double indexes?
    I cannot activate a table without having primary keys defined and any unique secondary index would
    allways include all of the primary keys.
    Thanks in advance for you help
    (I'm sorry that you cannot be granted reward points for just reading the extensive problem description)
    regards
    Andreas

    Dear Rob,
    since your answer was helpful and since it was the only one I will grant you full points on that.
    Thanks again for your input. In case other developers should look this thread up being confronted
    with the same kind of problem, here is how we solved it:
    We added an artificial primary key (a number of type NUMC 8) to the table which is supposed to
    include the structure. This key alone takes care of the uniqueness of eacht entry.
    All the others fields that we want to have available for a fast direct access, including the ones
    from the included structure, are put together in a secondary index.
    best regards
    Andreas

  • Explore return table BAPI_MATERIAL_SAVEDATA

    Hi Friends,
    I would like write the content of the return table in BAPI_MATERIAL_SAVEDATA.
    The code is like this.
    REPORT  Z_CREATE_MAERIAL_BAPI.
    data clientdata type BAPI_MARA.
    data wa_clientdata TYPE bapi_mara_ga.
    data up_clientdata type TABLE OF BAPI_MARA_GA.
    data HEADERDATA TYPE BAPIMATHEAD.
    data RETURN type BAPIRET2.
    data wa_return...................?????????
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        HEADDATA                    = HEADERDATA
       CLIENTDATA                  = clientdata
    IMPORTING
       RETURN                      = return
    LOOP AT return INTO wa_return.
       WRITE: / 'Return Type: ', wa_return-type.
        WRITE: / 'Return ID: ', wa_return-id.
        WRITE: / 'Return #: ', wa_return-number.
        WRITE: / 'Message 1: ', wa_return-message.
        WRITE: / 'Message 2: ', wa_return-message_v1.
        WRITE: / 'Message 3: ', wa_return-message_v2.
        WRITE: / 'Parameter: ', wa_return-parameter.
        WRITE: / 'Row: ', wa_return-row.
        WRITE: / 'Field: ', wa_return-field.
        WRITE: / 'System: ', wa_return-system.
        SKIP.
        ULINE.
        SKIP.
        ENDLOOP.
    During the check it says 'return' is no internal table.
    How can I manage that.
    Thanks in advance for you help.
    Rg. Jimbob
    Edited by: jimbob on Jun 29, 2008 8:21 PM

    Yes thats true..for this bapi FM return parameter is an export parameter, it is not a table instead it is a structure.
    EXPORTING
    *"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2.
    You should use RETURNMESSAGES instead of RETURN which is defined under TABLE.
    RETURNMESSAGES STRUCTURE  BAPI_MATRETURN2.
    REPORT Z_CREATE_MAERIAL_BAPI.
    data clientdata type BAPI_MARA.
    data wa_clientdata TYPE bapi_mara_ga.
    data up_clientdata type TABLE OF BAPI_MARA_GA.
    data HEADERDATA TYPE BAPIMATHEAD.
    data RETURN type BAPIRET2.
    data wa_return type BAPI_MATRETURN2.
    data returnmessages type standard table of BAPI_MATRETURN2.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
    HEADDATA = HEADERDATA
    CLIENTDATA = clientdata
    IMPORTING
    RETURN = return
    tables
    RETURNMESSAGES = returnmessages.
    LOOP AT returnmessages INTO wa_return.
    WRITE: / 'Return Type: ', wa_return-type.
    WRITE: / 'Return ID: ', wa_return-id.
    WRITE: / 'Return #: ', wa_return-number.
    WRITE: / 'Message 1: ', wa_return-message.
    WRITE: / 'Message 2: ', wa_return-message_v1.
    WRITE: / 'Message 3: ', wa_return-message_v2.
    WRITE: / 'Parameter: ', wa_return-parameter.
    WRITE: / 'Row: ', wa_return-row.
    WRITE: / 'Field: ', wa_return-field.
    WRITE: / 'System: ', wa_return-system.
    SKIP.
    ULINE.
    SKIP.
    ENDLOOP.
    Hope it will help.
    Regards,
    Joy.

  • Table field and structure field

    Hi ,
    I am working on an user exit.
    I have to update a field on the transaction screen DFBATCH-MHD_IO (DFBATCH is a struture).
    Now the same field is defined in table MARA-VFDAT (MARA is a table).
    Now in the user exit function module I have written a code which will update the table field MARA-VFDAT.
    So will the structure field also gets updated automatically since that structure field is same as the table field (only name is different) or I have to explicitly equate table field to structure field.
    Raghu.

    How do you know that DFBATCH-MHD_IO is tied to MARA-VFDAT.   Is there a line of code in the transaction like this.
    MARA-VFDAT = DFBATCH-MHD_IO. 
    or
    DFBATCH-MHD_IO = MARA-VFDAT. 
    If you are updating MARA-VFDAT from your userexit, and the existing code in the transaction is filling the DFBATCH-MHD_IO from MARA-VFDAT,  then no you shouldn't need to fill it.
    Regards,
    Rich Heilman

  • Adding a single table without a logical join to another table (OBIEE 10g)

    Sometimes I want to just display a single table without a logical join to another table in the repository. However, everytime I move it to the Business Model and Mapping layer and perform a Global Consistency Check, it tells me that it needs a logical join and I am forced to create another table to join to it. Thus creating a dimension-fact relationship. There are times I don't need this relationship and just want to display some data. Is there anyway to get around this?
    Thanks in advance!

    Yes,You have to create a join.You cannot take single table to BMM layer.You can create an alias of the table.Join this alias and base table through any common column and take both tables to BMM and desired table to presentation layer.
    Another way is to create a view in physcial layer.Write a select statement like
    Select primary_key from Table
    Where primary_key is primary key of base table.Join this view ith base table and repeat the steps defined for Alias.
    Regards,
    Sandeep

  • Creation of condition table without copy

    During creation of Condition table ( without copying any condition from available tables), Is it possible to see all field catalouges available? and if possible then how can we see all fields available to add desired ones into our table?

    Hi,
    SPRO >Sales and Distribution->Basic Functions>Pricing>Pricing Control-->Define Condition Tables
    In the above menu path you can find out the Field catalog what SAP has given if you want to add new field you can add provided
    If you done the Enhancements
    Regards,
    Prasanna

  • What are the advantages  using internal tables without headerline.

    hi,
    i have a doubt,please clarify.
    data:itab like &lt;databse table&gt; occurs 0 with header line.
    or
    data:itab like &lt;databse table&gt;occurs 0,
    wa like line type of itab.
    in above two cases , in my view  no difference.
    in first case there will be one workarea will be created with same name itab,
    in second case we are explicitly creating work area.
    ok.
    here my doubt is in what cases it is madatory to create  internal table with  explicitly work area?
    thank in advance.
    venu

    Hi,
    It is a good practice to define a structure for your internal table. Then declare an internal table with the defined structure. Using a workarea to access to the internal table.
    TYPES : BEGIN OF struc_tab,
                      rec1(10) TYPE c,
                  END OF struc_tab.
    DATA : itab TYPE TABLE OF struc_tab,
                wa_itab LIKE LINE OF itab.
    There is no differences, just that we're avoiding declaring using 'With Occurs 0' or 'With Header Line' and in some cases in oo programming, headerline are not allowed.
    Regards,
    Loo

  • How to create internal table for a structure in BSP

    hi ,
    I have created a Structure in BSP.I want to create an internal table for that Structure. But in my coding ie.
    <% data: begin of itab_1 .
                     include type zuvendstr.
                     data:end of itab_1.
                     data wa_str like line of itab_1.
                     loop at itab_1 into wa_str. %>
                    <tr>
                     <td><%=wa_str-name%> </td>
                           <%endloop.%>
    In this zuvendstr is Structure ,wa_str is workarea and itab_1 is an Internal table.But it is showinng an error that itab_1 is unknown.But we cannot define internal tables for an Structure in Page Attributes.So,please resolve how to create internal table for Structure in BSPS

    Hi,
    You can define itab_1 like this (assuming zuvendstr is a structure type):
    DATA: itab_1 TYPE TABLE OF zuvendstr.
    Regards,
    Tanguy

  • How to insert data in the table without  join and using mapped rule value

    1.Table SOL_K
    A B C D – Columns Name
    C D A B –Coulmns Values Defined (Rule --- Defined)
    2.SECOND table SIC_K
    SIC_ K
    A B C D
    Kamal Micky NULL MANOJ
    3 Table SIC_Mapping
    Same Columns A B C D based On Table SOL_K defined rule
    I want to insert values(from table SIC K) into table SICMapping Table with the help of first table(SOL_K)(mapped rule)
    Required Result SIC_Mapping Table
    The output will be come like this.
    A B C D — Columns Name
    NULL MANOJ Kamal Micky ---- Came based on defined Mapping Rule

    What's your database version?
    That's a funny requirement.
    How about :
    select case sol.a
              when 'A' then sic.a
              when 'B' then sic.b
              when 'C' then sic.c
              when 'D' then sic.d
           end as a
         , case sol.b
              when 'A' then sic.a
              when 'B' then sic.b
              when 'C' then sic.c
              when 'D' then sic.d
           end as b
         , case sol.c
              when 'A' then sic.a
              when 'B' then sic.b
              when 'C' then sic.c
              when 'D' then sic.d
           end as c
         , case sol.d
              when 'A' then sic.a
              when 'B' then sic.b
              when 'C' then sic.c
              when 'D' then sic.d
           end as d
    from sol_k sol, sic_k sic
    ;XQuery can do the trick too :
    SQL> SELECT *
      2  FROM XMLTable(
      3   'for $i in ora:view("SIC_K")/ROW
      4    return element r {
      5     for $j in ora:view("SOL_K")/ROW/child::*
      6     return element {name($j)} {$i/child::*[name()=$j]/text()}
      7    }'
      8   columns
      9     a varchar2(30) path 'A'
    10   , b varchar2(30) path 'B'
    11   , c varchar2(30) path 'C'
    12   , d varchar2(30) path 'D'
    13  );
    A          B          C          D
               MANOJ      Kamal      Micky
    Edited by: odie_63 on 29 juin 2011 22:07

Maybe you are looking for

  • Report to find the list of POs raised for a particular vendor by a user.

    Hi Gurus, Is there any report which will give the detail of PO's raised against a particular vendor (with address) by a user for the particular period. Thanks and Regards, Prakash

  • Media encoder freezes after 4.2 update installation

    Hey guys, I´m in a middle of a huge project and I updated premiere and media encoder to a new 4.2 version. After that I can´t get anything out of premiere cause every time I try to export media encoder totally freezes after couple of seconds after I´

  • Linking multiple sheets?

    Greetings, I have a Numbers 09 workbook with multiple (40) sheets that I would like to be able to link to a summery sheet. The cell on the summery sheet would sum all of the data from the same cell in all other 40 sheets as it is changed. I was able

  • Sending a message to xfce4-notifyd [SOLVED]

    I'd like to have a bash script send some output to xfce4-notifyd but am unsure how to do it.  Upon googling, I think the right program to call is dbus-send but I can't seem to send anything that gets displayed by xfce4-notifyd.  Example: dbus-send --

  • EXPORT WITH PREMIERE PRO

    Why can't I export my editing with Premiere Pro