How to use at last/ at end of in this code

Hi,
i want to do sum for each and every line item of the delivery quantity and compare it with final purchase order quantity if it is equal do not display in the output.(how to use at last/at end of ) in this code,
below code wat i have ritten is only comparing first record with final purchase order quantity and displaying the output, but i want sum of every line item and compare with final quantity(purchase order quantity)
if possible try modify this code
clear:wa_final,wa_kopoo,wa_likpp1.
    loop at it_kopoo into wa_kopoo.
      move wa_kopoo-ebeln to wa_final-ebeln.
      move wa_kopoo-ebelp to wa_final-ebelp.
      move wa_kopoo-matnr to wa_final-matnr.
      move wa_kopoo-txz01 to wa_final-txz01.
      move wa_kopoo-menge to wa_final-menge.
      move wa_kopoo-meins to wa_final-meins.
      move wa_kopoo-werks to wa_final-werks.
      move wa_kopoo-matkl to wa_final-matkl.
      move wa_kopoo-reswk to wa_final-reswk.
      move wa_kopoo-aedat to wa_final-aedat.
      move wa_kopoo-ekgrp to wa_final-ekgrp.
      move wa_kopoo-EINDT to wa_final-EINDT.
    read table it_likpp1 into wa_likpp1 with key vgbel = wa_final-ebeln
                                                 vgpos = wa_final-ebelp.
      if sy-subrc eq 0.
        if wa_final-menge > wa_likpp1-LFIMG.
        else.
          continue.
        endif.
      endif.
      append wa_final to it_final.
      clear:wa_final,wa_kopoo,wa_likpp1.
    endloop.
  endif.

Hi,
Try this:
define one more internal table it_final1 similar to i_final .
CLEAR:wa_final,wa_kopoo,wa_likpp1.
SORT it_kopoo BY ebeln ebelp.
LOOP AT it_kopoo INTO wa_kopoo.
  move-corresponding wa_kopoo to wa_final.
  COLLECT wa_final INTO it_final1.
  CLEAR: wa_kopoo, wa_final.
ENDLOOP.
sort it_final1 by ebeln ebelp.
LOOP AT it_final1 INTO wa_final.
  READ TABLE it_likpp1 INTO wa_likpp1 WITH KEY vgbel = wa_final-ebeln
                                               vgpos = wa_final-ebelp.
  IF sy-subrc EQ 0.
    IF wa_final-menge NE wa_likpp1-lfimg.
      APPEND wa_final TO it_final.
    ENDIF.
  ENDIF.
ENDLOOP.
Regards,
Subramanian

