<?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: BAPI Select Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-select-query/m-p/2964745#M699544</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
call function 'BAPI_COSTCENTERGROUP_GETDETAIL'
  exporting
    controllingarea = p_kokrs
    groupname       = p_ksgru
  tables
    hierarchynodes  = itab_nodes
    hierarchyvalues = gt_cgrp.
 
if sy-subrc = 0.
  refresh s_kostl.
  move: 'I' to s_kostl-sign,
        'BT' to s_kostl-option.
  loop at gt_cgrp.
    move gt_cgrp-valfrom to s_kostl-low.
    move gt_cgrp-valto   to s_kostl-high.
    append s_kostl.
  endloop.
endif.

sort s_kostl.
delete adjacent duplicates from s_kostl.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Oct 2007 18:48:04 GMT</pubDate>
    <dc:creator>ferry_lianto</dc:creator>
    <dc:date>2007-10-09T18:48:04Z</dc:date>
    <item>
      <title>BAPI Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-select-query/m-p/2964744#M699543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;    call function 'BAPI_COSTCENTERGROUP_GETDETAIL'
         exporting
              controllingarea = p_kokrs
              groupname       = p_ksgru
         tables
              hierarchynodes  = itab_nodes
              hierarchyvalues = gt_cgrp.

    if sy-subrc = 0.
      refresh s_kostl.
      move: 'I' to s_kostl-sign,
            'BT' to s_kostl-option.
      loop at gt_cgrp.
        move gt_cgrp-valfrom to s_kostl-low.
        move gt_cgrp-valto   to s_kostl-high.
        append s_kostl.
      endloop.
    endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above code even though the BAPI returns 33 values &lt;/P&gt;&lt;P&gt;S_KOSTL has 66 values ( values are replicated into it).&lt;/P&gt;&lt;P&gt;How to fix this problem.......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2007 18:44:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-select-query/m-p/2964744#M699543</guid>
      <dc:creator>SG141</dc:creator>
      <dc:date>2007-10-09T18:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-select-query/m-p/2964745#M699544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
call function 'BAPI_COSTCENTERGROUP_GETDETAIL'
  exporting
    controllingarea = p_kokrs
    groupname       = p_ksgru
  tables
    hierarchynodes  = itab_nodes
    hierarchyvalues = gt_cgrp.
 
if sy-subrc = 0.
  refresh s_kostl.
  move: 'I' to s_kostl-sign,
        'BT' to s_kostl-option.
  loop at gt_cgrp.
    move gt_cgrp-valfrom to s_kostl-low.
    move gt_cgrp-valto   to s_kostl-high.
    append s_kostl.
  endloop.
endif.

sort s_kostl.
delete adjacent duplicates from s_kostl.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2007 18:48:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-select-query/m-p/2964745#M699544</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2007-10-09T18:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-select-query/m-p/2964746#M699545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karthik - your code works with no problems in our system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand, you are checking the return code after the BAPI call. You should be checking the BAPI return structure instead. So it may be that the BAPI is not returning values, and you have tables that are filled with old values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rob Burbank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2007 19:07:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-select-query/m-p/2964746#M699545</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-09T19:07:51Z</dc:date>
    </item>
  </channel>
</rss>

