Ho to read intern table in update rule?

Hello experts,
I have the following start routine:
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line  -
TABLES: /BIC/AZD_ODS_C00.
DATA: ITEM_TABLE TYPE STANDARD TABLE OF /BIC/AZD_ODS_C00
      WITH HEADER LINE
      WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
DATA: gv_flag type c.
$$ end of global - insert your declaration only before this line   -
$$ begin of routine - insert your code only below this line        -
fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
to make monitor entries
SELECT * FROM  /BIC/AZD_ODS_C00 INTO TABLE ITEM_TABLE.
SORT ITEM_TABLE BY /BIC/ZABOOKID ASCENDING.  
       LOOP AT ITEM_TABLE.
        AT NEW /BIC/ZABOOKID.
        GV_FLAG = 'X'.
        ENDAT.
       ENDLOOP.
if abort is not equal zero, the update process will be canceled
  ABORT = 0.
How can I read intern table ITEM_TABLE in a update rule?
And will gv_flag be still available in update rule?
thanx
hiza
Message was edited by:
        Hiza
Message was edited by:
        Hiza

Hi,
I am just giving you a sample code which I had used
just try to read this will help you
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line  -
TABLES: ...
DATA:   ...
$$ end of global - insert your declaration only before this line   -
The follow definition is new in the BW3.x
TYPES:
  BEGIN OF DATA_PACKAGE_STRUCTURE.
     INCLUDE STRUCTURE /BIC/CSZRINF001.
TYPES:
     RECNO   LIKE sy-tabix,
  END OF DATA_PACKAGE_STRUCTURE.
DATA:
  DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
       WITH HEADER LINE
       WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
FORM startup
  TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
           MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
           DATA_PACKAGE STRUCTURE DATA_PACKAGE
  USING    RECORD_ALL LIKE SY-TABIX
           SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
  CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line        -
fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
to make monitor entries
break-point.loop at DATA_PACKAGE.if DATA_PACKAGE-/BIC/ZREMPID GE 5.delete DATA_PACKAGE.endif.endloop.
if abort is not equal zero, the update process will be canceled
  ABORT = 0.
$$ end of routine - insert your code only before this line         -
Regards
Rahul

