How to build tree/hierarchy/explorer format in internal table

Dear Friends,
I have one internal table with parent and child, again child will be acting as parent and it can have further childs ......
like that it goes on there is no constant levels it goes on....
for example.
parent child
100 101
102
103
101 201
202
102 301
103 401
402
403
this has to be displayed in hierarchy mode.
here i to as a column wich has to represent its position/level in the hierarchy like:
1
1.1
1.1.1
1.2
1.2.1
......n
1.2.2...n
1.3
2
2.1
2.2
3
etc...
let me know any ideas to get the maping of the rows to put it in tree format( like windows explorer).
Thanks,
Mahesh.Gattu

REPORT  Z_TREE.
TYPE-POOLS: ICON.
TYPE-POOLS : FIBS,STREE.
INCLUDE <ICON>.
DATA : T_NODE TYPE SNODETEXT.
DATA : NODE_TAB LIKE T_NODE OCCURS 0 WITH HEADER LINE.
DATA : ITAB LIKE VBAP OCCURS 0 WITH HEADER LINE.
DATA : ITTX LIKE MAKT OCCURS 0 WITH HEADER LINE.
DATA : LI TYPE I VALUE 1.
CLEAR : NODE_TAB, NODE_TAB[].
SELECT * FROM VBAP INTO TABLE ITAB UP TO 50 ROWS.
SELECT * FROM MAKT INTO TABLE ITTX FOR ALL ENTRIES IN ITAB WHERE MATNR = ITAB-MATNR.
NODE_TAB-TYPE = 'T'.
NODE_TAB-NAME = ''.
NODE_TAB-TLEVEL = '01'.
NODE_TAB-NLENGTH = ''.
NODE_TAB-COLOR = '3'.
NODE_TAB-TEXT = 'ICON_DETAIL'.
NODE_TAB-TCOLOR = '1'.
NODE_TAB-KIND = 'I'.
NODE_TAB-TLENGTH = '2'.
NODE_TAB-TEXT1 = 'Details'.
NODE_TAB-TCOLOR1 = '2'.
NODE_TAB-KIND = 'I'.
NODE_TAB-TLENGTH1 = '10'.
APPEND NODE_TAB.
CLEAR NODE_TAB.
LOOP AT ITAB.
  AT NEW VBELN.
    NODE_TAB-TYPE = 'P'.
*   node_tab-name = 'Sale Number'.
    NODE_TAB-TLEVEL = '02'.
*   node_tab-nlength = '12'.
    NODE_TAB-TCOLOR = '4'.
    NODE_TAB-TEXT = ITAB-VBELN.
    NODE_TAB-TLENGTH ='10'.
    APPEND NODE_TAB.
    CLEAR NODE_TAB.
  ENDAT.
READ TABLE ITTX WITH KEY MATNR = ITAB-MATNR.
  NODE_TAB-TYPE = 'P'.
* node_tab-name = 'LI'.
  NODE_TAB-TLEVEL = '03'.
* node_tab-nlength = '4'.
NODE_TAB-TEXT = 'ICON_MATERIAL'.
NODE_TAB-TCOLOR = '1'.
NODE_TAB-KIND = 'I'.
NODE_TAB-TLENGTH = '2'.
  NODE_TAB-TCOLOR1 = '5'.
  NODE_TAB-TEXT1 = ITAB-MATNR.
  NODE_TAB-TLENGTH1 = '20'.
  NODE_TAB-TCOLOR2 = '7'.
  NODE_TAB-TEXT2 = ITTX-MAKTX.
  LI = STRLEN( ITTX-MAKTX ).
  NODE_TAB-TLENGTH2 = LI.
  APPEND NODE_TAB.
  CLEAR NODE_TAB.
*  READ TABLE ITTX WITH KEY MATNR = ITAB-MATNR.
*  NODE_TAB-TYPE = 'P'.
** node_tab-name = 'LI'.
*  NODE_TAB-TLEVEL = '03'.
** node_tab-nlength = '4'.
*  NODE_TAB-TCOLOR1 = '7'.
*  NODE_TAB-TEXT1 = ITTX-MAKTX.
*  LI = STRLEN( ITTX-MAKTX ).
*  NODE_TAB-TLENGTH = LI.
*  APPEND NODE_TAB.
*  CLEAR NODE_TAB.
ENDLOOP.
CALL FUNCTION 'RS_TREE_CONSTRUCT'
  TABLES
    NODETAB = NODE_TAB.
*DATA: type_mapping TYPE stree_ctl_type_mapping_tab.
*DATA: wa_type TYPE stree_ctl_type_mapping.
*CLEAR: type_mapping[].
*wa_type-type = 'A'.
*wa_type-icon = '@BL@'.
*APPEND wa_type TO type_mapping.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
  EXPORTING
    STATUS      = 'STANDARD'
    USE_CONTROL = 'L'.

