Program does not fetch desired results

I need to enhance a master data datasource with additional fields STPRS, PEINH from MBEW table and WAERS (currency for STPRS) from T001 table. Table T001 and MBEW table have no fields in common. So I took an indirect approach to this.I have a program for enhancing a BW DataSource in R/3. Here is the code:
types: begin of zty_waers,
       bukrs type bukrs,
       waers type waers,
       bwkey type bwkey,
       end of zty_waers.
data: zit_waers type standard table of zty_waers,
      wa_waers like line of zit_waers.
DATA : it_temp type standard table of biw_marc_s,
       wa_temp like line of it_temp,
       S_INDEX TYPE SY-TABIX,
       z_index type sy-tabix.
DATA : BEGIN OF ITAB_MBEW OCCURS 0,
       MATNR TYPE MATNR,
       BWKEY TYPE BWKEY,
       STPRS TYPE STPRS,
       PEINH type PEINH,
       WAERS type WAERS,
       END OF ITAB_MBEW.
data: wa_mbew like line of itab_mbew.
DATA: BEGIN OF ITAB_CEPC OCCURS 0,
      PRCTR LIKE CEPC-PRCTR,
      KOKRS LIKE CEPC-KOKRS,
      DATBI LIKE CEPC-DATBI,
      SEGMENT LIKE CEPC-SEGMENT,
      END OF ITAB_CEPC.
select abukrs awaers b~bwkey into table zit_waers
       from t001 as a inner join t001k as b on
          abukrs = bbukrs.
IF NOT I_T_DATA[] IS INITIAL.
  IT_TEMP[] = I_T_DATA[].
  SELECT MATNR BWKEY STPRS PEINH FROM MBEW INTO TABLE ITAB_MBEW FOR ALL ENTRIES IN IT_TEMP
  WHERE MATNR = IT_TEMP-MATNR and BWKEY = IT_TEMP-WERKS.
  SELECT PRCTR KOKRS DATBI SEGMENT FROM CEPC INTO TABLE ITAB_CEPC FOR ALL ENTRIES IN IT_TEMP
  WHERE PRCTR = IT_TEMP-PRCTR AND KOKRS = IT_TEMP-KOKRS AND DATBI = '99991231'.
  ELSE.
  EXIT.
  ENDIF.
loop at itab_mbew into wa_mbew.
z_index = sy-tabix.
read table zit_waers into wa_waers with key bwkey = wa_mbew-bwkey.
if sy-subrc = 0.
wa_mbew-waers = wa_waers-waers.
endif.
modify itab_mbew from wa_mbew transporting waers.
endloop.
  sort itab_mbew by matnr.
  loop at i_t_data into wa_temp.
    s_index = sy-tabix.
    Read Table itab_mbew with key matnr = wa_temp-matnr
     into wa_mbew.
      if sy-subrc = 0.
      wa_temp-zzstprs = wa_mbew-stprs.
      wa_temp-zzwaers = wa_mbew-waers.
      wa_temp-zzpeinh = wa_mbew-peinh.
      endif.
      Sort itab_cepc.
      Read Table itab_CEPC
      with key PRCTR  = wa_temp-PRCTR
               KOKRS  = wa_temp-KOKRS
      binary search.
      if sy-subrc = 0.
      wa_temp-ZZSEGMENT = itab_CEPC-SEGMENT.
      endif.
      modify i_t_data from wa_temp.
      clear wa_temp.
    endloop.
I_T_DATA table has entries from the DataSource MAT_PLANT.  But when I am testing the datasource for the new fields the data is coming out wrong. For example if I run the extractor checker RSA3 for material number 10000306 and plants 1017 - 1021 i extract 2 entries and the stprs values are same for both plants
But if I run RSA3 for 1021 alone then i get another value for 1021 plant. This means the STPRS value is getting overwritten for some reason. Debugging of this code is very difficult since it is embedded in another program.
Can anyone tell me wht is wrong with the logic?
Thanks
Deepthi

Hi,
In the read table itab_mbew..Try adding the bwkey also..changes marked in bold..
sort itab_mbew by matnr.
loop at i_t_data into wa_temp.
s_index = sy-tabix.
Read Table itab_mbew with key matnr = wa_temp-matnr
<b>                                               bwkey = wa_temp-werks</b>.
into wa_mbew.
if sy-subrc = 0.
wa_temp-zzstprs = wa_mbew-stprs.
wa_temp-zzwaers = wa_mbew-waers.
wa_temp-zzpeinh = wa_mbew-peinh.
endif.
Thanks,
Naren

