Pls provide information regarding internal tables

hi
i would like to know can we create relationship between two internal tables.
like foriegn key relationship . if yes pls tell me how .

hi...
there is  actual relationship that can b created for 2 internal tables using foreign keys,but by using " for all entries" in select statements.
syntax: for all entries.
TYPES: BEGIN OF ftab_type,
         carrid TYPE sflight-carrid,
         connid TYPE sflight-connid,
       END OF ftab_type.
DATA:  ftab TYPE STANDARD TABLE OF ftab_type WITH
                 NON-UNIQUE DEFAULT KEY INITIAL SIZE 10,
       free TYPE I,
       wa_sflight TYPE sflight.
Suppose FTAB is filled as follows:
CARRID  CONNID
LH      2415
SQ      0026
LH      0400
SELECT * FROM sflight INTO wa_sflight
    FOR ALL ENTRIES IN ftab
    WHERE CARRID = ftab-carrid AND
          CONNID = ftab-connid AND
          fldate = '20010228'.
  free = wa_sflight-seatsocc - wa_sflight-seatsmax.
  WRITE: / wa_sflight-carrid, wa_sflight-connid, free.
ENDSELECT.
try it out.
reward if useful.

Similar Messages

  • Need information about Internal Tables

    Hi Every one!
    I Need some information about Internal tables. Pls help be above the same.
    Thanks & with Regards,
    Chandra.

    Hi..,
    <b>
    Internal tables </b>
    Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
    Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object.
    <b>Internal Tables as Data Types</b>
    Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.
    <b>Line type</b>
    The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
    <b>Key</b>
    The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
    If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.
    The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
    <b>
    Table type</b>
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    <u>Standard tables</u> have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    <u>
    Sorted tables</u> are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.
    <u>
    Hashed tables</u> have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    <b>
    Generic Internal Tables</b>
    Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols and the interface parameters of procedures . You cannot use them to declare data objects.
    <b>Internal Tables as Dynamic Data Objects</b>
    Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.
    <b>
    Choosing a Table Type</b>
    The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.
    <b>
    Standard tables</b>
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.
    <b>Sorted tables</b>
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
    <b>
    Hashed tables</b>
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
    regards,
    sai ramesh

  • Regarding Internal table and access performance

    hey guys.
    In my report , Somehow i reduced the query performance time by selecting minimum key fields and moved the selected records to internal table.
    Now from this internal table i am restricting the loop
    as per my requirements using where statements.(believing that internal table retrieval is more faster than database acces(using query)).
    But still my performance goes down.
    Could you pls suggest me how to reduce the execution time
    in abap programming.
    I used below commands.
    Read using binary search.
    loop ...where statement.
    perform statements.
    collect staements.
    delete itab.(delete duplicates staements too)
    sort itab(sorting).
    For each above statements do we have any faster way to retrieval records.
    If i see my bottle neck at se30.it shows
    ABAP programming to 70 percent
    database access to 20 percent
    R3 system as 10percent.
    now how to reduce this abap process.
    could you pls reply.
    ambichan.
    ambichan.

    Hello Ambichan,
    It is difficult to suggest the improvements without looking at the actual code that you are running. However, I can give you some general information.
    1. READ using the BINARY SEARCH addition.
    This is indeed a good way of doing a READ. But have you made sure that the internal table is <i>sorted by the required fields</i> before you use this statement ?
    2. LOOP...WHERE statement.
    This is also a good way to avoid looping through unnecessary entries. But further improvement can certainly be achieved if you use FIELD-SYMBOLS.
    LOOP AT ITAB INTO <FIELD_SYMBOL_OF_THE_SAME_LINE-TYPE_AS_ITAB>.
    ENDLOOP.
    3. PERFORM statements.
    A perform statement can not be optimized. what matters is the code that you write inside the FORM (or a subroutine).
    4. COLLECT statements.
    I trust you have used the COLLECT statement to simplify the logic. Let that be as it is. The code is more readable and elegant.
    The COLLECT statement is somewhat performance intensive. It takes more time with a normal internal table (STANDARD). See if you can use an internal table of type  SORTED. Even better, you can use a HASHED internal table.
    5. DELETE itab.(delete duplicates staements too)
    If you are making sure that you are deleting several entries based on a condition, then this should be okay. You cannot avoid using the DELETE statement if your functionality requires you to do so.
    Also, before deleting the DUPLICATES, ensure that the internal table is sorted.
    6. SORT statement.
    It depends on how many entries there are in the internal table. If you are using most of the above points on the same internal table, then it is better that you define your internal table to be of type SORTED. That way, inserting entries will take a little more time (to ensure that the table is always sorted), but alll the other operations are going to be much faster.
    Get back to me if you need further assistance.
    Regards,
    <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=zwcc%2fwm4ups%3d">anand Mandalika</a>.

  • Issue regarding internal tables

    Dear all,
    My issue is that , I need to enter data into a single internal table by fetching data from two sap tables using two different selct quries. I should not use joins or for all entries. And display the internal table data in the list.
    Problem am facing is only one select query is geeting fetched and the other table data in not in the list.
    Pleas provide the possible solutions.
    Thanks & Regards,
    Madhavi.M

    DATA: BEGIN OF itab1 OCCURS 0,
          qmnum LIKE qmel-qmnum,
          qmtxt LIKE qmel-qmtxt,
          indtx LIKE qmel-indtx,
          qmdat LIKE qmel-qmdat,
          ltrmn LIKE qmel-ltrmn,
          priok LIKE qmel-priok,
          aufnr LIKE qmel-aufnr,
          bezdt LIKE qmel-bezdt,
          qmnam LIKE qmel-qmnam,
          qmart LIKE qmel-qmart,
          END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0,
          qmnum LIKE qmih-qmnum,
          btpln LIKE qmih-btpln,
          ingrp LIKE qmih-ingrp,
          END OF itab2.
    DATA : itab3 TYPE TABLE OF z_notif WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS : notnum FOR qmel-qmnum OBLIGATORY,
                     notype FOR qmel-qmart,
                     floc FOR qmih-btpln,
                     name FOR qmel-qmnam.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
    To fetch the values in the internal table ****************
    from ztable corresponding to the entries made *************
    by the user in the selection screen ******************
    SELECT qmnum qmtxt indtx qmdat ltrmn priok aufnr bezdt qmnam qmart INTO
    TABLE itab1 FROM qmel WHERE qmnum IN notnum
    AND qmart IN notype AND qmnam IN name.
    SELECT qmnum btpln ingrp INTO TABLE itab2 FROM qmih FOR ALL ENTRIES IN
    itab1 WHERE qmnum = itab1-qmnum AND btpln IN floc.
    To move the contents of ITAB1 to ITAB3 ***************
        LOOP AT itab1.
          itab3-qmnum = itab1-qmnum.
          itab3-qmtxt = itab1-qmtxt.
          itab3-indtx = itab1-indtx.
          itab3-qmdat = itab1-qmdat.
          itab3-ltrmn = itab1-ltrmn.
          itab3-priok = itab1-priok.
          itab3-aufnr = itab1-aufnr.
          itab3-bezdt = itab1-bezdt.
          itab3-qmnam = itab1-qmnam.
          itab3-qmart = itab1-qmart.
          READ TABLE itab2 WITH KEY qmnum = itab1-qmnum.
    To move the contents of ITAB2 to ITAB3 ***************
          itab3-btpln = itab2-btpln.
          itab3-ingrp = itab2-ingrp.
          APPEND itab3.
        ENDLOOP.
    have a look at this example this may help you.....
    reward if helpful.....

  • Using Provide-endprovide copy internal table

    Hi,
    I have problem that is if i want to copy the data from infotype to internal table means
    Provide * from p9012 between  pn-begda  and  pn-endda.
    if p9012-zz_client_c EQ itemp-z_client_c.
    MOVE: p9012-begda TO it9012-begda,
               p9012-zz_dept_c TO it9012-z_dept_c,
               SORT IT9012 BY z_dept_c.
               append it9012.
    endif.
    endprovide.
    this one not copying data from infotype to internaltable.
    what i can do?
    Thanks,
    Regards,
    Nandha

    HI Use this code example..
    plz reward poins if it helps you..
    & Report  ZSAPHR_PNP
    Report ZSAPHR_PNP.
    TABLES : PERNR.
    *Infotype Declaration
    INFOTYPES: 0002, "PERSONAL DATA
               0006, "ADDRESS
               0008, "
               0000, "
               0001. "ACTIONS
    DATA : BEGIN OF ITAB  OCCURS 10,  "INTERNAL TABLE DECLARATION
           NACHN  LIKE  P0002-NACHN,
           VORNA  LIKE  P0002-VORNA,
           GESCH  LIKE  P0002-GESCH,
           GBDAT  LIKE  P0002-GBDAT,
           FAMST  LIKE  P0002-FAMST,
           HSNMR  LIKE  P0006-HSNMR,
           STRAS  LIKE  P0006-STRAS,
           LOCAT  LIKE  P0006-LOCAT,
           PSTLZ  LIKE  P0006-PSTLZ,
           LAND1  LIKE  P0006-LAND1,
           PLANS  LIKE  P0001-PLANS,
           ORGEH  LIKE  P0001-ORGEH,
           BET01  LIKE  P0008-BET01,
           WAERS  LIKE  P0008-WAERS,
           PERNR  LIKE  P0000-PERNR,
           END OF ITAB.
    DATA: G_REPID LIKE SY-REPID."Report name
    INITIALIZATION.
      G_REPID = SY-REPID.
      PNPTIMED = 'D'.
    **********************************************START OF
    SELECTION*****************************************
    START-OF-SELECTION.
    GET PERNR.
      PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA.
        ITAB-PERNR = P0000-PERNR.
        ITAB-NACHN = P0002-NACHN.
        ITAB-VORNA = P0002-VORNA.
        IF P0002-FAMST = '0'.
          ITAB-FAMST = 'S'.
        ELSE.
          ITAB-FAMST = 'M'.
        ENDIF.
        ITAB-FAMST = P0002-FAMST.
        IF P0002-GESCH = '1'.
          ITAB-GESCH = 'M'.
        ELSE.
          ITAB-GESCH = 'F'.
        ENDIF.
        ITAB-GBDAT = P0002-GBDAT.
        ITAB-HSNMR = P0006-HSNMR.
        ITAB-STRAS = P0006-STRAS.
        ITAB-LOCAT = P0006-LOCAT.
        ITAB-PSTLZ = P0006-PSTLZ.
        ITAB-LAND1 = P0006-LAND1.
        ITAB-ORGEH = P0001-ORGEH.
        ITAB-PLANS = P0001-PLANS.
        ITAB-BET01 = P0008-BET01.
        ITAB-WAERS = P0008-WAERS.
        APPEND ITAB.
      ENDPROVIDE.
    END-OF-SELECTION.

  • Regarding Internal Table Field Validation [Modification]

    Hi All,
    I have a small issue with formatting of a field.
    The Field is POTX1 - it would get the value as 'New MT-EPPE0097-COMP02',
    Means i have one internal table field as i_error-POTX1 in that some times we get value as 'New MT-EPPE0097-COMP02'.
    Whenever i get 'New' literal in that internal table field i have to remove that literal from that internal table field. And Left Justify the remaining part of the field.
    Ex:  'New MT-EPPE0097-COMP02'
         should become 'MT-EPPE0097-COMP02'.
    For this first i have to find wether 'New' Literal exists in the Internal table field or not then i have to remove it.
    Can anybody tell me how can i solve this issue.
    Thanks in advance.
    Thanks & Regards,
    Rayeezuddin.

    Hi,
    Take a look :
    loop at i_error.
      if i_error-potx1(3) = 'New'
        w_potx1 = i_error-potx1.
        i_error-potx1 = w_potx1+3(37).
        MODIFY i_error.
      endif.
    ENDLOOP.
    Regards,
    Erwan.
    Message was edited by: Erwan LE BRUN

  • Regarding Internal Table Manipulation

    Hi All,
    I have a issue when working against Internal Table inside a function module.
    Issue is:
    My I.Table declaration is as below:
    <b>DATA: BEGIN OF i_vbfa_tab OCCURS 0.
              INCLUDE STRUCTURE vbfa.
    DATA: END   OF i_vbfa_tab.</b>
    Then in code i had written following logic:
      SELECT VBELV
             VBELN
             VBTYP_N
             VBTYP_V
             FROM VBFA
             INTO ( V_VBELV, V_VBELN, V_VBTYP_N, V_VBTYP_V )
             WHERE VBELN   = V_SO_ORDER2 AND
                   VBTYP_N = 'G'         AND
                   STUFE   = '00'.
      IF SY-SUBRC EQ 0.
        I_VBFA_TAB–VBELN   = V_VBELN.        
        I_VBFA_TAB–VBELV   = V_VBELV.        
        I_VBFA_TAB–VBTYP_N = V_VBTYP_N.      
        I_VBFA_TAB–VBTYP_V = V_VBTYP_V.      
        APPEND I_VBFA_TAB.
        CLEAR I_VBFA_TAB.
      ENDIF.
    Then when i am checking for <b>F2[Syntax]</b> it is giving error as <b>'The Field I_VBFA_TAB-VBELN is unknown'</b>. This is the case with all 4 assignment statements.
    Can anybody tell me what is the issue over here.
    What can i do to assign those values to internal table and append. I had tried with <b>MOVE</b> that is also giving same error.
    Can anybody solve my issue.
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    If you are doing something like:
    call function 'Z_FUNC'
      tables i_vbfa_tab = vbfa_tab.
    and in the FM:
    function z_func
    *"  TABLES
    *"      i_vbfa_tab STRUCTURE  vbfa OPTIONAL
    perform get_vbfa.
    and then in an include
    form get_vbfa
    SELECT VBELV
    VBELN
    VBTYP_N
    VBTYP_V
    FROM VBFA
    INTO ( V_VBELV, V_VBELN, V_VBTYP_N, V_VBTYP_V )
    WHERE VBELN = V_SO_ORDER2 AND
    VBTYP_N = 'G' AND
    STUFE = '00'.
    I think you'll get the syntax arror you describe. Try:
    call function 'Z_FUNC'
      tables i_vbfa_tab = vbfa_tab.
    and in the FM:
    function z_func
    *"  TABLES
    *"      i_vbfa_tab STRUCTURE  vbfa OPTIONAL
    perform get_vbfa
    <b>  tables i_vbfa_tab.</b>
    and then in the include
    form get_vbfa
    <b>  tables i_vbfa structure vbfa.</b>
    data: v_vbelv   like vbfa-vbelv,
          v_vbeln   like vbfa-vbeln,
          v_VBTYP_N like vbfa-VBTYP_N,
          v_VBTYP_v like vbfa-VBTYP_v,
    SELECT VBELV
    VBELN
    VBTYP_N
    VBTYP_V
    FROM VBFA
    INTO ( V_VBELV, V_VBELN, V_VBTYP_N, V_VBTYP_V )
    WHERE VBELN = V_SO_ORDER2 AND
    VBTYP_N = 'G' AND
    STUFE = '00'.
    IF SY-SUBRC EQ 0.
    I_VBFA_TAB–VBELN = V_VBELN.
    I_VBFA_TAB–VBELV = V_VBELV.
    I_VBFA_TAB–VBTYP_N = V_VBTYP_N.
    I_VBFA_TAB–VBTYP_V = V_VBTYP_V.
    APPEND I_VBFA_TAB.
    CLEAR I_VBFA_TAB.
    ENDIF.
    I didn't test this, so if you use it, test it thoroughly.
    Rob

  • Regarding internal table read.

    Hi,
    i want to read internal table and compare the one variable existing with in from date and to date.
    the psudo code is like this
    READ TABLE L_TABEMPLOYEE INTO L_WAEMPLOYEE WITH KEY  EMPLOYEE = SOURCE_FIELDS_RULE-PERNR
    ULTIMO BETWEEN L_WAEMPLOYEE-DATEFROM AND L_WAEMPLOYEE-DATETO.
    but this statement gives error.
    how to code for the same requirement.
    regards,
    swami.

    Hi,
    Recode like this.It will definitely work
    LOOP AT L_TABEMPLOYEE INTO L_WAEMPLOYEE
                                 WHERE EMPLOYEE = SOURCE_FIELDS_RULE-PERNR
                                              AND ULTIMO > L_WAEMPLOYEE-DATEFROM
                                              AND ULTIMO < L_WAEMPLOYEE-DATETO.
    <Write what you want to do here >
    ENDLOOP.
    Please reward if useful
    Thanks Arjun
    Edited by: Arjun Puthuruthy on Mar 26, 2008 10:52 AM

  • This is Regarding internal tables

    Hi to all,
    I have 3 internal tables like this.
    it_itab1       It_itab2        it_final
      !--f1            !-f3           !---f1
      !--f2            !-f4           !---f2
                                           !---f3
                                           !---f4
    the fields are like this.now i want to move the data from first two internal tables to final internal table.
    how to do this.
    thanks and regards,
    s

    create ur final internal table with the same data element as the fields of 1 and 2 itabs
    and say move- corresponding  to it_final..

  • This is regarding internal table

    Hi to all,
    types : begin of it_itab,
            name type ztab-name,
            tval like ztab-tval,
            fval like ztab-fval,
            end ofit_itab,
            it_jtab type standard  table of it_itab.
    What is the meaning of this it_jtab type standard table of it_itab.
    what it specifies exactly.
    Thanks and regards,
    s

    Hi,
    types : begin of it_itab,
    name type ztab-name,
    tval like ztab-tval,
    fval like ztab-fval,
    end ofit_itab,
    Types defines the standard strcuture which you can use any where in the report.
    <b>it_jtab type standard table of it_itab.</b>
    As strcuture doesnot contain morethan one data, we declaring the internal using the strcuture which defined.<b> The above statement is used to create a  internal table without header line and the internal table type is of standard.</b>
    Thanks,
    Sriram Ponna.

  • Regarding internal table

    Hi ,
         i have an internal table
    DATA: BEGIN OF tbl_infile OCCURS 0,
             Aufnr(12) type c,
             budat(8) TYPE c,
             tubes(13) type c,
             srap(13) type c,
             batches(13) type c,
             runmin(13) type c,
             stopmin(13) type c,
          END OF tbl_infile.
    here the date from file comes into internal table as 140409 i want to change this to 14.04.2009 and place back into internal table how to change the internal table ?
    Thanks in advance

    Hi,
    This is very simple:
    1.Change the lenght of the budat from 8 to 10
    2.either use the FM 'CONVERT_DATE_TO_EXTERNAL' to convert the date or
    use the below snippet
    3.Declare 3 local variable of type c each of lenght 2
    data:var1(2) tyep c,
    var2(2) tyep c,
    var3(2) tyep c,
    4.extract the dd,mm and yy using the offset from the budat
    var1 = budat+0(2).
    var2 = budat+2(2).
    var3 = budat+4(2).
    5.finally concatenate the above 3 variable into budat of internal table.
    concatenate var1 '.' var2 '.' var3 into budat.
    Hope this might solve your problem.
    Pooja
    Edited by: Pooja Gupta on Mar 13, 2009 4:46 AM

  • Regarding Internal table logic

    Hi,
    I have my internal table as follows:
    DATA: BEGIN OF I_DATA OCCURS 0,
            prgname TYPE SYST-REPID,
            matnr   TYPE mara-matnr,
            berid   TYPE mdma-berid,
          END OF I_DATA.
    Data that fills into can be as follows:
    Ex:
    PROGRAM1,1000,MRP1
    PROGRAM1,1000,MRP1
    PROGRAM1,2000,MRP1
    PROGRAM2,1000,MRP1
    PROGRAM2,1000,MRP1
    PROGRAM2,2000,MRP1
    PROGRAM3,1000,MRP1
    PROGRAM3,1000,MRP1
    PROGRAM3,2000,MRP1
    It can any order in above way.
    Then i will sort the above data as follows:
    SORT I_DATA BY prgname matnr berid.
    Now here my issue is:
    DATA: t_objtxt     LIKE solisti1   OCCURS 0  WITH HEADER LINE.
    I need to push the above internal table data into T_OBJTXT internal table as follows:
    It should first Display program Name as Program Name: Program3, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.
    When 2nd program comes again i have to write Program Name: Program2, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.
    When 3nd program comes again i have to write Program Name: Program3, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.
    Etc. Same process we need to follow.
    The final out put should be as below:
    PROGRAM NAME : PROGRAM1
    MATNR, BERID
    1000,MRP!
    1000,MRP1
    2000,MRP1
    PROGRAM NAME : PROGRAM2
    MATNR, BERID
    1000,MRP!
    1000,MRP1
    2000,MRP1
    PROGRAM NAME : PROGRAM3
    MATNR, BERID
    1000,MRP!
    1000,MRP1
    2000,MRP1
    Like wise o/p need to be send to I_OBJTXT and to email.
    <b>The logic i have written is as follows:</b>
      LOOP AT I__DATA.
        AT NEW PRGNAME.
          MOVE '*****************************************' TO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          CONCATENATE t_objtxt-line 'PROGRAM NAME : '
                      I_DATA-PRGNAME
                      INTO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          MOVE '*****************************************' TO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          CONCATENATE TEXT-024 " Material
                      TEXT-025              " MRP
                      INTO t_objtxt-line
                      SEPARATED BY C_COMMA.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          MOVE '-----------------------------------------' TO t_objtxt-line.
          CONCATENATE t_objtxt-line '------------------' INTO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
        ENDAT.
    *    MOVE '' TO t_objtxt-line.
    *    APPEND t_objtxt.
    *    CLEAR t_objtxt.
        CONCATENATE I_DATA-MATNR
                    I_DATA-BERID
                    INTO t_objtxt-line
                    SEPARATED BY C_COMMA.
        APPEND t_objtxt.
        CLEAR t_objtxt.
        AT END OF MATNR.
          MOVE '' TO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          MOVE '*****************************************' TO t_objtxt-line.
          CONCATENATE t_objtxt-line '******************' INTO t_objtxt-line.
          CONCATENATE t_objtxt-line '******************' INTO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
        ENDAT.
      ENDLOOP.
    The above logic is not working correctly.
    Can anybody give me correct logic for the same.
    Thanks in advance.
    Thanks,
    Deep.

    Can you paste the total code.
    santhosh

  • Information regarding SAP Tables

    HI All,
            I am new to SAP.As a part of archiving project,we recently archived the entire SAP database using a tool.When we started archiving we stopped the SAP and all the jobs which are running to make sure that all the tables are stagnant.This is due to the fact that once we archive, we do a row count on the Oracle(SAP) and archived tales to make sure every thing is archived.
                       But unfortunately, As we archiving the oracle database(SAP) got restarted as there was a backup job which ran and restarted the server.Now when we completed the full archiving and did a row count comparision we found that the below tables have different counts from the Oracle(SAP) i.e source.I think that these tables are SAP metadata and when system got restarted due to the back p job, these tables might have been updated.
    Please see the list of tables below and let me know whether these tables contain any Data which might e useful to the customer or is it just some metadata used by SAP and nothing else...
    DBABARL
    DBAML
    DBATL
    DBSNP
    DDLOG
    MONI
    PAHI
    SDBAD
    SDBAH
    SGOSHIST
    SNAP
    TBTCO
    TBTCP
    TSP01
    TSP02
    TSPEVDEV
    TSPEVJOB
    TST01
    TXMILOGRAW
    UTAB
    VARI
    Thanks in Advance

    > Please see the list of tables below and let me know whether these tables contain any Data which might e useful to the customer or is it just some metadata used by SAP and nothing else...
    Well - you can check the content of the tables in SE11 and SE16. Whether the data is used or not depends on the customizing of the system and the applications/modules used. Whether this is "only" metadata can only be determined by the customer himself.
    Markus

  • How to get information regarding WF table

    My scenario is this.
    When a employee applies leave a notification is sent to 1st of his three supervisor in the hierarchy. If he approves the notification is sent to 2nd supervisor. After his approval a FYI is sent to final supervisor. If a employee has sent a request and if the supervisor has not responded for that request within a day then a reminder notification has to be sent to the supervisor again. I have no idea as of what to do.
    Is there any query available to track this in backend?

    Hi,
    I do have the similar problem. I am using the timeout specifications and set the frequency to 1 hour and max notifications to 10 while testing. First email was sent out when the manager was not responded within 1 hour, But after 2 hours when I ran the NEM_MAIN, It is not sending any reminder emails to the manager.
    Edited by: 951696 on Aug 8, 2012 2:28 PM

  • Storing internal table from XML File into DDIC

    Hi everybody,
    im trying to store an internal table <b>without</b> knowing the content - means the structure (fields)- into th DDIC, but i failed. The code is:
    DATA xslt_error TYPE REF TO cx_xslt_exception.
    TRY .
    perform load_file  using 'D:/usr/YTGVF_asXML.xml'    changing itab_XMLResult.
          refresh itab_tableA.
          call transformation id
            source xml itab_XMLResult
            result GREATEST = itab_tableA.
    CATCH cx_xslt_exception INTO xslt_error.
      DATA: xslt_message type string .
      xslt_message = xslt_error->get_text( ).
      write xslt_message.
    ENDTRY.
    form load_file
      using    path type localfile
      changing tab type table.
      data:    s type string,
               filelength type i.
      s = path.
      refresh tab.
      call function 'GUI_UPLOAD'
        exporting  filename   = s
                   filetype   = 'BIN'
        importing  filelength = filelength
        tables     data_tab   = tab
        exceptions others     = 1.
    endform.                    "load_file
    So, how can i store itab_tableA, without knowing the content (fields) of the table? The XML-File is of type asXML - i guess there should be a solution.
    Thanks for all replies!
    BG, Jim

    Absolutely, I don't see why that would be a problem.
    After parsing through the schema or DTD, you would know what the structure of the XML file coming through would be. So it would be basically uploading the file to SAP and then parsing the schema or DTD file, you will come to know the structure of your XML.
    And once you know the structure, you can create your <a href="/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table internal table</a>, and put the values from the XML file in the same.
    Considering my limited knowledge in XML, I am not able to provide information regarding , if there are any function modules/classes which SAP supports to directly read an XML schema/DTD and create a table of that sort. But the above inputs should help you in your way...
    Regards,
    Subramanian V.

