<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: To sum quantity in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-sum-quantity/m-p/6815705#M1469603</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you want to get help from any one please try to post properly. Do You think any one can read what you have written. When you post question on the right hand side you can see list of help text and Markup Possibilities.&lt;/P&gt;&lt;P&gt;Kindly use them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 Mar 2010 11:49:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-27T11:49:23Z</dc:date>
    <item>
      <title>To sum quantity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-sum-quantity/m-p/6815704#M1469602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the Sum of Quantity for a particular Material in ALV report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code of my  partial Program. Pls help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_fldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA:&lt;/P&gt;&lt;P&gt;       lit_fieldcat TYPE slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;       lwa_fieldcat TYPE slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;       lv_cnt       TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_program_name         = 'ZPPREP_QM_REGISTER'&lt;/P&gt;&lt;P&gt;      i_internal_tabname     = 'GIT_OUTPUT'&lt;/P&gt;&lt;P&gt;      i_bypassing_buffer     = gc_x&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      ct_fieldcat            = lit_fieldcat&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      inconsistent_interface = 1&lt;/P&gt;&lt;P&gt;      program_error          = 2&lt;/P&gt;&lt;P&gt;      OTHERS                 = 3.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE s398(00) WITH 'Error in ALV display' space space space.&lt;/P&gt;&lt;P&gt;    STOP.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR lv_cnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT lit_fieldcat INTO lwa_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR gwa_it_fldcat.&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING lwa_fieldcat TO gwa_it_fldcat.&lt;/P&gt;&lt;P&gt;    gwa_it_fldcat-key     = space.&lt;/P&gt;&lt;P&gt;    lv_cnt = lv_cnt + 1.&lt;/P&gt;&lt;P&gt;    gwa_it_fldcat-col_pos = lv_cnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE lwa_fieldcat-fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'MATNR'.&lt;/P&gt;&lt;P&gt;        gwa_it_fldcat-no_zero = gc_x.&lt;/P&gt;&lt;P&gt;        gwa_it_fldcat-key     = gc_x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; WHEN 'MENGE'.&lt;/P&gt;&lt;P&gt;        gwa_it_fldcat-coltext = 'Qty./Mat doc'.&lt;/P&gt;&lt;P&gt;        gwa_it_fldcat-no_zero = gc_x.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       gwa_it_fldcat-do_sum = gc_x.  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    gwa_it_fldcat-ref_field = lwa_fieldcat-ref_fieldname.&lt;/P&gt;&lt;P&gt;    gwa_it_fldcat-ref_table = lwa_fieldcat-ref_tabname.&lt;/P&gt;&lt;P&gt;    gwa_it_fldcat-scrtext_l = lwa_fieldcat-seltext_l.&lt;/P&gt;&lt;P&gt;    gwa_it_fldcat-scrtext_m = lwa_fieldcat-seltext_m.&lt;/P&gt;&lt;P&gt;    gwa_it_fldcat-scrtext_s = lwa_fieldcat-seltext_s.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   gwa_it_fldcat-do_sum    = lwa_fieldcat-do_sum.                  "For Sum of Quantity&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND gwa_it_fldcat TO git_fldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   collect  gwa_it_fldcat INTO git_fldcat.  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  OUTPUT_TABLE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;       lv_fld    TYPE i,&lt;/P&gt;&lt;P&gt;       lv_atnam  TYPE cabn-atnam,&lt;/P&gt;&lt;P&gt;       lit_batch TYPE TABLE OF clbatch,&lt;/P&gt;&lt;P&gt;       lwa_batch TYPE clbatch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   sort git_mseg by matnr.              " Added by NKU&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT git_mseg INTO gwa_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE git_mchb INTO gwa_mchb WITH KEY matnr = gwa_mseg-matnr&lt;/P&gt;&lt;P&gt;                                               werks = gwa_mseg-werks&lt;/P&gt;&lt;P&gt;                                               lgort = gwa_mseg-lgort&lt;/P&gt;&lt;P&gt;                                               charg = gwa_mseg-charg&lt;/P&gt;&lt;P&gt;                                               BINARY SEARCH.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      CONTINUe.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Materail No&lt;/P&gt;&lt;P&gt;    lv_fld = lv_fld + 1.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT lv_fld OF STRUCTURE &amp;lt;gfs_line&amp;gt; TO &amp;lt;gfs_field&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;gfs_field&amp;gt; = gwa_mseg-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Quantity&lt;/P&gt;&lt;P&gt;    lv_fld = lv_fld + 1.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT lv_fld OF STRUCTURE &amp;lt;gfs_line&amp;gt; TO &amp;lt;gfs_field&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;gfs_field&amp;gt; = gwa_mseg-menge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    lv_fld = lv_fld + 1.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT lv_fld OF STRUCTURE &amp;lt;gfs_line&amp;gt; TO &amp;lt;gfs_field&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;gfs_field&amp;gt; = gwa_mseg-meins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***End of Quantity&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Mar 2010 09:54:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-sum-quantity/m-p/6815704#M1469602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-27T09:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: To sum quantity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-sum-quantity/m-p/6815705#M1469603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you want to get help from any one please try to post properly. Do You think any one can read what you have written. When you post question on the right hand side you can see list of help text and Markup Possibilities.&lt;/P&gt;&lt;P&gt;Kindly use them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Mar 2010 11:49:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-sum-quantity/m-p/6815705#M1469603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-27T11:49:23Z</dc:date>
    </item>
  </channel>
</rss>

