<?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 Question for ABAP coding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-for-abap-coding/m-p/3086032#M731870</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a report that I am making that I am stuck on. I have to select a date range, sales org, and currency to view the report in.  I have coded it and it looks right to me, but I don't get the correct results.  In stead i get a message after the inputs that says "Enter rate / USD rate type M for 27.11.2007 in the system settings"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where usd is the user input currency and 27.11.2007 is the second range of the input date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code:&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;*&amp;amp; Report  ZDCA01FN2                                                   *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&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;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&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;REPORT  ZDCA01FN2 MESSAGE-ID ZD01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*create type with wanted fields&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF VBRK_TYP,&lt;/P&gt;&lt;P&gt;              SORG     TYPE VBRK-VKORG,&lt;/P&gt;&lt;P&gt;              TAX_AMT  TYPE VBRK-MWSBK,&lt;/P&gt;&lt;P&gt;              CURRENCY TYPE VBRK-WAERK,&lt;/P&gt;&lt;P&gt;              SDATE    TYPE VBRK-ERDAT,&lt;/P&gt;&lt;P&gt;             END OF VBRK_TYP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:        WA_DVBRK TYPE VBRK_TYP,&lt;/P&gt;&lt;P&gt;             ITAB_VBRK TYPE STANDARD TABLE OF VBRK_TYP,&lt;/P&gt;&lt;P&gt;             LOCAL_AMOUNT TYPE VBRK-MWSBK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*select range of dates&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: PDATE FOR WA_DVBRK-SDATE OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*user select currency value use value and sales organization&lt;/P&gt;&lt;P&gt;PARAMETERS:  CURRENCY TYPE VBRK-WAERK OBLIGATORY VALUE CHECK,&lt;/P&gt;&lt;P&gt;             SALEORG TYPE VBRK-VKORG OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*select all first before function call and collect appropriate fields&lt;/P&gt;&lt;P&gt;*into itable&lt;/P&gt;&lt;P&gt;SELECT * FROM VBRK INTO CORRESPONDING FIELDS OF WA_DVBRK&lt;/P&gt;&lt;P&gt;             WHERE VKORG = SALEORG AND&lt;/P&gt;&lt;P&gt;             ERDAT IN PDATE.&lt;/P&gt;&lt;P&gt;COLLECT WA_DVBRK INTO ITAB_VBRK.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*error check to see if needed to perform sub &amp;amp; function&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;  MESSAGE A000.&lt;/P&gt;&lt;P&gt;  EXIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;PERFORM SUB_WRITE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM SUB_WRITE.&lt;/P&gt;&lt;P&gt;DATA: TOTAL_SALES TYPE VBRK-MWSBK,&lt;/P&gt;&lt;P&gt;      MISSING_RATE TYPE I VALUE '5'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB_VBRK INTO WA_DVBRK.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;    DATE = SYST-DATUM&lt;/P&gt;&lt;P&gt;    FOREIGN_AMOUNT = WA_DVBRK-TAX_AMT&lt;/P&gt;&lt;P&gt;    FOREIGN_CURRENCY = WA_DVBRK-CURRENCY&lt;/P&gt;&lt;P&gt;    LOCAL_CURRENCY = CURRENCY&lt;/P&gt;&lt;P&gt;    RATE = 0&lt;/P&gt;&lt;P&gt;    TYPE_OF_RATE = 'M'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;    LOCAL_AMOUNT = LOCAL_AMOUNT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;    MISSING_RATE = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*check to see if conversion worked&lt;/P&gt;&lt;P&gt;IF SYST-SUBRC = MISSING_RATE.&lt;/P&gt;&lt;P&gt;   MESSAGE A000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*output report records&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;   WRITE: /10 WA_DVBRK-SORG,&lt;/P&gt;&lt;P&gt;           20 WA_DVBRK-CURRENCY,&lt;/P&gt;&lt;P&gt;           20 WA_DVBRK-SDATE,&lt;/P&gt;&lt;P&gt;           30 WA_DVBRK-TAX_AMT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*add total sales for report&lt;/P&gt;&lt;P&gt;TOTAL_SALES = LOCAL_AMOUNT + TOTAL_SALES.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;SKIP 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*write added total sales&lt;/P&gt;&lt;P&gt;WRITE: / TEXT-004,&lt;/P&gt;&lt;P&gt;         TOTAL_SALES,&lt;/P&gt;&lt;P&gt;         TEXT-005,&lt;/P&gt;&lt;P&gt;         CURRENCY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*FOOTER&lt;/P&gt;&lt;P&gt;SKIP 1.&lt;/P&gt;&lt;P&gt;ULINE: /02(70).&lt;/P&gt;&lt;P&gt;WRITE:  /15 TEXT-001, SY-UNAME.&lt;/P&gt;&lt;P&gt;WRITE:  /15 TEXT-002, SY-DATUM.&lt;/P&gt;&lt;P&gt;WRITE:  /15 TEXT-003, SY-UZEIT.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Nov 2007 16:44:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-27T16:44:54Z</dc:date>
    <item>
      <title>Question for ABAP coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-for-abap-coding/m-p/3086032#M731870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a report that I am making that I am stuck on. I have to select a date range, sales org, and currency to view the report in.  I have coded it and it looks right to me, but I don't get the correct results.  In stead i get a message after the inputs that says "Enter rate / USD rate type M for 27.11.2007 in the system settings"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where usd is the user input currency and 27.11.2007 is the second range of the input date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code:&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;*&amp;amp; Report  ZDCA01FN2                                                   *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&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;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&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;REPORT  ZDCA01FN2 MESSAGE-ID ZD01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*create type with wanted fields&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF VBRK_TYP,&lt;/P&gt;&lt;P&gt;              SORG     TYPE VBRK-VKORG,&lt;/P&gt;&lt;P&gt;              TAX_AMT  TYPE VBRK-MWSBK,&lt;/P&gt;&lt;P&gt;              CURRENCY TYPE VBRK-WAERK,&lt;/P&gt;&lt;P&gt;              SDATE    TYPE VBRK-ERDAT,&lt;/P&gt;&lt;P&gt;             END OF VBRK_TYP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:        WA_DVBRK TYPE VBRK_TYP,&lt;/P&gt;&lt;P&gt;             ITAB_VBRK TYPE STANDARD TABLE OF VBRK_TYP,&lt;/P&gt;&lt;P&gt;             LOCAL_AMOUNT TYPE VBRK-MWSBK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*select range of dates&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: PDATE FOR WA_DVBRK-SDATE OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*user select currency value use value and sales organization&lt;/P&gt;&lt;P&gt;PARAMETERS:  CURRENCY TYPE VBRK-WAERK OBLIGATORY VALUE CHECK,&lt;/P&gt;&lt;P&gt;             SALEORG TYPE VBRK-VKORG OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*select all first before function call and collect appropriate fields&lt;/P&gt;&lt;P&gt;*into itable&lt;/P&gt;&lt;P&gt;SELECT * FROM VBRK INTO CORRESPONDING FIELDS OF WA_DVBRK&lt;/P&gt;&lt;P&gt;             WHERE VKORG = SALEORG AND&lt;/P&gt;&lt;P&gt;             ERDAT IN PDATE.&lt;/P&gt;&lt;P&gt;COLLECT WA_DVBRK INTO ITAB_VBRK.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*error check to see if needed to perform sub &amp;amp; function&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;  MESSAGE A000.&lt;/P&gt;&lt;P&gt;  EXIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;PERFORM SUB_WRITE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM SUB_WRITE.&lt;/P&gt;&lt;P&gt;DATA: TOTAL_SALES TYPE VBRK-MWSBK,&lt;/P&gt;&lt;P&gt;      MISSING_RATE TYPE I VALUE '5'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB_VBRK INTO WA_DVBRK.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;    DATE = SYST-DATUM&lt;/P&gt;&lt;P&gt;    FOREIGN_AMOUNT = WA_DVBRK-TAX_AMT&lt;/P&gt;&lt;P&gt;    FOREIGN_CURRENCY = WA_DVBRK-CURRENCY&lt;/P&gt;&lt;P&gt;    LOCAL_CURRENCY = CURRENCY&lt;/P&gt;&lt;P&gt;    RATE = 0&lt;/P&gt;&lt;P&gt;    TYPE_OF_RATE = 'M'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;    LOCAL_AMOUNT = LOCAL_AMOUNT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;    MISSING_RATE = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*check to see if conversion worked&lt;/P&gt;&lt;P&gt;IF SYST-SUBRC = MISSING_RATE.&lt;/P&gt;&lt;P&gt;   MESSAGE A000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*output report records&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;   WRITE: /10 WA_DVBRK-SORG,&lt;/P&gt;&lt;P&gt;           20 WA_DVBRK-CURRENCY,&lt;/P&gt;&lt;P&gt;           20 WA_DVBRK-SDATE,&lt;/P&gt;&lt;P&gt;           30 WA_DVBRK-TAX_AMT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*add total sales for report&lt;/P&gt;&lt;P&gt;TOTAL_SALES = LOCAL_AMOUNT + TOTAL_SALES.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;SKIP 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*write added total sales&lt;/P&gt;&lt;P&gt;WRITE: / TEXT-004,&lt;/P&gt;&lt;P&gt;         TOTAL_SALES,&lt;/P&gt;&lt;P&gt;         TEXT-005,&lt;/P&gt;&lt;P&gt;         CURRENCY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*FOOTER&lt;/P&gt;&lt;P&gt;SKIP 1.&lt;/P&gt;&lt;P&gt;ULINE: /02(70).&lt;/P&gt;&lt;P&gt;WRITE:  /15 TEXT-001, SY-UNAME.&lt;/P&gt;&lt;P&gt;WRITE:  /15 TEXT-002, SY-DATUM.&lt;/P&gt;&lt;P&gt;WRITE:  /15 TEXT-003, SY-UZEIT.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2007 16:44:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-for-abap-coding/m-p/3086032#M731870</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-27T16:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Question for ABAP coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-for-abap-coding/m-p/3086033#M731871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears that configuration is missing for currency USD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consult your functional consultant to resolve the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In IMG (Transaction SPRO) under &lt;/P&gt;&lt;P&gt;SAP Netweaver -&amp;gt; General Settings -&amp;gt; Currencies -&amp;gt; Check Exchange Rate Types&lt;/P&gt;&lt;P&gt;SAP Netweaver -&amp;gt; General Settings -&amp;gt; Currencies -&amp;gt; Enter Exchange Rates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naveen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2007 11:27:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-for-abap-coding/m-p/3086033#M731871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-28T11:27:24Z</dc:date>
    </item>
  </channel>
</rss>

