Regarding appending data in table type

Hello Experts,
Actually, I have one structure and in that I am using one table type .
e.g. in the main structure, fields are as follows,
  po_number   po_line_item_no  gr_details
here gr_details is table type having following fields.
  gr_number gr_qty gr_date
As we all know that one po can have multiple GR,
I want to append entries in the above structure in such a way that for one po entry , in the same record , multiple Gr entries should come.
I am doing one program , in it is mendatory.
can anyone please revert back on the same with High Priority ( Coding in Program to append values as per explained above ).
Best Regards,
Rashmi.

Hi!
For the same PO entry multiple GRs in same record is not possible. But you can have multiple GR entries in your internal table with same PO details.
For eg. If you have one PO with 4 GRs then you will have 4 lines in internal table that belong to same PO but different GRs. In this case PO details would be redundant.
To read these values into internal table
1. You can read the GR details into corresponding columns of internal table and then update the PO columns for these records.
2. The other bit diffcult way could be to read all PO details into internal table. Then loop at internal table for each PO find out the no. of GRs. If it has N no of GRs then add (N-1) rows with same PO details and different GR details and update the N the GR detail into the existing row of the internal table. If it has only 1 GR then update the existing line. If PO has no GR then delete the table line.
Reward points for all the useful answers.

Similar Messages

  • Appending data with different type

    In follow up to an earlier post, regarding appending data from one table to anlther, please could I have some advice on the appropriatness of using certain data types to accommodate data from a non-SQL data type?
    The following is displayed as
    non-SQL data type > SQL data type
    i) Real > FLOAT
    ii) Integer > NUMBER
    iii) Boolean > VarChar2
    iv) Character > CLOB
    v) Integer > FLOAT
    vi) Date > VarChar2
    My feeling is that i), ii), v) are acceptable, and the rest not acceptable. Please let me know if you disagree.
    From an earlier post, I gather that "to_char" is better than "VarChar2" when holding numerical data.
    Many thanks

    803242 wrote:
    In follow up to an earlier post, regarding appending data from one table to anlther, please could I have some advice on the appropriatness of using certain data types to accommodate data from a non-SQL data type?If you are copying data from one table to another, only SQL types are relevant because you cannot create tables with columns using non-SQL types.
    The following is displayed as
    non-SQL data type > SQL data type
    i) Real > FLOAT
    ii) Integer > NUMBER
    iii) Boolean > VarChar2
    iv) Character > CLOB
    v) Integer > FLOAT
    vi) Date > VarChar2
    Only boolean that you have listed as non-SQL types, is actually a non-SQL type.
    From an earlier post, I gather that "to_char" is better than "VarChar2" when holding numerical data.For holding numerical data you would use number or a variation such as integer or real, you would definitely not use varchar2. to_char is a data type conversion function, not a data type so is irrelevant.

  • Read data from table  type

    Hi everyone,
    I am calling a FM BBP_READ_ATTRIBUTES, it exports a line ET_ATTR(Table type) , now in this there is a field  VLIST which is an Internal table . and It has entry in it.
    Now I require to get this internal table.
    I declare in data statement var type tabletype.
    How exactly can i retreive this internal table .
    when i double clicl on ET_ATTR , it a tabl type but i calls a line type BBPS_ATTR which is like a structure and there is a feild like VLIST which is an internal table .
    Please help me to retrieve the data in this internal table.
    Reagrds,
    Raj

    Plz try the following..
    FIELD_SYMBOLS: <fs_vlist_tab> type VLIST.  " plz give the table type of VLIST
    DATA: WA_VLIST TYPE LINE OF VLIST
    READ TABLE ET_ATTR INDEX 1. " as you saying it has only one line, read only index 1. o.w. you can read the other lines too as per you requirement.
    ASSIGN ET_ATTR-VLIST TO <FS_VLIST_TAB>.
    READ TABLE <FS_VLIST_TAB> into WA_VLIST index 1.
    * and process your WA_VLIST as requried..
    Regards
    Prax

  • EEWB : in CRM 4.0 adding  field with data element = table type

    Hi,
    Do you have experience in CRM4.0 to add a customer field with data element that is a table type ?

    Marie,
    I don't believe it is possible in CRM 4.0.  Another drawback of the EEWB is that you can't add currency or quantity fields using the EEWB tool.
    Good Luck,
    Stephen

  • Regarding entering data in Table J_2IRG1BAL

    Hi SAP Gurus,
    While I tried to enter data into table J_2IRG1BAL through  Menu->Utilities->Table->contents->Create Entries
    The following Error is displayed .
    error : Create data processing function module
    Message no. SV023
    Diagnosis
    You have called the function for editing view contents. The function modules needed for the maintenance functionality of this view are not available in the system.
    Procedure
    The data processing function module must be re-generated.
    Contact the system administration.
    Plz Help!
    Reagrds Pavan.

    Hi Pavan,
    Have a look at this OSS Notes
    I thnk u need to regenrate the function module using SAP Note .Chk the following whether it will be useful or not.
    Note 316683 - V_T778Q: Create data processing function module
    Note 849858 - OT: Create data processing function module error -T558E.
    Try a search for OSS Notes in Service market place with messages which u have got.
    Regards,
    Lakshman.

  • Regarding logical data base tables

    i am working on abap-hr. i want to know how to retrieve data from two different hr-database tables to two different internal tables and then send it to final internal table.can any one plz give me sample hr code.
    your help is rewarded with points
    bye
    rad

    Hi
    If you are using logical databases, then you don't have to give any SELECT statement.
    1. For getting the personnel number, you use PNP logical database.
    2. Declare infotypes of the 2 tables from which you need to fetch data, say for 0000, 0001.
    3. Use the event GET PERNR in START-OF-SELECTION.
    when you do this, an internal table will be created and will be populated with all pernr for the declared infotypes in P0000, P0001.
    4. at the event END-OF-SELECTION, GET PERNR will be triggered and next pernr will be fetched and the internal tables with that pernr will be populated.
    You can use these internal tables for getting the desired records by using the macros,
    RP-PROVIDE-FROM-LAST ......
    SAMPLE CODE:
    infotypes: 0000, 0001, 0002.
    tables: pa0000, pa0001, PERNR.
    data: begin of itab occurs 0,
          end of itab.
    Start-of-selection
      START-OF-SELECTION.
      GET PERNR.
    RP-PROVIDE-FROM-LAST P0001 SPACE PN-BEGDA PN-ENDDA.
    if no record is found then exit
      IF PNP-SW-FOUND = 1.
        ITAB-PERNR  = PERNR-PERNR.      "Emp no
        ITAB-BUKRS  = P0001-BUKRS.      "Company code
        ITAB-WERKS  = P0001-WERKS.      "Personnel area
        ITAB-BTRTL  = P0001-BTRTL.      "Personnel sub-area
    RP-PROVIDE-FROM-LAST P0002 SPACE PN-BEGDA PN-ENDDA.
      if pnp-sw-found = 1.
        ITAB-VORNA  = P0002-VORNA.
        ITAB-NACHN  = P0002-NACHN.
       endif.
      ELSE.
        EXIT.
      ENDIF.    
    append itab.
      END-OF-SELECTION.
    this will fetch the last record. if you need to fetch all records then you can loop P0001 and get the values for that particular pernr.
    loop at P0001.
      itab-pernr = pernr-pernr.
      itab-werks = P0001-werks.
    endloop.
    Regards,
    Navneeth
    PS: If not clear, please let me know.
    Message was edited by: Navneeth Saraogi

  • Regarding selecting data from tables in report?

    How to read the data into the report which is stored in the cluster form in the database its urgent please reply me?

    Retrived from a Clustered Table
         IMPORT letter = my_table_in
            FROM DATABASE zlmetext(lm) ID text_idx.
    You'll have to find where the data was EXPORTed to find the values for some of the parms.
    IMPORT letter = my_table_in
      here, I used
          EXPORT letterdesc  FROM zlmetext-letterdesc
                 letteravail FROM zlmetext-letteravail
                 subject     FROM zlmetext-subject
                 erdat       FROM zlmetext-erdat
                 ernam       FROM zlmetext-ernam
                 aedat       FROM zlmetext-aedat
                 aenam       FROM zlmetext-aenam
                 letter      FROM it_ltr_text
            TO DATABASE zlmetext(lm) ID text_idx.
    In this case, all the fields except letter were stored in the base portion of the table record.   Only Letter was stored in the clustered area.
    Becaue I used LETTER, the "key" to the clustered area is now LETTER and my import uses LETTER as the key to find the table that i stored using letter.
    in this part
    FROM DATABASE zlmetext(lm) ID text_idx.
    the lm is the cluster and must be the same as the export.  This value can NOT be a variable and must be hardcoded as shown.
    text_idx is the built key to retrieve and this is the code I used to create it
    DATA:
      BEGIN OF text_idx,
        appl     LIKE zlmetext-appl,
        letterid LIKE zlmetext-letterid,
        srtf2    LIKE zlmetext-srtf2,
      END OF text_idx.
      text_idx-appl     = zlmetext-appl.
      text_idx-letterid = zlmetext-letterid.
      CLEAR: text_idx-srtf2.

  • Regarding Changing data in Table Maintanance Generator

    hi all,
        I Created one Z Table for Five fields Sales District( BZIRK) , Sales District Description (BZTXT) , Vendor No , Vendor Name and Person Incharge. I Created Table Maintanance Generator for five fields.
        In my ZTable after giving Vendor No when i enter Vendor Name is coming automatically and record is Created.For these i used Event No 5.
    When i am going again and When I change Vendor No When I Press enter Vendor No is not coming automatically. 
    Which Event Should i use.
    How can i achieve this . Plz send detailed process.
    Please suggest.
    Regards
    Rami

    Hi,
    Please eloberate u r question. and give some code.
    Regards,
    Nandha

  • Reading data from Table type from Badi /sapapo/curto_create

    Hi,
    I have been trying to read data from badi /sapapo/curto_create . In this badi there is method CS_PPDS_RTO.
    which has nested structure upto 8 level. I have been trying to read data but i am not suceesfull in reading data from the stsructre
    which is present at lowest level.
    The  nested structure of the BEFORE_SAVE is following way.
    BEFORE_SAVE-CS_PPDS_RTO-HIRARCHY-ADD_APPLICTN_DATA-MODES-BODY-CAP_REQS-RESUID.
    I have to read the value of reusid bt i am not sure whow to read this value can you please help me by giving some Bapi or method
    to read the value of Reusid .
    Thanks

    Hi!
    DATA: lv_resuid TYPE resuid.
    LOOP AT CS_PPDS_RTO-HIRARCHY-ADD_APPLICTN_DATA-MODES-BODY-CAP_REQS-RESUID
    INTO lv_resuid.
    ENDLOOP. 

  • Query regarding the data type for fetcing records from multiple ODS tables

    hey guys;
    i have a query regarding the data type for fetcing records from multiple ODS tables.
    if i have 2 table with a same column name then in the datatype under parent row node i cant add 2 nodes with the same name.
    can any one help with some suggestion.

    Hi Mudit,
    One option would be to go as mentioned by Padamja , prefxing the table name to the column name or another would be to use the AS keyoword in your SQL statement.
    AS is used to rename the column name when data is being selected from your DB.
    So, the query  Select ename as empname from emptable will return the data with column name as empname.
    Regards,
    Bhavesh

  • Assigning data from one Table type to another structure

    Hi every one,
    I have a table type X sent from one function module to another Proxy generated method which has the parameter defined as a structure.
    I have declared a variable Y as a LINE TYPE OF X.
    Then I have this statement which fills up the data.
    READ TABLE X INTO Y INDEX 1.
    The data is transferred from X to Y.
    Now i need to send this to the proxy generated Function module which has a structure Z.
    Now when i say MOVE-CORRESPONDING Y to a variable of type Z, it says it cannot be converted.
    The structure in proxy generated FM has different data type but the same domain as that of standard one.
    Everywhere it is prefixed with YY.
    And also has one additional Controller tab inserted,
    Can you guys tell me how to move the data from this table type to the structure.
    - Venkat

    Hi,
    Declare a variable of line type Z.
    Move corresponding values from variable X to this variable.
    Append this variable to the table Z.
    Try this.
    Regards,
    R.Nagarajan.

  • Appending data from amultiple internal tables

    Hi Experts,
    I need to append data from more than one internal tables to one internal table. But the internal tables has different structure.
    For example, I have internal tables I_A550 table which has field KNUMH, and I_A573 which has same filed KNUMH. Same way I have 25 tables, and all have KNUMH field.
    Now I have taken an internal table I_AXXX which has only one field KNUMH. I need to transfer data from all those 25 tables to I_AXXX.
    I wrote code as below.
    LOOP AT I_A550
       MOVE I_A550-KNUMH to I_AXXX-KNUMH.
       APPEND I_AXXX.
    ENDLOOP.
    LOOP AT I_A573.
        MOVE I_A573-KNUMH to I_AXXX-KNUMH.
        APPEND I_AXXX.
    ENDLOOP.
    But instead of writing 25 loops, is there any way we can simplify this?
    Thanks in advance.

    Hi,
    Just use field-symbols for your purpose as follows:-
    See the example below
    TYPES: BEGIN OF y_t_final,
           matnr TYPE matnr,
           END OF y_t_final.
    TYPES: y_tt_final TYPE STANDARD TABLE OF y_t_final.
    data : WA_mara type mara,
           wa_mard type mard.
    DATA : itab  TYPE STANDARD TABLE OF mara.
    DATA : itab1 TYPE STANDARD TABLE OF mard.
    DATA : it_final TYPE STANDARD TABLE OF y_t_final.
    DATA : wa_final TYPE y_t_final.
    wa_mara-matnr = '1'.
    append wa_mara to itab.
    wa_mard-matnr = '2'.
    append wa_mard to itab1.
    PERFORM f_loop USING  itab
                   CHANGING it_final.
    PERFORM f_loop USING  itab1
                   CHANGING it_final.
    The code inside the perform is as follow:-
    FORM f_loop  USING    p_itab TYPE ANY TABLE
                 CHANGING p_it_final TYPE y_tt_final.
      FIELD-SYMBOLS : <fs>     TYPE ANY TABLE,
                       <wa>    TYPE ANY,
                       <field> TYPE ANY.
      DATA: l_data TYPE REF TO data.
      ASSIGN p_itab TO <fs>.
      IF <fs> IS ASSIGNED.
        CREATE DATA l_data LIKE LINE OF <fs>.
        ASSIGN l_data->* TO <wa>.
        IF <wa> IS ASSIGNED.
          LOOP AT <fs> INTO <wa>.
            ASSIGN component 'MATNR' of structure <wa> TO <field>.
            IF <field> IS ASSIGNED.
              MOVE <field> TO wa_final-matnr.
              append wa_final to p_it_final.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.
    I hope you can understand the concept.
    Regards,
    Ankur Parab

  • Regarding the table type

    hi,
    this is the requirement
    iam selecting a field from a data base table and passing that field to an import parameter of a function module.
    the type of the import parameter is table line type.
    how to pass data to that variable which of table type.
    table type : /SAPAPO/RESID_TAB. "there is a field of type this in FM
    DATA : LOC_IT_RESOURCE type /SAPAPO/RESID_TAB .
    DATA : L_IT_RESOURCE like /sapapo/res_head-RESUID.
    now if i have to pass value from L_IT_RESOURCE  to LOC_IT_RESOURCE
    how shd i assign value?
    can anyone suggest an answer for this.
    thanks in advance

    Move individual common values from one table to another table ..
    using LOOP .. ENDLOOP.
    Some fields will be common in both table...
    LOOP AT L_IT_RESOURCE.
    move common values to wa of LOC_IT_RESOURCE
    append wa to LOC_IT_RESOURCE.
    ENDLOOP.
    reward if useful
    Regards
    Prax

  • Mapping Line type Data to table data

    Hi,
    I am trying to refer to a data element present in the line type of a table type which belongs to an import parameter of a smartform. How will i access the data element to use in the where clause of a select statement.
    For Eg:
    Import Parameter name: PARTNER_H
    TYPE: CRMT_OUTPUT_PARTNER_H_COMT  (table type)
    The line type attached to this table type is CRMT_OUTPUT_PARTNER_H_COM.
    This line type is the structure that contains the data element that i need to use. the details are as below:
    Component: RELATION_PARTNER
    Component type: BU_PARTNER_GUID
    I have written a select statement as below:
    SELECT SINGLE * from BUT000 into I_FS_BUT000 where
      PARTNER_GUID = PARTNER_H-RELATION_H.
    I have given the input parameter as  PARTNER_H.
    It throws me an error that "PARTNER_H" is a table without a header line and therefore has no component called "RELATION_H".
    Is this the correct way to access the data element?Please help.

    Hi Neena,
                   Since PARTNER_H is an internal table it may have multiple values. If you want only a single entry from BUT000, you ll have to determine which entry from PARTNER_H you need in select query.
    If it is always going to have only a single value then , this will work :
    data: wa_partner_h type line of CRMT_OUTPUT_PARTNER_H_COMT.
    Read table partner_h into wa_partner_h index 1.
    if sy-subrc is initial.
    SELECT SINGLE * from BUT000 into I_FS_BUT000 where
    PARTNER_GUID = WA_PARTNER_H-RELATION_H.
    endif.
    Regards,
    Arun

  • Datapump : How to append data in an existing table

    Hello Everyone,
    We are new to Datapump.
    We try to extract data from one user/schema and to append it into another user/schema.
    First we tried Tt use the parameter table_exists_action=append during the importation but we receive this error (but the rows are appended):
    ORA-39152: Table "XXXXX"."YYYYY_ZZZ" exists. Data will be appended to existing table but all dependent metadata will be skipped due to table_exists_action of append
    Which I don't expect since the utility have been told to, indeed, append data.
    Next we tried to use CONTENT=DATA_ONLY on exportation and importation but the importation never end.
    How can we append data into a table's user/schema without having an error?
    Best regards.
    Carl

    IGNORE=Y during the import.it does the same operation. if the table already exists,it ignores and proceed with importing/appending data to the tables. same way, they do have indexes=n and constraints=n option.
    both export/import have equivalent options for fitering to our requirement and datapump has one step above classic import in which you can filter upto metadata object as well.

Maybe you are looking for

  • Bridge CC Thumbnails

    have one folder with only 65 Canon raw pictures in it. Whenever I go to this folder, it will generate 25 thumbnails (info at bottom left). Even when I just minimise the window and again maximise it. Have purged the thumbnail and also tried deleting t

  • Password Protected PDF using iTextSharp

    hello i create pdf files using iTextSharp in vb.net .  i did it but now i need to create these pdf files as password protected and i can't find any method for this, how can i create password protect a pdf using iTextSharp ?

  • "name" field in contacts never stored

    If I add a new contact with just a "Name" and phone number, the "Name" is not stored (so the new contact shows up at the very bottom of the contact list with just a phone number). I have to use for example "phonetic first name" to work around this. T

  • Default background color code for Canvas, Panel, Form?

    I could not find them. Are they the same for MX and Spark components?

  • DVI vs. Analog connection

    I just got a new monitor that has both Analog, and DVI hookups. I am currently connected using the Analog, because that is what cable came with the monitor. My G4 tower also has a DVI & Analog connectiosn. Is it worth getting a DVI cable to connect t