Similar Messages

  • Retrieving data from Excel format to internal table(deep structure)

    hi all,
    can anybody help me how to Retrieving data from Excel format to internal table(deep structure)
    and if u have any sample code for that please send it.
    my internal table is like this
    DATA: BEGIN OF ty_text,
    vbeln TYPE vbeln,
    posnr TYPE posnr,
    seqno TYPE seqno,
    textid TYPE tdid,
    tdline TYPE tdline,
    END OF ty_text.
    DATA: BEGIN OF ty_item,
    vbeln TYPE vbeln,
    posnr TYPE posnr,
    dispct1(16),
    dispct2(16),
    dispct3(16),
    text LIKE table of ty_text,
    END OF ty_item.

    hi,
    check this code
    TABLES:zmatnr.
    TYPE-POOLS  truxs.
    DATA : itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA row LIKE alsmex_tabline-row.
    data : gi_final like zmatnr occurs 0 with header line.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETER : pfname LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfname.
      PERFORM search.
    START-OF-SELECTION.
    perform process.
    form process.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = pfname
          i_begin_col             = 1
          i_begin_row             = 2
          i_end_col               = 12
          i_end_row               = 65000
        TABLES
          intern                  = itab
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      describe table itab lines itab_count.
       row = 1.
      loop at itab.
        if itab-row <> row.
          append gi_final.
          clear gi_final.
        endif.
        case itab-col.
          when '1'.
          gi_final-MATNR = itab-value.
          when '2'.
           gi_final-Maktx = itab-value.
          endcase.
        row = itab-row.
      endloop.
      append gi_final.
      clear gi_final.
    endform.
    FORM search .
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = 'X'
        CHANGING
          file_name = pfname.
    ENDFORM.
    regards
    siva

  • HOW CAN I PASS A DEFAULT VALUE IN INTERNAL TABLE

    HOW CAN I PASS A DEFAULT VALUE IN INTERNAL TABLE.
    DATA : BEGIN OF ITAB OCCURS 0,
               FIELD1(2) TYPC C DEFAULT   '12',
               FIELD2     TYPE C ,
               END OF ITAB1.
    IT'S GIVING ERROR MESSAGE.
    PLZ LOOK INTO THIS AND GIVE ME CORRECT SOLUTION.
    THANKS
    SURI

    DATA : BEGIN OF ITAB OCCURS 0,
    FIELD1(2) TYPC C,
    FIELD2 TYPE C ,
    END OF ITAB1.
    itab-field1 = '12'.
    itab-field2 = 'A'.
    append itab.
    clear itab-field2.
    itab-field1 = '12'.
    itab-field2 = 'B'.
    append itab.
    clear itab-field2.
    Now everytime u'll have the value for field1 = '12'.
    Regards
    Vasu

  • How to get the field name of an internal table during runtime?

    How to get the field name of an internal table during runtime?

    Hi  Sudhir,
    Declare and Use Get Cursor Field in Your Prm to get the field Name of the Intenal Table
    Example Code:
        <b>  DATA: v_field(60).                        " Insert this code.
         GET CURSOR FIELD v_field.        " Insert this code.</b>
         <b>CHECK v_field = 'ITAB-KUNNR'.    " Insert this code. (or)
    Write: v_field.</b>
    Regards,
    Ramganesan K.

  • How to Organize the columns in the dynamic internal table?

    Hello Folks!
    How to Organize the columns in the dynamic internal table? i tried passing the parameter COL_POS to the fieldcatalog, Which is not working.

    Organize in What order ? What is your way to output ?
    If you use ALV, you need to create fresh FIELD CATALOG for your dynamic table and then assign the column position.
    Regards,
    Diwakar

  • How to fetch the SAP Standard Prog. built internal table into my_z_prog.?

    Hi Experts,
    Pls. let me know that,
    How to fetch the SAP Standard Prog. built internal table into my_z_prog.?
    For more explannation, pls. see my other thread with name of yestrday,
    SUBMIT RFGLBALANCE WITH selection criteria, then How to get resulted itab?
    thanq

    Hi
    Suppose RFGLBALANCE is your standard program and you have an internal table named I_RFGLBALANCE.
    And lets say your Z program name is Z_SRINIVAS.
    First find out the type of the internal table you want in your Z-program in the standard program. And declare an internal table of similar type in your Z-program.
    I hope you can do this much.
    Later wherever you are putting the below mentioned code.
    SUBMIT RFGLBALANCE WITH selection criteria
    Write the code which i have written.Obviously modify it to suit your requirement.
    Please show what is not working fine so that even anyone else can help you with the problem you are facing.
    Regards,
    Mayank

  • How can I get Number of Lines from internal table?

    Hello at all,
    i have in my Report a internal Table, which have many KUNNR.
    For example the internal Table:
    MANDT.......KUNNR......NAME.........FIRSTNAME........CITY
    ...040..........12345.........Owen............Michael........Liverpool
    ...040..........12345.........Owen............Michael........Liverpool
    ...040..........99999.......Johnson.......... Jeffrey........London
    ...040..........12345.........Owen............Michael........Liverpool
    ...040..........55555.......Hardley.......... Kingston.......Birmingham
    I want to know, how many same KUNNR are existing in the internal Table?
    In my example i need the result 3, because their is existing 3 times the Kunnr 12345 in the internal Table.
    Have anyone an idea, how can I resolve this problem?
    Edited by: Thomas Zloch on Jun 21, 2010 2:55 PM - one question mark at a time is sufficient

    Hi,
    1.Create two internal tables of same type and sort according to Kunnr then Delete the
    adjusent duplicates by comparing KUNNR
    2.Sort the table by KUNNR and use ON change of Concept in that Just increment the counter.
    I am writing the sample logic here.
    tables kna1.
    data: t_kna1 type table of kna1,
             w_kunnr type kna1-kunnr,
             counter type i," Holds No.of KUNNRs in the T_kna1
             t_kna2 type table of kna1.
    select * from kna1 into table kna1 up to 100 rows.
    t_kna2[] = t_kna1[].
    delete t_kna2 by kunnr.
    delete adjusent duplicates from t_kna2 by comparing kunnr."1st Method
    read table t_kna2 transporting no-fields.
    counter = sy-tfill."1st Method
    loop at t_kna1 into kna1."2nd Method
    at first.
    w_kunnr = kna1-kunnr .
    counter = 1.
    endat.
    if w_kunnr ne kna1-kunnr.
    counter = counter + 1.
    endif.
    endloop.
    Note : Here I used a sample table KNA1 in this there are no Duplicates of KUNNR .

  • Tables - How to build "Tree-Tables"

    Hi,
    Is it possible to build "Tree-Tables" just like expandable tables in ADF, Ice, Tomahawk?
    Thanks a heap,
    A.Gurisatti

    You can use ADF or other JSF components in Creator. It will not be drag and drop - like Creator provided JSF components.
    If someone can volunteer on writing instructions on how to use ADF in Creator, that would be great. Any volunteers?

  • How to read the hierarchy data from the same table using loop in AMDP method

    Hi All,
    We have a requirement to get the top partner from BUT050 table.
    Here the Top parent is nothing but the top most in the hierarchy of the partners from BUT050.
    Example:
    For partner 1234 (BUT050-PARTNER1) there is partner 3523(BUT050-PARTNER2) one level above
    For partner 3523(BUT050-PARTNER1)  there is partner 4544 (BUT050-PARTNER2) last level .
    so in this case for the partner 1234 the Top parent is 4544 .
    I have created AMDP Procedure method to get the top-parnet and below given is the logic implemented in AMDP method.
    Here i have implemented a recursive logic with the WHILE loop to get the top most hierarchy partner from the same table BUT050
    IV_Parent is the input partner and ev_top_parent is the output value.
    AMDP Procedure Method:
        DECLARE lv_date VARCHAR(8) := TO_VARCHAR (current_date, 'YYYYMMDD');
        DECLARE found INT := 1;
              iv_partner1 =  SELECT partner1 FROM but050
                              WHERE partner2 = iv_partner
                              AND reltyp = :iv_hierarchy
                              AND date_to >=  :lv_date
                              AND date_from <= :lv_date;
         WHILE found <> 0  do
           select partner1 into ev_top_parent from :iv_partner1;
                           iv_partner1 =  SELECT partner1 FROM but050
                           WHERE partner2 in ( select partner1 from :iv_partner1 where partner1 is not null)
                           AND reltyp = 'ZBP004'
                           AND date_to >= :lv_date
                           AND date_from <= :lv_date;
           select COUNT ( partner1 ) INTO found FROM :IV_PARTNER1;
        END WHILE;
    This method is working fine, but here it is only taking one single partner and getting the top parent as output.
    Now i would like to convert this mehtod so as to accept n number of partners (not one single partner) as input and should process each partner to get the top parent.
    Could anyone guide me how can i handle the given AMDP method further so as to work some how it is within another loop from other AMDP method.
    Thanks.
    Regards,
    Laxman.P

    Hi
    Go to SE11 and enter the hierarchy table name.
    /BIC/H....(infoobject name)...and execute the table and select table entry and delete all....
    Thanks
    TG

  • How to build a query to join on two tables without mapping

    I did Automatic mapping by the workbench Directofield mapping with the table and java object.
    Wanted to build a simple join query by joining on the same field on both the tables.Not the sql query through the toplink using expression builder.
    Please help.............
    Spent one full day for this................

    Thanks Don for the reply,sorry to bug you,but i need help.....
    SELECT A.AGNCY_C,
         A.TYPE_C,
         A.RESN_C,
         A.S_TYPE_C,
         A.SUB_ID_C,
         A.RY_C
    FROM RATING A, REF B
    WHERE A.ID_C = B._ID_C
    AND A.ALPHA_C = B.ALPHA_C
    AND A.EFF_D >= B.MATURITY_D
    This is the real query i was talking about.I did mapping automatically through the workbench,generated java classes also throught the workbench.
    Now they don't want to execute the raw sql.They wanted to get all the RATING objects with the where condition.
    So how to build a query by using toplink.
    tried your example
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression creditRating = builder.getTable("RATING").getField("ID_C");
    Expression issue_ref = builder.getTable("REF").getField("ID_C");
    Expression join = creditRating.equal(issue_ref);
    I am getting java.lang.OutOfMemoryError
    error.
    I selected the option generate classes and descriptors
    from the tables (RATING,REF).,so it created the classes and dscriptors automatically.
    In Database script for the table RATING like this
    ALTER TABLE RATING ADD (
    CONSTRAINT RATING_F1 FOREIGN KEY (ID_C, ALPHA_C)
    REFERENCES REF (ID_C,ALPHA_C));
    I think when i generate descriptor automatically it is keeping this association.
    Please help me.........

  • How to find number of lines in an internal table

    Dear all,
    how to find number of records present in an internal table.

    DESCRIBE TABLE
    Syntax
    DESCRIBE TABLE itab [KIND knd] [LINES lin] [OCCURS n].
    Extras:
    1. ... KIND knd
    2. ... LINES lin
    3. ... OCCURS n
    Effect
    This statement determines some properties of the internal table itab and assigns them to the specified variables. The various additions enable you to determine the table type, the number of currently filled rows and the initial memory requirement.
    In addition, the system fields sy-tfill and sy-tleng are filled with the current number of table rows and the length of a table row in bytes.
    Notes
    For detailed information about an internal table, you should use the methods of RTTS of the DESCRIBE TABLE statement.
    Without the specification of an addition, the statement DESCRIBE TABLE only sets the system fields sy-tfill and sy-tleng.
    Addition 1
    ... KIND knd
    Effect
    The table type of the internal table itab is determined and a corresponding one-digit identification is assigned to the data object knd. A character-type data type is expected for the data object. The identifications are "T" for standard tables, "S" for sorted tables and "H" for hashed tables. These values are also defined as constants sydes_kind-standard, sydes_kind-sorted, and sydes_kind-hashed in the type group SYDES.
    Addition 2
    ... LINES lin
    Effect
    The current number of table rows of the internal table itab is determined and is assigned to the data object lin.The data type i is expected for the data object.
    Note
    As of release 6.10, the current number of rows of an internal table can also be determined using the in-built function lines.
    Addition 3
    ... OCCURS n
    Effect
    The initial memory requirement defined during the creation of the internal table with the addition INITIAL SIZE or the obsolete addition OCCURS is determined and assigned to the data object n. The data type i is expected for the data object.
    Example
    Descending sorting of a generically typed internal table in a subprogram. Since sorted tables cannot be sorted in a descending order, the table type is checked to avoid an exception that cannot be handled.
    TYPE-POOLS sydes.
    FORM sort_descending CHANGING itab TYPE ANY TABLE.
      DATA tabkind(1) TYPE c.
      DESCRIBE TABLE itab KIND tabkind.
      IF tabkind = sydes_kind-standard OR
         tabkind = sydes_kind-hashed.
        SORT itab DESCENDING.
      ELSEIF tabkind = sydes_kind-sorted.
        MESSAGE '...' TYPE 'E'.
      ELSE.
        MESSAGE '...' TYPE 'E'.
      ENDIF.
    ENDFORM.
    DESCRIBE FIELD INTO
    Note
    This statement is for internal use only.
    It cannot be used in application programs.
    Syntax
    DESCRIBE FIELD dobj INTO td.
    Effect
    All characteristics of the field f, its components , sub-components etc. are displayed in the field td (type description). td has to be of the type SYDES_DESC, defined in Type Group SYDES. Because of this, the type group SYDES must be integrated into the ABAP-program with a TYPE-POOLS statement .
    The structure SYDES_DESC has two table-type components TYPES and NAMES:
    In TYPES, the tree structure of the type belonging to f is displayed. The components of a node are stored in the table TYPES in a continuous manner. Beginning and end of the line area that represents the components are stored in TYPES-FROM and TYPES-TO. The reference to the superior node can be found in TYPES-BACK. If no superior resp. subordinate node exists, then this is marked by the value 0 (For the relevance of further components, refer to the following sections).
    The names of components, types etc. are not stored directly in TYPES. Instead, the components TYPES-IDX_... hold an index in the name table NAMES. The value 0 indicates that there is no reference to the name table.
    NAMES contains the possibly fragmented names in the component NAMES-NAME. If a name continues in the following line, this is indicated by an asterisk ('*') in the component NAMES-CONTINUE.
    The type description table (TYPES) not only stores information about the tree structure but also further information about the type of f resp. its components. This includes especially all information that can be determined using the usual additions to DESCRIBE FIELD. In detail, TYPES contains the following columns:
    IDX_NAME
    Component Name
    IDX_USER_TYPE
    Name of a user-defined type, i.e., a type that was defined through its TYPES-statement. Derived types (... TYPE A-B) and structures from the ABAP-Dictionary are not considered to be user-defined types.
    CONTEXT
    For user-defined types only: The context, in which the type is defined. Possible values are defined in the constant SYDES_CONTEXT of the type group SYDES. Please only use these constants to carry out a comparison. In detail, we distinguish between the following type contexts:
    SYDES_CONTEXT-PROGRAM: Program-global type
    SYDES_CONTEXT-FORM   : FORM-local type
    SYDES_CONTEXT-FUNCTION: FUNCTION-local type
    SYDES_CONTEXT-METHOD : METHOD-local type
    IDX_CONTEXT_NAME
    For user-defined types only:
    With a local context: The name of the FORM or FUNCTION, whose type was defined. The name of the associated program is then the first entry in the name table.
    With a global context: The name of the program in which the type was defined.
    IDX_EDIT_MASK
    Conversion routine from the ABAP-Dictionary, is in accordance with the addition EDIT MASK at simple DESCRIBE.
    IDX_HELP_ID
    Help-Id when referencing to fields from the ABAP-Dictionary
    LENGTH
    Internal length, corresponds to the addition LENGTH at simple DESCRIBE
    OUTPUT_LENGTH
    Output length, corresponds to the addition OUTPUT-LENGTH at simple DESCRIBE
    DECIMALS
    Number of decimal digits, corresponds to the addition DECIMALS at simple DESCRIBE
    TYPE
    ABAP-Type, corresponds to the addition TYPE at simple DESCRIBE
    TABLE_KIND
    A table type is stored here for the components which represent an internal table. The same values are returned as with the variant DESCRIBE TABLE itab KIND k. Components which do not represent a table get the return value set to SYDES_KIND-UNDEFINED (see type group SYDES).
    Example
    Example definition of the complex data type EMPLOYEE_STRUC:
    PROGRAM DESCTEST.
    TYPES: BEGIN OF name_struc,
             first  TYPE c LENGTH 20,
             last   TYPE c LENGTH 20,
           END OF name_struc,
           BEGIN OF absence_time_struc,
             day        TYPE d,
             from       TYPE t,
             to         TYPE t,
           END OF absence_time_struc,
           phone_number TYPE n LENGTH 20,
           BEGIN OF employee_struc,
             id         LIKE sbook-customid,
             name       TYPE name_struc,
             BEGIN OF address,
               street  TYPE c LENGTH 30,
               zipcode TYPE n LENGTH 4,
               place   TYPE c LENGTH 30,
             END OF address,
             salary_per_month TYPE p LENGTH 10 DECIMALS 3,
             absent           TYPE STANDARD TABLE OF absence_time_struc
                                   WITH NON-UNIQUE DEFAULT KEY,
             phone            TYPE STANDARD TABLE OF phone_number
                                   WITH NON-UNIQUE DEFAULT KEY,
           END OF employee_struc.
    You can determine the structure of the type EMPLOYEE_STRUC by collecting the type group SYDES as follows:
    TYPE-POOLS: sydes.
    DATA: employee TYPE employee_struc,
          td       TYPE sydes_desc.
    DESCRIBE FIELD employee INTO td.
    The following table shows a few selected columns of the type description table TD-TYPES. For a better overview, the names of the columns IDX_NAME, IDX_UERR_TYPE and IDX_EDIT_MASK have been shortened:
        |FROM| TO |BACK|NAME|UTYP|EMSK|TYPE
    |--||||||--
      1 |  2 |  7 |  0 |  0 |  2 |  0 |  v
      2 |  0 |  0 |  1 |  6 |  0 |  4 |  N
      3 |  8 |  9 |  1 |  7 |  5 |  0 |  u
      4 | 10 | 12 |  1 |  8 |  0 |  0 |  u
      5 |  0 |  0 |  1 |  9 |  0 |  0 |  P
      6 | 13 | 13 |  1 | 11 |  0 |  0 |  h
      7 | 17 | 17 |  1 | 12 |  0 |  0 |  h
      8 |  0 |  0 |  3 | 13 |  0 |  0 |  C
      9 |  0 |  0 |  3 | 14 |  0 |  0 |  C
    10 |  0 |  0 |  4 | 15 |  0 |  0 |  C
    11 |  0 |  0 |  4 | 16 |  0 |  0 |  N
    12 |  0 |  0 |  4 | 17 |  0 |  0 |  C
    13 | 14 | 16 |  6 |  0 | 18 |  0 |  u
    14 |  0 |  0 | 13 | 20 |  0 |  0 |  D
    15 |  0 |  0 | 13 | 21 |  0 |  0 |  T
    16 |  0 |  0 | 13 | 22 |  0 |  0 |  T
    17 |  0 |  0 |  7 |  0 |  0 |  0 |  N
    Please note that the entries in rows 6 and 7 represent internal tables (ABAP-Type h). There is always an entry for the corresponding row type (rows 13 and 17) to an internal table.
    The indices in the rows 5 to 7 refer to entries in the name table TD-NAMES. If you look, e.g., at row 3, you find the corresponding component name in TD-NAMES from row 7 (NAME) onward and the corresponding user type from row 5 (NAME_STRUC) onward.
    In the name table TD-NAMES you find the following entries. Note that the names SALARY_PER_MONTH and ABSENCE_TIME_STRUC are stored in two parts:
        |CONTINUE|NAME                   |CONTINUE|NAME
    |--|     -||--
      1 |        |DESCTEST            12 |        |PHONE
      2 |        |EMPLOYEE_STRUC      13 |        |FIRST
      3 |        |SBOOK-CUSTOMID      14 |        |LAST
      4 |        |==ALPHA             15 |        |STREET
      5 |        |NAME_STRUC          16 |        |ZIPCODE
      6 |        |ID                  17 |        |PLACE
      7 |        |NAME                18 |   *    |ABSENCE_TIME_ST
      8 |        |ADDRESS             19 |        |RUC
      9 |   *    |SALARY_PER_MONT     20 |        |DAY
    10 |        |H                   21 |        |FROM
    11 |        |ABSENT              22 |        |TO

  • How can i collect data form diff. Internal Tables to single main table

    hi
       i am using 3 diffrent internal tables for fatching & store data , but when i want to put it on report for display it come in APPENDING MANNER i.e. data from 1 table get displayed , all otther fields remain blank, then data from 2 table appended at bottom , similar for 3 table ,
         but i want the data together.
    is there any way by which i can insert data to final table's particular field without effecting all others fields data . ?
    please give answer it's urgent

    <b>see how data is brought into I_OUT.</b>
    REPORT  Y_RK_REPORT_TASK2 LINE-SIZE 180
                              LINE-COUNT 25(8)
                              NO STANDARD PAGE HEADING.
    *&                      TABLE DECLARATION                              *
    TABLES: MARA,              "GENERAL MASTER DATA
            MARC,              "PLANT DATA FOR MATERIAL
            MARD,              "STORAGE LOCATION DATA FOR MATERIAL
            MBEW,              "MATERIAL VALUATION
            MVKE,              "SALES DATA FOR MATERIAL
            MAKT.              "MATERIAL DESCRIPTION
    *&                      INTERNAL TABLE DECLARATION                     *
    DATA: BEGIN OF I_MARC OCCURS 0,
              MATNR LIKE MARC-MATNR,
              WERKS LIKE MARC-WERKS,
              LVORM LIKE MARC-LVORM,
              PSTAT LIKE MARC-PSTAT,
          END OF I_MARC.
    DATA: BEGIN OF I_MARA OCCURS 0,
               MATNR LIKE MARA-MATNR,
               MBRSH LIKE MARA-MBRSH,
               MEINS LIKE MARA-MEINS,
          END OF I_MARA.
    DATA: BEGIN OF I_MAKT OCCURS 0,
               MATNR LIKE MAKT-MATNR,
               MAKTX LIKE MAKT-MAKTX,
          END OF I_MAKT.
    DATA: BEGIN OF I_MBEW OCCURS 0,
               MATNR LIKE MBEW-MATNR,
               BWKEY LIKE MBEW-BWKEY,
               BWTAR LIKE MBEW-BWTAR,
               LBKUM LIKE MBEW-LBKUM,
          END OF I_MBEW.
    DATA: BEGIN OF I_MVKE OCCURS 0,
               MATNR LIKE MVKE-MATNR,
               VKORG LIKE MVKE-VKORG,
               VTWEG LIKE MVKE-VTWEG,
          END OF I_MVKE.
    DATA: BEGIN OF I_MARD OCCURS 0,
               MATNR LIKE MARD-MATNR,
               WERKS LIKE MARD-WERKS,
               LGORT LIKE MARD-LGORT,
               LABST LIKE MARD-LABST,
          END OF I_MARD.
    DATA: BEGIN OF I_OUT OCCURS 0,
            MATNR LIKE MARC-MATNR,
            WERKS LIKE MARC-WERKS,
            LVORM LIKE MARC-LVORM,
            PSTAT LIKE MARC-PSTAT,
            MBRSH LIKE MARA-MBRSH,
            MEINS LIKE MARA-MEINS,
            MAKTX LIKE MAKT-MAKTX,
            BWKEY LIKE MBEW-BWKEY,
            BWTAR LIKE MBEW-BWTAR,
            LBKUM LIKE MBEW-LBKUM,
            VKORG LIKE MVKE-VKORG,
            VTWEG LIKE MVKE-VTWEG,
            LGORT LIKE MARD-LGORT,
            LABST LIKE MARD-LABST,
          END OF I_OUT.
    *&             A T - S E L E C T I O N - S C R E E N                   *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-101.
    PARAMETERS: P_WERKS LIKE MARC-WERKS.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-102.
    SELECT-OPTIONS: S_MATNR FOR MARC-MATNR,
                    S_LGORT FOR MARD-LGORT.
    SELECTION-SCREEN END OF BLOCK B2.
    *&                             INITIALIZATION.
    INITIALIZATION.
      P_WERKS = '3000'.
      S_MATNR-SIGN = 'I'.
      S_MATNR-OPTION = 'EQ'.
      S_MATNR-LOW = '1'.
      S_MATNR-HIGH = '995'.
      S_LGORT-SIGN = 'I'.
      S_LGORT-OPTION = 'EQ'.
      S_LGORT-LOW = '0001'.
      S_LGORT-HIGH = '0007'.
      APPEND S_LGORT.
      APPEND S_MATNR.
      CLEAR S_MATNR.
      CLEAR S_LGORT.
    *&             S T A R T - O F - S E L E C T I O N                     *
    START-OF-SELECTION.
         SELECT MATNR WERKS LVORM FROM MARC
                             INTO TABLE I_MARC
                             WHERE WERKS = P_WERKS
                             AND MATNR IN S_MATNR.
        SELECT MATNR MBRSH MEINS FROM MARA
                              INTO TABLE I_MARA
                              FOR ALL ENTRIES IN I_MARC
                              WHERE MATNR = I_MARC-MATNR.
        SELECT MATNR  MAKTX FROM MAKT
                             INTO TABLE I_MAKT
                             FOR ALL ENTRIES IN I_MARA
                             WHERE MATNR = I_MARA-MATNR
                             AND SPRAS = SY-LANGU.
        SELECT MATNR BWKEY BWTAR FROM MBEW
                            INTO TABLE I_MBEW
                            FOR ALL ENTRIES IN I_MARA
                            WHERE MATNR = I_MARA-MATNR.
        SELECT MATNR VKORG VTWEG FROM MVKE
                            INTO TABLE I_MVKE
                            FOR ALL ENTRIES IN I_MARA
                            WHERE MATNR = I_MARA-MATNR.
        SELECT MATNR WERKS LGORT LABST FROM MARD
                            INTO TABLE  I_MARD
                            FOR ALL ENTRIES IN I_MARC
                            WHERE MATNR = I_MARC-MATNR
                            AND WERKS = P_WERKS
                            AND LGORT IN S_LGORT..
    *&             MOVING DATA TO I-OUT                                    *
    LOOP AT I_MARC.
      MOVE I_MARC-MATNR TO I_OUT-MATNR.
      MOVE I_MARC-WERKS TO I_OUT-WERKS.
      MOVE I_MARC-LVORM TO I_OUT-LVORM.
      READ TABLE I_MARA WITH KEY MATNR = I_MARD-MATNR.
      MOVE I_MARA-MBRSH TO I_OUT-MBRSH.
      MOVE I_MARA-MEINS TO I_OUT-MEINS.
      READ TABLE I_MAKT WITH KEY MATNR = I_MARD-MATNR.
      MOVE I_MAKT-MAKTX TO I_OUT-MAKTX.
      READ TABLE I_MBEW WITH KEY MATNR = I_MARD-MATNR.
      MOVE I_MBEW-BWKEY TO I_OUT-BWKEY.
      MOVE I_MBEW-BWTAR TO I_OUT-BWTAR.
      READ TABLE I_MVKE WITH KEY MATNR = I_MARD-MATNR.
      MOVE I_MVKE-VKORG TO I_OUT-VKORG.
      MOVE I_MVKE-VTWEG TO I_OUT-VTWEG.
        LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR
                         AND WERKS = I_MARC-WERKS.
            MOVE I_MARD-LGORT TO I_OUT-LGORT.
            MOVE I_MARD-LABST TO I_OUT-LABST.
            APPEND I_OUT.
        ENDLOOP.
    CLEAR I_OUT.
    ENDLOOP.
    *&             DISPLAYIING FROM I-OUT                                  *
    LOOP AT I_OUT.
    *FORMAT HOTSPOT ON.
    WRITE: /5 I_OUT-MATNR,
            22 I_OUT-WERKS,
            29 I_OUT-LGORT,
            33 I_OUT-LABST,
            56 I_OUT-LVORM,
            61 I_OUT-MBRSH,
            71 I_OUT-MEINS,
            82 I_OUT-VTWEG,
            93 I_OUT-BWKEY,
            104 I_OUT-BWTAR,
            118 I_OUT-VKORG,
            130 I_OUT-MAKTX.
    *FORMAT HOTSPOT OFF.
    ENDLOOP.
    *&        E N D -- O F --  S E L E C T I O N                           *
      END-OF-SELECTION.
    *&                  T O P - O F - P A G E                              *
    TOP-OF-PAGE.
    WRITE 60 'MATERIAL MASTER REPORT -- BASIC LIST'
            COLOR COL_GROUP.
    WRITE: SY-ULINE.
    WRITE: /2 'MATERIAL_NO',
            22 'PLANT',
            28 'STORGE_LOC',
            45 'STOCK',
            54 'FLAG',
            60 'INDUSTRY',
            70 'UNIT',
            76 'DISTR_CHANNEL',
            91 'VALU_AREA',
            102 'VALU_TYPE',
            114 'SALES_ORG',
            128 'DESCRIPTION'.
    *&                  E N D - O F - P A G E                              *
    END-OF-PAGE.
      WRITE: / SY-ULINE.
      WRITE: /85 'PAGNO: ',SY-PAGNO,
               SY-ULINE.
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • How to pass a string varaible to an internal table field

    Hi Experts,
    I am reading notes/text entries by calling read_text and then passing them in a variable. I want to display the notes. But even after declaring the variable as  LINE2048, it is displaying only 255characters as output length.
    My code:
    TYPES: BEGIN OF TYP_FINAL,
             PARTNER_NO      TYPE BU_PARTNER,         "Partner No.
            OBJECT_ID       TYPE CRMT_OBJECT_ID_DB,  "Object ID
            PROCESS_TYPE    TYPE CRMT_PROCESS_TYPE,  "Activity Type
           ACTUAL_NOTE     TYPE LINE2048,           "Actual Notes
           END OF TYP_FINAL.
    data : T_FINAL           TYPE STANDARD TABLE OF TYP_FINAL,
              WA_FINAL          TYPE TYP_FINAL.
    data:  v_actualnote     TYPE LINE2048.
              CALL FUNCTION 'READ_TEXT'
                EXPORTING
                 CLIENT                        = SY-MANDT
                  ID                            = C_0002
                  LANGUAGE                      = sy-langu
                  NAME                          = l_name1
                  OBJECT                        = C_BUT000
                TABLES
                  LINES                         = t_line
               EXCEPTIONS
                 ID                            = 1
                 LANGUAGE                      = 2
              IF SY-SUBRC = 0.
               clear: v_accountnote.
               LOOP AT T_LINE INTO WA_LINE.
                 CONCATENATE v_accountnote wa_line INTO v_accountnote SEPARATED BY space.
                 clear: wa_line.
               ENDLOOP.
              wa_final-account_note = v_accountnote.
              clear: v_accountnote.
             ENDIF.
    So, if I make the v_actualnote as string and pass it to a string variable, that should work.
    But the system is not allowing me to declare a string varaible inside the internal table.
    Please let me know how to display more than 255 characters in v_accountnote  .
    Regards,
    Sangeeta.

    you are passng that as a string = '5,6' does not exist
    try this : http://www.mssqltips.com/sqlservertip/1771/splitting-delimited-strings-using-xml-in-sql-server/
    declare @table table(sno int)
    insert into @table values(5),(6)
    DECLARE @xml as xml,@txtSchedule as varchar(100),@delimiter as varchar(10)
    SET @txtSchedule='5,6'
    SET @xml = cast(('<X>'+replace(@txtSchedule,',','</X><X>')+'</X>') as xml)
    select * from @table WHERE sno IN ( select N.value('.', 'varchar(10)') as value FROM @xml.nodes('X') as T(N))
    Hope it Helps!!

  • How to get the Data type of the Internal Table.

    How can i get the data types used to create an internal table
    TYPES : BEGIN OF t_makt,
              matnr    TYPE    matnr,
              maktx    TYPE    maktx,
            END OF t_makt.
    Like this some function will give me which data types i have used for the internal table at run time.

    Use the FM ..
    data : int_fcat type SLIS_T_FIELDCAT_ALV.
    REUSE_ALV_FIELDCATALOG_MERGE ..
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = sy-repid
                I_INTERNAL_TABNAME     = 'IMAT'   <-- this is your internal table
                 I_INCLNAME             = sy-repid
           CHANGING
                CT_FIELDCAT            = int_fcat <--- this contains all the fields along with their characteristics ...
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.

  • How to add a group of rows in internal table

    Hi champs,
       I have some requirement.
    I have one internal table which contain 4 columns .out of which 3 has some numeric value and first has some letters e.g A ,B,C etc.
    Now suppose i have 20 rows in itab in which 10 are A 5 are B and 5 are C .Now as column 3 has numeric values i need to get the total of column 3 for all A ,B and C .
    How to solve this problem.Please guid me.
    thanks in advance
    Jhon

    Hi,
    Check the following code:
    DATA: BEGIN OF LINE,
    COL1 TYPE C,
    COL2 TYPE I,
    COL3 TYPE I,
    END OF LINE.
    DATA ITAB LIKE HASHED TABLE OF LINE
    WITH UNIQUE KEY COL1 COL2.
    LINE-COL1 = 'A'.
    DO 3 TIMES.
    LINE-COL2 = SY-INDEX.
    LINE-COL3 = SY-INDEX ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    LINE-COL1 = 'B'.
    DO 3 TIMES.
    LINE-COL2 = 2 * SY-INDEX.
    LINE-COL3 = ( 2 * SY-INDEX ) ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    SORT ITAB.
    LOOP AT ITAB INTO LINE.
    WRITE: / LINE-COL1, LINE-COL2, LINE-COL3.
    AT END OF COL1.
    SUM.
    ULINE.
    WRITE: / LINE-COL1, LINE-COL2, LINE-COL3.
    SKIP.
    ENDAT.
    AT LAST.
    SUM.
    ULINE.
    WRITE: / LINE-COL1, LINE-COL2, LINE-COL3.
    ENDAT.
    ENDLOOP.
    Regards,
    Bhaskar

