Not getting correct Record...

Hi All,
I want to Display Some record from table but i m not getting proper data. in my table there three records but it giving mr only last record..
Tables:mast,stpo,vbap,mara.
  DATA: BEGIN OF struct occurs 100,
    MATNR type VBAP-MATNR,
    END OF struct.
  DATA: BEGIN OF struct1 occurs 100,
        stlnr type mast-stlnr,
        idnrk type stpo-idnrk,
        menge type stpo-menge,
        nlfzt type stpo-nlfzt,
        roms1 type stpo-roms1,
        EXTWG type MARA-EXTWG,
      END OF struct1.
  data: itab4 like VBAP occurs 1 with header line.
  data: itab1 like MARA occurs 1 with header line.
  data: itabstpo like stpo occurs 1 with header line.
  select * from mara into table itab1.
  select * from VBAP into table itab4.
  loop at struct.
  ind = sy-tabix.
  read table itab4 with key vbeln = struct-vbeln.
if sy-subrc = 0.
   move itab4-MATNR to struct-MATNR.
  endif.
  modify struct index ind transporting  matnr.
endloop.
select * from mast into corresponding fields of table struct1 where matnr = struct-matnr and  WERKS = company
            and stlan = '5' .
select * from stpo into table itabstpo.
// this loop is firing three time and data also showing me at breakpoint but at tha time of printing it is giving me only one record..
loop at struct1.
loop at itabstpo where stlnr = struct1-stlnr.
move itabstpo-menge to struct1-menge.
MODIFY struct1 INDEX SY-TABIX.
move itabstpo-nlfzt to struct1-nlfzt.
MODIFY struct1 INDEX SY-TABIX.
move itabstpo-roms1 to struct1-roms1.
MODIFY struct1 INDEX SY-TABIX.
move itabstpo-idnrk to struct1-idnrk.
MODIFY struct1 INDEX SY-TABIX.
endloop.
endloop.
loop at struct1.
  write: / struct1-roms1, struct1-nlfzt ,struct1-menge ,struct1-idnrk.
  endloop.
pls help...
Regards,
yunus

Hi,
  i have seen ur code but it is not clear what exactly u want ; can u please clarify ;
There is no data in struct.
hence ur code is not getting executed.
what u can do it
first insert data into struct that is <b>VBELN</b>
<b>at the 1st loop at struct</b>
what u can do is loop at another itab so u can insert data into struct
Mail me @
[email protected]
Message was edited by: Manoj Gupta
Message was edited by: Manoj Gupta

