Which is the suitable Internal table.

Hi,
I want to know which type of internal table would be suitable for the below mentioned process.
There is some initial set of data in a internal table. The table is looped and i do operation on the data available in that line and get another data which has to be added to the same internal table. So that when the control is done with the intial set of data in the table, it starts reading the newly added line and do the same operations mentioned below.
Warm Regards,
Aruna G

Hi,
The loop wont be infinite, cos at  one point the above mentioned processiing of data wont happen since it wont meet some of the criteria. Its just i want to use a table sequentially and append data to it at the end.
Warm Regards,
Aruna G

Similar Messages

  • Problem in filling the final internal table

    Hi,
    I am working on a code in which i have to fill up the final internal table which will store the values coming form different internal tables.Here's the code which i am trying to do but it is not giving the execat functionality.In this code ITOUTPUT is the final itab which is storing the values of all other internal tables.
    Here's the code:-
    loop at itab1.
      select single maktx into v_item from makt where matnr = itab1-matnr.
          ITOUTPUT-banfn = ITab1-banfn.
          ITOUTPUT-badat = ITab1-badat.
          ITOUTPUT-meins = ITab1-meins.
          ITOUTPUT-menge = ITab1-menge.
          ITOUTPUT-lfdat = ITab1-lfdat.
      IF ITAB1-MEINS = 'KG'.
        V_TOTREQ = V_TOTREQ + ITAB1-MENGE.
      ELSEIF ITAB1-MEINS = 'TO'.
        V_TOTREQ = V_TOTREQ + ( ITAB1-MENGE * 1000 ).
      ELSEIF ITAB1-MEINS = 'G'.
        V_TOTREQ = V_TOTREQ + ( ITAB1-MENGE / 1000 ).
      ENDIF.
      v_tpo = 0.
      v_por = 0.
      LOOP AT ITPO WHERE BANFN = ITAB1-BANFN AND bnfpo = ITAB1-bnfpo.
        if v_por <> '0'.
          write : / '  '.
        endif.
          ITOUTPUT-ebeln = ITPO-ebeln.
          ITOUTPUT-aedat = ITPO-aedat.
          ITOUTPUT-lifnr = ITPO-lifnr.
          ITOUTPUT-menge = ITPO-menge.
          ITOUTPUT-EINDT = ITPO-EINDT.
        IF ITAB1-MEINS = 'KG'.
          V_TOTPO = V_TOTPO + ITPO-MENGE.
        ELSEIF ITPO-MEINS = 'TO'.
          V_TOTPO = V_TOTPO + ( ITPO-MENGE * 1000 ).
        ELSEIF ITPO-MEINS = 'G'.
          V_TOTPO = V_TOTPO + ( ITPO-MENGE / 1000 ).
        ENDIF.
        v_tpo = v_tpo + itpo-menge.
        v_tgr = 0.
        v_por = 1.
        v_grr = 0.
        loop at itmrn where ebeln = itpo-ebeln and ebelp = itpo-ebelp.
          if v_grr <> '0'.
            write : / '  '.
          endif.
          select single budat from mkpf into v_grdate where MBLNR = itmrn-MBLNR.
          write: 143 Itmrn-menge,v_grdate .
            itoutput-PMENGE = itmrn-menge.
          v_tgr = v_tgr + itmrn-menge.
          v_grr = 1.
        endloop.
        p_po = itpo-menge - v_tgr.
       write: 173 p_po.
      ENDLOOP.
      p_req = itab1-menge - v_tpo.
      write :  195 p_req.
    endloop.
    loop at itoutput.
      write:/ itoutput-banfn,12 itoutput-badat,24 v_item,50 itoutput-meins,53 itoutput-menge,itoutput-lfdat,
              89 ITPO-ebeln,100 ITPO-aedat,111 ITPO-lifnr,(10) itpo-menge, ITPO-eindt.
      MODIFY itoutput.
    endloop.

    Hi,
    Ok,i ha d checked my code by using your logic and giving the run time error ......
    i had debugged my code (orignal onementioned in above thread with little modification) in which  i am able to see that finaloutput (intrenal table) is getting filled properly and the  problem arises when  the cursor comes to the write statement ... it is repeating some of the values when output is displayed where as before displaying output this iternal table is having the correct data. i am using the following code :-
    append itoutput.
      ENDLOOP.
      p_req = itab1-menge - v_tpo.
      write :  195 p_req.
      append itoutput.          ,<---  added this
      clear itoutput.               <--- added this
    endloop.
    loop at itoutput.
      write:/ itoutput-banfn,12 itoutput-badat,24 v_item,50 itoutput-meins,53 itoutput-menge,itoutput-lfdat,
              89 ITPO-ebeln,100 ITPO-aedat,111 ITPO-lifnr,(10) itpo-menge, ITPO-eindt.
      MODIFY itoutput.         <------ not removed
    endloop.

  • 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

  • It cannot reference the dynamic internal table in memory as an object.

    Hi,
    I am getting the syntax error in the second select. I guest it cannot reference the dynamic internal table in memory as an object.
    The internal table contains different fields from multiple tables and it gets created OK. Then the first select within the loop executes OK allowing me to read the multiple tables in ITABLES.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = ifc
        IMPORTING
          ep_table        = dy_table.
    ***OK, the dynamic tables is created here
      assign dy_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data dy_line like line of <dyn_table>.
      assign dy_line->* to <dyn_wa>.
    loop at ITABLES.
    ***OK, no syntax errors in this select here
      select * appending corresponding fields of table <dyn_table>
                 from (ITABLES-TABNAME).
    endloop.
    data: ikonp like konp occurs 0 with header line.
    ***NOT OK, there is syntax errors
      select * into table ikonp
      from KONP for all entries in <dyn_table>
      where knumh = <dyn_table>-knumh.
    Some of the tables in ITABLES are pooled tables which does not allow me to use INNER JOINS. Therefore I need a second select in order to read the pricing table KONP.
    Thanks in advance for any hint.

    Hi Abel,
    You must be getting the syntax error that <dyn_table> does not contain the field knumh.
    try putiing the entire where clause in a char type variable say wa_char and then use in ur query as
    where (wa_char) .. it may work..
    concatenate 'knumh' '=' '<dyn_table>-knumh' INTO wa_char SEPARATED BY SPACES.
    SELECT ... from konp...
    where (wa_char).
    Revert if it doesnt work.

  • Getting the final internal table of a transaction VA05

    Hi,
    Can anyone help me in getting the final internal table of a transaction VA05 when called from a program. I need to use to this internal table for further processing.
    Thanks in advance,
    Vinay.

    Hi,
    Not quite sure what you are after but the following may help.
    For a start VA05 uses FM RV_SALES_DOCUMENT_VIEW_3 to select it's data.  Your program could simply call this.  However, if you are doing a CALL TRANSACTION from your program to VA05 and you want to get the results back then you could utilise some 'old style' userexits available in VA05.
    Two choices here:
    1. At the end of FM RV_SALES_DOCUMENT_VIEW_3 there is a form END_MODIFICATION or
    2. When VA05 calls RV_SALES_DOCUMENT_VIEW_3 it performs a user sort MV75AFZ1(MV75AFZ1)
    Both of these belong to package VMOD which means you can modify them by simply registering the object in OSS (these are 'old style' exits before SMOD/CMOD and are prevelant in SD)
    From either of these you could EXPORT to memory for when control is returned back to your program.
    Thanks,
    Pete

  • Reg : Joining the all internal table records into a single internal table

    Hi all
    I am having 5 internal tables and i want to put all these entries in a single intrnal table and my requirement is for each and every record it has to go through all the internal tables and if an entry is missing meand.it has to go through the other internal tables and for missing entries i should leave it as blank and rest of the contents i have to display can any please gimme some logic how to do this??
    Thanks in advance

    Don't have time or will to deliver turnkey solutions, but here is a frame:
    LOOP AT itab1...
      READ TABLE itab2 WITH TABLE KEY... (fields linking itab1 and itab2)
      READ TABLE itab3 WITH TABLE KEY... (fields linking itab1 and itab3)
      LOOP AT itab4 WHERE... (fields linking itab1 and itab4)
        READ TABLE itab5 WITH TABLE KEY... (fields linking itab4 and itab5)
        MOVE-CORRESPONDING... (all five work areas to target work area)
        APPEND itabtarget...
      ENDLOOP.
    ENDLOOP.
    so use READ when there is a 1:1 relationship (e.g. check table entry), and LOOP when there is a 1:N relationship (e.g. items for a header)
    Thomas

  • Problem in modifying the main internal table gt_data

    Hello i have written code for modifying the main internal table. i have read data from ausp table and put into the internal table gt_ausp. now i want to modify my main table GT-DATA with gt_ausp. i am not able to do this.
    LOOP AT gt_data  INTO ls_list.
        lt_temp-objek  =  ls_list-matnr.
        APPEND  lt_temp.                  " 특성값 발췌용도로 저장
        APPEND  ls_list  TO lt_work.      " 핵심작업용도로 저장
      ENDLOOP.
      DESCRIBE TABLE lt_temp.
      IF  sy-tfill  EQ  0.
        pv_flg  =  'X'.
        EXIT.
      ENDIF.
    Get 제품인증(플랜트별).....
      DESCRIBE TABLE lt_cetino_tp.
            플랜트          자재번호
            카타로그-인증   코드그룹-인증   인증코드
            Certi. No.
    Get 자재별 특성값..........
              오브젝트  특성이름  내부특성   내부카운터  특성값
      SELECT    aobjek    batnam   aatinn    aatzhl    a~atwrt
            INTO CORRESPONDING FIELDS OF TABLE  lt_ausp_tp
            FROM ausp AS a  INNER JOIN  cabn AS b
              ON aatinn  =  batinn
             FOR ALL ENTRIES IN  lt_temp
           WHERE a~objek  EQ  lt_temp-objek   " 오브젝트키(자재번호)
             AND a~klart  EQ  '001'           " 클래스유형
           AND a~atzhl  EQ  '001'           " 특성값카운터(최종건만 존재)
                                              자재특성 변경시 변경됨
             AND b~adzhl  EQ  '0000'.
      IF  sy-subrc  EQ  0.
        DELETE ADJACENT DUPLICATES FROM  lt_ausp_tp.
        lt_ausp[]     =  lt_ausp_tp[].
        lt_ausp_tp2[] =  lt_ausp_tp[].
        DELETE ADJACENT DUPLICATES FROM  lt_ausp_tp2.
      Get 특성내역
              내부특성   " 내부카운터
              특성값       특성값내역
        SELECT    aatinn  " aatzhl
                  aatwrt    batwtb
              INTO CORRESPONDING FIELDS OF TABLE  lt_cawn
              FROM cawn AS a  INNER JOIN  cawnt AS b
                ON aatinn  =  batinn  AND
                   aatzhl  =  batzhl  AND
                   aadzhl  =  badzhl
               FOR ALL ENTRIES IN  lt_ausp_tp2
             WHERE a~atinn  EQ  lt_ausp_tp2-atinn  " 내부특성
               AND b~spras  EQ  sy-langu.
      ENDIF.
      SORT  lt_work BY matnr .
      BREAK-POINT.
      LOOP AT lt_work  INTO ls_list.
      특성내역
        READ TABLE  lt_ausp  WITH TABLE KEY  objek = ls_list-matnr
                                             atnam = 'SECTION_WIDTH'.
      수출자재가 아닌 것은 제외
    LS_LIST-SECTION_WIDTH = LT_AUSP-ATWRT.
    MODIFY TABLE GT_DATA FROM LS_LIST  TRANSPORTING SECTION_WIDTH.

    Hi,
    Question before: why dont you just use the std.API for reading the classification data?
    e.g. "BAPI_OBJCL_GETDETAIL"
    Second: a DELETE DELETE ADJACENT DUPLICATES works only only sorted tables.
    Doing this after a select will only succeed randomly depending on the buffers of your data based below.
    ( 90% chance if it is an oracle system)
    To your question:
    Just replace your LOOP AT gt_data into ls_list
    by a LOOP AT gt_data ASSIGNING <current_list_record>.
    then you can access the fields directly:
    <current_list_record>-SECTION_WIDTH = LT_AUSP-ATWRT.
    Cause of your issue:
    "MODIFY" needs a key to to find the record to be updated.
    If your gt_data ist referencing a DDIC table type with a key or a local type with a key
    it has no chance to do it.
    Hope that helps.
    br,

  • Passing the Dynamic Internal Table as the Output Parameter of the FM...

    Hi,
    How can we pass the internal table as the output from the Function Module TABLES parameter.
        SELECT * FROM TVRO BYPASSING BUFFER INTO TABLE <ltable>.
    Now I need to pass the dynamic internal table <ltable> as the output in the function module.
    Thanks!
    Puneet.

    I can't use TVRO as the table type. The Table name is as the Input. This program will download the contents of the table and create an app server file. It can be for any database table.
    so i want the output of this FM should be the data from that table. So what should be the TABLE type.
    like in  a program i will use:::
      FIELD-SYMBOLS: <ltable> TYPE ANY TABLE,
                     <l_line> TYPE ANY,
                     <l_field> TYPE ANY.
        SELECT * FROM (p_table) BYPASSING BUFFER INTO TABLE <ltable>.
    That is my requirement.

  • Add field value to the existing internal table.

    how to add a field value to the existing internal table.
    DATA: BEGIN OF ITAB occurs 0,
                 EBELN TYPE EKPO-EBELN,
                 EBELP TYPE EKPO-EBELP,
                 AEDAT TYPE EKPO-AEDAT,
                 amount(10) type c,
               END OF ITAB.
    select * from ekpo
           into corresponding fields of table itab.
    itab-amount = '2400'.
    loop at itab where ebeln eq 70 .
           write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,itab-amount.
             endloop.
    here output is not showing the amount field value.
    please tell me how to solve this problem urgent
    thanks in advance.

    Hi Sekhar,
        First let me know wheather you are assigning some value to the amount field externally to all records? if this is wright means check the below code.
    DATA: BEGIN OF ITAB occurs 0,
    EBELN TYPE EKPO-EBELN,
    EBELP TYPE EKPO-EBELP,
    AEDAT TYPE EKPO-AEDAT,
    END OF ITAB.
    select * from ekpo
    into corresponding fields of table itab.
    v_amount = '2400'.
    loop at itab where ebeln eq 70 .
    write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,v_amount.
    endloop.
    or if you want to modify perticular records in itab  then use below code.
    DATA: BEGIN OF ITAB occurs 0,
    EBELN TYPE EKPO-EBELN,
    EBELP TYPE EKPO-EBELP,
    AEDAT TYPE EKPO-AEDAT,
    amount(10) type c,
    END OF ITAB.
    select * from ekpo
    into corresponding fields of table itab.
    loop at itab.
    itab-amount = '2400'.
    modify itab index sy-tabix (or perticular line number).
    endloop.
    loop at itab where ebeln eq 70 .
    write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,itab-amount.
    endloop.
    Thanks,
    Suma.

  • How to get the final internal table after the ALV is modified?

    Dear experts,
    My WebDynpro application allows users to delete row, sort the column. After all this modification, I need to get the final internal table of ALV to generate a csv.file. Are there any methods to get the final interal table content of ALV?
    Many thanks!
    meer

    Hi Friend  ,
    Please see this  link for wiki of  WDA Alv Hierarchy : [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f&overridelayout=true]
    Regards,

  • With in the internal table can I READ the same internal table for a record?

    With in the internal table can I READ the same internal table?
    For Suppose
    LOOP AT itab.
    can I do as below
    READ TABLE itab with key bukrs = itab-bukrs
                       belnr = itab-belnr.
    *and I have to compare
    IF itab-shkzg = itab-shkzg_ia.
    ENDIF.
    ENDLOOP.

    Hi,
    Yes..But use work area to differentiate..
    EX.
    DATA: WA LIKE ITAB.
    DATA: WA_READ LIKE ITAB.
    LOOP AT itab <b>INTO WA</b>.
    can I do as below
    READ TABLE itab <b>INTO WA_READ</b>
               with key bukrs = itab-bukrs
    belnr = itab-belnr.
    *and I have to compare
    IF <b>WA</b>-shkzg = <b>WA_READ</b>-shkzg_ia.
    ENDIF.
    ENDLOOP.
    Please reward for helpful answers.
    Thanks,
    Naren

  • Assigning value to Field - Symbol ( which is type of internal table field )

    Hi All,
      I am facing problem to assign the value to a field symbol. My requirement is creating a dynamic internal table and populate values into that internal table, so that i can display the values .
      I am having a structure with fields like status , Plant1 name , Plant2 name.....Plant n .
      So i declared an internal table it_tab with this structure.
      I am having one more table which having number of records for Plant1 ,Plant 2 ,....Plant n based on some condition.
      I need to count the number of records for Plant1 and i need to put in the internal table it_tab.
      For this i created field-symbol .
    Here, t_deployment table will have the plants 1,2,3...and
         t_devobject will have some records for these plants.
    LOOP AT T_DEPLOYMENT. 
    clear w_count.
    LOOP AT T_DEVOBJECT WHERE ZDEPLOYMENT = T_DEPLOYMENT-DOMVALUE_L AND
                              ZADSTATUS = '10'.
    w_count = w_count + 1.
    ENDLOOP.
    concatenate 'it_tab-' t_deployment-domvalue_l into var_bet_name.
    assign var_bet_name to <bet_var_name>.
    now my internal table field i.e. it_tab-plant1 came into <bet_var_name> . But i want to assign a value for it.
    at last what i need is it_tab-plant1 = w_count.
    whaterver the w_count has value that needs to assign to it_tab-plant1. But i don't want to assign directly it it_tab-plant1. I want to assign dynamically. Because tommorrow some more plants added to t_deployments , i don't want to make changes to my program. It should take care....w/o changing the program.
    I tried the following statement.
    (<bet_var_name>) = w_count. But its not working.
    Please let me know how i can get this.
    Thanks in Advance.
    Pavan.

    Hi pavan,
    As ur requirement is creating a dynamic internal table,
    try the following way,
    remember the fieldcat should be of type LVC not SLIS.
    BUILD LT_LVCFIELDCAT in a way that, the value from the internal table becomes the fieldname
    ex:-
    loop at it_models INTO WA_MODELS.
        LS_LVCFIELDCAT-FIELDNAME = WA_models-MODEL.
        LS_LVCFIELDCAT-SELTEXT = WA_models-MODEL.
    append ls_lvcfieldcat to lt_lvcfieldcat.
    endloop.
    DATA: DREF TYPE REF TO DATA,WA_REF TYPE REF TO DATA.
    FIELD-SYMBOLS: <TEMP_TAB> TYPE TABLE, <TEMP_WA> TYPE ANY.
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = LT_LVCFIELDCAT
        IMPORTING
          EP_TABLE        = DREF.
      ASSIGN dref->*  TO <TEMP_TAB>.
    now basing on the fieldcatalog <temp_tab> is build.
    NOW FILL <TEMP_TAB>.
    WHILE FILLING, ASSIGN COMPONENT IDX/NAME.....
    this statement will be very usefull.
    i hope this will be help full.
    pls reward the points if it helps u.
    regards
    Hyma

  • Issue in populating the dynamic internal table  in SMARTFORMS

    Hi Experts,
    My requirement is I have a table in the below format.
    Measuring Point
    Description of Measuring Point
    UOM
    Date
    Time
    Reading
    96
    POWER GENERATED
    kwh
    20140501
    101837
    1.00E+04
    96
    POWER GENERATED
    kwh
    20140502
    102220
    1.00E+04
    96
    POWER GENERATED
    kwh
    20140503
    104623
    1.25E+01
    96
    POWER GENERATED
    kwh
    20140504
    101111
    2.00E+03
    98
    AUX POWER CONSUME
    kwh
    20140501
    101837
    1.00E+05
    98
    AUX POWER CONSUME
    kwh
    20140502
    102220
    1.00E+05
    99
    NET POWER EXPORTED
    kwh
    20140501
    101837
    1.00E+07
    99
    NET POWER EXPORTED
    kwh
    20140502
    102220
    1.00E+07
    100
    AVG POWER GENERATED
    MW
    20140501
    101837
    1.00E+02
    100
    AVG POWER GENERATED
    MW
    20140502
    102220
    1.00E+02
    101
    AUX POWER CONSUMED(%)
    20140501
    101837
    1.00E+02
    101
    AUX POWER CONSUMED(%)
    20140502
    102220
    1.01E+01
    102
    PLANT AVAILABLE HRS
    hrs
    20140501
    101837
    1.01E+01
    102
    PLANT AVAILABLE HRS
    hrs
    20140502
    102220
    1.01E+01
    103
    PLANT RUN HOURS
    hrs
    20140501
    101837
    1.01E+01
    103
    PLANT RUN HOURS
    hrs
    20140502
    102220
    1.01E+01
    104
    PLANT AVAILABLITY FACTOR
    20140501
    101837
    1.00E+02
    104
    PLANT AVAILABLITY FACTOR
    20140502
    102220
    1.00E+02
    which i need to display like below based on the user Requirement for print out.
    DATE
    POWER GENERATED(96)
    AUX POWER CONSUME(98)
    NET POWER EXPORTED(99)
    AVG POWER GENERATED(100)
    AUX POWER CONSUMED(%)(101)
    PLANT AVAILABLE HRS(102)
    PLANT RUN HOURS(103)
    PLANT AVAILABLITY FACTOR(104)
    kwh
    kwh
    kwh
    MW
    hrs
    hrs
    01.05.2014
    1.00E+04
    1.00E+05
    1.00E+07
    1.00E+02
    1.00E+02
    1.01E+01
    1.01E+01
    1.00E+02
    02.05.2014
    1.00E+04
    1.00E+05
    1.00E+07
    1.00E+02
    1.01E+01
    1.01E+01
    1.01E+01
    1.00E+02
    03.05.2014
    1.25E+01
    04.05.2014
    2.00E+03
    Now the issue is how to assign the values of stops from the internal table to dynamically  for a specific date in SMARTFORMS?
    Please help me in resolving this issue.

    Hi,
    See if this articale is good for you:
    The case of "dynamic columns in smartform"
    Regards.

  • How to compare two entries in the same internal table

    Hi
    I hav e an internal table. I want to compare the entries in the internal table and delete the entries which is duplicates from the internal table. for ex. if plant 1000 is repeated two times. Then both the record of plant 1000 should be removed .
    Please suggest some idea.
    Thanks
    Subha

    Hi,
    Apply this code.
    include one more field in itab & jtab as delete_flag(1) type c.
    move itab to jtab.
    Loop at itab into wa_itab.
    lv_tabix = sy-tabix.
    Loop at jtab into wa_jtab where plant = wa_itab-plant.
    if sy-tabix ne lv_tabix.
    wa_itab-delete_flag = 'X'.
    endif.
    Endloop.
    modify itab from wa_itab transporting delete_flag.
    clear: wa_itab,wa_jtab.
    endloop.
    delete itab where delete_flag = 'X'.
    Now you have filtered ITAB with your desired results.
    It will surely help.
    Edited by: Adarsh Jain on Aug 18, 2010 7:57 AM
    Edited by: Adarsh Jain on Aug 18, 2010 7:58 AM

  • Passing the dynamic internal tables to the calling program

    Hello,
    From my user exit USEREXIT_MOVE_FIELD_TO_VBAP in program MV45AFZZ I am calling a routine to build dynamically an internal table. I get A DUMP in the perform statement. Please see below.
    *FORM USEREXIT_MOVE_FIELD_TO_VBAP.*
    *Global declarations
    RANGES: KSCHL      FOR A605-KSCHL,
                   KUNNR     FOR A605-KUNNR,
                   MATNR     FOR A605-MATNR.
    field-symbols: <dyn_table> type standard table,
                         <dyn_wa>,
                         <dyn_field>.
    *Internal tables and work areas
    data: dy_table type ref to data,
            dy_line  type ref to data,
            xfc type lvc_s_fcat,
            ifc type lvc_t_fcat.
      KSCHL-sign   = 'I'.
      KSCHL-option = 'EQ'.
      KSCHL-low    = 'ZB00'.
      APPEND KSCHL.
      if not vbap-matnr is initial.
        MATNR-sign   = 'I'.
        MATNR-option = 'EQ'.
        MATNR-low    = vbap-matnr.
        APPEND MATNR.
      endif.
      if not vbak-kunnr is initial.
        KUNNR-sign   = 'I'.
        KUNNR-option = 'EQ'.
        KUNNR-low    = vbak-kunnr.
        APPEND KUNNR.
      endif.
    perform get_data(ZSD_CARRIER_SELECTION)
                               TABLES KAPPL
                                             KSCHL
                                             KUNNR
                                             MATNR
                              CHANGING <dyn_table>.
    *ENDFORM.*
    *Then in program ZSD_CARRIER_SELECTION*
    *Global declarations
    RANGES: KSCHL      FOR A605-KSCHL,
                   KUNNR     FOR A605-KUNNR,
                   MATNR     FOR A605-MATNR.
    field-symbols: <dyn_table> type standard table,
                         <dyn_wa>,
                         <dyn_field>.
    *Internal tables and work areas
    data: dy_table type ref to data,
            dy_line  type ref to data,
            xfc type lvc_s_fcat,
            ifc type lvc_t_fcat.
    *FORM get_data  CHANGING dyn_table.*
      select single * into w_t685
      from t685 where KSCHL eq P_KSCHL
                  and KOZGF ne space.
      select * into table i_T682I
      from T682I where KVEWE = w_t685-KVEWE
                   and KAPPL = w_t685-KAPPL
                   and KOZGF = w_t685-KOZGF.
      loop at  i_T682I into W_T682I.
        CONCATENATE 'A' W_T682I-KOTABNR INTO w_dd02l-TABNAME.
        itables-TABNAME = w_dd02l-TABNAME.
        collect itables.
      endloop.
      loop at itables.
        perform get_structure tables ifc
                              using  itables-TABNAME.
      endloop.
      loop at ifc into xfc where key = 'X'.
        clear i_fields.
        i_fields-FIELDNAME = xfc-fieldname.
        i_fields-sign      = 'I'.
        i_fields-option    = 'EQ'.
        if xfc-fieldname = 'KSCHL'.
          i_fields-low = 'ZB00'.
        endif.
        append i_fields.
      endloop.
      call method cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = ifc
        IMPORTING
          ep_table        = dy_table.
      assign dy_table->* to <dyn_table>.
      create data dy_line like line of <dyn_table>.
      assign dy_line->* to <dyn_wa>.
    *ENDFORM.*
    *FORM get_structure tables ifc type LVC_T_FCAT*
                       *using TABNAME.*
      data : idetails type abap_compdescr_tab,
             xdetails type abap_compdescr.
      data : ref_table_des type ref to cl_abap_structdescr.
    * Get the structure of the table.
      ref_table_des ?=
          cl_abap_typedescr=>describe_by_name( TABNAME ).
      idetails[] = ref_table_des->components[].
      select * into table i_dd03l
      from dd03l where tabname = tabname.
      sort i_dd03l by fieldname.
      loop at idetails into xdetails.
        clear xfc.
        xfc-fieldname = xdetails-name .
        xfc-datatype  = xdetails-type_kind.
        xfc-inttype   = xdetails-type_kind.
        xfc-intlen    = xdetails-length.
        xfc-decimals  = xdetails-decimals.
        read table i_dd03l with key fieldname = xfc-fieldname
                                    KEYFLAG   = 'X'.
        if sy-subrc = 0.
          xfc-key   = 'X'.
        endif.
        collect xfc into ifc.
      endloop.
    *ENFORM.                    "get_structure*
    Thanks in advance.
    Please use code tags in the future when pasting code.
    Edited by: Rob Burbank on Mar 2, 2009 4:29 PM

    Hi,
    In the calling program whereyou are calling the subroutine...
    perform get_data(ZSD_CARRIER_SELECTION)
                               TABLES KAPPL
                                             KSCHL
                                             KUNNR
                                             MATNR
                              CHANGING <dyn_table>.
    you have made use of field symbol <dyn_table> which you have not assigned.... due to which you are getting a dump....
    so before the call you have to assign this field symbol and then use it in the call...
    just assing to some dummy type and then you pass it using changing...
    later on in the called program you can unassign the field-symbol as soon as you enter in the subroutine.
    data itab type standard table of scarr.
    assign itab to <dyn_table>.
    perform get_data(ZSD_CARRIER_SELECTION)
                               TABLES KAPPL
                                             KSCHL
                                             KUNNR
                                             MATNR
                              CHANGING <dyn_table>.
    even if this does not solve your problem try debugging and check at which line it is going for a dump... so that it gives a clear idea where exactly is the fault
    Regards,
    Siddarth

Maybe you are looking for

  • Search Results Query Text - Get all data, Exclude all list data except one

    Hi Experts, I have a situation wherein in the global search of our internal site, we have to display all results & restrict any list item except one list. Earlier we had restricted /Lists/ & People to be displayed in the results. But in the new searc

  • X99S Gaming 7 - USB power and FAN speed??

    1. How do I get power from my USB ports (smartphone charging) when my computer is turned OFF. 2. I cant get my SYSFans to run under 50%??? They can go down to 30% when I use a Fan controller.

  • Stuck with comparison!!

    Hi I'm attaching my vi. I'm doing serial Visa read to get the data. My algo goes like this: I compare my serial port visa read string with  char "x". If x is received than I increament the index in the structure. There is another control(steps) which

  • Customizing look and feel web interface

    Hi all, We are customizing the theme "web interface", but don't appears, when we look for it in "Theme Root". Only appears the themes created by SAP. the steps that we followed are: - Copy the theme, with the program BPS_UPDATE_MIMEREPOS - import the

  • Where is Unicode Support

    I tried buzzword today and got amazed after finding that there is NO Unicode support. When I tried to write a few Unicode Hindi word, all it displays was dots like this - ...... I tried to copy this on my local Notepad, and Unicode characters were di