Maybe you are looking for

  • WebDynpro components in GP?

    Hello, I am creating WebDynpros in studio and would want them to be available in Guided Procedures. In help.sap.com, it expects us to develop them on IWebdynproCO callable object which is available in 'caf/eu/gp/api' DC(Development Component). But, t

  • I'm having trouble with syncing my iPod to my computer.

    I'm having trouble with syncing my iPod. It gets stuck on the last step saying, "Waiting for changes to be applied." It's been doing this for the last half hour. Is there anything I can do to correct this or is am just going to have to restore my iPo

  • Loose reception bars when 3g is turned on

    no matter where I'm at. Why is that? Does the 3g symbol take the place of the bars? I may be fooling myself physchologicaly but it seems a tad faster. Don't really know if it's even working when this happens.

  • Jdev 11.1.2.3 RedHat 5.8 - AF:Switcher Question

    Hello: Can AF:Switcher component be used in a page Fragment? Also, I'm using the method of creating functional subsystems as adflibs and then combining these subsystems into a master project to generate the EAR. Would the subsystems only use page fra

  • Multiple smartforms call for transfer order

    Hi All, I have a requirement to call multiple smartforms based on customer number from same print program.How i would define nace setting and also in my requirement i have to create a ztable that will contain customer number and smartform name,that m