Internal table problem for BDC

Hai i am having flatfile like this format
H   text1   1000   plant_name   10 short_text   X     X
                                                 20 short_text   X     X
                                                 30 short_text   X     X
H   text1   1000   plant_name   10 short_text   X     X
                                                 20 short_text   X     X
                                                 30 short_text   X     X
now this H indicates new record. In each new record number of line items are there.
How to proceed using internal tables. please help me.

hi,
arrange your flat file like this...
H    text1 1000  plant_name  10  short_text X X
H    text1 1000  plant_name  20 short_text  X X
H    text1 1000  plant_name  30 short_text  X X
H1  text1 1000  plant_name  10 short_text  X X
H1  text1 1000  plant_name  20 short_text  X X
H1  text1 1000  plant_name  30 short_text  X X
now make an internal table having all the fields present in your flat file
and loop at that internal table and on change of field H call your function module and pass the value for record H......
similarly it will work for H1.....H2.....
for eg...
LOOP AT "Your internal table" INTO "Work area of your internal table".
    AT END OF "field name for H".
      CALL FUNCTION ''Your function module"

Similar Messages

  • Bdc upload file data into internal table problem with gui_upload fm

    Hello experts,
    my coding is like this ..
    data : begin of itab occurs 0 .
    field1 like mara-matnr,
    field2......
    etc,
    end of itab.
    data: file1 type string.
    parameter :file like rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    static = 'X'
    mask = space
    field_name = 'FILE'
    CHANGING
    file_name = file.
    START-OF-SELECTION.
    FILE1 = FILE . "HERE I AM PASSING INTO STRING
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = FILE1
    FILETYPE = 'ASC'
    has_field_separator = 'X'
    TABLES
    data_tab = itab. " here the data is not populating from the file , it is giving the error like speified table not found.
    HERE i am getting the message like "specified table name not recgonised" . the data is not populating into the itab from the file.
    file structure is same as the internal table.
    I stored the file as .txt( ie in notepad).
    my file is like this..
    10000 200 323 sunndarrr.......
    i had a problem with this bdc , i am getting like "specified table name not recgonised" in the fm gui_upload while debugging.
    when i am using the ws_upload it is working fine.
    please guide me where i have done the mistake.
    thank you so much for all the replies.

    Hi,
    Have a look on the following code.
    TABLES: kna1.
    DATA: BEGIN OF itab1 OCCURS 0,
          str(255),
          END OF itab1.
    DATA: itab2 TYPE kna1 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
        filename                = 'D:\ABAP EVE\ffile1.txt'
        filetype                = 'ASC'
      TABLES
        data_tab                = itab1
      EXCEPTIONS
        conversion_error        = 1
        file_open_error         = 2
        file_read_error         = 3
        invalid_type            = 4
        no_batch                = 5
        unknown_error           = 6
        invalid_table_width     = 7
        gui_refuse_filetransfer = 8
        customer_error          = 9
        no_authority            = 10
        OTHERS                  = 11.
    IF sy-subrc <> 0.
      WRITE:/ 'sorry'.
    ELSE.
      LOOP AT itab1.
        SPLIT itab1-str AT ',' INTO itab2-kunnr itab2-name1.
        APPEND itab2.
      ENDLOOP.
      IF sy-subrc = 0.
        LOOP AT itab2.
          WRITE:/ itab2-kunnr,itab2-name1.
          INSERT INTO kna1 VALUES itab2.
        ENDLOOP.
        IF sy-subrc = 0.
          WRITE:/ 'inserted'.
        ELSE.
          WRITE:/ 'not inserted'.
        ENDIF.
      ELSE.
        WRITE:/ 'fail'.
      ENDIF.
    ENDIF.
    Flat file:
    10001,Sadney
    10003,Yogesh
    20005,Madan
    1.U need to define internal table with one field of max size
    2.upload the flat file data into that internal table
    3.split that internal table data into another internal table(having fields)
    <REMOVED BY MODERATOR>
    thanks,
    Chandu
    Edited by: Alvaro Tejada Galindo on Apr 30, 2008 12:17 PM

  • Dynamic internal table problem in FM - HR_INFOTYPE_OPERATIONS

    Dear All,
    I have a problem when I use a Dynamic internal table in FM - HR_INFOTYPE_OPERTATION..
    Please suggest me on the way to overcome this problem..
    We wanted to have a dynamic Program for Info type operations which can be used for any info types as we are changing only BEGDA and the related actions
    So in my program I have the parameters to accept
    P_BEGDA - 01.10.2007
    P_INFTY - P0008
    P_ACTIO - COPY
    I am able to create a dynamic table based on the parameters P_INFTY and able to read it also using the FM - HR_READ_INFOTYPE
    BUT when I pass the dynamic internal table to a FM - HR_INFOTYPE_OPERTATION I am getting a DUMP
    The DUMP is at the below statement from FM - HR_INFOTYPE_OPERTATION
    ASSIGN record TO <record> CASTING TYPE (tabname). "XDP UniCode
    It gives the below possiblities
    "ASSIGN_BASE_TOO_SHORT" C 
    "SAPLHRMM" or "LHRMMU03"  
    "HR_INFOTYPE_OPERATION"   
    But If I use the below internal table
    Data : g_t_0008 like P0008 occurs 0 with header line.
    And If I use the internal table g_t_0008 instead of dynamic tables then it works. So I strongly feel it's due to not having a header in the dynamic table below see below the sample code on how I am generating a dynamic internal table
    field-symbols: <dyn_table> type standard table.
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    to get the srurcute
    perform get_structure using l_f_table.
    perform create_dynamic_itab .
    assign dy_table->* to <dyn_table>.
    perform get_data tables <dyn_table01>
                      using pernr-pernr p_infty.
    below are the forms routine….
    form get_structure using p_table.
    data : idetails type abap_compdescr_tab,
           xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    clear : ifc[], dy_table.
    Get the structure of the table.
      ref_table_des ?=
          cl_abap_typedescr=>describe_by_name( p_table ).
      idetails[] = ref_table_des->components[].
      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.
        append xfc to ifc.
      endloop.
    endform.
    form create_dynamic_itab.
    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.
    endform.
    *&      Form  get_data
    form get_data  tables   p_table
                   using    p_pernr
                            p_infty.
    clear : p_table, p_table[].
      CALL FUNCTION 'HR_READ_INFOTYPE'
           EXPORTING
                PERNR           = P_PERNR
                INFTY           = p_infty
                BEGDA           = p_datum
                ENDDA           = p_datum
           TABLES
                INFTY_TAB       = p_table
           EXCEPTIONS
                INFTY_NOT_FOUND = 1
                OTHERS          = 2.
      CHECK SY-SUBRC EQ 0.
    IF lines( p_table ) GT 0.
    *write :/'Record exist' , 'IT', p_infty.
    clear p_table.
    PERFORM hr_operation tables  p_table
                         using  g_t_t588d-actio g_t_t588d-INFTY
                                g_t_t588d-SUBTY.
    else.
    PERFORM append_status using g_t_itab-pernr p_infty ' '
                                'Error' 'No records'.
    ENDIF.
    endform.                    " get_data
    form hr_operation  tables    p_table
                       using     p_actio P_INFTY P_SUBTY.
    data: l_f_return    LIKE bapireturn1.
    ASSIGN COMPONENT 'BEGDA' OF STRUCTURE p_table TO <l_field>.
          <l_field> = p_begda.
            CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                infty         = P_infty
                number        = G_T_ITAB-PERNR
                subtype       = P_subty
                validityend   = g_f_endda
                validitybegin = P_datum
                record        = P_TABLE
                operation     = p_actio
              IMPORTING
                return        = l_f_return.
    IF sy-subrc NE 0.
    ENDIF.
    ENDFORM.

    try
    using field symbol for a wrk area instead of Field symbol for a table
    loop your inernal table (again a field symbol) assigning to <fs_wrkarea>
    in loop call HR_INFO.._OP..
    reward if helpful

  • Smartform loop into internal table problem

    hello experts,
    i am doing an example given in **************** regarding smartforms. I am getting problem which doing the smartforms . please help me.
    http://****************/Tutorials/Smartforms/SFMain.htm
    in that i am doing the program
    Working with loop.
    I have done exactly as the screen shots in the program.
    Now in the main window i created a loop.
    in that loop i am not getting the option internal table.
    But it is showing as operand . It is in the data tab of the loop.
    I searched the all the tabs in the loop but did not find the option  internal table.
    so then i ticked the operand and i did as speified in the screen shots.
    it_tab into fs_tab
    Then i created a text and then placed &fs_tab-vbeln& etc.
    then i executed the smartform now in the output i am not getting the sales order number , item etc.
    The output is showing like
    &fs_tab-vbeln&     &fs_tab-posnr&   etc.
    please guide me how to get the internal table option in  the loop. And also tell me how to rectify this problem

    thanks for all the replies.
    I will give all  at the time of closing my thread.
    Hi Sravanthi -> in loop node i am not getting the internal table insted of that i am getting operand in the data tab.
    This is my main problem.I dont why operand is comming there.
    my version is 4.7e
    Hi Karthik and swati -> i simply hard coded the statements in the text as shown in the example.
    Now i will try with the add field.
    But please tell me why i am not getting internal table option in loop.

  • Internal table problem

    Hi Friends,
    I am not an expert in ABAP, but I seem to have a weird problem with the following piece of code. When I uncomment the write statement in the first loop code and execute, it actually displays values for
    itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zhr, itab_zsel-zvar_log.
    But
    when I have the code exactly as shown below, it displays just the itab_zsel-zdate1, itab_zsel-ztime1 and not itab_zsel-zvar_log
    Can you tell me wht is wrong with this code?
    itab_log and itab_sel are internal tables
    loop at itab_log.
    loop at itab_zsel where zdate1 = itab_log-zbatchdate and zhr = itab_log-zhrmin.
      itab_zsel-zvar_log = itab_log-zlogid.
    modify table itab_zsel.
    *write:/ itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zhr, itab_zsel-zvar_log.
    endloop.
    endloop.
    loop at itab_zsel.
    write:/ itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zvar_log.
    endloop.
    Thank you

    Hi Deepthi,
      I did not understand what you are trying to do,
    but try this and see if it helps
    loop at itab_log.
    clear lw_tabix.
    lw_tabix =sy-tabix.
    read table itab_zsel with key zdate1 = itab_log-zbatchdate zhr = itab_log-zhrmin.
    if sy-subrc = 0.
    itab_zsel-zvar_log = itab_log-zlogid.
    modify itab_zsel index lw_tabix.
    *write:/ itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zhr, itab_zsel-zvar_log.
    endif.
    endloop.
    loop at itab_zsel.
    write:/ itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zvar_log.
    endloop.
    Regards,
    Ravi

  • Dynamic ALV Internal table Problem

    Hi all,I have successfully built an IT using method 'create_dynamic_table'.But my problems are :
    1)When Iam trying to select the data with multiple tables then it is short dumping.
    2)I tried to oselect the data using one table,after selecting the data if I use FM REUSE_ALV_Grid_Display then it is showing short dump with error 'type conflict when calling FM'.
    I never used field symbols before.PLZ complete my program or give me suffecient feedback.Here is my program :
    DATA : g_tdref TYPE REF TO data,
           g_wdref TYPE REF TO data.
    DATA : dats LIKE vbbe-mbdat,
           t_fieldcat TYPE lvc_t_fcat,
           wa_fieldcat TYPE lvc_s_fcat.
    FIELD-SYMBOLS : <it_dyn> TYPE STANDARD TABLE,
                    <wa_dyn>,
                    <dyn_field>.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_mbdat FOR dats.
    SELECTION-SCREEN END OF BLOCK blk1.
    wa_fieldcat-tabname = 'MSKA'.
    wa_fieldcat-fieldname = 'WERKS'.
    wa_fieldcat-datatype = 'CHAR'.
    wa_fieldcat-intlen = '10'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    wa_fieldcat-tabname = 'MSKA'.
    wa_fieldcat-fieldname = 'MATNR'.
    wa_fieldcat-datatype = 'CHAR'.
    wa_fieldcat-seltext = 'Material Number'.
    wa_fieldcat-intlen = '18'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    wa_fieldcat-tabname = 'MAKT'.
    wa_fieldcat-fieldname = 'MAKTX'.
    wa_fieldcat-datatype = 'CHAR'.
    wa_fieldcat-intlen = '10'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    wa_fieldcat-tabname = 'VBBE'.
    wa_fieldcat-fieldname = 'MBDAT'.
    wa_fieldcat-datatype = 'CHAR'.
    wa_fieldcat-intlen = '10'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    wa_fieldcat-tabname = 'VBBE'.
    wa_fieldcat-fieldname = 'OMENG'.
    wa_fieldcat-datatype = 'QUAN'.
    wa_fieldcat-intlen = '10'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    DATA : d TYPE i,
           v(02) TYPE n VALUE '0',
           day(8) TYPE c.
    d = s_mbdat-high - s_mbdat-low + 1.
    DO d TIMES.
      v = v + 1.
      CONCATENATE 'Day' v INTO day.
      wa_fieldcat-tabname = 'VBBE'.
      wa_fieldcat-fieldname = day.
      wa_fieldcat-datatype = 'DATS'.
      wa_fieldcat-seltext = day.
      wa_fieldcat-intlen = '8'.
      APPEND wa_fieldcat TO t_fieldcat.
      CLEAR : wa_fieldcat.
    ENDDO.
    *-----Building Dynamic internal table.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = t_fieldcat
      IMPORTING
        ep_table        = g_tdref.
    ASSIGN g_tdref->* TO <it_dyn>.
    CREATE DATA g_wdref LIKE LINE OF <it_dyn>.
    ASSIGN g_wdref->* TO <wa_dyn>.
    SELECT m~werks m~matnr v~omeng v~mbdat INTO CORRESPONDING FIELDS
    OF TABLE <it_dyn> FROM mska AS m INNER JOIN vbbe AS v
    ON m~posnr = v~posnr WHERE v~mbdat IN s_mbdat.

    *DATA : d TYPE i,
          v(02) TYPE n VALUE '0',
          day(8) TYPE c.
    *d = s_mbdat-high - s_mbdat-low + 1.
    *DO d TIMES.
    v = v + 1.
    CONCATENATE 'Day' v INTO day.
    wa_fieldcat-tabname = 'VBBE'.
    wa_fieldcat-fieldname = day.
    wa_fieldcat-datatype = 'DATS'.
    wa_fieldcat-seltext = day.
    wa_fieldcat-intlen = '8'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    *ENDDO.
    *-----Building Dynamic internal table.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = t_fieldcat
      IMPORTING
        ep_table        = g_tdref.
    ASSIGN g_tdref->* TO <it_dyn>.
    CREATE DATA g_wdref LIKE LINE OF <it_dyn>.
    ASSIGN g_wdref->* TO <wa_dyn>.
    SELECT OMENG FROM VBBE INTO CORRESPONDING FIELDS OF TABLE <IT_DYN> WHERE MBDAT IN S_MBDAT.
    BREAK-POINT.
    YOU WILL GET VALUES IN INTERNAL TABLE.
    TO SOLVE YOUR ISSUE YOU SHOULD USE NUM INSTEAD OF DATS.

  • Internal Table - logic for Chunk

    Hi,
    I have an internal table with n records.
    I want to use at a time say max of 20 records .
    This is calling a BDC.
    i.e.
    loop at n record.
    take 20 records.
    call BDC.
    then next set of recrds.
    repeat process till all records processed.
    Thanks in Advance.
    Amit

    Hi,
    try this way.
    data: count type i.
    loop at table
      if count LE 20.
        add 1 to count.
      else.
        clear count.
        call bdc.
        "refresh all the concerned tables and variables for the next 20 records.
      endif.
    endloop.
    Or.
    loop ...
    WHILE count le 20.  
       ADD 1 TO count.
    ENDWHILE.                   
        clear count.
        call bdc.
        "refresh all the concerned tables and variables for the next 20 records.
    endloop
    Regards.
    Marcelo Ramos

  • Create internal table dynamically for IDoc fields

    Hi,
    I need to create an internal table dynamically based on the segment field names that are returned in the table pt_fields when calling function 'IDOCTYPE_READ_COMPLETE'.  I see many posts suggesting classes such as 'cl_wrf_dynamic_table=>create_dynamic_table', but it does not work for me.  The problem I have with the classes is that it doesn't allow you to have the same column name more than once.  But in the scenario I am testing, I have some column names that are duplicated, and I cannot remove the duplicates.  Are there any functions or classes that I can use to create a dynamic internal table that will not check if a column name is used twice?
    Thanks,
    Carrie

    Hello Carrie
    My first thought was that RTTI might be able to do this but it does not (see the dump below). And it is obvious that RTTI behave likes this.
    Error analysis
        An exception occurred which is explained in detail below.
        The exception, which is assigned to class 'CX_SY_STRUCT_COMP_NAME', was not
         caught and
        therefore caused a runtime error.
        The reason for the exception is:
        Multiple Specification of the Name 'CUSTOMER' as a Component Name (Component 7)
    Just think about any way  to define statically an itab or structure containing duplicated field names. You will always get a syntax error irrespective of whether you use a DDIC structure, a TYPE or a DATA variable.
    If there is no way to define such a structure statically why should it be different when defining dynamically?
    Regards
      Uwe

  • How to select perticular row in table control for BDC

    Hi all
    I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is  material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
    Please Suggest me. it urgent.
    Thanks& Regards,
    RP

    Hi all
    I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is  material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
    Please Suggest me. it urgent.
    Thanks& Regards,
    RP

  • Urgent...simple internal table problem

    Hi gurus
    i am filling a internal table like this
    loop at i_0001 into s_0001.
    clear out_final.
    out_final-pernr = s_0001-pernr.
    out_final-parea = s_0001-parea.
    loop at i_0021 into s_0021 where pernr = s_0001-pernr and subty ne '7'.
    perform rec1.
    endloop.
    loop at i_0106 into s_0106 where pernr = s_0001-pernr and subty ne '7'.
    perform rec2.
    append out_final to i_final.
    clear out_final.
    endloop.
    and my performs are
    FORM rec1.
    read table i_0021 into s_0021 with key pernr = s_0001-pernr.
    out_final-fname = s_0021-fname.
    out_final-lname = s_0021-lname.
    out_final-bdate = s_0021-bdate.
    ENDFORM.                    " rec1
    FORM rec2.
    read table i_0106 into s_0106 with key pernr = s_0001-pernr.
    out_final-ssn = s_0106-ssn.
    out_final-add1 = s_0106-add1.
    out_final-add2 = s_0106-add2.
    out_final-city = s_0106-city.
    out_final-state = s_0106-state.
    out_final-country = s_0106-country.
    out_final-zip = s_0106-zip.
    out_final-hphone = s_0106-hphone.
    ENDFORM.                    " rec2
    all my declerations and syntax are correct
    now i have 2 simple things to ask
    1. when i write data i get duplicate records ....is my loop , clear and append are in right place
    2. i wan to delimit this data for a condition where bdate is greater than 18. bdate is of type p0021-fgbdt which i have to format using some FM....how do i do that where do i have to add code for that.
    thanks in advance
    plz help
    regards

    Hi,
      Check the below code.
    loop at i_0001 into s_0001.
    clear out_final.
    out_final-pernr = s_0001-pernr.
    out_final-parea = s_0001-parea.
    <b>*****loop at i_0021 into s_0021 where pernr = s_0001-pernr and subty ne '7'.</b>
    perform rec1.
    <b>***endloop.
    ****loop at i_0106 into s_0106 where pernr = s_0001-pernr and subty ne '7'.</b>perform rec2.
    <b>if not out_final is initial.</b>
    append out_final to i_final.
    <b>endif.</b>
    clear out_final.
    endloop.
    and my performs are
    FORM rec1.
    read table i_0021 into s_0021 with key pernr = s_0001-pernr
                                                             <b>subty ne '7'.</b>
    <b>if sy-subrc = 0.</b>
    out_final-fname = s_0021-fname.
    out_final-lname = s_0021-lname.
    out_final-bdate = s_0021-bdate.
    <b>endif.</b>
    ENDFORM. " rec1
    FORM rec2.
    read table i_0106 into s_0106 with key pernr = s_0001-pernr
                                                             <b>subty ne '7'.</b>
    <b>if sy-subrc = 0.</b>
    out_final-ssn = s_0106-ssn.
    out_final-add1 = s_0106-add1.
    out_final-add2 = s_0106-add2.
    out_final-city = s_0106-city.
    out_final-state = s_0106-state.
    out_final-country = s_0106-country.
    out_final-zip = s_0106-zip.
    out_final-hphone = s_0106-hphone.
    <b>endif.</b>
    ENDFORM. " rec2
    <b></b><b></b>
    Hope this will solve ur duplication problem

  • Populating Empty Fields for Existing Internal Table Using For All Entries

    I have an internal table called itab_extract that populates without any issues in SELECT A and SELECT B below. Trying to avoid looping, I am using select DB table 'for all entries' in itab_extract. I want the empty fields in itab_extract to populate from the values in the database. However, about 200,000 entries are being appended to the table, and, the values that existed for the already populated fields in itab_extract are gone, and the new fields are populated.
    I've played with the syntax and cannot seem to get it to work. My next option is a time consuming loop.
    How should the for all entries syntax look to accomplish filling the empty fields in the itab?   Thank-You
    *read ekko
        select ebeln lifnr aedat bsart from ekko                                                     *SELECT A*
               into  CORRESPONDING FIELDS OF TABLE me->itab_extract
               where aedat in r_aedat.
        select ebeln lifnr aedat BSART from ekko                                                  *SELECT B*
               appending CORRESPONDING FIELDS OF TABLE me->itab_extract
               where aedat in S_DATE2 AND
                     BSART IN S_BSART.
          select ebelp werks matnr                                                                           *SELECT C*
            into CORRESPONDING FIELDS OF TABLE itab_extract
            from ekpo
            FOR ALL ENTRIES IN itab_extract
            where ebeln = itab_extract-ebeln.

    Hi Tom,
               This SQL statement will be time consuming, Do not use a loop.
    There are two options.
    1. Select EKKO and EKPO details based on standard SAP view. (You can type EKKO in se11 view to find the correct view).
        also use one range table populate r_aedat and s_date2 in the same. So you where condition will have r_newrange and   
        s_bsart. Also do not use into corresponding fields, it is not a good idea. It will increase your performance. Maintain the proper 
        sequence (Based on database structure of EKKO and EKPO)
    2. If you are keen to use for all entries, then first select ekko then after your sy-subrc check get the data from EKPO.
    Should be like this.
    select ebeln bsart aedat lifnr from ekko into table gt_ekko where aedat in r_newrange and bsart in s_bsart.
    if sy-subrc eq 0.
    sort gt_ekko by ebeln ascending.
    select ebeln ebelp werks matnr  into table gt_ekpo for all entries in gt_ekko where ebeln eq gt_ekko-ebeln.
    endif.
    Hope it helps,
    Best Regards,
    Tapodipta Khan.

  • How to use dynamic internal table with FOR ALL ENTRIES

    Hello SDNers,
    I am having a dynamic internal table & want to use FOR ALL ENTRIES(FAE) using this dyn. table.
    This works fine for me:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE ztable
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE (lv_dynwhere). "lv_dynwhere -> dynamic where clause
          ENDIF.
    SAP documentation says:
    "The logical expression sql_cond of the WHERE condition can be comprised of several logical expressions using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one comparison with a column of the internal table itab that can be specified statically or dynamically. "
    How do we specify the column of the internal table dynamically ? Can we do something like this:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE key_field1 = (dynamic token for column1 of <lt_tmp>)
                           key_field2 = (dynamic token for column2 of <lt_tmp>)
          ENDIF.
          ENDIF.
    Let me know if i am not clear about my requirement.
    BR,
    Suhas

    Hello Thomas,
    What i meant was something like this:
    WHERE key_field1 = ('<LT_TMP-COL1>') AND
          key_field2 = ('<LT_TMP-COL2>')
    I am confused by what SAP means with "dynamic representation of internal table columns" in FAE ?
    @Rob: I was referring to SAPNW 7.0 documentation & the phrase (release 6.40 & higher) is missing. Anyways fyi i am on ECC5.0 ABAP release 6.40.
    @Subhankar: This is what Marcin had proposed in For all entries and dynamic table.
    Thanks,
    Suhas
    Edited by: Suhas Saha on Apr 6, 2010 11:53 AM

  • Internal table handling for table controls

    hi,
    can any one say me how we manage to store one header data and more than one line item data in one internal table. pls provide me one example with code.
    thanks,

    You need to make sure that table t_open_summ contains only the data for PO =xxxx matnr=xxx to begin with. I.e. when that table is filled in, just don't put any other data there. Then all the corresponding scrolling code (Page Up/Down) will work as usual.
    As an alternative, you could create a "clone" of t_open_summ and work with it instead.

  • How to delete entries in an internal table except for one entry

    Hi all,
    I have 4 records in my internal table and I need to delete all the  records in the internal table except the last one.How do i do this?Any sample code?
    Thanks.
    Moderator message - Please do not ask or answer basic questions - thread locked
    Edited by: Rob Burbank on Dec 16, 2009 3:23 PM

    Hi,
      use following logic:
    DATA: lt_itab type standard table.
    DATA: l_lines type i.
    DESCRIBE TABLE lt_itab lines l_lines.
    l_lines = l_lines - 1.
    delete lt_itab from 1 to l_lines.
    Regards,
      Karol

  • Import   internal table problem

    Hi..
      I have 2 programs with me.
    In the first program my code is like this
    REPORT  Y_TEST1.
    DATA:
      BEGIN OF FS_DATA,
        NUMBER   TYPE I,
        NAME(30) TYPE C,
      END OF FS_DATA.
    DATA:
      T_DATA LIKE STANDARD TABLE OF FS_DATA.
    DEFINE APPEND_TABLE.
      FS_DATA-NUMBER = &1.
      FS_DATA-NAME = &2.
      APPEND FS_DATA TO T_DATA.
      CLEAR FS_DATA.
    END-OF-DEFINITION.
    APPEND_TABLE 1 'HARISH'.
    APPEND_TABLE 2 'MAHESH'.
    APPEND_TABLE 3 'SURESH'.
    APPEND_TABLE 4 'WAJID'.
    APPEND_TABLE 5 'SANKAR'.
    APPEND_TABLE 6 'SATISH'.
    APPEND_TABLE 7 'CHANDU'.
    APPEND_TABLE 8 'VEERESH'.
    EXPORT T_DATA TO MEMORY ID 'NAM'.
    SUBMIT Y_TEST1_CALLED.
    And my Second Program code is ..
    REPORT  Y_TEST1_CALLED.
    DATA:
        FS_DATA(30).
    DATA:
    T_DATA LIKE STANDARD TABLE OF FS_DATA.
    IMPORT T_DATA FROM MEMORY ID 'NAM' . ******ERROR
    LOOP AT T_DATA INTO FS_DATA.
      WRITE: / FS_DATA.
    ENDLOOP.
    These are the programs that i have here in
    second Prog i am getting Shortdump as Types mis match ..
    but according  to my requirement i need to get the data into itab t_data without changing structure of the internal tables ,
    here I need to use any of options in IMPORT
    { { { {[ACCEPTING PADDING] [ACCEPTING TRUNCATION]}
            | [IGNORING STRUCTURE BOUNDARIES] }
            [IGNORING CONVERSION ERRORS [REPLACEMENT CHARACTER rc]] }
        | [IN CHAR-TO-HEX MODE] }
        [CODEPAGE INTO cp]
        [ENDIAN INTO endian].
    what i need to use and how ......
    i think correct option is IGNORING CONVERSION ERRORS but it is giving syntax error ..can any one send me the proper code and my system is ECC 5.

    Hi Pasupulati,
    Please try it in this way. I have already done it in my one requirement.
    Hi,
    Please use it in this way,
    *& First Prog----
    data: char4(4) type c.
    EXPORT char4 TO MEMORY ID 'ZOT'.
    *& Other Prog---
    Data: char4(4) type c.
    IMPORT char4 FROM MEMORY ID 'ZOT'.
    Once you get the output.
    Then Free the Memory
    syntax is:
    Free memory id 'ZOT'.

Maybe you are looking for

  • Error while schedulingg update stat in db13

    Dear Experts, Please look into my issue we are facing an error while scheduling update statistics in db13 and I tried to open detailed log It is given SXPG_COMMAND_EXECUTE failed for BRTOOLS - Reason: program_start_error: For More Information, See SY

  • Material Description in different language

    Hi Expertsl We have to show material description on the label. As of now the label description is displaying in English. Material description is also maintained in a language calledd 'Z1'. So the present requirement is as below 1. If the material des

  • Accessing a file in a jar

    I'm writing a program that I am packaging into a jar. There is a data file that I would like to include in the package, that the program needs to access. In the jar, I have two folders: src > ... > code data > donationsList.txt Here is the code that

  • Result of Agent resultion doesnot agree with agents of task

    Hi, i am getting the following error for Zdecission task Result of Agent resultion doesnot agree with agents of task . This may be due to possible agents for task. where i need to do possible agents classification for task.

  • DHCP Relay Cisco SG500X

    Hi,  I've create 2 vlan in a cisco SG500X-24 and a DHCP server on vlan 2. I just want to dhcp server assign ip to devices on vlan 3. I've configured the vlan and dhcp server relay commands. ip dhcp relay address 192.168.1.11 ip dhcp relay enable ip d