Similar Messages

  • How do use the method record(int score) in this code?

    how do i use record(int score) from the class Stats to record a new score?
    public class ScoreInfo {
    private int score;
    private int numStudents;
    public ScoreInfo(int aScore){
          score = aScore;
          numStudents=1;
    public void increment(){numStudents++;}
    public int getScore(){return score;}
    public int getFrequency(){return numStudents;}
    import java.util.ArrayList;
    import java.*;
    public class Stats
    private ArrayList<ScoreInfo> scoreList;
    public boolean record(int score)
         int k=0;
         while(k<scoreList.size() && score > scoreList.get(k).getScore()){
              k++;
         boolean found = k<scoreList.size() && score == scoreList.get(k).getScore();
          if(found){scoreList.get(k).increment();}
          else{scoreList.add(k,new ScoreInfo(score));}
          return found;
    public void recordScores(int[] stuScores)
    static int score = 50;
    public static void main(String[] args) throws Exception
    Stats stats = new Stats();
    ScoreInfo thestat = new ScoreInfo(score);
    stats.scoreList.add(thestat);
    }

    hiwa wrote:
    In your main() method, or in any code which tries to create a new score, below is wrong:
    ScoreInfo thestat = new ScoreInfo(score);
    stats.scoreList.add(thestat);They should be:
    stats.record(thestat); // record() method creates a new ScoreInfo
    // and add it to the scoreList, see your own posted code
    stats.record(thestat); will not work because record has a parameter that needs an integer not an object
    i tried public static void main(String[] args) throws Exception
    Stats stats = new Stats();
    ScoreInfo thestat = new ScoreInfo(7);
    stats.record(7);
    but i get this error Exception in thread "main" java.lang.NullPointerException
    at Stats.record(Stats.java:13)
    at Stats.main(Stats.java:39)

  • How to calculate first date and end date of this year in Query

    Hi Expert
    I want to calculate following dates with inputted date in query.
    I have no knowledge on ABAP and I just can create a query with simple logic.
    Could you teach me how to calculate following date?
    (If inputted date is April 12 2009)
    - First date of this year (Ex January 1 2009)
    - End date  of this year (Ex December 31 2009)
    - First date of last year (Ex January 1 2008)
    - End date of last year  (Ex December 31 2008)
    - First date of this month (Ex April 1 2009)
    Thank you!
    Take

    HR_JP_MONTH_BEGIN_END_DATE   use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
    04/01/2009 as begin date
    04/30/2009 as end date
    pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
    Abh

  • How to use standard Search Input Help (return 2 data code and desc) ?

    Hi,
    Please advise how to use standard Input Help provided by SAP and return 2 data (code and description) ? because the standard Input Help only return the code only ?
    Thank You and Best Regards
    Fernand

    >
    Saket  Abhyankar wrote:
    > Hi,
    >
    > I think you need to go for 'Search Help Exit' or OVS.
    >
    > Regards,
    >
    > Saket.
    That is not true that this is the only way.  The standard Data Dictory based search help can return more than one value as long as there are multiple exporting values defined in the search help, the search help is attached to a Data Dictionary Structure, and this same data dictionary structure is used as the source of the context node. You can read more about this in the online help:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/9f724642314aabe10000000a42189b/frameset.htm
    The Note section under Integration:
    If an input help structure is stored in a field in the ABAP Dictionary, and if you want to use the field mapping of search help parameters stored in the ABAP Dictionary as the field name for the structure for your Web Dynpro input help, then map your context nodes to this structure. This ensures that all components of the structure are available dynamically at runtime as attributes of the node.
    If the context node is not mapped to the structure, the data element's input help can be used if there is one.

  • How To Use OSB's For Each to do this example?

    Hi All Friend:
    My XML From Assign . it SOAP Response Body variable is : RequestBussiNo. The Document is :
    <soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <DownloadBusinessNOResponse xmlns="http://www.taiji.com.cn/">
    <DownloadBusinessNOResult>
    <BusinessNO>
    <string>150100110262188</string>
    <string>150100110280225</string>
    <string>150100110284768</string>
    </BusinessNO>
    <ArraySize>3</ArraySize>
    <Result>true</Result>
    <ReturnCode>0000-Interface execute successed!</ReturnCode>
    </DownloadBusinessNOResult>
    </DownloadBusinessNOResponse>
    </soap:Body>
    I Don't Know How to Use For Each Function to each this Document Get the "string" tag text;
    my friend Please help me. thanks.

    Check the below thread and let us know if it helps
    Re: OSB:for-each action working procedure with a sample.
    Re: Assign activity erros with XPath query string returns multiple nodes.
    Regards,
    Ramesh

  • How to use the One-to-One mapping in Java Code

    Dear all:
    I have set the direct mapping and named query,
    and have written web service of login.
    I can login successfully.
    Now,I want learning about One-to-One mapping.
    I have setting the One-to-One mapping,
    then what can I do latter?
    I do not found any paper showing how to use it in web service?
    Somebody help me?thx all.

    Following code worked for me:
    import oracle.javatools.resourcebundle.BundleFactory;
    import java.util.ResourceBundle;
    * This method retrieves localized strings from a given XLIF resource bundle.
    * @param bundleName The XLIF bundle from which the localized string is to be retrieved.
    * @param key The key of the localized string.
    * @return The localized string retrieved from the given XLIF bundle.
    public static String getXlifLocalizedString(String bundleName, String key) {
    if (StringUtils.isEmpty(key)) {
    return key;
    if (StringUtils.isEmpty(bundleName)) {
    return "[" + key + "]";
    String localizedString = null;
    ResourceBundle resourceBundle = null;
    try {
    resourceBundle = BundleFactory.getBundle(bundleName);
    localizedString = resourceBundle.getString(key);
    } catch (Exception e) {
    LOG.log(Level.SEVERE, "Problem in loading XLIF resource bundle: " + bundleName, e);
    return "[" + key + "]";
    return localizedString;
    }

  • How to use XLIFF file as resource bundle in Java code

    We use xliff as resource bundle for our ADF application. it is has been no problem to have localized message displayed on UI. how ever, I'm wonderring how to use Java code to access xliff as resource bundle which similar to access properties resource bundle. for example:
    Locale myLocale = new Locale("es", "ES");
    ResourceBundle bundle = ResourceBundle.getBundle("HelloResourceBundle", myLocale);
    System.out.println(bundle.getString("Hello"));is it posible to create "HelloResourceBundle" in xliff format?
    Thanks

    Following code worked for me:
    import oracle.javatools.resourcebundle.BundleFactory;
    import java.util.ResourceBundle;
    * This method retrieves localized strings from a given XLIF resource bundle.
    * @param bundleName The XLIF bundle from which the localized string is to be retrieved.
    * @param key The key of the localized string.
    * @return The localized string retrieved from the given XLIF bundle.
    public static String getXlifLocalizedString(String bundleName, String key) {
    if (StringUtils.isEmpty(key)) {
    return key;
    if (StringUtils.isEmpty(bundleName)) {
    return "[" + key + "]";
    String localizedString = null;
    ResourceBundle resourceBundle = null;
    try {
    resourceBundle = BundleFactory.getBundle(bundleName);
    localizedString = resourceBundle.getString(key);
    } catch (Exception e) {
    LOG.log(Level.SEVERE, "Problem in loading XLIF resource bundle: " + bundleName, e);
    return "[" + key + "]";
    return localizedString;
    }

  • How to use new cluster  'cl' commands from c/c++ code

    Hi All
    I need to invoke cluster commands from c/c++ code and parse the output to retrieve neccessary fields e.g status to be used in program.
    e.g
    #cluster status
    I need to capture output and use it in c/c++ code.
    Does any one have tried to use new cluster 'cl' commands from c/c++ code??
    Thanks
    Pandit

    The output of the cl* commands is for human consumption and as such (as most administrative commands) the output is not considered stable, so it could change with a Patch, etc.
    Instead you should use the cluster api to retreive the information you need.
    The Sun Cluster Data Services Developer's Guide for Solaris OS (http://docs.sun.com/app/docs/doc/819-2972?a=expand) describes the various possibilities, including the C API.
    Read especially http://docs.sun.com/app/docs/doc/819-2972/6n57ngitf?a=view for more details as which functions are available via the libdsdev. Each function has a specific manpage outlining the lib and includes needed as well es which information it offers.
    In your example, you can use scha_resource_get() (3HA) in order to retrieve the status of a specific resource (http://docs.sun.com/app/docs/doc/819-3055/6n5a6lhnl?a=view).
    Greets
    Thorsten

  • How to ignore the last recrod end separator

    Hi Team,
    I am creating a file like below
    1,100,200&2,200,300&3,300,400&
    In this file
    First Record is--1,100,200
    Second Record is--2,200,300
    Third Record is--3,300,400
    I am using the field separator is ,(comma) and end separator is &.
    My requirement is last record does not contain the end separator(&).
    My output file should be like this
    1,100,200&2,200,300&3,300,400
    Regards
    Swathi

    Hi Swathi,
    U can use another mapping in ur scenario.
    Just take input as field with string and read whole data and create output as a field with string den do the below mapping
    field1
                   endswith-->                                          if with out else>    replace string--
    >target Field
    &                                                                                space
                                    field1
                                                   concat
    first check  source field is endswith & or not if it endswith & then concat & to field1 then replace && to space and map to target u will get ur scenario correctly.
    Thanks,
    Enivass
    Edited by: enivas on Jan 12, 2012 10:57 AM

  • How to use if-then-else-end if in template building?

    hi,
    I am not able to use the "if-then-else-end if" in my template. I want to display a data based on a condition. My requirement is as follows:
    if bal_for_vd < 0 then
    bal_for_vd * no_of_days
    else 0
    end if
    I tried using
    1.<?if: BAL_FOR_VD < 0 then BAL_FOR_VD*NO_OF_DAYS else 0 end if?>
    2.<?xdofx:if BAL_FOR_VD < 0 then BAL_FOR_VD * NO_OF_DAYS end if?>
    3.<?choose:?>
    <?when:BAL_FOR_VD < 0?> <?BAL_FOR_VD * NO_OF_DAYS ?>
    <?end when?>
    <?otherwise?>0
    <?end otherwise?>
    <?end choose?>
    4.<?if:BAL_FOR_VD < 0?><?BAL_FOR_VD*NO_OF_DAYS?><end if?>
    but ended up getting errors or nothing is getting displayed.
    When i used <?BAL_FOR_VD * NO_OF_DAYS ?> alone its working fine and correct getting result. But on giving condition its erring out.
    I will be glad if i get some solution for this.
    Regards,
    Vishnu T Ramakrishnan

    Hi..
    Below syntax should work..I tried with a sample xml..
    <?xdofx:if BAL_FOR_VD < 0 then BAL_FOR_VD * NO_OF_DAYS
      else
    0
    end if?>HTH..

  • Anyone know how to use a 'home' and 'end' key on the Macbook pro keyboard?

    I had a pc before, and the keyboard had home and end keys on the keyboard for quickly moving cursor to end or beginning of word or sentence.  I can't figure out if there is something like that on the Macbook pro.  It would be really helpful.  So does anyone know if there is those keys and if so what do i use?
    I'd appreciate any help. 
    Thanks

    see if any of this works for you
    On a smaller keyboard, such as the wireless, or on portables, you can use fn- left arrow for home and fn- right arrow for end.
    On a Mac, 'home and 'end' take you to the beginning and the end of document, respectively. Getting to the beginning or end of a line is done with cmd- leftarrow and cmd- rightarrow. Emacs shortcuts, such a ctrl-a and ctrl- e also work in most places, where the app is done right.

  • How to use e4x to extract complex data like this ?

    The xml object structure like the following :
    <TEXTFORMAT LEADING="2">
        <P ALIGN="LEFT">
            <FONT FACE="Verdana" SIZE="16" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
               First Item
                          <FONT SIZE="10">
                         Second Item
                          </FONT>
            </FONT>
        </P>
    </TEXTFORMAT>
    this is the htmltext from richTextEditor , I want every font size = 16 value to be a tree label .
    So my question is : how can I extract "First Item "? I Know it's easy to exract the "second Item" , like P.FONT.FONT ,
    BUT , I use P.FONT, instead of get "First Item" I get  :
    <FONT FACE="Verdana" SIZE="16" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
               First Item
                          <FONT SIZE="10">
                         Second Item
                          </FONT>
            </FONT>
    I only want to extract "First Item" out of this XML block , Any Ideas ?

    Flex harUI I love you ! I've been thinking this problem for a whole morning . You saved my time ! Thank you !

  • How to use business object Bus0002 to create a company code?

    Dear all,
    I wanna create a companycode with BO BUS0002 , And I want to transfer the necessary data such as description and currency without the maintain screen.
    But the parameters of the CREATE method does not contain these kind of parameters. my question is how can i create a BO with completed data.
    I found the BO BUS0002 have several attributes such as description and currency
    and so on. Can I set these attributes? But how?
    Your kindly help will be greate appreciated.

    Hi
    your program must be having the include which contains all the macros (swc_get_element) you are using
    in your program. if you are using include <cntain>, it does not contain the macro "swc_call_method" to execute BOR methods. so remove this include from ur program and add include <cntn01>. or simply call the function module used in that macro, it is : 'SWO_INVOKE'. replace &1, &2, &3 with the variables you r passing in macro.
      call function 'SWO_INVOKE'
           exporting
                access     = 'C'
                object     = &1-handle
                verb       = &2
                persistent = ' '
           importing
                return     = swo_%return
           tables
                container  = &3.
    Regards
    Vishal Kapoor

  • How does "use the hot fix installer to apply this update (ColdFusion 10 Update)" work?

    I am building a ColdFusion 10 server on Windows Server 2008-R2 from scratch using the Lockdown Guide. I am stuck on the Updates. The mandatory "manual" update is installed, but I don't see how to jump to Update 10. In the administrator, when I check for updates it shows Update 10, but there is no download button. There is a download button for Update 7, but nothing happens. Is there not manual download and installation option? What am I doing wrong here? This should be the easy part. Thanks.
    Message was edited by: GDMVU

    It sounds like the updates page is not loading properly.  Have you tried refreshing that page in CF Administrator?  Also, you might try restarting the ColdFusion service.  You might have a proxy/firewall issue as well.  Here is the direct download link for the update: http://download.adobe.com/pub/adobe/coldfusion/hotfix_010.jar.
    -Carl V.

  • How to use Dlls and Header files in my java Code?

    Hi All,
    I want to make use of dll and header files of DataStage, from my Java Interface.
    i am buliding a product where i need to contact DataStage server from my Java Code alone, For this they provided dlls and header files
    Now i wan to make use of them and need to perform DataStage operations from my Java Interface.
    Can any on help out me regarding this?

    Try Java Platform SDK for native function calls without JNI writing code, like it done in .NET languages.
    For MS Windows:
    http://www.simtel.net/product.php[id]100916[SiteID]simtel.net
    For Linux/Unix:
    http://www.simtel.net/product.php[id]117719[SiteID]simtel.net

Maybe you are looking for

  • Checkpoint not complete in alert log file Oracle 11gR2 RAC

    Hi, I found checkpoint not complete in alert log file, almost every 3 seconds . In metalink i saw for this error, archive_lag_target=0, already this value was set to 0 in my database. We have 7 redo log groups for each instance, each group is of two

  • Question fractions of an hour formulas on Time Sheets

    I am trying to build a time sheet. Sometimes the time entered needs to be less than one hour. But when it then multiplies by the hourly rate, I get a problem. The formula calculates the "hours" by subtracting the start time from the end time in the f

  • Network Question: How Do I See the Macs from the PC?

    I'm a PC-to-Mac switcher. I'm trying to move all my activites to the Mac platform, so at the moment I'm sort've one foot in each world. One problem I have encountered is transferring files from the PC to the Macs over my network. When I'm on the Mac,

  • How do you turn video clips?

    I am using iMovie to edit my video clips but I have a clip that is turned sideways. How do I rotate it without using QuickTime Pro (which I don't have)? Is there another option for me? Your help is greatly appreciated. Ivy424 MacBook   Mac OS X (10.4

  • JDeveloper Extension Development - How to

    Based on the Clean White Space extension (by Daniel Work CleanWhiteSpace.zip), I modified it to work with JDeveloper 5.0.5.2 (build 1618) and added new functionality to remove every other blank line. (FYI: I work on Windows and my CVS server on Linux