Similar Messages

  • Info Cube not getting full records

    Hi All,
    I am extracting data from the flat file (60k records..of which most fields have binary values),, am getting the values into data source..but when loading from data source to info cube am not getting total records..
    the load is successful and it is showing as transferred 60k records and added 510 records in the manage tab of the info cube.
    what would be the problem ....any help is appreciated.

    Hi,
    Data with same combination for characterstic is added and only for unique charactersitc value it will give new record.
    Material---Customer-Price
    10002----- C1--
    20
    10002----- C1--
    20
    10002----- C1--
    20
    10002----- C2--
    20
    SO As you can see in flat file 4 records are there but in inofcube it will be only 2
    Data with same combination of charactersitc is added and with unique combo only it will display.
    Hope it clears you.
    Also in addition please check the data in flat file.
    Regards,
    AL

  • Not getting correct Tax calculation - due to "Ship to party region code"

    When we are making Sales order   using (UTXJ cond.)
    Origin Country----
    IN
    Delivering Plant Region----
    24
    Ship To Party region----
    24   (maintained in customer 1 address)                    
    Tax Classification Customer------J
    Tax Classification Material----
    1
    We are getting correct   Tax calculation for tax code AD (4% + 1%)
    But when we are using
    Origin Country----
    IN
    Delivering Plant Region     -
    24
    Ship To Party region----
    06     (maintained for customer 2 address)                     
    Tax Classification Customer------ J
    Tax Classification Material----
    1
    We are not getting correct   Tax calculation for same tax code AD (4 %( JIN2) + 1 %( ZIN2)). Instead we are getting only 1%..

    difference in tax codes used for sales purpose is just the fact that  Ship to party region is different.
    Ship To Party region----
    24   (up)
    Ship To Party region----
    06    (Bihar)
    For 06 it is not calculating correct  values

  • In full update not getting all records

    Dear BW Masters,
    I am working with MM module. Iam using standard extract structure 2LIS_02_ACC
    Iam doing full update. Getting full data 1300 records in to PSA. But getting only 298 in to my ODS. I tried changing fields in to KEY FIELDS AND IN TO DATA FIELDS in my ODS
    But could not get data.
    Pls help me..i have dead line before that i need to complete report on the same.
    Its happening with the other HDR and ITM extractors.
    PLs help me..

    Hi
    Please post the query in relavent forum. (BI)
    You have posted in MM forum for BW help.
    Regards
    Ramakrishna

  • Not getting all records in pagination

    I am also have a problem getting all records in the report as the post on Apr. 21,2004. My reports pagination stops at 500. When I set the 'max row count' to 100000. The pagination at the bottom of my page disapears. When I leave 'max row count' empty, it only goes from 1-500. No way to view records past the 500th record.
    I see there was a post on Apr. 21, 2004 about the same thing but it did not specify a fix or work around or if I'm missing a setting. (also tried the log off/on but did not help).
    *My pagination Scheme is 'Row Ranges 1-15 16-30 in select list(wiht pagination)'
    *My report has 1000+ records.
    Thanks, Paula

    The actual number of rows supported by the select list depends on how many rows you show on each page. If you go with the default of 15 rows, you would be able to use the select list with close to 5000 rows. If you increase the number of rows per page, the select list will work with even more rows.
    If the select list can't be used, it may make sense to consider using the "row ranges with set pagination" style. Set pagination lets you navigate from one set to the next instead of one page to the next, so you can navigate through your result set a lot quicker.
    However the best option for reports with that many rows would be "row ranges x-y", without showing the total number of rows. The reason is that the report renders a lot faster if you don't have the total number of rows calculated. In order to better be able to find certain records, I would recommend a search field on your report page that lets you filter the result set.
    Hope this helps,
    Marc

  • Full update not getting all records from PSA to ODS

    Dear BW Masters,
    I am working with MM module. Iam using standard extract structure 2LIS_02_ACC
    Iam doing full update. Getting full data 1300 records in to PSA. But getting only 298 in to my ODS. I tried changing fields in to KEY FIELDS AND IN TO DATA FIELDS in my ODS
    But could not get data.
    Pls help me..i have dead line before that i need to complete report on the same.
    Its happening with the other HDR and ITM extractors.
    PLs help me..

    Hello,
    Look at this example:
    R/3 Record:
    CustNo | Name | Order | Amount
    1234 | Customer1 | Order 1 | 100
    1235 | Customer2 | Order 2 | 200
    1234 | Customer1 | Order 3 | 300
    If Cust.No is Keyfield, In BW you will get 2 records
    1234
    1235
    If Order No is Key field, you will get 3 records.
    It is not necessary to get the same no of records as they are in R/3.

  • BI Query with Hierarchy in VC does not get correct values

    Hello Gurus,
    I am building a model in VC for Performance Score card using Query as data service.
    I have  the following problem.
    When I execute query in BEx with Hierachy_node variable , it is getting correct values, but the same is getting incorrect values in VC.
    The Hierarcynode variable I am using is a TOP node, then the values including child nodes are also should be displayed, which is working fine with BEx query but not in VC.
    When I execute the query with hierarchy node value as child node I am getting correct values both in VC and in BEx.
    The correct values are not shown only when I use top nodes.
    Please help me in this regard.
    Thanks in advance
    Ganesh

    Hi
    We are facing the same issue. Is this issue resolved? Pls let us know the solution
    Regards
    Aruna

  • Not getting correct values in ODS

    BW gurus
      when i do delta loads for ODS i am getting strange values into my ods.How ever if i do full loads on ods ,i am getting correct values(same values as RSA3).
    1 .Any idea why i am getting wrong values if i do delta   loads .
    2.If i make this ods as full load(currently delta) ,there are already few reports on this ods ,Will there be any effect on those reports?

    Riccardo,Tony
    Thanks for your quick reply.
    I have in ods as follows
    Asset  fisper   qty
      1     006.2006   2
      1     007.2006   3
    Now i have added 2 more assets to period 6
    in RSA3 is ok as follows
    Asset  fisper   qty
      1     006.2006   4
      1     007.2006   3
    In ods with delta load is  not ok as follows
    Asset  fisper   qty
      1     006.2006   9
      1     007.2006   3
    In ods with full load is OK as follows
    Asset  fisper   qty
      1     006.2006   4
      1     007.2006   3
    any advice greatly appreciated

  • CUBE Not getting All records from DSO

    Hi Experts ,
    We have a situation where we have to load data from a DSO to a Cube . The DSO contains only 9 records and while we r loading the data into cube , the cube is only getting 2 records . Thus 7 records are missing. Also The Cube contains more Fields  than DSO. in the transformations , for the extra fields we have written end routine and those extra fields will get data by reading master data .. Any pointers how to get the missing records or what is the error ...
    Sam

    Why multiple threads ????

  • Not getting correct data for newly added field in 0FI_AR_4

    Hi to all,
    I have added SPART field from VBRK table into 0FI_AR_4 datasource .
    Based on join BSID-VBELN = VBRK-VBELN to get SPART from VBRK table.
    but i found that some VBELN are not maintained in VBRK table, But are Present in BSID table, so i am not get SPART for which no
    VBELN maintained in VBRK.
    Please can any one tell me, what condition should i take to get SPART from VBRK to 0FI_AR_4.
    as i knew that only BSID-VBELN = VBRK-VBELN sufficent to get data for SPART.
    or any different condition i required.
    I shall be thankful to you for this.
    Regards
    Pavneet Rana

    Thanks for reply,
    i have written code for that like that.
    SELECT SINGLE * FROM VBRK
    WHERE VBELN = <fs_d>-VBELN .
    if sy-subrc = 0.
    <FS_D>-SPART = VBRK-SPART.
    endif.
    ENDLOOP.
    according to it result are not capturing all SPART from VBRK. as it only matches the VBELN which are same in both VBRK and BSID table.
    so how to get SPART from VBRK if same VBELN is not maintained in both tables.
    Please can you tell me CODE for that.
    I shall be thankful to you for this.
    Regards
    Pavneet Rana
    Edited by: pavneet rana on Feb 1, 2011 4:53 AM

  • COHV not get correct production order

    Hi
        I get a odd case...
        CO40 convert the planned order into production order  and get correct user defined status profile..
        COHV convert the planned order into production order but miss the user defined status profiel...
    btw,I use the same production order type in both COHV/CO40...
        It seems there is a bug in COHV..Do you have any suggestion?thanks..
    COHV:
    Function   Convert planned order
    Execute Function  Execute function in the backgournd /Execute function immediately
    Order type:PP01(the same as the one in CO40.PP01 has a user defined status profile)
    Collective Order:Convert entire collective order

    Hi,
        Any one know how to configure COHV for Planned order conversion and confirmation for backflush ?thanks
    hi,i finally get the solution..thanks everyone...OPJ2..
    Edited by: Monst Yang on Oct 30, 2011 11:21 PM

  • Select List field in Form not pulling correct record

    I have a report that displays a Product Name and a Host Name. Each product can reside on multiple hosts and each host has multiple products, hence an associative table with product_host_asgmt_id, product_id and host_id is defined.
    The report I created selects data from the associative table and presents the user the product names and host names without a problem. the same report has an edit link that when selected will open a form that should display the selected host name and product name. In the form both of these fields are defined as Select List. The issue is that the list shows all the LOV but does not focus on the one that was selected in the report to edit.
    I unhid the product_host_asgmt_id, product_id and host_id in the form and the values contained are correct, so I think the Automated Row Fetch is working. This same form needs to be used for editing and for creating new values hence the Select List.
    I I have the Source section of the Host_name select list field set to : Only when current session state is null and the Source Type is an SQL query selecting all host_name form the host table.
    Any ideas how to get the values selected in the report to appear in the form?
    Thanks and apologize if this is trivial. I'm a rookie Apex user (but I like it).

    When you link to the form page, I assume you are passing the host_id value into a page item. Say you pass this value into item P2_HOST_ID, just make the select list item's Source Type Item (application or page item name) and enter P2_HOST_ID in the Source field.
    This assumes that the lov query is of the form "select host_name d, host_id r from ...".
    Be careful with Source Used "Only, ..." so that you never allow the page to display with a stale and unwanted value in P2_HOST_ID or that will produce an incorrect display value in the select list.
    Scott
    P.S. Please tell us your first name and put it into your handle and/or profile to help us.

  • 2LIS_02_ITM not feting correct records.

    For the datasource 2LIS_02_ITM ,
    In RSA7 , Delta queue .- Its showing one entry for 2LIS_02_ITM with total - 73 , Is total shows the no. of records in Delta queue ?
    When i run the infopackage then in PSA it showing only 32 records get updated.
    I think it should be - 73 , pls correct me ?
    Thanks

    Hello Ram,
    Thanks for a good Answers.
    I just would like to make a concept. Pls help me in this refrence.
    Assume i have a new data source. and i ran init on it.
    and from setup table there is 800 records. and it fetch these record sucessfully.
    Then I ran delta and it fetch 100 new records. - 100 records.
    So if i see the data source in RSA3 then - What will be show if i select update mode as -
    D =
    F =
    Also is the delta request will be avilable in Delta queue also ?
    Thanks

  • Am not getting correct status of IDOC after using MASTER_IDOC_DISTRIBUTE FM

    Hi,
    Am triggering an out bound custom IDOC by using my_custom_FM for sales orders. With in my_custom_FM am calling standard FM 'MASTER_IDOC_DISTRIBUTE' and distributing custom IDOC. If IDOC got failed I have to send an error message to SAP inbox (am achieving this, explicitly by using a standard FM). But, immediately after executing FM MASTER_IDOC_DISTRIBUTE, i checked the IDOC status in 'communication_idoc_control' parameter, its saying '30'(am keep on refreshing EDIDS table and WE05), even though IDOC went well. After am completely coming out from debugging the status has changed to '03' in EDIDS and WE05!
    1) Let me know how to get the correct status of IDOC immediately after executing the FM MASTER_IDOC_DISTRIBUTE (because, in next line am calling my message sending FM based on IDOC status).
    2) Or do i need to place my message sending FM some where else?
    Thank you

    Thank you.
    Unfortunately this is happening in an UPDATE task, still as a trial i tried to use COMMIT WORK, as expected it thwon a dump. Also tried only with DEQUE_ALL, no use.
    Are you sure that I can process the subsequent step/block of code(calling error message sending FM to SAP inbox) based on SY-SUBRC of MASTER_IDOC_DISTRIBUTE FM, not based on the IDOC STATUS?
    Because, just as trial, i have given a junk value(say, XXXXXX) for Message type in IDOC control, just before triggering the MASTER_IDOC_DISTRIBUTE FM.......but, still am getting SY-SUBRC = 0!! with a status of 29. Hence am thinking to do not relay on SY-SUBRC=0, sorry if am wrong
    Should i put my code of (calling error message sending FM) in any user-exit?
    Thank you

  • % is not getting correctly for the Grand Total Row in OBI10g

    Hi,We have a report in table view with the following structure.
    Name     Target     Act     %Ach
    ABC     100     50     50
    XYZ     200     10     5
    Total     300     60     27.5
    The value for the %Ach Total row should be 20% but in the report it is showing as 27.5.
    any one observed this ,how to correct this??
    Thanks

    Hi,
    To get grand total correctly..configure instanceconfig.xml and put..
    <ReportAggregateEnabled>true</ReportAggregateEnabled> between <serverinstace>..
    refer..
    http://obiee101.blogspot.com/2009/09/obiee-grand-totals-with-calculated.html
    Hope it solves ur problem

Maybe you are looking for