<?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: Coding error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302489#M503366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're looping at itab1, but trying to modify customer. You don't have a position in customer, so maybe you want to append customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2007 17:37:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-24T17:37:56Z</dc:date>
    <item>
      <title>Coding error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302488#M503365</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 am getting Dum Error in this code where i put arrow mark.&lt;/P&gt;&lt;P&gt;Kindly please help me.&lt;/P&gt;&lt;P&gt;Its too urgent for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION Z_CUSTOMER_GET_LIST_1.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      CUSTOMER STRUCTURE  ZCUSTOMER_1&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables : KNA1 ,KNB1, ADRC, CAWN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : begin of itab1 occurs 0,&lt;/P&gt;&lt;P&gt;       kunnr like kna1-kunnr,&lt;/P&gt;&lt;P&gt;       name1 like kna1-name1,&lt;/P&gt;&lt;P&gt;       sortl like kna1-sortl,&lt;/P&gt;&lt;P&gt;       ktokd like kna1-ktokd,&lt;/P&gt;&lt;P&gt;       telf1 like kna1-telf1,&lt;/P&gt;&lt;P&gt;       telfx like kna1-telfx,&lt;/P&gt;&lt;P&gt;       stras like kna1-stras,&lt;/P&gt;&lt;P&gt;       regio like kna1-regio,&lt;/P&gt;&lt;P&gt;       ADRNR like kna1-adrnr,&lt;/P&gt;&lt;P&gt;       ort01 like kna1-ort01,&lt;/P&gt;&lt;P&gt;       land1 like kna1-land1,&lt;/P&gt;&lt;P&gt;       pstlz like kna1-pstlz,&lt;/P&gt;&lt;P&gt;       loevm like kna1-loevm,&lt;/P&gt;&lt;P&gt;       nodel like kna1-nodel,&lt;/P&gt;&lt;P&gt;       spras like kna1-spras,&lt;/P&gt;&lt;P&gt;       end of itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : begin of itab2 occurs 0,&lt;/P&gt;&lt;P&gt;       ADDRNUMBER like adrc-ADDRNUMBER,&lt;/P&gt;&lt;P&gt;       transpzone like adrc-transpzone,&lt;/P&gt;&lt;P&gt;       str_suppl1 like adrc-str_suppl1,&lt;/P&gt;&lt;P&gt;       str_suppl2 like adrc-str_suppl2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       end of itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : begin of itab3 occurs 0,&lt;/P&gt;&lt;P&gt;       kunnr like knb1-kunnr,&lt;/P&gt;&lt;P&gt;       zterm like knb1-zterm,&lt;/P&gt;&lt;P&gt;       end of itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : begin of itab4 occurs 0,&lt;/P&gt;&lt;P&gt;       atinn like cawn-atinn,&lt;/P&gt;&lt;P&gt;       spars like cawn-spras,&lt;/P&gt;&lt;P&gt;       end of itab4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select kunnr name1 sortl ktokd telf1&lt;/P&gt;&lt;P&gt;       telfx stras regio ort01 land1&lt;/P&gt;&lt;P&gt;       pstlz loevm nodel adrnr from kna1&lt;/P&gt;&lt;P&gt;       into corresponding fields of table itab1 where KTOKD EQ 'Z001'&lt;/P&gt;&lt;P&gt;                           or KTOKD EQ 'Z002'&lt;/P&gt;&lt;P&gt;                           or KTOKD EQ 'Z003'&lt;/P&gt;&lt;P&gt;                           or KTOKD EQ 'Z004'&lt;/P&gt;&lt;P&gt;                           or KTOKD EQ 'ZSAI' .&lt;/P&gt;&lt;P&gt;sort itab1 by kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;if itab1-ktokd = 'Z001'.&lt;/P&gt;&lt;P&gt;itab1-ktokd = 'SP'.&lt;/P&gt;&lt;P&gt;modify itab1.&lt;/P&gt;&lt;P&gt;elseif itab1-ktokd = 'Z002'.&lt;/P&gt;&lt;P&gt;itab1-ktokd = 'SH'.&lt;/P&gt;&lt;P&gt;modify itab1.&lt;/P&gt;&lt;P&gt;elseif itab1-ktokd = 'Z003'.&lt;/P&gt;&lt;P&gt;itab1-ktokd = 'PY'.&lt;/P&gt;&lt;P&gt;modify itab1.&lt;/P&gt;&lt;P&gt;elseif itab1-ktokd = 'Z004'.&lt;/P&gt;&lt;P&gt;itab1-ktokd = 'BP'.&lt;/P&gt;&lt;P&gt;modify itab1.&lt;/P&gt;&lt;P&gt;elseif itab1-ktokd = 'ZSAI'.&lt;/P&gt;&lt;P&gt;itab1-ktokd = 'IC'.&lt;/P&gt;&lt;P&gt;modify itab1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear customer.&lt;/P&gt;&lt;P&gt;refresh customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*select addrnumber str_suppl1 str_suppl2 transpzone from adrc into table itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*sort itab2 by addrnumber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select kunnr zterm from knb1 into corresponding fields of table itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;loop at itab1 where ktokd = 'SP' or ktokd = 'BP'.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;**read table itab2 with key addrnumber = itab1-adrnr binary search.&lt;/P&gt;&lt;P&gt;**if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;read table itab3 with key kunnr = itab1-kunnr binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to customer.&lt;/P&gt;&lt;P&gt;**move-corresponding itab2 to customer.&lt;/P&gt;&lt;P&gt;move-corresponding itab3 to customer.&lt;/P&gt;&lt;P&gt;*customer-kunnr = itab1-kunnr.&lt;/P&gt;&lt;P&gt;*customer-name1 = itab1-name1.&lt;/P&gt;&lt;P&gt;*customer-sortl = itab1-sortl.&lt;/P&gt;&lt;P&gt;*customer-ktokd = itab1-ktokd.&lt;/P&gt;&lt;P&gt;*customer-telf1 = itab1-telf1.&lt;/P&gt;&lt;P&gt;*customer-telfx = itab1-telfx.&lt;/P&gt;&lt;P&gt;*customer-stras = itab1-stras.&lt;/P&gt;&lt;P&gt;*customer-regio = itab1-regio.&lt;/P&gt;&lt;P&gt;*customer-ort01 = itab1-ort01.&lt;/P&gt;&lt;P&gt;*customer-pstlz = itab1-pstlz.&lt;/P&gt;&lt;P&gt;*customer-loevm = itab1-loevm.&lt;/P&gt;&lt;P&gt;*customer-nodel = itab1-nodel.&lt;/P&gt;&lt;P&gt;*customer-zterm = itab3-zterm.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;append customer.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&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;&lt;P&gt;loop at itab1 where ktokd = 'SH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select addrnumber transpzone str_suppl1 str_suppl2&lt;/P&gt;&lt;P&gt;       from adrc into itab2&lt;/P&gt;&lt;P&gt;       where addrnumber = itab1-adrnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*move-corresponding itab2 to customer.&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 where ktokd = 'SH'.&lt;/P&gt;&lt;P&gt;read table itab2 with key addrnumber = itab1-adrnr binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;customer-str_suppl1 = itab2-str_suppl1.&lt;/P&gt;&lt;P&gt;customer-str_suppl2 = itab2-str_suppl2.&lt;/P&gt;&lt;P&gt;customer-transpzone = itab2-transpzone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;&amp;gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 17:23:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302488#M503365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-24T17:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Coding error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302489#M503366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're looping at itab1, but trying to modify customer. You don't have a position in customer, so maybe you want to append customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 17:37:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302489#M503366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-24T17:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Coding error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302490#M503367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;customer-str_suppl1 = itab2-str_suppl1.&lt;/P&gt;&lt;P&gt;customer-str_suppl2 = itab2-str_suppl2.&lt;/P&gt;&lt;P&gt;customer-transpzone = itab2-transpzone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;append customer&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 17:39:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302490#M503367</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-24T17:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Coding error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302491#M503368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subramanyam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have refreshed the Internal table and then u r trying to modify it.&lt;/P&gt;&lt;P&gt;(Just above the endif at which u got an error).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;according to me it should be Append customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****Dont forget to give points to useful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 17:44:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302491#M503368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-24T17:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Coding error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302492#M503369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try changing your statements to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 where ktokd = 'SH'.&lt;/P&gt;&lt;P&gt;read table itab2 with key addrnumber = itab1-adrnr binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*customer-str_suppl1 = itab2-str_suppl1.&lt;/P&gt;&lt;P&gt;*customer-str_suppl2 = itab2-str_suppl2.&lt;/P&gt;&lt;P&gt;*customer-transpzone = itab2-transpzone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY customer FROM itab2.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work since you are actually using a single record from itab2 (so it's like a work area).  Otherwise, read your itab2 record into a workarea and then modify customer from that work area.&lt;/P&gt;&lt;P&gt; - April King&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 17:46:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302492#M503369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-24T17:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Coding error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302493#M503370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is my requirment. I need to fetch data from kna1, knb1, adrc and cawn based on these coditions ( between " " )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R/3 Description	Table 	SAP Field Name 	Comments &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOLD_                 	KNA1	KUNNR	&lt;/P&gt;&lt;P&gt;LONG NAME	KNA1	NAME 1	&lt;/P&gt;&lt;P&gt;Customer Name 	KNA1	SORTL	&lt;/P&gt;&lt;P&gt;Partner Type 	KNA1	KTOKD	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Build logic so that the partner type is   not sent to ISP but the code is:&lt;/P&gt;&lt;P&gt;Z001 = SP&lt;/P&gt;&lt;P&gt;Z002 = SH&lt;/P&gt;&lt;P&gt;Z003 = PY&lt;/P&gt;&lt;P&gt;Z004 = BP &lt;/P&gt;&lt;P&gt;ZSAI = IC &lt;/P&gt;&lt;P&gt;Do not interface any partner types but those mentioned here."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Telephone 	                KNA1	TELF1	&lt;/P&gt;&lt;P&gt;Fax Number 	KNA1	TELFX	&lt;/P&gt;&lt;P&gt;Street Address	KNA1	STRAS 	&lt;/P&gt;&lt;P&gt;Street 2	                ADRC 	STR_SUPPL1	&lt;/P&gt;&lt;P&gt;Street 3	                ADRC 	STR_SUPPL2	&lt;/P&gt;&lt;P&gt;City 	                KNA1	REGIO	&lt;/P&gt;&lt;P&gt;Region	                KNA1	ORT01	&lt;/P&gt;&lt;P&gt;Country	                KNA1	LAND1	&lt;/P&gt;&lt;P&gt;Postal Code 	KNA1	PSTLZ	&lt;/P&gt;&lt;P&gt;Transportation Zone	ADRC 	TRANSPZONE&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;"Only available for ship to  = Z002 "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Payment Term	KNB1	ZTERM	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Only available for Sold to &amp;amp; Bill to "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GroupID                    CAWN	ATINN	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Only for Sold to "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deletion Flag 	KNA1	LOEVM	&lt;/P&gt;&lt;P&gt;"If there is a value in this field it needs to be passed to the ISP to have the record deleted from CP "&lt;/P&gt;&lt;P&gt;Deletion Flag 	KNA1	NODEL	&lt;/P&gt;&lt;P&gt;"If there is a value in this field it needs to be passed to the ISP to have the record deleted from CP "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLease help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 18:04:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-error/m-p/2302493#M503370</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-24T18:04:01Z</dc:date>
    </item>
  </channel>
</rss>

