<?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: Problem in validating a field value. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-validating-a-field-value/m-p/1134372#M112648</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi viraylab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF t_amount-tramt &amp;lt; 0.&lt;/P&gt;&lt;P&gt;t_amount-tramt = 0.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;t_amount-blamt = t_amount-netwr - t_amount-tramt.&lt;/P&gt;&lt;P&gt;COLLECT t_amount. CLEAR t_amount.&lt;/P&gt;&lt;P&gt;APPEND t_proj.&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this collect will collect the wa into the table internal table. then your are clearing it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have you assigned the values for t_proj before appending&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;kishore&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Feb 2006 07:57:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-24T07:57:57Z</dc:date>
    <item>
      <title>Problem in validating a field value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-validating-a-field-value/m-p/1134370#M112646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently having a hard time analyzing the code below. The code below is a part of a report where it displays certain PO(purchase order) based on the criteria in the selection screen. The report shows the PO's amount, downpayment, GR, Invoice, payment and balance. when I run the report, the payment must have the same value as the invoice but it shows otherwise. So for example, PO number 123456 has an amount of 100, 000 and it's invoice is 50, 000 so the payment must also be 50, 000 and the balance would be PO amount - payment. Anyway, I have posted below the code. I hope you could help me guys. Thanks and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;t_amount-netwr is the PO amount&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;t_amount-dpamt is the downpayment&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;t_amount-gramt is the goods receipt&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;t_amount-iramt is the invoice receipt&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;t_amount-tramt is the payment&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;t_amount-blamt is the balance&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE t_pohistory WHERE hist_type &amp;lt;&amp;gt; 'A'&lt;/P&gt;&lt;P&gt;                       AND hist_type &amp;lt;&amp;gt; 'E'&lt;/P&gt;&lt;P&gt;                       AND hist_type &amp;lt;&amp;gt; 'Q'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT t_account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DELETE it_dtl WHERE ebeln = t_account-ebeln&lt;/P&gt;&lt;P&gt;                    AND psphi IS initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DELETE t_ekpo WHERE ebeln = t_account-ebeln&lt;/P&gt;&lt;P&gt;                    AND ebelp = t_account-po_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   t_proj-ebelp = t_account-po_item.&lt;/P&gt;&lt;P&gt;    SELECT SINGLE psphi FROM prps INTO t_proj-psphi&lt;/P&gt;&lt;P&gt;          WHERE posid = t_account-wbs_elem_e.&lt;/P&gt;&lt;P&gt;    CHECK sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    LOOP AT t_pohistory WHERE po_item = t_account-po_item&lt;/P&gt;&lt;P&gt;                          AND ebeln   = t_account-ebeln.&lt;/P&gt;&lt;P&gt;      t_amount-ebeln = t_account-ebeln.&lt;/P&gt;&lt;P&gt;      t_amount-psphi = t_proj-psphi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ON CHANGE OF t_pohistory-po_item.&lt;/P&gt;&lt;P&gt;        CLEAR v_netwr.&lt;/P&gt;&lt;P&gt;        SELECT SINGLE netwr FROM ekpo INTO v_netwr&lt;/P&gt;&lt;P&gt;              WHERE ebeln = t_account-ebeln&lt;/P&gt;&lt;P&gt;                AND ebelp = t_account-po_item.&lt;/P&gt;&lt;P&gt;        t_amount-netwr = v_netwr.&lt;/P&gt;&lt;P&gt;      ENDON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CHECK NOT t_amount-psphi IS INITIAL.&lt;/P&gt;&lt;P&gt;      IF t_pohistory-pstng_date IN so_augdt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF t_pohistory-db_cr_ind = 'H'.&lt;/P&gt;&lt;P&gt;          t_pohistory-val_loccur = - t_pohistory-val_loccur.&lt;/P&gt;&lt;P&gt;          t_pohistory-val_forcur = - t_pohistory-val_forcur.&lt;/P&gt;&lt;P&gt;          t_pohistory-cl_val_loc = - t_pohistory-cl_val_loc.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF t_pohistory-hist_type = 'A'.&lt;/P&gt;&lt;P&gt;          IF t_pohistory-currency &amp;lt;&amp;gt; 'PHP'.&lt;/P&gt;&lt;P&gt;            t_amount-dpamt = t_amount-dpamt + t_pohistory-val_forcur.&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;            t_amount-dpamt = t_amount-dpamt + t_pohistory-val_loccur.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ELSEIF t_pohistory-hist_type = 'E'.&lt;/P&gt;&lt;P&gt;          IF t_pohistory-currency &amp;lt;&amp;gt; 'PHP'.&lt;/P&gt;&lt;P&gt;            t_amount-gramt = t_amount-gramt + t_pohistory-val_forcur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;            t_amount-gramt = t_amount-gramt + t_pohistory-val_loccur.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ELSEIF t_pohistory-hist_type = 'Q'.&lt;/P&gt;&lt;P&gt;          IF t_pohistory-currency &amp;lt;&amp;gt; 'PHP'.&lt;/P&gt;&lt;P&gt;            t_amount-iramt = t_amount-iramt + t_pohistory-val_forcur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;            t_amount-iramt = t_amount-iramt + t_pohistory-val_loccur.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF t_pohistory-currency &amp;lt;&amp;gt; 'PHP'.&lt;/P&gt;&lt;P&gt;          IF t_pohistory-val_loccur = 0 OR&lt;/P&gt;&lt;P&gt;             t_pohistory-val_forcur = 0.&lt;/P&gt;&lt;P&gt;            t_amount-tramt = t_amount-dpamt.&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;            t_amount-tramt = ( t_pohistory-cl_val_loc /&lt;/P&gt;&lt;P&gt;                             ( t_pohistory-val_loccur /&lt;/P&gt;&lt;P&gt;                               t_pohistory-val_forcur ) ) +&lt;/P&gt;&lt;P&gt;                               t_amount-dpamt.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ELSE.&lt;/P&gt;&lt;P&gt;          t_amount-tramt = t_pohistory-cl_val_loc + t_amount-dpamt.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF NOT t_pohistory-cl_val_loc IS INITIAL.&lt;/P&gt;&lt;P&gt;          CONCATENATE t_pohistory-mat_doc t_pohistory-doc_year&lt;/P&gt;&lt;P&gt;                INTO bkpf-awkey.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          SELECT SINGLE * FROM bkpf&lt;/P&gt;&lt;P&gt;                WHERE awkey = bkpf-awkey.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          SELECT augdt augbl shkzg dmbtr wrbtr FROM bsak&lt;/P&gt;&lt;P&gt;                INTO (bsak-augdt,bsak-augbl,bsak-shkzg,&lt;/P&gt;&lt;P&gt;                      bsak-dmbtr,bsak-wrbtr)&lt;/P&gt;&lt;P&gt;                WHERE bukrs = bkpf-bukrs&lt;/P&gt;&lt;P&gt;                  AND gjahr = bkpf-gjahr&lt;/P&gt;&lt;P&gt;                  AND belnr = bkpf-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            IF bsak-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;              bsak-dmbtr = - bsak-dmbtr.&lt;/P&gt;&lt;P&gt;              bsak-wrbtr = - bsak-wrbtr.&lt;/P&gt;&lt;P&gt;            ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            IF t_pohistory-currency &amp;lt;&amp;gt; 'PHP'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             IF bsak-augdt GT pa_augdt.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              IF bsak-augdt IN so_augdt.&lt;/P&gt;&lt;P&gt;                t_amount-tramt = t_amount-tramt + bsak-wrbtr.&lt;/P&gt;&lt;P&gt;              ENDIF.&lt;/P&gt;&lt;P&gt;            ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             IF bsak-augdt GT pa_augdt.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              IF bsak-augdt IN so_augdt.&lt;/P&gt;&lt;P&gt;                t_amount-tramt = t_amount-tramt + bsak-dmbtr.&lt;/P&gt;&lt;P&gt;              ENDIF.&lt;/P&gt;&lt;P&gt;            ENDIF.&lt;/P&gt;&lt;P&gt;          ENDSELECT.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF t_account-distr_perc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;          t_amount-dpamt = ( t_account-distr_perc *&lt;/P&gt;&lt;P&gt;                             t_amount-dpamt ) / 100.&lt;/P&gt;&lt;P&gt;          t_amount-gramt = ( t_account-distr_perc *&lt;/P&gt;&lt;P&gt;                             t_amount-gramt ) / 100.&lt;/P&gt;&lt;P&gt;          t_amount-iramt = ( t_account-distr_perc *&lt;/P&gt;&lt;P&gt;                             t_amount-iramt ) / 100.&lt;/P&gt;&lt;P&gt;          t_amount-tramt = ( t_account-distr_perc *&lt;/P&gt;&lt;P&gt;                             t_amount-tramt ) / 100.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF t_amount-tramt &amp;lt; 0.&lt;/P&gt;&lt;P&gt;        t_amount-tramt = 0.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      t_amount-blamt = t_amount-netwr - t_amount-tramt.&lt;/P&gt;&lt;P&gt;      COLLECT t_amount. CLEAR t_amount.&lt;/P&gt;&lt;P&gt;      APPEND t_proj.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 07:41:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-validating-a-field-value/m-p/1134370#M112646</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-02-24T07:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in validating a field value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-validating-a-field-value/m-p/1134371#M112647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if both should have same value, then y r u doing separate calculations for both&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can use t_amount-tramt = t_amount-iramt right!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 07:56:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-validating-a-field-value/m-p/1134371#M112647</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2006-02-24T07:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in validating a field value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-validating-a-field-value/m-p/1134372#M112648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi viraylab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF t_amount-tramt &amp;lt; 0.&lt;/P&gt;&lt;P&gt;t_amount-tramt = 0.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;t_amount-blamt = t_amount-netwr - t_amount-tramt.&lt;/P&gt;&lt;P&gt;COLLECT t_amount. CLEAR t_amount.&lt;/P&gt;&lt;P&gt;APPEND t_proj.&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this collect will collect the wa into the table internal table. then your are clearing it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have you assigned the values for t_proj before appending&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;kishore&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 07:57:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-validating-a-field-value/m-p/1134372#M112648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-24T07:57:57Z</dc:date>
    </item>
  </channel>
</rss>