Similar Messages

  • My macbook pro with OS 10.6.7 'mail' program does not send my mail through the IPS wireless, I am connected to. The message is my 'e-mail is rejected by the server'. It has been working until 5 days ago. The connection doctor says I am connected and no lo

    My macbook pro with OS 10.6.7 'mail' program does not send my mail through the IPS wireless, I am connected to. The message is my 'e-mail is rejected by the server'. It has been working until 5 days ago. The connection doctor says I am connected and no log in required.
    After trying lots I found now in 'Airport Utility is 'unable to detect any airport wireless devises.....'
    There is no provider to be seen in airport utility and only 'rescan' is an option with no results...
    even so I am connected and can browse the net receive mail etc. and the outgoing 'mail server' is set to the internet provider I am connected to.
    Can you enlighten me what can I do I need to use my e-mail program urgently !!!
    Thanks for your help

    I'm not sure what "IPS wireless" is, but unless you have an Apple Wi-Fi base station (such as a Time Capsule, AirPort Extreme, or AirPort Express), AirPort Utility won't see anything.
    You might try defining a new SMTP server to see if that will work any better.
    By the way, the subject field for these messages isn't intended to hold a lot of text.  Put a short description of your problem in the subject field and save the rest of your message for the body field.

  • The RFUMSV50 program does not generate transfer lines of deferred VAT

    Hello;
    The RFUMSV50 program does not generate transfer lines of deferred VAT ,
    The context is the following one:
    Code VAT Created with code target VAT, general account of VAT also created,
    Rule of deferred VAT created and activated for the company code in question, with marks to compensate for check.
    The data of tests are the following ones:
    Creation of an invoice via the FB60,
    Integral payment of the invoice via F-53,
    Creation of the confirmation of the operation in bank via the manual statement FF67,
    Clearing of the intermediate banking account  with the bank account  via F-03.
    After all these elements, by executing the RFUMSV50 program, I have nothing in result.
    There somebody who had the same problem, could help us?
    Thank you.

    Hi
    Service Tax credit cannot be utilized unless the Vendor Invoice is Paid. This is the reason till the payment is done the service tax Amount will be accumulated in deferred tax account and once the invoice is paid the balance in deferred tax is need to be transferred  to respective Service Tax , Educational Cess and higher Education Cess account. There can be various business scenarios for full and Partial Payment to facilitates the transfer of such deferred balance to respective account SAP has come up with some new standard program RFUMSV50 instead of RFUMSV25. To overcome the limitation of this program i.e. not able to take care of more than one tax line item, below the solution is provided with scenarios “Full Payment is made to Vendor Invoice”. 
    hope this is help ful
    thanks
    Trinath

  • Function Module does not fetch value

    Hi All,
    I am using the fm RV_PRICE_PRINT_HEAD to fetch condition records. When I run this fm in SE37 for a particular document(vbeln) number, the values are fetched correctly into the internal tables TKOMV and TKOMVD.
    The same fm does not fetch values when I run for second time for the same document(vbeln). This means :
    1) I will go to SE37, type RV_PRICE_PRINT_HEAD, supply the export parameters in COMM_HEAD_I, execute it and obtain the condition records (Till this time absolutely fine)
    2) Now, press Back (F3), Let the export parameters in "COMM_HEAD_I" will remain same. Just press Execute (F8). Then condition values are not fetched.
    Could any body help in this regard...
    Thanks
    Thimmappa Hegde

    Hi
       I have given you the other alternative bcoz there is a limitation while calling this FM: RV_PRICE_PRINT_HEAD.
    If you see the comments and code of Include: LV61AA11, you can understand the problem.
    <b>* mechanism to controll which conditions are already part of table TKOMV
    Every time a pricing result is read from database the key is put into
    TABGL. Also TABGL is updated if we've lines in TKOMV assigned to a
    special key but entry in TABGL (case 2).
    Originally TABGL was established to handle following pathological
    case: condition successfully read from DB -> entry in TABGL. Then all
    read conditions where deleted during processing (e.g. manually
    deletion etc.). If we run into this routine again no records should
    be redetermined from DB...</b>
      read table tabgl with table key knumv = komk-knumv
           transporting no fields.
    Case 1:
    conditions have been already read because there is a fitting entry in
    TABGL. Exit immediately if caller doesn't want to force DB access.
      if sy-subrc eq 0. ---><b> First time SY-SUBRC NE 0 so no problem</b>   
         if generell_lesen ne 'X'. <b>--> Later runs SY-SUBRC  eq 0 and generell_lesen value is SPACE</b>.
            exit.
        endif.
      else.
      Hope this clarifies your doubt now.
    Kind Regards
    Eswar

  • Lots of programs does not respond, when opened

    Lots of programs does not respond, when they are opened, Apple store, Mail, Photo Booth and VideoConverterPro and some moor.
    To close, I have to click on finder first. What to do ?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • HP Device Toolbox (via Programs) does not open. It only opens via Webbrowser​.

    I have the HP LaserJet 100 color MFP M175 PCL6 since one year and it operated always properly.
    Its connected via USB.
    But now I cannot start HP Device Toolbox anymore when I start it via Start > Programs > HP etc. 
    I see shortly some flashes on my desktop but the program does not start. I get an error window in Dutch saying: "Error Cannot connect to printer. Check printer connection and try to restart HP Device Toolbox".
    I can acces HP Device Toolbox only by entering the IP adress of the printer in the webbrowser.
    I can print and scan normally.
    I uninstalled all the HP software and reinstalled the software and drives but this does not help.
    Who can help?
    Thanks in advance.
    Joep

    Hi @Joep123,
    Too bad the System Restore didn't work, I have seen this type of issues after some updates were ran on the computer.
    I would disable all the start up programs and temporarily turn off the Antivirus Software to see if there is a program interfering in the back ground. How to use MSCONFIG . Click on the start up tab and click disable all.
    Try and open the Toolbox Software again.
    Are you getting any error messages?
    If you are still having issues, try the following steps please:
    Update the printer's firmware. HP LaserJet Pro Series Firmware Update Utility
    I would download and install the full driver, instead of using the Smart Install on the printer.
    HP LaserJet Pro Series Full Solution Software and Driver.
    If you have another computer, run the install on it to see if you have the same results.
    Please let me know the results.
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Why this query does not show the result?

    Why the query with the schema prefixed does not show the result and the query without schema display the correct results?
    SQL> select data_object_id,object_type from dba_objects where object_name='HR'.'JOBS';
    select data_object_id,object_type from dba_objects where object_name='HR'.'JOBS'
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    SQL> select data_object_id,object_type from dba_objects where object_name='HR.JOBS';
    no rows selected
    SQL> select data_object_id, OWNER, object_type from dba_objects where object_name='JOBS';
    DATA_OBJECT_ID     OWNER                          OBJECT_TYPE
    69662              HR                                 TABLE
                       OE                                 SYNONYM
    SQL> SELECT USER FROM DUAL;
    USER
    SYS

    Hi,
    the column object_name refers to a object_name which is 'JOBS', the column owner refers to the owner 'HR', the value isn't stored together, so you have to select the two columns. It is the same behaviour as every other table/view. Have a look at the values in the view DBA_OBJECTS.
    Herald ten Dam
    Superconsult.nl

  • TS1702 Maps program does not work. In standard it only shows a grid. If I ask for a route it shows start and end point and three route boxes but nothing else. It does show directions. If I switch to hybrid it shows to routes but no roads. Background is a

    Maps program does not work. In standard it only shows a grid. If I ask for a route it shows start and end point and three route boxes but nothing else. It does show directions. If I switch to hybrid it shows to routes but no roads. Background is a blur.

    Do you have a question? This is a user to user help forum. Apple is not here only other users like yourself. You don't report problems to Apple here.
    By the way, it might help if you indicated where you are located.
    To complain to Apple use http://www.apple.com/feedback/ipad.html

  • On Creative Cloud,Photoshop CC Trial (or any other Adobe programs) does not download , States "Download error  Press Retry to try again... (49)". How can I resolve this?

    On Creative Cloud,Photoshop CC Trial (or any other Adobe programs) does not download , States "Download error  Press Retry to try again... (49)". How can I resolve this?

    Try logging out of the CC Application and restarting your computer. Also, try running the CC app as an administrator.
    Benjamin

  • Every time I try to open Photoshop Elements 12, it opens the Adobe login, after I login the program does not open:( Help please?

    Every time I try to open Photoshop Elements 12, it opens the Adobe login, after I login the program does not open:( Help please?

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • I purchased Adobe CS4.  I am now being asked for my serial number and when I put it in the program does not recognize it for Acrobat Pro 9 though it does for PhotoShop, Bridge and the rest of the suite.  What can I do?

    I purchased Adobe CS4.  I am now being asked for my serial number and when I put it in the program does not recognize it for Acrobat Pro 9 though it does for PhotoShop, Bridge and the rest of the suite.  What can I do?

    Contact support if you have serial number issues. Otherwise start by checking this stuff:
    Sign in, activation, or connection errors
    Mylenium

  • My Firefox version is 13.0.1, I use Windows Seven 64-bit, when I click on Firefox, but the program does not run! But Firefox is seen in the list of Windows proc

    My Firefox version is 13.0.1, I use Windows Seven 64-bit, when I click on Firefox, but the program does not run! But Firefox is seen in the list of Windows processes, while Firefox does not run.
    I manually deleted Firefox from the list once I have Windows processing.
    And when I clicked on Firefox, Firefox will open quickly and easily.
    Firefox process in Windows Processes names list called "firefox.exe * 32" is.
    Please try to solve my problem, my problem is how to solve?

    Hi, are you saying that you start Firefox and it stalls -- you can see it in the Task Manager but it never displays -- but if you kill that process and start Firefox again it starts up properly that second time?
    If you look at the statistics available in the Task Manager's processes tab such as bytes read or other bytes, can you see whether Firefox is doing anything at all? ''Note: You might need to add columns if your Processes tab isn't set up to display statistics. You can do that from the View menu.''
    You might already have seen these troubleshooting articles. If not, does anything here help:
    * [[Firefox won't start - find solutions]]
    * [[Firefox hangs or is not responding - How to fix]]

  • After upgrading to iOS 8, the weather app does not show up results for any of the Indian States/cities

    After upgrading to iOS 8 on my iPhone 5, the weather app does not show up results for any of the Indian States/cities. Can Apple look into this or does anyone have a solution to this.

    Swipe from bottom of days listed ("Wednesday, Thursday, Friday, etc")  upwards.  I thought it was gone too but it's still there~just takes different way to access it.

  • I just signed up for a subscription to adobe reader paying EUR 24.40. The program does not work, and I can not even go to my personal page .... help ...?

    I just signed up for a subscription to adobe reader paying EUR 24.40.
    The program does not work, and I can not even go to my personal page .... help ...?

    Adobe Reader is free; it does not require a subscription.
    Did you subscribe to an online service like ExportPDF, PDF Pack, ...?
    What exactly does "not work" mean?

  • What are the points which the migration program does not support?

    Hi,
    I have a question about migration program 'RSEC_MIGRATION'.
    As described in 'Running the Enterprise Data Warehouse',
    in 'Frequently Asked Questions - Business Intelligence in SAP NetWeaver 2004s',
    this program supports about 80% automatic migration
    according to some documents.
    What is the rest 20%?
    What doesn't this program support?
    Though it may be difficult to make a list for that
    because settings of authorization objects are various,
    I think SAP should list up as many important points
    which this program does not support as possible
    by using some examples.
    If SAP thinks of delivering such a list,
    when will it be delivered?
    Best regards,
    Kaito Hosoyamada

    Hi Kaito,
    this statement relflects the fact that a program will never be able to handle all potential complex scenarios that customers might have.
    The facts that are not completely covered by the migration assistant are:
    1.) The more complex the existing authorization concept, the more manual migration work might be necessary
    2.) Customer-exit variables for 0TCTAUTHH cannot be migrated; the respective hierarchy nodes must be assigned manually
    3.) Intensive tests are highly recommended
      Cheers
       SAP NetWeaver BI Organisation

Maybe you are looking for

  • How To Get The Total Delivered Quantity of a Sales Order

    Hello All, I have a requirement of getting the total delivery quantity of the sales order .I have checked it in LIps table but I am getting partially delivered quantity for a schedule line item.Can any one tell me how to get the total delivered quant

  • IPhoto 6 - Date Display Bug?

    I've gone ahead and upgraded to iPhoto 6. Upon first launch, it asked to update the files which I did. The new file hierarchy issues aside (Original/Year/Roll drives me nuts), I've noticed that while the calendar shows the correct pictures of the day

  • While Saving Notification iw21

    Hi Guys, I have one requirement while saving the notification (i.e. notification no. not saved in database table) this notification is assign to existing order at that time i need to check the swerk (Maintenance plant) available in the location data

  • Org Structure Isn't appearing in PPOM_OLD

    Dear Gurus, I'm getting a very stranger error, All OM object Id's were uploaded through LSMW by using PP02, but when i checked in PPOM_OLD to see org structure I'm unable to view the Org structure view & also I've checked the internal tables HRP1001

  • Why does iMovie unexpectedly quit when updating thumbnails?

    When I open iMovie (9.0.8) on my MacBook Pro (OS 10.8.2), it tells me "iMovie needs to generate thumbnails for the videos in your iPhoto library…" with buttons "later" and "now". When select "now" iMovie unexpectedly quits after a couple of seconds.