<?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: Cam someone help with below ABAP code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137323#M1975731</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your replies. I am really sorry if i wasted you time but the issue was with one of the columns used in where clause. I rectified the data in that column and the same code worked.&lt;/P&gt;</description>
    <pubDate>Sun, 16 Feb 2020 12:34:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2020-02-16T12:34:06Z</dc:date>
    <item>
      <title>Cam someone help with below ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137318#M1975726</link>
      <description>&lt;P&gt;Hi Friends,&lt;/P&gt;
  &lt;P&gt;I am new to ABAP coding and have written one code as below. But GL_Account column is not being updated not sure why.&lt;/P&gt;
  &lt;P&gt;Can someone please help&lt;/P&gt;
  &lt;P&gt;TYPES:&lt;/P&gt;
  &lt;P&gt; BEGIN OF ty_mapping,&lt;/P&gt;
  &lt;P&gt;cond_type TYPE c LENGTH 30,&lt;/P&gt;
  &lt;P&gt;gl_account TYPE c LENGTH 10,&lt;/P&gt;
  &lt;P&gt;country TYPE c LENGTH 10,&lt;/P&gt;
  &lt;P&gt;distr_chan TYPE c LENGTH 10,&lt;/P&gt;
  &lt;P&gt; END OF ty_mapping.&lt;/P&gt;
  &lt;P&gt; DATA: lt_avfmapping TYPE STANDARD TABLE OF ty_mapping,&lt;/P&gt;
  &lt;P&gt;ls_avfmapping TYPE ty_mapping.&lt;/P&gt;
  &lt;P&gt; SELECT cond_type&lt;/P&gt;
  &lt;P&gt;gl_account&lt;/P&gt;
  &lt;P&gt;country&lt;/P&gt;
  &lt;P&gt;distr_chan&lt;/P&gt;
  &lt;P&gt; FROM /bic/ac_afinval2&lt;/P&gt;
  &lt;P&gt; INTO TABLE lt_avfmapping&lt;/P&gt;
  &lt;P&gt; WHERE ( src_trdp = 'No' or src_trdp = 'NO' ) and country = 'CCE' .&lt;/P&gt;
  &lt;P&gt; IF sy-subrc = 0.&lt;/P&gt;
  &lt;P&gt; SORT lt_avfmapping BY cond_typeDISTR_CHAN ASCENDING.&lt;/P&gt;
  &lt;P&gt; DELETE ADJACENT DUPLICATES FROM lt_avfmapping&lt;/P&gt;
  &lt;P&gt; COMPARING cond_type.&lt;/P&gt;
  &lt;P&gt; ENDIF.&lt;/P&gt;
  &lt;P&gt; FIELD-SYMBOLS:&lt;/P&gt;
  &lt;P&gt;&amp;lt;fs_datapak&amp;gt; LIKE LINE OF RESULT_PACKAGE.&lt;/P&gt;
  &lt;P&gt; LOOP AT RESULT_PACKAGE ASSIGNING &amp;lt;fs_datapak&amp;gt;.&lt;/P&gt;
  &lt;P&gt;READ TABLE lt_avfmapping INTO ls_avfmapping WITH KEY&lt;/P&gt;
  &lt;P&gt;cond_type = &amp;lt;fs_datapak&amp;gt;-KNART&lt;/P&gt;
  &lt;P&gt;distr_chan = &amp;lt;fs_datapak&amp;gt;-DISTR_CHAN .&lt;/P&gt;
  &lt;P&gt; IF sy-subrc = 0.&lt;/P&gt;
  &lt;P&gt;&amp;lt;fs_datapak&amp;gt;-GL_ACCOUNT = ls_avfmapping-gl_account .&lt;/P&gt;
  &lt;P&gt;ENDIF.&lt;/P&gt;
  &lt;P&gt; ENDLOOP .&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2020 13:17:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137318#M1975726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-02-15T13:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cam someone help with below ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137319#M1975727</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;while using code in questions, use code button in order to view properly &lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2020 13:46:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137319#M1975727</guid>
      <dc:creator>Abinathsiva</dc:creator>
      <dc:date>2020-02-15T13:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cam someone help with below ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137320#M1975728</link>
      <description>&lt;P&gt;When you debug your logic, are your tables filled with the information you expect? What happens in the loop when you are trying to set the gl_account?&lt;/P&gt;&lt;P&gt;So far you have not given enough information to help you out, one could only guess.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2020 16:54:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137320#M1975728</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-02-15T16:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cam someone help with below ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137321#M1975729</link>
      <description>&lt;P&gt;From the information you've given, there could be multiple sources of the problem.&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;Simply data missing in the tables&lt;/LI&gt;&lt;LI&gt;Data in the column gl_account of the table "/bic/ac_afinval2" being 0&lt;/LI&gt;&lt;LI&gt;There could be a problem with the types. You use the type "ty_mapping", which is clear, because it is explicitly defined in your code, but we dont know the type of fields of "/bic/ac_afinval2" (character legnths) and of "result_package". If the type of &amp;lt;fs_datapak&amp;gt;-KNART and cond_type don't match exactly, then the READ statement will not find any entry and exit with subrc = 4, therefore you will never get to your assignment "&amp;lt;fs_datapak&amp;gt;-gl_account = ls_avfmapping-gl_account."&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;What i would suggest is either you try to debug the program as @Michael Piersche suggested and see the types yourself or you post the exact types here, so someone could help.&lt;/P&gt;&lt;P&gt;As a sidenote - you don't use some nice new features available in abap since version 7.4, like new open sql syntax or inline declarations.
You could look up the version of your system:&lt;/P&gt;&lt;P&gt;In the SAP GUI &amp;gt; under Menu: "System" &amp;gt; click on "Status ..." &amp;gt; in the section "SAP System data" &amp;gt; under "Product version" &amp;gt; click the magnifying glass &amp;gt; in the Tab "Installed Product Versions" look in the "Release" column for the Product "SAP NETWEAVER".&lt;/P&gt;&lt;P&gt;If the Version is &amp;gt;= 7.4, i could show you how to further simplify your code.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2020 17:47:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137321#M1975729</guid>
      <dc:creator>an10n</dc:creator>
      <dc:date>2020-02-15T17:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cam someone help with below ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137322#M1975730</link>
      <description>&lt;P&gt;Please enter a meaningful title (currently, it has the same meaning as none title). And use the CODE button to format the code (as S Abinath said).&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2020 17:48:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137322#M1975730</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-02-15T17:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cam someone help with below ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137323#M1975731</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your replies. I am really sorry if i wasted you time but the issue was with one of the columns used in where clause. I rectified the data in that column and the same code worked.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2020 12:34:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cam-someone-help-with-below-abap-code/m-p/12137323#M1975731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-02-16T12:34:06Z</dc:date>
    </item>
  </channel>
</rss>