Similar Messages

  • Data package's data coolection in one internal table of Update rule in bw

    Hello Gurus,
    I have a requirement in bw which demands to create update routine, in which I need to find the vendor for the material, which doesn't have vendor by some business rule but, here in this case data is divided into different datapackages so here in this case material data is splited over different datapackages.
    One material can have n no of records with differnt plants.
    My only question is like can we collect all datapackage data in one internal table.
    Ex: if there are total 5 datapckages, so in update rule can we collect all these datapackages records?
    Please suggest your opinion.
    Thanks in advance,
    Snehal.
    Moderator message: please have a look in the BW forums.
    Edited by: Thomas Zloch on Jan 11, 2011 1:49 PM

    hi,
    i think your problem is need of a work area...
    Using "FOR ALL ENTRIES IN lt_zhrp"  You must use " check lt_zhrp is not initial "
    DATA: lt_zhrp TYPE STANDARD TABLE OF zhrp,
          lt_zhrt TYPE STANDARD TABLE OF zhrt.
    *new
    data: wa_zhrp type lt_zhrp.
    SELECT tabnr
    FROM zhrp
    INTO CORRESPONDING FIELDS OF TABLE lt_zhrp
    WHERE objid = lv_posid.
    LOOP AT lt_zhrp INTO wa_zhrp.
      SELECT low
      FROM zhrt
      INTO CORRESPONDING FIELDS OF TABLE lt_zhrt
      WHERE tabnr =  wa_zhrp-tabnr  " lt_zhrp-tabnr
      AND attrib = 'NET_VALUE'.
    ENDLOOP.
    Edited by: Miguel Antunes on Apr 28, 2010 4:22 PM

  • Read internal table with key not equal to

    Hi,
    How can I read internal table with key not equal to some other field.
    Basically in read statement we can read only fields equal to others fields.

    Hi,
    Test the following Code you can Use Loop at for this But not Read Table
    DATA: BEGIN OF it_test OCCURS 10,
      f1(4),
      f2 TYPE i,
      f3(2),
      END OF it_test.
    DATA: it_test2 LIKE STANDARD TABLE OF it_test WITH HEADER LINE.
    it_test-f1 = '1000'.
    it_test-f2 = 10.
    it_test-f3 = 'B'.
    APPEND it_test TO it_test.
    it_test-f1 = '2000'.
    it_test-f2 = 10.
    it_test-f3 = 'A'.
    APPEND it_test TO it_test.
    it_test-f1 = '1000'.
    it_test-f2 = 10.
    it_test-f3 = 'B'.
    APPEND it_test TO it_test.
    it_test-f1 = '1000'.
    it_test-f2 = 10.
    it_test-f3 = 'A'.
    APPEND it_test TO it_test.
    it_test-f1 = '1000'.
    it_test-f2 = 40.
    it_test-f3 = 'A'.
    APPEND it_test TO it_test.
    LOOP AT it_test INTO it_test WHERE f3 NE 'A'.
      WRITE: / it_test-f1, it_test-f2, it_test-f3.
    ENDLOOP.
    Kind Regards,
    Faisal

  • Read internal table from report.

    Hi all.
    I want to know is it possible to read internal table from report without modifying the report. is there any function module by which we can run the report and read data from internal table?
    Thanks.

    hi
    hope it will help you.
    <REMOVED BY MODERATOR>
    Read table doesn't allow ne operator.
    It reads only one record...Either by index or key.
    READ TABLE MY_TAB INDEX 1.
    READ TABLE MY_TAB WITH KEY CODE = 'ATG'.
    these are the results for SY-SUBRC checks after read table
    SY-SUBRC = 0:
    An entry was read.
    SY-TABIX is set to the index of the entry.
    SY-SUBRC = 2:
    An entry was read.
    SY-TABIX is set to the index of the entry. This return code can only occur when you use the COMPARING addition. For further detauls, refer to the COMPARING section of the additions
    SY-SUBRC = 4:
    No entry was read.
    The value of SY-TABIX depends on the table type and whether the BINARY SEARCH addition was specified.
    If the table is a SORTED TABLE or a table sorted in ascending order of the type STANDARD TABLE with the BINARY SEARCH addition, SY-TABIX refers to the next-highest index.
    Otherwise, SY-TABIX is undefined.
    SY-SUBRC = 8:
    No entry was read.
    This return code only occurs with a SORTED TABLE or a STANDARD TABLE with the BINARY SEARCH addition. SY-TABIX is set to the number of all entries plus 1.
    Reading records with keys
    http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm
    Reading lines with Index
    http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3730358411d1829f0000e829fbfe/content.htm
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 5:43 PM

  • Reading internal tables

    Hi all
    i am using internal table itab1,
    i want to add the similar contents of itab1 from itab2 into itab3
    how to do it?
    thanks
    raghvendra bhanap

    Hi,
    This is a documentation regarding reading internal tables.
    Hope this will be useful...
    When the size of the record or the number of records in the internal table is large, doing a linear search is time consuming. It is always a good practice to search a record by binary search (Always Sort the table before doing a binary search). The difference is felt especially in the production environment where the live data is usually huge. As of release 4.0 there are new types of internal tables like SORTED and HASHED which can be effectively used to further reduce the search time and processing time.
    e.g.     Do not use the following statement:-
    Select matnr from mara
    Into table i_mara
    Where matnr in s_matnr.
         Select matnr werks from marc
              Into table i_marc
              For all entries in i_mara
              Where matnr eq i_mara-matnr.
         Loop at I_mara.
              Read table i_marc with key matnr = I_mara-matnr.
         Endloop.
    Instead use the following statement:-
         Select matnr from mara
              Into table i_mara
              Where matnr in s_matnr.
                                       Select matnr werks from marc
                                            Into table i_marc
                                            For all entries in i_mara
                                           Where matnr eq i_mara-matnr.
                                       Sort I_marc by matnr.
                                       Loop at I_mara.
                                            Read table i_marc with key
    matnr = I_mara-matnr
    binary search.
                                       Endloop.
    It is a good practice to search records from internal tables using a binary search. But extreme caution needs to be applied as it may either increase the time or may cause run time termination if it is not sorted.
    Always the sort the internal table by the required keys before performing a binary search.                                                                               
    e.g.     Do not use the following statement:-
    Select matnr from mara
    Into table i_mara
    Where matnr in s_matnr.
         Select matnr werks from marc
              Into table i_marc
              For all entries in i_mara
              Where matnr eq i_mara-matnr.
         Loop at I_mara.
              Read table i_marc with key matnr = I_mara-matnr binary search.
         Endloop.
    Instead use the following statement:-
         Select matnr from mara
              Into table i_mara
              Where matnr in s_matnr.
                                       Select matnr werks from marc
                                            Into table i_marc
                                            For all entries in i_mara
                                           Where matnr eq i_mara-matnr.
                                       Sort I_marc by matnr.
                                       Loop at I_mara.
                                            Read table i_marc with key
    matnr = I_mara-matnr
    binary search.
                                       Endloop.
    It is a general practice to use           Read table <itab>…     This statement populates all the values of the structure in the workarea.
    The effect is many fold:-
    •     It increases the time to retrieve data from internal table
    •     There is large amount of unused data in work area
    •     It increases the processing time from work area later
    It is always a good practice to retrieve only the required fields. Always use the syntax      Read table <itab> transporting f1 f2  …  FN …          If just a check is being performed for existence of a record use      Read table <itab> transporting no fields …
    e.g.     Do not use the following statement:-
    data: i_vbak like vbak occurs 0 with header line.
    data: i_vbap like vbap occurs 0 with header line.
    Loop at i_vbak.
         read table i_vbap with key
    vbeln = i_vbak-vbeln binary search.
         If sy-subrc = 0 and i_vbap-posnr = ‘00010’.
         endif.
    Endloop.
    Instead use the following statement:-
    data: i_vbak like vbak occurs 0 with header line.
    data: i_vbap like vbap occurs 0 with header line.
    Loop at i_vbak.
                                  read table i_vbap transporting posnr with key
    vbeln = i_vbak-vbeln binary search.
                                  If sy-subrc = 0 and i_vbap-posnr = ‘00010’.
                                  endif.
    Endloop.
    There are many ways in which a select statement can be optimized. Effective use of primary and secondary indexes is one of them. Very little attention is paid especially to the secondary indexes. The following points should be noted before writing a select statement:-
    •     Always use the fields in the where clause in the same order as the keys in the database table
    •     Define the secondary indexes in the database for the fields which are most frequently used in the programs
    •     Always try to use the best possible secondary index in the where clause if it exists
    •     Do not have many secondary indexes defined for a table
    •     Use as many keys both primary and secondary as possible to optimize data retrieval
    As of release 4.5 it is now possible to define the secondary index in the where clause using %_HINT.
    e.g.     Do not use the following statement:-
         Assuming a secondary index is defined on the field vkorg in table vbak
         Select vbeln vkorg from vbak
              Into table i_vbak
              Where vbeln in s_vbeln.
         Loop at i_vbak.
              Case i_vbak-vkorg.
              When ‘IJI1’.
              When ‘IJI2’.
              Endcase.
         Endloop.
    Instead use the following statement:-
                                       Select vbeln vkorg from vbak
                                            Into table i_vbak
                                            Where vbeln in s_vbeln and
                                                 Vkorg in (‘IJI1’,’IJI2’).
                                       Loop at i_vbak.
                                            Case i_vbak-vkorg.
                                            When ‘IJI1’.
                                            When ‘IJI2’.
                                            Endcase.
                                       Endloop.

  • 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

  • How to read internal table other program (assign?)

    Hello techies,
    The problem >
    I have 2 Sap standard programs A & B
    I'm editing a userexit in program B but I need to read
    data from program A that is also running.
    While using the debugger, I can ask for the folowing
           (A)internaltable
            example : (SAPLMEPO)pot
    this shows the content of internal table "pot" of the program "SAPLMEPO".
    The question>
    How can I copy the content of a table(ex. pot) in program "A"(ex. SAPLMEPO) to a internal table pot2 of program "B"?
    Possible sollution (does not work in 5.0)
    CODE SAMPLE *************
    Fields          **
    data: w_name type char50,"help field
          w_recpot like ekpo."help structure
    Internal tables **
    data: Begin of it_pot2 occurs 0.
       include structure it_pot2.
    data: End of it_pot2
    field-symbols <fs_pot> type any table.
    w_structure_name = '(SAPLMEPO)pot'.
    assign (w_structure_name) to <fs_pot>.
    loop at <fs_pot> into w_recpot.
    it_pot2 = w_recpot.
    append it_pot2
    Endloop.
    END CODE SAMPLE *************
    Thanks in advance,
    Frederik

    Hi again,
    1. Simple.
    2. In your case, u should use
      <b>[]</b>
      DATA : myitab LIKE TABLE OF t001 WITH HEADER LINE.
      DATA : w_struct_name(100) TYPE c.
      BREAK-POINT.
      FIELD-SYMBOLS <fs_pot> TYPE ANY TABLE.
    <b>  w_struct_name = '(ZAM_TEMP0)ITAB[]'.</b>
      ASSIGN (w_struct_name) TO <fs_pot>.
    3. No need to use Loop etc.
    4. *----
    In your case
    CODE SAMPLE *************
    Fields **
    data: w_name type char50,"help field
    w_recpot like ekpo."help structure
    Internal tables **
    data: Begin of it_pot2 occurs 0.
    include structure it_pot2.
    data: End of it_pot2
    field-symbols <fs_pot> type any table.
    w_structure_name = '<b>(SAPLMEPO)POT[]</b>'.
    assign (w_structure_name) to <fs_pot>.
    NOT REQUIRED
    *loop at <fs_pot> into w_recpot.
    *it_pot2 = w_recpot.
    *append it_pot2
    *Endloop.
    END CODE SAMPLE *************
    regards,
    amit m.

  • Reading internal table into File Adapter

    Hi,
    I would like to read an internal table from RFC function (sender), and write all the rows into the file by using File Adapter. Here is the scenerio;
    RFC Adapter -> XI -> File adapter
    Internal table content, below;
    FLD1  FLD2   FLD3
    1        A        B
    2        X        Y
    I expect the result, below;
    <?xml version="1.0" encoding="UTF8" ?>
    <rfc:Z_RFC xmlns:rfc="urn:sapcom:document:sap:rfc:functions">
    <ITAB_ZSUBS001>
      <item>
       <FLD1>1</FLD1>
       <FLD2>A</FLD2>
       <FLD3>B</FLD3>
      </item>
      <item>
       <FLD1>2</FLD1>
       <FLD2>X</FLD2>
       <FLD3>Y</FLD3>
      </item>
    </ITAB_ZSUBS001>
    </rfc:Z_RFC>
    I see all the records in payload, but cannot write into file. Anybody have any suggestion? Thank you.
    Regards,
    Orkun Gedik
    Message was edited by:
            Orkun GEDIK

    Hi,
    Thank you for the feedback. From now on I am getting the error, below;
    Error> occured [1] >Thu Apr 05 09:24:21,046<   
    RfcException:
        message: Commit fault: com.sap.aii.af.rfc.afcommunication.RfcChannelMismatchException: Wrong Sender Agreement:The Sender agreement does not have channel Rfc_Fiyat_Sender configured for the functionmodule Z_RFC
        Return code: RFC_CLOSED(6)
        error group: 108
        key: RFC_ERROR_INTERNAL
    Please see the last configuration, below;
    Message mappings:
    RFC Message:
    Messages 1..1
    Message1 1..1
    Z_RFC 1..1
    ITAB_ZSUBS001 1..1
    item 0..unbounded
    TXTKOD 0..1
    TXTAD 0..1
    TXTADDR 0..1
    Message Type: Malzeme
    Messages 1..1
    Message1 1..1
    Malzeme 0..unbounded
    TXTKOD 1..1
    TXTAD 1..1
    TXTADDR 1..1
    Interface mappings:
    Source Interface: Z_RFC Occurrence 1
    Target Interface: MI_MAlzeme_In_Asyn Occurrence 0..unbounded
    I bound the items below;
    item -> Malzeme
    TXTKOD -> TXTKOD
    TXTAD -> TXTAD
    TXTADDR -> TXTADDR
    Also,I refreshed the adapter cache and full cache by using SXI_CACHE and restart the RFC adapter thorugh Visual Admin in order to solve the problem, but it couldn't be a solution for the problem. Do you have any suggestion about it?
    Regards
    Message was edited by:
            Orkun GEDIK

  • Reg - Reading internal table with multiple record in a single field

    Dear Guru's,
                        i want to read a internal table with field having mutilple entries like
    read table READ TABLE LT_T2 INTO LT_T2_WA WITH KEY HKONT IN ( '0001152430', '0001152930', '0001152410' ).
    But it says comma without preceding colon (after READ?).
    please guide me.....
    thanks & Regards,
    Balaji.S

    ya this is inside the loop.
    plz check....
    loop at lt_t2 into lt_t2_wa.
    READ TABLE LT_T2 INTO LT_T2_WA WITH KEY HKONT IN ( '0001152430', '0001152930', '0001152410' ).
    endloop.
    thanks & Regards,
    Balaji.S

  • Reading internal table issue?

    SELECT PERNR WERKS ABKRS BUKRS KOSTL ENAME GSBER FROM PA0001
                INTO TABLE GT_0001
                FOR ALL ENTRIES IN GT_0709
               WHERE PERNR = GT_0709-PERNR
                 AND ENDDA >= P_DATE
                 AND BEGDA <= P_DATE.
             READ TABLE GT_0001 INTO LS_0001 WITH TABLE KEY PERNR = LS_0709-PERNE
             IF SY-SUBRC = 0.
            CALL FUNCTION 'PA03_PCR_READ'
          EXPORTING
            F_ABKRS         = LS_0001-ABKRS
          IMPORTING
            F_CURRENT_BEGDA = GV_BEGINDATE
            F_CURRENT_ENDDA = GV_ENDDATE.
            ENDIF.
    IN THIS CODE WHILE READING THE INTERNAL TABLE IT IS SHOWING ERROR?
    PLEASE CORRECT THE CODE.
    REGARDS
    REDDY

    Hi,
    Please remove 'TABLE' keyword from your syntax.
    Check the datatype of field PERNR & PERNE. It shoud be same.
    Check the value which is in PERNE fied shoud be available in PERNR Field or not?
    Hope by this things you will be able to resolve issue.
    Regards,
    Narendra

  • SELECT-OPTIONS can u use it to read internal table ?????

    Hello All,
       I am trying to read an internal table with the select-options statement. I am getting a syntax error so i am hoping i am just coding it incorrectly. Can someone tell me what is wrong here is the if statement :
    if p_begdte in t_rpt-datab and
           p_enddte in t_rpt-datbi.
        else.
           exit.
        endif.
    thanks scott

    This is not working?
    tables: a916.
    * Beg valid date *
    data text021(29).
    selection-screen begin of line.
    selection-screen comment 1(30) text-021 for field p_begdte.
    selection-screen position 32.
    select-options: p_begdte for a916-datab default '20041101' to
    '99991231'.
    selection-screen end of line.
    * End valid date *
    data text022(29).
    selection-screen begin of line.
    selection-screen comment 1(30) text-022 for field p_enddte.
    selection-screen position 32.
    select-options: p_enddte for a916-datbi default '20041101' to
    '99991231'.
    selection-screen end of line.
    start-of-selection.
    <b>Loop at t_rpt.
    if t_rpt-datab in p_begdte
      and t_rpt-datbi in p_endte.
    * do something
    else.
    exit.
    endif
    Endloop.</b>
    Regards,
    Rich Heilman

  • READ Internal Table

    Hi
      I face many situations where i have to issue a READ statement on an Internal Table where i have to use "<" or ">" operators. READ just allows to use keys with all "=" operators.But at the same time i need to get just one record. I know that READ is to get only one record.
    Any suggestion ?

    Ok if you have exactly pasted your problem  then try this , it will be much more fast . Also see F1 help on read and sy-subrc value , you will get the clue here.
    <i>REPORT ZTEST.
    DATA : BEGIN OF WA_TAB,
           DATE LIKE SY-DATUM,
           TIME LIKE SY-UZEIT,
           AMOUNT TYPE P DECIMALS 2,
    END OF WA_TAB.
    DATA ITAB1 LIKE SORTED TABLE OF WA_TAB WITH UNIQUE DEFAULT KEY WITH HEADER LINE..
    DATA ITAB2 LIKE SORTED TABLE OF WA_TAB WITH UNIQUE DEFAULT KEY WITH HEADER LINE..
    DATA COUNT TYPE I.
    ITAB1-DATE = '20050919'.
    ITAB1-TIME = '010000'.
    ITAB1-AMOUNT = 50.
    APPEND ITAB1.
    ITAB1-DATE = '20050919'.
    ITAB1-TIME = '020000'.
    ITAB1-AMOUNT = 60.
    APPEND ITAB1.
    ITAB1-DATE = '20050919'.
    ITAB1-TIME = '030000'.
    ITAB1-AMOUNT = 70.
    APPEND ITAB1.
    ITAB2-DATE = '20050918'.
    ITAB2-TIME = '021000'.
    APPEND ITAB2.
    LOOP AT ITAB2 .
      READ TABLE ITAB1 WITH KEY DATE = ITAB2-DATE
                                TIME = ITAB2-TIME.
      IF SY-SUBRC = 4 OR SY-SUBRC = 8 .
        COUNT = SY-TABIX - 1 .
      ENDIF.
      IF COUNT GE 1.
        READ TABLE ITAB1 INDEX COUNT .
        MOVE ITAB1-AMOUNT TO ITAB2-AMOUNT.
        MODIFY ITAB2.
        WRTIE ITAB2-AMOUNT.
      ENDIF.
    ENDLOOP.</i>
    Try changing the date and time values in ITAB2 and see the desired result.
    Cheers

  • Read Internal Table based on Multiple Values for Key Field

    Hi Gurus,
    i have one query can you tell me how read an internal table it_kna1 for multiple values of land1 DE US IND etc.
    i had tried as below but i could not can you try and let me knwo at the earliest.
    here i want read the values with DE or US and want further prosess them.
    REPORT  YC001.
    tables kna1.
    select-options: cust for kna1-kunnr.
    data: begin of it_kna1 occurs 0,
            kunnr like kna1-kunnr,
            name1 like kna1-name1,
            land1 like kna1-land1,
            end of it_kna1.
    select kunnr name1 land1 into table it_kna1 from kna1 where kunnr in cust.
    read table it_kna1 with key land1 = ( 'DE' OR 'US' ) .
    can anybody suggest me some solution.
    Thanks,
    Jeevi.

    This should be what you need:
    REPORT ztest NO STANDARD PAGE HEADING LINE-SIZE 80 MESSAGE-ID 00.
    TABLES kna1.
    SELECT-OPTIONS: cust FOR kna1-kunnr.
    DATA: BEGIN OF it_kna1 OCCURS 0,
            kunnr LIKE kna1-kunnr,
            name1 LIKE kna1-name1,
            land1 LIKE kna1-land1,
          END OF it_kna1.
    DATA: itab_index LIKE sy-tabix.
    SELECT kunnr name1 land1
      INTO TABLE it_kna1
      FROM kna1
      WHERE kunnr IN cust.
    SORT it_kna1 BY land1.
    READ TABLE it_kna1 WITH KEY
      land1 = 'DE'
      BINARY SEARCH.
    itab_index = sy-tabix.
    WHILE sy-subrc = 0.
      itab_index = itab_index + 1.
      WRITE: /001 it_kna1-kunnr, it_kna1-land1, it_kna1-name1.
      READ TABLE it_kna1 INDEX itab_index.
      IF it_kna1-land1 <> 'DE'.
        sy-subrc = 99.
      ENDIF.
    ENDWHILE.
    SKIP 1.
    READ TABLE it_kna1 WITH KEY
      land1 = 'US'
      BINARY SEARCH.
    itab_index = sy-tabix.
    WHILE sy-subrc = 0.
      itab_index = itab_index + 1.
      WRITE: /001 it_kna1-kunnr, it_kna1-land1, it_kna1-name1.
      READ TABLE it_kna1 INDEX itab_index.
      IF it_kna1-land1 <> 'US'.
        sy-subrc = 99.
      ENDIF.
    ENDWHILE.
    Rob

  • Need help in reading internal table data

    Hi All,
    I have two internal tables, it_cdhdr and it_cdpos. Data as follows:
    it_cdhdr:
    Objectclass     ObjectId          Changenr         Udate      Change_ind
    EINKBELEG    4500057161    0003273002    20131129    U
    EINKBELEG    4500057161    0003273001    20131129    U
    EINKBELEG    4500057161    0003272995    20131129    U
    EINKBELEG    4500057161    0003178904    20131030    U
    EINKBELEG    4500057161    0003178903    20131030    U
    it_cdpos
    Objectclas       ObjectId          Changenr      Tabname   Fname Value_new Value_old
    EINKBELEG    4500057161    0003178903    EKKO    FRGKE         A                B
    EINKBELEG    4500057161    0003178903    EKKO    FRGZU          X
    EINKBELEG    4500057161    0003178903    EKKO    PROCSTAT    05                03
    EINKBELEG    4500057161    0003178903    EKKO    RLWRT       800.00            0.00
    EINKBELEG    4500057161    0003178904    EKET    MENGE      1000.000         800.000
    EINKBELEG    4500057161    0003178904    EKKN    MENGE       500.000          400.000
    EINKBELEG    4500057161    0003178904    EKKN    NETWR            500.00        400.00
    EINKBELEG    4500057161    0003178904    EKKO    FRGKE          B                 A
    EINKBELEG    4500057161    0003178904    EKKO    FRGZU          X
    EINKBELEG    4500057161    0003178904    EKKO    PROCSTAT    03                 05
    EINKBELEG    4500057161    0003178904    EKKO    RLWRT       1000.00              800.00
    EINKBELEG    4500057161    0003178904    EKPO    BRTWR       1000.00            800.00
    EINKBELEG    4500057161    0003178904    EKPO    MENGE      1000.000           800.000
    EINKBELEG    4500057161    0003178904    EKPO    NETWR      1000.00            800.00
    EINKBELEG    4500057161    0003272995    EKKO    FRGKE        A                       B
    EINKBELEG    4500057161    0003272995    EKKO    FRGZU        X
    EINKBELEG    4500057161    0003272995    EKKO    PROCSTAT    05    03
    EINKBELEG    4500057161    0003273001    EKET    MENGE          2000.000          1000.000
    EINKBELEG    4500057161    0003273001    EKKN    MENGE          1000.000           500.000
    EINKBELEG    4500057161    0003273001    EKKN    NETWR           1000.00            500.00
    EINKBELEG    4500057161    0003273001    EKKO    FRGKE    B    A
    EINKBELEG    4500057161    0003273001    EKKO    FRGZU        X
    EINKBELEG    4500057161    0003273001    EKKO    PROCSTAT    03    05
    EINKBELEG    4500057161    0003273001    EKKO    RLWRT             2000.00             1000.00
    EINKBELEG    4500057161    0003273001    EKPO    AEDAT    20131129    20131030
    EINKBELEG    4500057161    0003273001    EKPO    BRTWR           2000.00           1000.00
    EINKBELEG    4500057161    0003273001    EKPO    MENGE          2000.000          1000.000
    EINKBELEG    4500057161    0003273001    EKPO    NETWR           2000.00           1000.00
    EINKBELEG    4500057161    0003273002    EKKO    FRGKE    A    B
    EINKBELEG    4500057161    0003273002    EKKO    FRGZU    X
    EINKBELEG    4500057161    0003273002    EKKO    PROCSTAT    05    03
    As per requirement, the main focus is on Changes to EKKN and EKPO tables and I have to get the latest changes.
    If you observe in above it_cdpos internal table data, it has two records,
    EINKBELEG    4500057161    0003178904    EKKN    NETWR            500.00        400.00
    EINKBELEG    4500057161    0003178904    EKPO    NETWR      1000.00            800.00
    EINKBELEG    4500057161    0003273001    EKKN    NETWR           1000.00            500.00
    EINKBELEG    4500057161    0003273001    EKPO    NETWR           2000.00           1000.00
    Now I have read only the latest changenr data. Say 0003273001 , in this case.
    My question is how do I know, the latest changenr has EKKN table changes, if you look at it_cdpos data above, the latest one is 0003273002, which doesnt have EKKN changes.
    Kindly let me know how to read latest EKKN or EKPO data from IT_CDPOS table.
    Thanks in advance,
    Rgs,
    Priya

    Hi Priya ,
    I guess your requirement is to find the latest change number ,that has got change in both ekkn and ekkpo .
    1- Sort it_cdhdr descending .
    Loop at it_chdr into w_cdhdr
      read table it_cdpos into w_cdpos with key changenr = w_cdhdr Tabname = ekkn .
       if sy-subrc=0 .
         read table it_cdpos into w_cdpos with key changenr = w_cdhdr Tabname = ekkpo .
           if sy-subrc=0 .
            "use convenient  way to return change number (using varaiable)"
             exit .
           endif .
       endif.
      endloop .
    By this way change number send will be the latest having both ekkn and ekkpo . If what i assumed is wrong ,then sorry for that . 

  • How to read another ODS in update rules

    Hi Experts,
    I have to read another ODS to get the QTY field and update the key fig in my cube.  I want to write the SQL statement as follows
    Select doc_num
              material
              Sum (qty)
    From ODS2
            where doc_num = datapackage-doc_num
                and material = datapackage-material
    Group by
            doc num
            material.
    In ODS2 the data is at the item level and that is why we need to sum it up.  Could someone please send the exact code that I need to write in the update rules.
    Thanks,
    Lokesh

    Hi Reddy,
    Edit the update rules,find the key figure for which you dont want the currency translation and change the translation to "No currency Translation".Then activate the update rules.This will probably resolve your problem.
    Thanks & Regards,
    suchitra.V

