Need data from li_gmia to i_gmia for a particular condition.

if li_gmia-rbukrs = i_gmgr_text-company_code
then i want to move li_gmia to i_gmia.
I'm trying in this manner?
Is the following approach ok?
loop at i_gmgr_text into w_gmgr_text.
  loop at li_gmia into lw_gmia.
  if w_gmgr_text-company_code = lw_gmgia-company_code.
  MOVE lw_gmiga TO w_gmia.
  APPEND w_gmgia INTO i_gmiga.
  ENDIF.
  endloop.
endloop.
Kindly comment.
Regards.

Hello Dude,
NESTED LOOPS - a strict NO-NO.
Try this code:
SORT i_gmgr_text BY company_code.
loop at li_gmia into lw_gmia.
READ TABLE i_gmgr_text into w_gmgr_text.
WITH KEY company_code = lw_gmgia-company_code
BINARY SEARCH.
IF sy-subrc = 0.
MOVE lw_gmiga TO w_gmia.
APPEND w_gmgia INTO i_gmiga.
ENDIF.
endloop.
Hope this is clear.
BR,
Suhas

Similar Messages

  • Need Help:Reading Data from RU payroll cluster for table GRREC

    Hi...
    I need help on how to read data from RU cluster table for table GRREC for the employee & run date and get the value from structure PC292 .
    Please let me know about the includes and the import and export statements to be used.
    Thanks in advance,
    RAVI.

    Hi,
    Here goes pseudocode
    Includes:
    include: rpppxd00    ,
                rpppxd10     ,
                rpc2cd09     , 
                rpc2rx02_ce , "if ldb pnp_ce is used else use the same include with out _ce
                rpc2rx29      ,  
                rpc2rx39      ,
                rpppxm00    ,
                rpc2ruu0_ce ,
    Declare:
    DATA : i_rgdir   LIKE pc261        OCCURS 0 WITH HEADER LINE     ,
               i_result  TYPE pay99_result OCCURS 0 WITH HEADER LINE ,
               i_grrec   LIKE  pc292           OCCURS 0 WITH HEADER LINE .
    start-of-selection:
    GET pernr.
    Get the RGDIR VALUE for the current PERNR & selected Molga
    get rgdir data TABLES i_rgdir
                          USING pernr-pernr
                                     p_molga " parameter
    CD-KEY-PERNR = PERNR-PERNR.
    RP-IMP-C2-CU.
    i_rgdir [] = rgdir[].
      LOOP AT i_rgdir WHERE fpbeg  LE  pn-endda
                        AND fpend  GE  pn-begda
                        AND srtza  EQ 'A'
                        AND void   NE   'V'.
      get_result_tabs   TABLES i_result
                                   USING 'RU'    "  US cluster
                                         pernr-pernr
                                         i_rgdir-seqnr
          RX-KEY-PERNR = PERNR-PERNR.
          UNPACK i_RGDIR-SEQNR TO RX-KEY-SEQNO.
          RP-IMP-C2-RU.
      i_grrec[] = i_result-inter-grrec[].
      LOOP AT i_grrec.
      case i_grrec.
      use wage types required here and pass the data to output table.
      endcase.
      endloop.
      endloop
    end-of-selction.

  • Problem with uploading data from excel using BDC for tcode f-02

    Hi All,
    I am uploading data from excel using BDC for tcode f-02. The problem here is, while recording, the values of some fields are recording twice. I dont know why it's happening so. But if I run my abap program, I have to give those fields twice in my excel sheet. Otherwise data does not upload. But it is not the feasible way. We must give those fields once in excel. Please tell me, how I can solve the issue.
    With regards,
    Rosaline.

    Hi,
      in BDC each and every action is recording. If your press enter in same screen that also recorded once aging may be this is your case repeating field values will appear. we can solve the problem for repeat fields like below.
    suppose in your excel having repeated field X1 X2 X3 the X2 contains repeated field X3 means delete the X3 field.
    Now In your itab having X1 and X2 fields. While in the LOOP the ITAB pass the X2 field to repeated the fields.
    LOOP at ITAB to WA.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_CURSOR'.
    bdcdata_wa-fval = 'RM08M-EBELN'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." 1st time pass the X2 fields
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." pass the same value to repeated field
    APPEND bdcdata_wa TO bdcdata_tab.
    Endloop.
    Hope you can understand.
    Regards,
    Dhina..

  • Extraction of data from CRM to BW for datasource 0crm_quotation_I

    Hi,
          Extraction of data from CRM to BW for data source 0CRM_QUOTATION_I  is taking  27 hours of time to load data into ODS for 1 million records.
    Here I am doing FULL LOAD with 4 Infopackages in parllel with different select-options.Even I tried  DELTA  load but it hasn't worked out properly.
          Is there any solution to reduce time from Datasource to ODS with FULL LOAD. Please help me.

    Hi krishna,
                       yes we did enhancement to this data source. In PRDOCTION its taking 27 hours time  to load data.
              For extraction from source system (CRM) its taking  nearly 24 hours time  as per JOb LOG .
    08/05/2010 11:53:08 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 10,849 records
    08/05/2010 12:02:02 Result of customer enhancement: 10,849 records
    08/05/2010 12:02:03 PSA=0 USING & STARTING SAPI SCHEDULER
    08/05/2010 12:02:03 Asynchronous send of data package 1 in task 0002 (1 parallel tasks)
    08/05/2010 12:02:06 IDOC: Info IDoc 2, IDoc No. 1576298, Duration 00:00:01
    08/05/2010 12:02:06 IDoc: Start = 08/05/2010 10:26:37, End = 08/05/2010 10:26:38
    08/05/2010 13:02:38 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 10,958 records
    08/05/2010 13:11:48 Result of customer enhancement: 10,958 records
    08/05/2010 13:11:52 Asynchronous send of data package 2 in task 0003 (1 parallel tasks)
    08/05/2010 13:11:53 tRFC: Data Package = 1, TID = 0AA00D0301984C5AEE8E44DB, Duration = 00:16:
    08/05/2010 13:11:53 tRFC: Start = 08/05/2010 12:02:19, End = 08/05/2010 12:18:27
    08/05/2010 14:30:13 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 11,296 records
    08/05/2010 14:39:53 Result of customer enhancement: 11,296 records
    like this its taking 24 hours in extraction its self.
    Edited by: kotha123 on Aug 10, 2010 12:08 PM
    Edited by: kotha123 on Aug 10, 2010 12:09 PM

  • Where is the data saved in the srtucture for a particular tcode

    Where is the data saved in the srtucture for a particular tcode.
    For eg in MM01 there is a field with RMMG1
    where dioes the data get saved from this field as in backend it shows the stucture and the structure can hold data only at runtime,
    Please help me
    Thanks in advance
    chinnu

    Hi,
    The strcuture : RMMG1 holds data at run time only that to it can hold only one record at a time.
    so we use this structure to hold data at run time and then we insert those values into database tables for that program.
    Here you can the values stored and processed in the program in the tables : MARA (for matnr ,mbrsh,mtart..),MARC (for Plant ),MARD( for storage location : lgort )...etc.
    so if you want to fecth some data means first you have to choose right table to fetch information by passing values in the selection screen.
    Regds
    Sivaparvathi
    Please reward points if helpful...

  • I want to retrieve data from p0001-PLANS based on the below condition,

    Hi,
    I want to retrieve data from p0001-PLANS
    based on the below condition
    select stext from hrp1000 where plvar = '01' and otype = 'S' and objid = p0001-plans and begda GE pn-begda and endda LE pn-endda.
    Thanks,
    Rama.

    Hi
    Based on the Query you have specified thoise are stoerdin an Internal table- then
    select stext from hrp1000 into table t_hrp where plvar = '01' and otype = 'S' and objid = p0001-plans and begda GE pn-begda and endda LE pn-endda.
    The check table for this PLANS is T528B .
    if t_hrp[] is not intitial.
    select * from t528B intot table t_528 where plans eq t_hrp-plans.
    endif.
    Now you can get the PLANS data.
    Refer to the Text tbale for PLANS -  T528T
    To get the TEXTS -
    if t_hrp[] is not initial.
    select * from T528T into table t_528T where plans eq t_hrp-plans.
    endif.
    Regards
    Lekha

  • How to stop PR creation from PM work order for a particular vendor?

    Hello Experts,
    We have following scenario for breakdown maintenance activities.
    When a machine breaks down, a breakdown order is created in SAP. The external manintenance services are planned in the order. When the order is released, a single PR (with multiple item numbers corresponding to number of services) is created by SAP. The PR has a release strategy. When PR is released, PO is created followed by the SES.
    The practice followed AS -IS for breakdown outside business hours:- If the breakdown happens outside business working hours, the person releasing the PRs is not available & hence PR can not be released resulting in no PO & no subsequent SES.
    In this case, the maintenance is completed by the external agency & the work order is TECO. The next day, TECO is reveresed, new PR is created, released, converted into PO, & then SES.
    TO-BE process:- Client expects that, for certain vendors identified, PR should not get created at all from the breakdown order. (The list of  vendors will be maintained seperately). For these vendors, a framework order will be created at the start of fiscal year & SES will be created as & when required agaainst the framework order.
    My concern is :- How to stop PR creation from PM work order for a particular vendor? OR delete the created PR?
    Highly appreciate your quick response.
    Thank you.
    Amit
    Note:- My ABAP consultant has checked following BADI's, but could not find it useful.
    IWO1_ORDER_BADI
    ORDER_COSTING_CK
    DATA_EXTENSION_CK
    VALUATION_CK
    ME_REQ_OI_EXT
    IWO1_PREQ_BADI
    ME_CHECK_SOURCES
    ME_REQ_POSTED
    IWO1_ORDER_BADI

    Dear Amit
    I am giving a different dimension to your question check if it fulfills your requirement -
    As we know Vendor selection comes at a later stage only after your PR creation, approval & RFQ etc. & PR generation from maintaine. order is controllled through control key PM03.  While triggering PR from order you have to specify Material group, Purchase group and vendor. Try to control it through authorisation as all these are authorisation objects. The persons executing breakdown order shall no t be given this authoriations
    shakti

  • How to find total recs in a local table for a particular condition

    Hi,
    How to find total recs in a local table for a particular condition?
    Thanks,
    CD

    Well, you may want to try this as well, and compare to the LOOP way.  Not sure what kind of overhead you may get doing this way. Here ITAB is our main internal table, and ITAB_TMP is a copy of it.  Again I think there may be some overhead in doing the copy.  Next, delete out all records which are the reverse of your condition.  Then whatever is left is the rows that you want to count.  Then simply do a LINES operator on the internal table, passing the number of lines to LV_COUNT.
    data: itab type table of ttab.
    data: itab_tmp type table of ttab.
    itab_tmp[] = itab[].
    delete table itab_tmp where fld1 <> 'A'.
    lv_count = lines( itab_tmp ).
    Regards,
    Rich Heilman

  • Sales order Pricing for a particular condition type

    Hi Folks,
    I have a requirement that when i change the Shipping condition(VBAK-VSBED) in the Sales order  The Pricing should be triggered and the price should be re-determined only for a particular condition type (ZFM1) . This condition type represents Freight charges.
    I am trying to use user exit USEREXIT_NEW_PRICING_VBAP(include MV45AFZB) in the below fashion but the price is getting
    re-determine for all the condition types. I have even tried by passing NEW_PRICING = 'H' but we have multiple condition types for freight and price would get re-determined for all these condition types. I want the price should get refreshed only for condition type ZFM1.
    FORM USEREXIT_NEW_PRICING_VBAP CHANGING NEW_PRICING.
       IF VBAK-VSBED NE *VBAK-VSBED
          New_Pricing = 'B'.
       ENDIF.
    ENDFORM..
    So, do we have any function module which i can use to refresh only a specific condition type.
    <Priority normalized by moderator>
    Edited by: Vinod Kumar on Nov 3, 2011 1:35 PM

    Hi
    It's hardcoded. Go to include FV45PF0P_PREISFINDUNG and you can see when the userexit is called and how the report call other subroutine:
              perform userexit_new_pricing_vbap(sapmv45a)
                      changing da_pricing.
              if not da_pricing is initial.
                 if da_pricing ne function_new_pricing.
                    perform preisfindung using da_pricing.
                 endif.
              endif.
    In subroutine PREISFINDUNG is called the FM 'PRICING' with the value for DA_PRICING for CALCULATION_TYPE.
    Regards
    Eduardo

  • HT201269 How can I delete all my data from former Iphone 4 for future sale on Ebay?

    Hello!
    I've just purchased an Iphone 5 from a new carrier. Now I should like to sell my former Iphone 4 but, obviously, removing all my personal data (contacts, photographs, etc.) .  How can I transfer the ringtones that I purchased from by Iphone 4?
    How can I do it? Thanks in advance.
    Regards,
    Maria

    backup the device and restore it as new.
    If you already have or don't need a backup:
    Erase your device
    Erasing all content and settings will delete all the data from your device, including songs, videos, contacts, photos, calendar information, and any other data. All device settings are restored to their factory condition.
    To remove all settings and information from your device, tap Settings > General > Reset > Erase All Content and Settings. For more information about this feature, see iOS: Understanding 'Erase All Content and Settings'.
    If you are unable to erase your device, restore the device using iTunes.
    See: http://support.apple.com/kb/HT4137  for the exact steps.
    Transferring ringtones isn't supported, as far as I know...

  • How to fetch the data from the table COEP for WBS element,cost center,,,,,?

    Hi,
    I would like to retrive the data from the table COEP ,based on KOKRS,BELNR fields.
    I need the output for Cost centre, cost element, wbs element,net work ,activity.
    These values are storing OBJNR ,OBJNAR_1,OBJNR_2,OBJNR_N3.
    But here always these field are not giving the correct values.
    for example : for one record COST CENTRE vlaue is storing in OBJNR_1 field,
                        for one record COST CENTRE vlaue is storing in OBJNR_2 field,
                       for one record  COST CENTRE vlaue is storing in OBJNR_3 field.
    Here SAP has used a generic approach for this.
    How can I dispaly the values in this case ?
    Thanks and Regards
    Srinivas.N

    Hi,
    I am asking, how can we say OBJNR_1 value alwyas belongs to cost center ?
    USPOB is not filling always.

  • How to read data from Logical Database ADA for more than one financia year

    Hi,
    I need to read data from ADA logical database and ANLCV node for current financial year 2007 and for the next 3 years – 2008, 2009, 2010. When I do this using program attached below, I receive only data for one year, which is entered at the selection screen in the field BERDATUM. How should I modify my program to read ANLCV node for more then one year ? Could anybody help me ?
    Kind regards,
    Zbigniew Debowski
    REPORT  ZWRZD075.
    NODES: anlav, anlcv.
    START-OF-SELECTION.
    GET anlav.
    WRITE:/ anlav-anln1, ' ', anlav-anln2.
    GET anlcv.
    WRITE:/ anlcv-kansw, ' ', anlcv-knafa, ' ', anlcv-gjahr.

    Hi!
    Have you already tried your luck in Java Programming forum?
    Regards,
    Thomas

  • ICR - Importing Data from Other SAP Systems for Reconcilaition

    Dear Ralph and Other Experts,
    At my current engagement we need to import data from a subsidiary separate SAP system for reconciliation. There are scenarios where one side of an Interco document is posted in the corporate system and the other half is posted in the subsidiary's system. The posts from the subsidiary are totaled by comp code account and trading part and then posted in the corporate system.
    This will make it challenging to run automatic rule assignments because scenarios will arise where one document in the subsidiary needs to be matched to many documents in the corporate system.
    I did some searching on changing the DataSource   in FBIC008 for certain company codes to file upload or external but cannot find documentation on how to complete the configuration or how this functionality it works. Has anyone used this functionality? Could somebody please explain or link me to a document about using this external or file upload functionality in the ICR system.
    Best,
    John S

    Hi Frank,
    Below are my thoughts, these are only conceptual and haven't had an opportunity to try these possibilities, also not sure if this is the right thing.
    1) Create an entry in DBCON using TCode: DBCO for the Database of system SAP2. Now in the application of SAP1 use the "SET CONNECTION" construct as the very first statement, so that consecutive SQL statements will point at the DB of SAP2.
    2) I have read somewhere that the Work Processes are connected to the Default database and i am not sure if you can change this setting, but if you can and provided you have have multiple application servers in your SAP1 landscape, then pick one of the application servers and change the settings on the WP to point at the DB of SAP2, you have the end users login to this particualr app server.
    3) If there are multiple app servers in SAP1 landscape, then choose one of the app servers and change the default database setting to point at DB of SAP2.
    Regards,
    Chen

  • Reinstalling data from Time Capsule, but for only one user

    Hello!
    I just got a new-used MacBook Pro and need to use Time Capsule to retrieve my old hard drive's data, but I do not want to overwrite the existing data on the laptop's drive, since it is different, including the OS, I believe. I would like to split the disc, as it were, without partitioning it, for multiple users using Time Capsule. Can I safely use Time Capsule to put all the files only into one user account, or do I need to wipe the drive and partition...?

    Anna Scott wrote:
    Hello!
    I just got a new-used MacBook Pro and need to use Time Capsule to retrieve my old hard drive's data, but I do not want to overwrite the existing data on the laptop's drive, since it is different, including the OS, I believe. I would like to split the disc, as it were, without partitioning it, for multiple users using Time Capsule. Can I safely use Time Capsule to put all the files only into one user account, or do I need to wipe the drive and partition...?
    You can use the +Migration Assistant+ app to transfer one or more user accounts from the old Mac, without overwriting anything on the new one. Those will be a separate accounts, with the same logins as on the old Mac. Each user account will have it's own preferences, data, etc. See the pink box in #19 of Time Machine - Frequently Asked Questions (or use the link in *User Tips* at the top of this forum), for details.
    That won't "merge" two or more user accounts, since each user's data is private. You can do that manually, if you want, by copying data from one user account to another, but it's rather tedious.
    You may also need to be careful if there's a big difference in the versions of OSX and/or 3rd-party apps on the two Macs; you may have apps and/or data on one that aren't compatible with the other. In many cases, a newer version of an app will work with the data from an older version, but not vice-versa. You may want to check that out rather carefully first.
    If that's a "deal breaker," there may be a (rather clumsy) workaround; partition the internal disk, so you have, say, Leopard on one partition and Snow Leopard on the other. Then boot from whichever you want. In that case, you'd do a full system restore to the new partition, per #14 in the FAQ. That will only work, though, if the Pro will even run the other version -- generally, a Mac won't run a version of OSX that's older than the Mac's hardware.

  • How to retrieve the data from a jsp page for print?

    i have a dynamic jsp file which will get the data at runtime.I have a print button in the jsp.When i chick the print button it should capture the data from the jsp and print it as LANDSCAPE mode. Now i am using Java Api for this
              Following code is a working sample which prints some data in LANDSCAPE mode..This is working fine....How can i modify this to get the data from a jsp?....I am using weblogic workshop for development
              package Awtjava;
              //working example
              import java.awt.*;
              import java.awt.print.*;
              public class testPrint implements Printable {
              private static String s[];
              private static Font f;
              private static int nLines;
              public static void main (String arg[]){
              s = new String[10];
              f = new Font("Arial", Font.PLAIN, 11);
              int i;
              s[0] = "This is a printer test";
              for (i=1; i<10; i++){
              s[i] = "The next line";
              nLines = 10;
              testPrint.printa();
              public static void printa(){
              System.out.println("public static void printa () ");
              PrinterJob pj=PrinterJob.getPrinterJob();
              Book b = new Book();;
              PageFormat pf = new PageFormat();
              pf = pj.defaultPage(pf);
              b.append(new testPrint(), pf, 2);
              pj.setPageable (b);
              try{
              if (pj.printDialog()){
              pj.print();
              catch (Exception e) { System.out.println ("Error"); }
              public int print (Graphics g1, PageFormat pf, int n){
              System.out.println("public int print");
              int x,y,i,fa,fh;
              FontMetrics fm;
              Graphics2D g = (Graphics2D) g1;
              pf.setOrientation(PageFormat.LANDSCAPE);
              fm = g.getFontMetrics (f);
              fa = fm.getMaxAscent();
              fh = fm.getHeight();
              x = (int)pf.getImageableX();
              y = (int)pf.getImageableY() + fa;
              g.setFont (f);
              g.setColor(Color.black);
              if (n==1){
              for (i=0; i<10; i++){
              g.drawString (s, x, y);
              y += fh;
              return PAGE_EXISTS;
              else {
              for (i=10;i<10; i++){
              g.drawString (s[i], x, y);
              y += fh;
              return PAGE_EXISTS;
              Hope you will reply soon...
              Thanks in advance
              Maria

    Hey, I got a doubt that who will call the print method in the same program and what about the g.drawString() it is showing any output effect. Finally how the variable n will get initializing to 0 and 1 for two times respectively. Can u please elaborate on this...

Maybe you are looking for

  • HP Envy M6 CANT RESTORE!!!

    Ok, to make a long story short and cut out all the un-needed info, i was informed by a tech to take another copy of windows and install it onto my hard drive to correct some partition issues created. After attempting to install my windows 7 on the la

  • Announcement : new Data Direct ODBC drivers available for download

    We have Crystal Reports 9 and we are using Crystal Reports with Legal Files software. I have downloaded the latest data direct driver. How do we get rid of the banner that comes up every time we run a report? Are the drivers not free if we purchase c

  • Rectfy

    Dear all      The following coding not working  how to rectify         REPORT ZV_F4 . TABLES: LFB1. SELECTION-SCREEN: BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003. SELECT-OPTIONS : S_AKONT FOR LFB1-AKONT. SELECT-OPTIONS : S_LIFNR FOR LFB1-LIFNR . "Ven

  • What has happened to the rotating disk when sending e-mails in 6.2?

    What has happened to the rotating disk when sending e-mails in 6.2?

  • Automatic app download from iCloud

    I downloaded two apps on my iPhone today and neither appeared on my iPad. Both devices are on the cloud and have been updated with the most recent software. This isn't the first instance, but I don't understand why they aren't automatically downloadi