<?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 BAPI_PROJECT_MAINTAIN - example in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-project-maintain-example/m-p/2727129#M632955</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;I would be greatful if someone could post a complete example of code that calls BAPI_PROJECT_MAINTAIN. I'm having a few probles specifically with assigning hierachy so if i could see an example of the bapi in use that would help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Sep 2007 15:06:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-04T15:06:07Z</dc:date>
    <item>
      <title>BAPI_PROJECT_MAINTAIN - example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-project-maintain-example/m-p/2727129#M632955</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;I would be greatful if someone could post a complete example of code that calls BAPI_PROJECT_MAINTAIN. I'm having a few probles specifically with assigning hierachy so if i could see an example of the bapi in use that would help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 15:06:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-project-maintain-example/m-p/2727129#M632955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T15:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PROJECT_MAINTAIN - example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-project-maintain-example/m-p/2727130#M632956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Here is the example code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&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;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_seqno(6)  TYPE n   VALUE '000001',&lt;/P&gt;&lt;P&gt;      lc_seqno(6)  TYPE n   VALUE '000000'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structures and Internal tables used in the BAPI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA  : gs_project_definition       LIKE bapi_project_definition,&lt;/P&gt;&lt;P&gt;        gs_project_definition_upd   LIKE bapi_project_definition_up.&lt;/P&gt;&lt;P&gt;DATA  : gt_method_project           LIKE bapi_method_project&lt;/P&gt;&lt;P&gt;                                         OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        gt_wbs_element_table_update LIKE bapi_wbs_element_update&lt;/P&gt;&lt;P&gt;                                         OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        gt_wbs_element_table        LIKE bapi_wbs_element&lt;/P&gt;&lt;P&gt;                                         OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        gt_wbs_hierarchie_table     LIKE bapi_wbs_hierarchie&lt;/P&gt;&lt;P&gt;                                         OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        gt_return                   LIKE bapireturn1&lt;/P&gt;&lt;P&gt;                                         OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        gt_return1                  LIKE bapiret2&lt;/P&gt;&lt;P&gt;                                         OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        gt_message_table            LIKE bapi_meth_message&lt;/P&gt;&lt;P&gt;                                         OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate Project definition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gs_project_definition-project_definition = 'PD-TRAINING'.&lt;/P&gt;&lt;P&gt;gs_project_definition-description        = 'Training project'.&lt;/P&gt;&lt;P&gt;gs_project_definition-project_profile    = 'PPRO001'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate Project dafinition update table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gs_project_definition_upd-project_definition = space.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate project method update&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gt_method_project-refnumber      = lv_seqno.&lt;/P&gt;&lt;P&gt;gt_method_project-objecttype     = 'WBS-ELEMENT'.&lt;/P&gt;&lt;P&gt;gt_method_project-method         = 'CREATE'.&lt;/P&gt;&lt;P&gt;gt_method_project-objectkey      = 'TRAINING'.&lt;/P&gt;&lt;P&gt;APPEND gt_method_project.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;lv_seqno = lv_seqno + 1.&lt;/P&gt;&lt;P&gt;gt_method_project-refnumber      = lv_seqno.&lt;/P&gt;&lt;P&gt;gt_method_project-objecttype     = 'WBS-ELEMENT'.&lt;/P&gt;&lt;P&gt;gt_method_project-method         = 'CREATE'.&lt;/P&gt;&lt;P&gt;gt_method_project-objectkey      = 'TRAINING.1'.&lt;/P&gt;&lt;P&gt;APPEND gt_method_project.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;lv_seqno = lv_seqno + 1.&lt;/P&gt;&lt;P&gt;gt_method_project-refnumber      = lv_seqno.&lt;/P&gt;&lt;P&gt;gt_method_project-objecttype     = 'WBS-ELEMENT'.&lt;/P&gt;&lt;P&gt;gt_method_project-method         = 'CREATE'.&lt;/P&gt;&lt;P&gt;gt_method_project-objectkey      = 'TRAINING.2'.&lt;/P&gt;&lt;P&gt;APPEND gt_method_project.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;gt_method_project-refnumber      = lc_seqno.&lt;/P&gt;&lt;P&gt;gt_method_project-objecttype     = space.&lt;/P&gt;&lt;P&gt;gt_method_project-method         = 'SAVE'.&lt;/P&gt;&lt;P&gt;gt_method_project-objectkey      = space.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate WBS element&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gt_wbs_element_table-wbs_element        = 'TRAINING'.&lt;/P&gt;&lt;P&gt;gt_wbs_element_table-project_definition = 'PD-TRAINING'.&lt;/P&gt;&lt;P&gt;gt_wbs_element_table-description        = 'Whole Project'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;gt_wbs_element_table-wbs_element        = 'TRAINING.1'.&lt;/P&gt;&lt;P&gt;gt_wbs_element_table-project_definition = 'PD-TRAINING'.&lt;/P&gt;&lt;P&gt;gt_wbs_element_table-description        = 'Preparation'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;gt_wbs_element_table-wbs_element        = 'TRAINING.2'.&lt;/P&gt;&lt;P&gt;gt_wbs_element_table-project_definition = 'PD-TRAINING'.&lt;/P&gt;&lt;P&gt;gt_wbs_element_table-description        = 'Execution'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Update the I_WBS_ELEMENT_TABLE_UPDATE table for the BAPI&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This is done 3 times because there are 3 WBS elements&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;created for the Studio Project&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DO 3 TIMES.&lt;/P&gt;&lt;P&gt;  gt_wbs_element_table_update-wbs_element = 'I'.&lt;/P&gt;&lt;P&gt;  APPEND gt_wbs_element_table_update.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          i_project_definition       = gs_project_definition&lt;/P&gt;&lt;P&gt;          i_project_definition_upd   = gs_project_definition_upd&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          return                     = gt_return&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;          i_method_project           = gt_method_project&lt;/P&gt;&lt;P&gt;          i_wbs_element_table_update = gt_wbs_element_table_update&lt;/P&gt;&lt;P&gt;          i_wbs_element_table        = gt_wbs_element_table&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         i_wbs_hierarchie_table     = gt_wbs_hierarchie_table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          e_message_table            = gt_message_table.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   WAIT          = 'X'&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   RETURN        = gt_RETURN1.&lt;/P&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;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&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;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 15:12:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-project-maintain-example/m-p/2727130#M632956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T15:12:11Z</dc:date>
    </item>
  </channel>
</rss>