Maybe you are looking for

  • Can you move websites published on from a Single User account to Team account?

    Hi All, Need some help we had a single user account with which all our websites were hosted for clients, then we upgraded the whole studio to the Team Package, but need to know if we can cancel the single user licence and move the current live sites

  • Is this possible in CS4? Sharing video links?

    I have used CS4 for a while but nothing very complicated so not sure if this is even possible. What I want to do is build a DVD with several episodes all using the same intro & ending + have a play all button; Like this Start - Episode 1 - Ending Sta

  • Setting up SRM-MDM catalog 2.0 in PI 7.0

    Hi guys, Iu2019m configuring the scenario for SRM-MDM catalog 2.0 and in the IR when I open the configuration scenario SRM_MDM_Catalog I get the following error: u201CSoftware component version with GUID 44345e20-149b-11da-ab19-eb7a0a114c15 does not

  • Oracle9 installation on AIX 6.1

    Hi As a part of Technical Upgrade from 4.7EESR1 to ECC6 EHP4, we need to build a Sandbox System on AIX 6.1 with 4.7EESR1/Oracle9 from AIX 5.1 / 4.7EESR1/Oracle9 system through SystemCopy/Export/Import option on a new Hardware for one of our clients o

  • Plant level P&L/BS reporting

    I am looking for some advice on how to achieve Plant level P&L/BS reporting without having to configure the org structure using one company code per plant. We would like to group multiple plants under one company code and still be able to generate a