Maybe you are looking for

  • How do i fix itunes, AVFoundationCF.dll missing (error 7, windows error 126)

    I tried to update itunes to 10.5 but wouldn't install. I then tried to uninstall and reinstall and have had problems ever since. I tried removing every apple file on my computer( itunes, bonjour, etc..) with REVO uninstall. Then reinstalling to no av

  • Problen when using log4j.jar in my web service application

    Hi, i have a little problem. I have to migrate an existing java application to web services, and this application uses log4j.jar. So i put that jar file in the lib dir in WEB-INF. However, when i try to deploy the application, i get an error saying o

  • Where can I find information regarding end of life or product lifecycle of Lenovo products

    The psrefs files are chockful of great information, however,  as an IT Manager, I need to be able to anticipate when models will be available for purchase, and when not.  We use the Image Ultra Builder extensively to deploy or replace 5-600 laptops/l

  • Problems converting from CS2 - eps files show TIFF error

    I have multiple volumes of a violin method book in InDesign CS2 and was considering upgrading to InDesign CS5. While using the trial version (which I just downloaded last night), every single of my eps files (hundreds of images across multiple docume

  • QUery in SPRO PO?

    hii In SPRO, under PO, what is the purpose of below things .. 1.Define Reasons for Ordering 2.Define Reasons for Cancellation 3.Set Up Authorization Check for G/L Accounts 4.Set up for subcontract order Explain me short in detail with some real time