<?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: Substitution Rule in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/substitution-rule/m-p/5861833#M1321625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Noopers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't identify what is p_land1 value.&lt;/P&gt;&lt;P&gt;This is passed to ASSIGN_FREIGHT_COSTS form in the calling program.&lt;/P&gt;&lt;P&gt;Where this form is called?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried to set a break-point in the beginning of ASSIGN_FREIGHT_COSTS form?&lt;/P&gt;&lt;P&gt;Do this, and check P_LAND1 value before using in SELECT, I think this is the problem. P_LAND1 may have wrong value when you execute ASSIGN_FREIGHT_COSTS form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or maybe you have some old value in PCASUB, and the wrong value is coming from an old iteraction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Frisoni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2009 16:29:37 GMT</pubDate>
    <dc:creator>guilherme_frisoni</dc:creator>
    <dc:date>2009-07-28T16:29:37Z</dc:date>
    <item>
      <title>Substitution Rule</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/substitution-rule/m-p/5861832#M1321624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Guru's, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not an  ABAP person - trying to understand the logic of this program that is part of a substitution rule. We have a table that is being populated with country , cost center &amp;amp; profit center. The table is ZFREIGHT_COSTS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g of the table . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;country                       cost center                          profit center &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;France                       FRX1000                             ZXY1234               &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Germany                    FRX1000                            ZXY1235&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both have the same cost center, but the profit center is different. Now when billing is taking place a document is created on the SD side &amp;amp; one on the FI - the problem is occuring on the FI side - the cost center  populated is wrong in the General Ledger. &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;So how the program should work is based on the contry it picks the profit center and in turn based on Profit center it picks up cost center - all this is happening from the tabl that is being populated ZFREIGHT_COSTS. However, this is not what is happening it's working fine until profit center - then when it comes time to pull to the cost center it's picking the wrong one? Even thought the table is having a different value populated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the program:- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;SELECT SINGLE LAND1 "Country key&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;FROM  KNA1 "General Data in Customer Master&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;INTO CORRESPONDING FIELDS OF KNA1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;WHERE  KUNNR  = PCASUB-KUNNR.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *SELECT SINGLE * FROM  ZFREIGHT_COSTS*&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;WHERE  LAND1  = KNA1-LAND1. "Country key&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;IF SY-SUBRC = 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------------------------" /&gt;&lt;P&gt; up to here i understand the program is pulling the country from the master data of customer master. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;PCASUB-PRCTR = ZFREIGHT_COSTS-PRCTR. "PROFIT CENTER&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;ELSE.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;MESSAGE E015 WITH KNA1-LAND1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;ENDIF.                                                    "SY-SUBRC=0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ENDFORM.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------------------" /&gt;&lt;P&gt; at this point it's pulling the profit center from the table based on country. &lt;/P&gt;&lt;P&gt;&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;STRONG&gt;&amp;amp;      Form  ASSIGN_FREIGHT_COSTS&lt;/STRONG&gt;&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;      text*&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;*&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;*&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_KNA1_LAND1  text*&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;     &amp;lt;--P_T_DRSEG_CO_KOSTL  text*&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;*&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;*&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FORM ASSIGN_FREIGHT_COSTS USING    P_LAND1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                          &lt;STRONG&gt;CHANGING P_KOSTL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *SELECT SINGLE * FROM  ZFREIGHT_COSTS*&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;WHERE  LAND1  = P_LAND1. "COUNTRY&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;IF SY-SUBRC = 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;P_KOSTL = ZFREIGHT_COSTS-KOSTL. "COST CENTER&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;ELSE.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------------" /&gt;&lt;P&gt;at this point it should pull the cost center from the table based on the profit center?? - it does not seem to do it correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;MESSAGE E030 WITH P_LAND1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;ENDIF.                                                    "SY-SUBRC=0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ENDFORM.                    " ASSIGN_FREIGHT_COSTS&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;END RH1 ADD*&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please tell me if i am understanding the logic of this program correctly. Also I do not know what is this P_Land1?? How can i find out what it is?? What do you think is causing this not to work just for these two countries?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Noopers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 16:18:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/substitution-rule/m-p/5861832#M1321624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-28T16:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Substitution Rule</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/substitution-rule/m-p/5861833#M1321625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Noopers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't identify what is p_land1 value.&lt;/P&gt;&lt;P&gt;This is passed to ASSIGN_FREIGHT_COSTS form in the calling program.&lt;/P&gt;&lt;P&gt;Where this form is called?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried to set a break-point in the beginning of ASSIGN_FREIGHT_COSTS form?&lt;/P&gt;&lt;P&gt;Do this, and check P_LAND1 value before using in SELECT, I think this is the problem. P_LAND1 may have wrong value when you execute ASSIGN_FREIGHT_COSTS form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or maybe you have some old value in PCASUB, and the wrong value is coming from an old iteraction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Frisoni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 16:29:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/substitution-rule/m-p/5861833#M1321625</guid>
      <dc:creator>guilherme_frisoni</dc:creator>
      <dc:date>2009-07-28T16:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Substitution Rule</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/substitution-rule/m-p/5861834#M1321626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Frisoni, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help ...  I am still playing around with this. Will keep you posted &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank again for your help !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards, &lt;/P&gt;&lt;P&gt;Noopers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 14:56:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/substitution-rule/m-p/5861834#M1321626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T14:56:57Z</dc:date>
    </item>
  </channel>
</rss>

