<?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: Clearing Plan data before posting using BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/clearing-plan-data-before-posting-using-bapi/m-p/6343947#M1397912</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Resolved myself .&lt;/P&gt;&lt;P&gt;just passed same contents and fiscalyear-1  , -2  and made quantities 0..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;vara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Oct 2009 17:10:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-21T17:10:54Z</dc:date>
    <item>
      <title>Clearing Plan data before posting using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clearing-plan-data-before-posting-using-bapi/m-p/6343946#M1397911</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 am posting data using 'BAPI_COSTACTPLN_POSTKEYFIGURE'.&lt;/P&gt;&lt;P&gt;As this is a plan data I want to overwrite the previous fiscal years data.. How should I  do that?&lt;/P&gt;&lt;P&gt;out fiscal year started in october .now it is 2010.but it is not overwriting 2008 or 9 values..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 LOOP AT lt_itemp INTO wa_itemp.

 CLEAR:coobject,totvalue,indexstructure.

    v_count = v_count + 1.

***Total Value Structure***
    MOVE '1' TO wa_totvalue-value_index .
    MOVE wa_itemp-statkeyfig TO wa_totvalue-statkeyfig .
    MOVE wa_itemp-stat_qty  TO wa_totvalue-stat_qty .
    MOVE wa_itemp-stat_qty  TO wa_totvalue-stat_qty_max .
    MOVE '2' TO wa_totvalue-dist_key_quan .
    MOVE '2' TO  wa_totvalue-dist_key_quan_max .
 APPEND wa_totvalue TO totvalue.
***Index Structure**
    MOVE '1' TO  wa_indexstructure-object_index .
    MOVE '1' TO wa_indexstructure-value_index .

    APPEND wa_indexstructure TO indexstructure.

**CO object Structure**
    MOVE '1' TO wa_coobject-object_index .
    MOVE wa_itemp-rec_wbs_el TO wa_coobject-wbs_element .
   APPEND wa_coobject TO coobject.

   clear wa_headerinfo.

     wa_headerinfo-co_area = '1000'.
  wa_headerinfo-fisc_year = v_fiscalyear.
  wa_headerinfo-period_from = '1'.
  wa_headerinfo-period_to = '12'.
  wa_headerinfo-version = '000'.



   CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
*    ENDIF.
    CALL FUNCTION 'BAPI_COSTACTPLN_POSTKEYFIGURE'
        EXPORTING
          headerinfo           = wa_headerinfo
*   DELTA                = ' '
        TABLES
          indexstructure       = indexstructure
          coobject             = coobject
*   PERVALUE             = PERVALUE
         totvalue             = totvalue
          return               = return.

 

   IF sy-subrc IS INITIAL.

     CALL FUNCTION 'BAPI_PS_PRECOMMIT'.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2009 16:33:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clearing-plan-data-before-posting-using-bapi/m-p/6343946#M1397911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-21T16:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Clearing Plan data before posting using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clearing-plan-data-before-posting-using-bapi/m-p/6343947#M1397912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Resolved myself .&lt;/P&gt;&lt;P&gt;just passed same contents and fiscalyear-1  , -2  and made quantities 0..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;vara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2009 17:10:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clearing-plan-data-before-posting-using-bapi/m-p/6343947#M1397912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-21T17:10:54Z</dc:date>
    </item>
  </channel>
</rss>

