Loop at Conditions within internal table

I have not been ABAPing long so primarily have been using keyword help...
I am trying to loop round an itab and only select and process unique keys from within the table!
However the table I am using to obtain the records has multiple records with the same reference and I am only interested in each unique occurrence of the IBASE_COMPONENT_GUID field.
So there could be four items for one Appliance and four for another one. So of the eight records, I would only need to loop round and select the unique GUIDS.
So there would only be two unique appliances I need to extract the records for.
Basically I am trying to do something like this:
    LOOP AT GT_ITEM_DATA INTO GS_ITEM_DATA WITH UNIQUE KEY IBASE_COMPONENT_GUID.
Is there a way to select each unique occurrence?

Basically, I use the COLLECT statement when I need to get the unique field (character only) field from the internal table.
Create a table with only one field, GUID.
LOOP through your main table, assign its GUID to new table's field GUID
Use COLLECT new_table.
Other option is,
Sort the table by GUID
Loop through it and use AT NEW GUID or AT END OF GUID
Fill out the table with this GUID.
Regards,
Naimesh Patel

Similar Messages

  • Loop using index read ( internal table)

    Hi,
    I thought of impelementing loop at ITAB using read statements, Here it goes.
    REPORT Z_LOOP_IMPROVE.
    DATA : T_OUTPUT TYPE STANDARD TABLE OF MARC WITH HEADER LINE,
    L_TABIX TYPE SY-TABIX.
    DEFINE ILOOP.
    DO.
    IF SY-INDEX EQ '1'.
    READ TABLE &1 WITH KEY &2 = &3 BINARY SEARCH.
    IF SY-SUBRC <> 0.
    EXIT.
    ENDIF.
    ELSE.
    L_TABIX = SY-TABIX + 1.
    READ TABLE &1 INDEX L_TABIX.
    IF SY-SUBRC NE 0 OR &1-&2 NE &3.
    EXIT.
    ENDIF.
    ENDIF.
    END-OF-DEFINITION.
    DEFINE IENDLOOP.
    ENDDO.
    END-OF-DEFINITION.
    DATA : T1 TYPE I, T2 TYPE I.
    SELECT * FROM MARC INTO TABLE T_OUTPUT.
    SORT T_OUTPUT BY WERKS.
    GET RUN TIME FIELD T1.
    ILOOP T_OUTPUT WERKS '0001'.
    WRITE : / T_OUTPUT-MATNR, T_OUTPUT-WERKS.
    IENDLOOP.
    GET RUN TIME FIELD T2.
    T2 = T2 - T1.
    WRITE : / T2.
    *C----
    But sadly it takes more time than a normal loop with
    where condition.
    can anyone suggest some ideas to improve execution speed?

    You can use a binary read to get the first record. Then read each record sequentially until you have proccessed all the records that meet your critera. You will have to have the internal table sorted so that the binary search and subsequent reads will work:
          READ TABLE itab WITH KEY
            field = whatever
            BINARY SEARCH.
          IF sy-subrc = 0.
            itab_index = sy-tabix.
            DO.
              IF sy-subrc = 0.
                IF itab_data-field = whatever
                  itab_index = itab_index + 1.
                  READ TABLE itab_data INDEX itab_index.
                ELSE.
                  EXIT.
                ENDIF.
              ELSE.
                EXIT.
              ENDIF.
            ENDDO.
          ENDIF.
    Rob

  • Loop fields in an internal table

    Dear experts,
    I have a scenario where I have an internal table (created in an end routine) c of felds that are both characteristics and key figures. I would like to do is to modify this table so that I keep the value of the charactersitics but I set the value of all the key figures to 0. How can I acomplish this and what is the best way? Is there for example a way to loop all the fields in the work area when I am looping though the internal table and then dependant on the data type, set the key figues = 0?
    Thanks!
    -Cathrin

    Hi Cathrin,
    It will not be possible to set the key figures to zero based on data type.
    You will have to set each key figure in the loop.
    Example:
    LOOP ITAB INTO WA_ITAB.
        WA_ITAB-KEYFIGURE1 = 0.
        WA_ITAB-KEYFIGURE2 = 0.
        MODIFY ITAB FROM WA_ITAB.
    ENDLOOP.
    Regards,
    Hemant Khemani

  • Looping over fields from internal table

    In a FM I have to check records of two ITABs against each other. Most fields can be checked 1:1 but some must be checked according to some business logic.
    I first want to check field-by-field and then I want to deal with exceptions.
    Question: How can I loop over fields in an ITAB in such a manner that I can compare fields?

    Hi, you can loop thru the columns(fields) of an internal table like so.
    field-symbols: <fs>.
    loop at itab.
    do.
    * Here you can use the field name instead of SY-INDEX
       assign component sy-index of structure itab to <fs>.
       if sy-subrc <>.
       exit.
       endif.
    * Now that you have access to the field via field symbol, you can compare
    * this value.
    Write:/ <fs>.
    enddo. 
    endloop.
    Regards,
    Rich Heilman

  • Loop break in an Internal table

    Hello,
    I have an internal table with many vendors and each vendor may have multiple line items. Now if a line item has incorrect data then that vendor shudnt get created and move on to the next vendor..As i show here
    v1,12,ea,3444
    v1,12,ea,3445
    v1,12,ea,3446
    v2,12,ea,3448
    v2,12,ea,3447
    If 3445 is incorrect then I shud move on to next vendor v2..How do i do this in an internal table.
    Thanks
    Viky

    Hi,
    You can make use of the AT control statements, something like this:
    Loop at itab.
    Check if the line item is ok.
    IF OK.
      flag = Y.
    ELSE.
      CONTINUE.
    ENDIF.
    AT END OF <vendor>.
    check flag = Y.
    Send vendor details.
    ENDAT.
    Endloop.
    Hope this helps,
    Sumant.

  • Distinct records based on condition within a table

    Hello PL/SQL Gurus/experts,
    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
    I have following table -
    Note - Table don't have any primary key on Order_ID -
    DROP TABLE T;
    create table T(Order_ID,Active_Flg) as select
    '201002', 'Y' from dual union all select
    '201002', '' from DUAL union all select
    '201003', '' from dual union all select
    '201004', 'Y' from DUAL union all select
    '201004', '' from dual union all select
    '201005', '' from DUAL ;I want to fetch those Order_ID which have Active-Flg as NULL and don't have the entry for Active_Flg=Y
    If use the following then it returns the distinct Order_ID but not the expected one -
    SELECT DISTINCT ORDER_ID FROM T WHERE ACTIVE_FLG IS NULL;Result -
    ORDER_ID
    201004
    201002
    201003
    201005Kindly help.....

    try this
    with t as
    select
    '201002' order_id, 'Y' active_flg from dual union all select
    '201002', '' from DUAL union all select
    '201003', '' from dual union all select
    '201004', 'Y' from DUAL union all select
    '201004', '' from dual union all select
    '201005', '' from DUAL
    select order_id
      from (
              select
                order_id,
                active_flg,
                count(case when active_flg =  'Y' then 1 end) over(partition by order_id) cntY
              from t
    where cntY = 0 and active_flg is null

  • Insert into internal table

    Hi Experts,
    I am new comer to ABAP, have some very important task to be done, need help from all of you. I have a program which displays the results(inform about the infocubes). I want to insert the output of this prgm into an internal table, I am looking lot into the documentation, but so far not much help and i am not able to execute it. And one more task, I want to join this internal table and one database table and get the result, my question is , Is it possible to join this internal table and database table based on some common field.
      Any help will be of grt help
    Thanks,
    Hem.

    Hi,
    For joining internal table with database table,you need to write the logic as below.
    This is the pseudo code.
    select * from database into table itab2 where condition.
    loop at itab1 into wa1.
       move-corresponding wa1 to wa3.
       loop at itab2 into wa2 where field = wa1-field.
        move-corresponding wa2 to wa3.
       endloop.
       append wa3 to itab3.
    endloop.
    1. select the required data from database table into internal table.
    2. loop the first internal table which you already have.
    3. Based on the key fields in these two internal tables[database],place the condition in READ or LOOP statement for the second internal table inside the loop of the first internal table.
    4. If there are more records in second internal table for a single record in first internal table,then use LOOP the second internal table within the first internal table.Otherwise, read the second internal table within the first internal table.
    5.Then move the corresponding fields from both the internal tables inside the loop to third internal table.Append the record to the third internal table.
    Hope it helps.
    Regards,
    J.Jayanthi

  • Inner join on internal table

    HI all,
    How to access data from two internal table using join condition ?
    suppose i have tow internal table itab and jtab and i want to access data by using inner join on this tow table.
    please tell .
    thanx..

    hi,
    You can use PROVIDE ENDPROVIDE statements in ABAP to achive this.
    Check the below documenttaion.
    PROVIDE
    Syntax
    PROVIDE FIELDS {*|{comp1 comp2 ...}}
                   FROM itab1 INTO wa1 VALID flag1
                   BOUNDS intliml1 AND intlimu1
                   [WHERE log_exp1]
            FIELDS {*|{comp1 comp2 ...}}
                   FROM itab2 INTO wa2 VALID flag2
                   BOUNDS intliml2 AND intlimu2
                   [WHERE log_exp2]
            BETWEEN extliml AND extlimu
            [INCLUDING GAPS].
    ENDPROVIDE.
    Effect
    The statements PROVIDE and ENDPROVIDE define a loop through a statement block. In this loop, any number of internal tables itab1 itab2 ... are processed together. A single table can appear several times. For every table itab you must specify a FIELDS clause. After FIELDS you must specify the character * for all components or a list comp1 comp2 ... for specific components of the relevant table. The names of the components comp1 comp2 ... can only be specified directly.
    To be able to process internal tables using PROVIDE, all tables itab1 itab2 ... must be fully typed index tables and contain two special columns that have the same data type (d, i, n, or t) for all relevant tables. For every table you must specify the names intliml1 intliml2 ... and intlimu1 intlimu2 ... of these columns using the addition BOUNDS.
    The columns intliml1 intliml2 ... and intlimu1 intlimu2 ... in every row of the relevant internal tables must contain values that can be interpreted as limits of closed intervals. Within a table, the intervals specified in these columns must not overlap and must be sorted in ascending order. The intervals therefore make up a unique key for every row.
    For every table you must specify a work area wa1 wa2 ... compatible with the row type and a variable flag1 flag2 ..., for which a character-type data type with length 1 is expected. In the PROVIDE loop, the components specified after FIELDS are filled with values in the relevant work areas wa1 wa2 ... for every specified internal table. The variables flag1 flag2 ... are also filled. A work area wa1 wa2 ... or a variable flag1 flag2 ... cannot be specified more than once.
    With the BETWEEN addition you must specify an interval extliml, extlimu. It must be possible to convert the data objects extliml and extlimu into the data types of the respective columns intliml1 intliml2 ... and intlimu1 intlimu2 ... of the individual tables.
    The interval limits intliml1 intliml2 ... and intlimu1 intlim2 for every row of all relevant internal tables itab1 itab2 ... that are within the closed interval made up by extliml and extlimu divide the latter into new intervals and every interval limit closes one interval in the original direction. If, within a relevant table, a lower interval limit follows an upper interval limit with no space or gap between them and the components of the corresponding rows specified after FIELDS have the same content, the two intervals are combined and the corresponding interval limits intliml1 intliml2 ... and intlimu1 intlimu2 ... are ignored for the new intervals.
    For every interval that is created in such a way and overlaps with at least one of the intervals of a table involved, the PROVIDE loop is passed once. The components of every work area wa1 wa2 ... specified after FIELDS and the variables flag1 flag2 ... are filled with values as follows:
    The components intliml1 intliml2 ... and intlimu1 intlimu2 ... of every work area wa1 wa2 ... are filled with the interval limits of the current interval.
    If the current interval overlaps with one of the intervals of an involved table, the remaining components of the corresponding work area are assigned the contents of the relevant components of this table row and the variable flag1 flag2 ... is set to the value "X". Otherwise, the work area components and the variables flag1 flag2 ... are set to their Initial value.
    Except for intliml1 intliml2 ... and intlimu1 intlimu2 ..., the components not specified after FIELDS are always set to their initial value. The components intliml1 intliml2 ... and intlimu1 intlimu2 ... are always assigned.
    The ABAP runtime environment checks for every table involved, whether the condition of sorted and non-overlapping intervals is met within the interval made up by extliml and extlimu and, if necessary, triggers an exception that can be handled.
    If the INCLUDING GAPS addition is specified, the system passes the PROVIDE loop for every interval, that is also when the current interval does not overlap with at least one of the intervals of an involved table. In the latter case, the variable flag is of initial value for every relevant table.
    You can use the WHERE addition to specify a condition for every table itab1 itab2 ... involved. After WHERE, you can specify any logical expression log_exp1 log_exp2 ... ; the first operand of every comparison must be a component of the internal table. As such, all logical expressions except for IS ASSIGNED, IS REQUESTED, and IS SUPPLIED are possible. You can only specify components that are in the list after FIELDS. Here it is not possible to specify a component using character-type data objects in brackets. The table entries for which the condition is not met are ignored by the PROVIDE loop. You can leave the PROVIDE loop following the instructions in the section Leaving loops.
    System fields
    The system fields sy-subrc and sy-tabix are set to the value 0 before every loop pass and at ENDPROVIDE. Only if the loop is not passed once, is sy-subrc set to 4 at ENDPROVIDE.
    Notes
    The relevant internal tables should not be modified in the PROVIDE loop.
    The WHERE condition can be used to remove overlaps between the tables involved or to ensure the sorting of the intervals.
    In two tables itab1 and itab2, the respective columns col1 and col2 are interval limits of type i. The filling of the internal tables results in the following intervals (rows two and three):
    |01|02|03|04|05|06|07|08|09|10|11|12|13|14|
    |   Itab1 Int1    |     |Itab1 Int2 |     |
    |        |      Itab2 Int1       |        |
    |  |          ... BETWEEN ...             |
    |  | i1  |   i2   | i3  |   i4   |i5|     |
    The interval specified in the BETWEEN addition to the PROVIDE statement is shown in the fourth row. It serves as a basis for the five intervals in the fifth row represented by i1 to i5. These can be processed in the PROVIDE loop.
    Because each of the five intervals overlaps with one of the intervals from rows two and three, the PROVIDE loop is passed five times.
    Only the component col3 of wa1 is filled in the first pass, only the component col3 of wa2 in the third pass, and the components col3 of both work areas in the second and fourth passes. The fields valid1 and valid2 are set accordingly.
    DATA: BEGIN OF wa1,
            col1 TYPE i,
            col2 TYPE i,
            col3 TYPE string,
          END OF wa1.
    DATA: BEGIN OF wa2,
            col1 TYPE i,
            col2 TYPE i,
            col3 TYPE string,
          END OF wa2.
    DATA: itab1 LIKE STANDARD TABLE OF wa1,
          itab2 LIKE STANDARD TABLE OF wa2.
    DATA: flag1(1) TYPE c,
          flag2(1) TYPE c.
    wa1-col1 = 1.
    wa1-col2 = 6.
    wa1-col3 = 'Itab1 Int1'.
    APPEND wa1 TO itab1.
    wa1-col1 = 9.
    wa1-col2 = 12.
    wa1-col3 = 'Itab1 Int2'.
    APPEND wa1 TO itab1.
    wa2-col1 = 4.
    wa2-col2 = 11.
    wa2-col3 = 'Itab2 Int1'.
    PROVIDE FIELDS col3 FROM itab1 INTO wa1
                                   VALID flag1
                                   BOUNDS col1 AND col2
            FIELDS col3 FROM itab2 INTO wa2
                                   VALID flag2
                                   BOUNDS col1 AND col2
            BETWEEN 2 AND 14.
      WRITE: / wa1-col1, wa1-col2, wa1-col3, flag1.
      WRITE: / wa2-col1, wa2-col2, wa2-col3, flag2.
      SKIP.
    ENDPROVIDE.
    The list output is as follows:
       2           3  Itab1 Int1 X
       2           3
       4           6  Itab1 Int1 X
       4           6  Itab2 Int1 X
       7           8
       7           8  Itab2 Int1 X
       9          11  Itab1 Int2 X
       9          11  Itab2 Int1 X
      12          12  Itab1 Int2 X
      12          12
    Exceptions
    Catchable Exceptions
    CX_SY_PROVIDE_INTERVAL_OVERLAP
    Cause: In one of the involved tables there are overlapping intervals within extlim1 and extlim2.
    Runtime Error: UNCAUGHT_EXCEPTION
    CX_SY_PROVIDE_TABLE_NOT_SORTED
    Cause: One of the involved tables is not sorted in ascending order by the intervals within extlim1 and extlim2.
    Runtime Error: UNCAUGHT_EXCEPTION
    Edited by: Velangini Showry Maria Kumar Bandanadham on Apr 28, 2008 1:36 PM

  • How to count no of line present in internal table depending on condtion.

    Hi,
    I want to count no of line present in one internal table.
    For example: I have an internal table with output tax line item
    lwa_gt_alv-ty_auste_ep consider this internal table having 100 lines
    depending on the condition copany code(BUKRS), Year(GJAHR), and Document number(BELNR).
    I want to count the number of line present for above mentioned condition in internal table lwa_gt_alv-ty_auste_ep.
    Kindly help as soon as possible.
    Thanks and best regards,
    Niteesh Rai

    Hello
    So, count into exist loop/endloop:
    data: counter type i.
    loop at itab.
    * do anything here ...
      if BUKRS = " condition for bukrs here
      and GJAHR = " condition for gjahr here
      and BELNR = " condition for belnr here
        counter = counter + 1.
      endif.
    * do anything here ...
    endloop.
    write counter.
    Also you may to try other way:
    data: counter type i.
    data: itab1 like itab occurs 0.
    itab1[] = itab[].
    delete itab1 where BUKRS NE " condition for bukrs here
                   and GJAHR NE " condition for gjahr here
                   and BELNR NE " condition for belnr here
    describe table itab1 lines counter.
    write counter.

  • Reading the data from field symbol internal table //

    Hi,
    There are 2 internal tables defined as Fieldsymbols (type any) and I need to retrive data from second internal table based on a field value in first internal table.
    Let's assue the name internal table 1 is <it_itab1>, 2nd internal table name is <it_itab2> and the work areas are <wa_itab1> and <wa_itab2>.
    The existing logic :
    LOOP at <it_itab1> ASSIGNING <wa_itab1>.
      ASSIGN COMPONENT 'XYZ' OF STRUCTURE <wa_itab1> TO l_field6.
      LOOP AT <it_itab2> ASSIGNING <wa_itab2>.
        ASSIGN COMPONENT 'XYZ' OF STRUCTURE <wa_itab2> TO <p_field7>.
        IF <p_field7> = l_field6.
    do the required business.
        ELSE.
          *     do the required business.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    The requirement of reading second internal table was achieved by putting loop on the internal table but its giving considerable effect on performance !!
    Is there any way to use READ statement in my case OR any way of putting WHERE condition on loop statement of second internal table ??
    Thank you !!

    Use the below Logic.
    Loop at Itab1 into wa_itab1.
        Loop at itab2 into wa_itab2 where p_field7 = wa_itab1-xyz or I_field6.
    do the required business.
        endloop.
        Loop at itab2 into wa_itab2 where p_field7 <> wa_itab1-xyz or I_field6.
    do the required business.
        endloop.
    endloop.
    Hope it is useful...

  • What are the internal table events

    hi experts
    can u help me for this

    Hi ramesh,
    There are basically internal table events are as below...
    at first / endat
    at last / endat
    at new / endat
    at end of / endat
    sum
    on change of / endon
    Use the at first and at last statements to perform processing during the first or last loop pass of an internal table.
    Use the at new and at end of statements to detect a change in a column from one loop pass to the next. These statements enable you to execute code at the beginning and end of a group of records.
    Use the sum statement to calculate totals for the rows of a control level.
    Another statement you can use to perform control break processing is on change of. It behaves in a manner similar to at new.
    on change of differs from at new in the following respects:
    It can be used in any loop construct, not just loop at. For example, it can be used within select and endselect, do and enddo, or while and endwhile, as well as inside get events.
    A single on change of can be triggered by a change within one or more fields named after of and separated by or. These fields can be elementary fields or field strings. If you are within a loop, these fields do not have to belong to the loop.
    When used within a loop, a change in a field to the left of the control level does not trigger a control break.
    When used within a loop, fields to the right still contain their original values; they are not changed to contain zeros or asterisks.
    You can use else between on change of and endon.
    You can use it with loop at it where . . ..
    You can use sum with on change of. It sums all numeric fields except the one(s) named after of.
    Any values changed within on change of remain changed after endon. The contents of the header line are not restored as they are for at and endat.
    <b>Reward Points if it useful....</b>
    Thanks and Regards
    Sreenivasa sharma k.

  • Getting the last record from the internal table

    When we use a READ statement it always picks up the first record which fulfill its condition but in my case I want to pick up the last record that fulfills it condition
    I have a internal table like
    id     type
    N1      A
    N1      T
    N1      A
    N1      6 ----> LAST RECORD
    my code is
    read table itab wIth key id = netobjid.
    for eg if netobjid = N1 , then I want to read the last record that corresponds to N1 ie ID N1 TYPE - 6...
    How to do that?

    HI
    actually i have done same requirement like this ...
    Take  one count variable into your internal table ..you pass the number of records into cont variable for every time  u enter the loop .
    Sort the internal table with count variable descending . ( AS we cant sort the internal table with sy-tabix)
    Then use read statement with sy-index = 1 .
    USe below logic ,............
    data  :  count  type i value '0'.
    LOOP at int .
    count = count + 1 .
    endloop.
    sort int count descending .
    read int  with  index = 1 .

  • Edit Internal Table for Sales Order Smartform (Y640_SDORC_A)

    I want to modify SmartForm Y640_SDORC_A so I always print the net value and discount percentage.
    I have an access sequence and my discount can be created by a discount percentage condition (ZD00) or by Special Price (PR01) condition.
    My problem is that if I use the Special Price Condition the Internal Table where the smartform loops to get the price only gets the Net Value amount, and it wont print the discount percentage, but if I dont use the Special Price condition the internal value has 2 rows the first one is for Discount Condition and the second for Net Value and it prints correctly.
    This is how my access secuence is arranged, the X are the print id column:
    PR00 Price
    ZD00 Discount      (X)
    PR01 Special Price
    --- Net Value    (X)
    How can I fix the internal table creation so when there is a Special Price Condition (PR01) the internal table also gets the Discount percentage value.
    Here is my Forms Code:
    *&      Form  GET_ITM_PRICE_TABLE
    FORM get_itm_price_table
    USING
    is_vbdpa             TYPE vbdpa
    is_vbdka             TYPE vbdka
    iv_price_print_mode  TYPE c
    iv_spras             TYPE spras
    CHANGING
    ct_komv              TYPE t_komv_tab
    ct_komvd             TYPE t_komvd_tab
    cs_komk              TYPE komk.
      DATA ls_komp TYPE komp.
      DATA ls_komk TYPE komk.
    *  DATA lt_tkomv  TYPE STANDARD TABLE OF komv.
      IF ls_komk-knumv NE is_vbdka-knumv OR
      ls_komk-knumv IS INITIAL.
        CLEAR ls_komk.
        ls_komk-mandt = sy-mandt.
        ls_komk-kalsm = is_vbdka-kalsm.
        ls_komk-kappl = 'V'.
        ls_komk-waerk = is_vbdka-waerk.
        ls_komk-knumv = is_vbdka-knumv.
        ls_komk-knuma = is_vbdka-knuma.
        ls_komk-vbtyp = is_vbdka-vbtyp.
        ls_komk-land1 = is_vbdka-land1.
        ls_komk-vkorg = is_vbdka-vkorg.
        ls_komk-vtweg = is_vbdka-vtweg.
        ls_komk-spart = is_vbdka-spart.
        ls_komk-bukrs = is_vbdka-bukrs_vf.
        ls_komk-hwaer = is_vbdka-waers.
        ls_komk-prsdt = is_vbdka-erdat.
        ls_komk-kurst = is_vbdka-kurst.
        ls_komk-kurrf = is_vbdka-kurrf.
        ls_komk-kurrf_dat = is_vbdka-kurrf_dat.
      ENDIF.
      ls_komp-kposn = is_vbdpa-posnr.
      ls_komp-kursk = is_vbdpa-kursk.
      ls_komp-kursk_dat = is_vbdpa-kursk_dat.
      IF is_vbdka-vbtyp CA 'HKNOT6'.
        IF is_vbdpa-shkzg CA ' A'.
          ls_komp-shkzg = 'X'.
        ENDIF.
      ELSE.
        IF is_vbdpa-shkzg CA 'BX'.
          ls_komp-shkzg = 'X'.
        ENDIF.
      ENDIF.
      IF iv_price_print_mode EQ 'A'.
        CALL FUNCTION 'RV_PRICE_PRINT_ITEM'
          EXPORTING
            comm_head_i = ls_komk
            comm_item_i = ls_komp
            language    = iv_spras
          IMPORTING
            comm_head_e = ls_komk
            comm_item_e = ls_komp
          TABLES
            tkomv       = ct_komv
            tkomvd      = ct_komvd.
      ELSE.
        CALL FUNCTION 'RV_PRICE_PRINT_ITEM_BUFFER'
          EXPORTING
            comm_head_i = ls_komk
            comm_item_i = ls_komp
            language    = iv_spras
          IMPORTING
            comm_head_e = ls_komk
            comm_item_e = ls_komp
          TABLES
            tkomv       = ct_komv
            tkomvd      = ct_komvd.
      ENDIF.
      cs_komk = ls_komk.
    ENDFORM.                    "get_itm_price_table
    Regards,
    Carlos

    Turns out this can be done modifiying access sequence.
    Carlos

  • Need to update Ztable from final internal table

    Hi,
    ITAB   = Final internal table has 9 fields : 1 2 3 4 5 6 7 8 9
    Ztable = Ztable has 6 fields ex : 1 3 4 6 7 8
    Structure of both Itab and Ztable are different.
    I have data in the Final Internal table and needs to update data into a ztable.
    If condition is true...
      Modify ztable from itab
    endif.
    Any suggestions how I can update Ztable from the INternal table
    Regards,
    Kittu

    Hello,
    First keep the loop to the final internal table then move all the records to the work area after moving to workarea then create another workarea for the Ztable then move only the field values which are there in Ztable then use modify keyword.
    example
    move:
    y_wa_final_itab-kdauf to y_wa_zhr_item-vbeln,
    y_wa_final_itab-kdpos to y_wa_zhr_item-posnr,
    y_wa_final_itab-receiptno to y_wa_zhr_item-receiptno
    modify zhr_item from y_wa_zhr_item

  • CLEAR INTERNAL TABLE

    IN WHICH CONDITION CLEAR INTERNAL TABLE,APPEND INTERNAL TABLE  STATEMENT IS USED?

    hi,
    Normally we use clear statement immediately after using append statement... so as to clear the header of internal table ..
    loop at itab.
      itab1-field1 = itab-field.
      append itab1.
      clear itab1.
    endloop.

Maybe you are looking for

  • Shopping cart Approval preview in SRM

    Hi Experts, I have an issue in SRM Shopping Cart Approval Overview. Now in Shopping Cart approval overview, displaying the positions of the agents. But i want to display names of the agents in case of positions. Please help me to solve this issue. Re

  • My Apple ID was renamed

    Why my Apple ID was renamed?

  • SEEBURGER AS2 Adapter Security

    Hello, I am running into an issue on the install of the SEEBURGER AS2 Adapter.  We currently have other AS2 communication software in place, which are in our DMZ for security purposes. However, we do not want to put our SAP XI server in the DMZ becau

  • Oracle Performance Management doubts

    Hi All, I have some questions related to Oracle performance management and hope they will get answered over here:- Que1. The weight of all objective should be 100 but in my case it is allowing any value. What I need to do to restrict it? Que2. Can we

  • The Answer + 1

    I know I'm a relative newbie, but this just cost me two hours of troubleshooting an application sync issue that didn't exist.  Can somebody please tell me why this is returning a count that's one higher than the actual number of users in the group?