<?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: Issue creating WBS using BAPI_BUS2054_CREATE_MULTI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829253#M353548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Trim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The message comes from (It is S004) in the BAPI_BUS2054_CREATE_MULTI (see below bold).  I would be placing a breakpoint at the point where the BAPI is calling the function PS_BAPI_PREPARE to see if the lv_subrc variable is being set at this stage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      call function 'CJ2054_CREATE'&lt;/P&gt;&lt;P&gt;           exporting&lt;/P&gt;&lt;P&gt;                i_pspid             = i_project_definition&lt;/P&gt;&lt;P&gt;                i_wbs_element       = ls_wbs_element&lt;/P&gt;&lt;P&gt;           tables&lt;/P&gt;&lt;P&gt;                extensionin         = extensionin&lt;/P&gt;&lt;P&gt;           exceptions&lt;/P&gt;&lt;P&gt;                element_not_created = 1&lt;/P&gt;&lt;P&gt;                dates_not_created   = 2.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0 or lv_subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      message e007(cnif_pi) with text-wbs ls_wbs_element-wbs_element&lt;/P&gt;&lt;P&gt;                            into null.&lt;/P&gt;&lt;P&gt;      lv_error = con_yes.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;      message s004(cnif_pi) with text-wbs ls_wbs_element-wbs_element&lt;/P&gt;&lt;P&gt;                            into null.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jan 2007 22:47:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-15T22:47:05Z</dc:date>
    <item>
      <title>Issue creating WBS using BAPI_BUS2054_CREATE_MULTI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829252#M353547</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;I am trying to create WBS elements under existing project (CJ20N) using &amp;#147;BAPI_BUS2054_CREATE_MULTI&amp;#148;. I am I am getting &amp;#147;ET_RETURN&amp;#148; with message type &amp;#145;S-W-I&amp;#146;, even after commit no WBS created. Type &amp;#145;S&amp;#146; message says &amp;#147;Individual check for creating the object WBS Element XXX required&amp;#148;. Please find my code for more info. I am I using correct BAPI? Any hint or suggestion welcome. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Trim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT gt_wbs_element .

    MOVE-CORRESPONDING gt_wbs_element to gt_wbs_element_bapi.
    MOVE : gt_wbs_element-mims_id    to gt_wbs_element_bapi-USER_FIELD_CHAR20_1.
    MOVE : gt_wbs_element-PROJECT_DEFINITION to gv_proj.
*** Conert all dates
    split_date gt_wbs_element-WBS_BASIC_START_DATE gt_wbs_element_bapi-WBS_BASIC_START_DATE.
    split_date gt_wbs_element-WBS_BASIC_FINISH_DATE gt_wbs_element_bapi-WBS_BASIC_FINISH_DATE.
    split_date gt_wbs_element-WBS_FORECAST_START_DATE gt_wbs_element_bapi-WBS_FORECAST_START_DATE.
    split_date gt_wbs_element-WBS_FORECAST_FINISH_DATE gt_wbs_element_bapi-WBS_FORECAST_FINISH_DATE.
*   split_date gt_wbs_element-WBS_ACTUAL_START_DATE gt_wbs_element_bapi-WBS_ACTUAL_START_DATE.
*   split_date gt_wbs_element-WBS_ACTUAL_FINISH_DATE gt_wbs_element_bapi-WBS_ACTUAL_FINISH_DATE.
    APPEND gt_wbs_element_bapi.

****   Update Custome 'Z' Fields
    clear : BAPI_TE_WBS_ELEMENT, gv_error.
    BAPI_TE_WBS_ELEMENT-WBS_ELEMENT    = gt_wbs_element-WBS_ELEMENT.
    BAPI_TE_WBS_ELEMENT-ZZCP_APPRBUD   = gt_wbs_element-ZZCP_APPRBUD.
    BAPI_TE_WBS_ELEMENT-ZZCP_ELECT     = gt_wbs_element-ZZCP_ELECT.
    BAPI_TE_WBS_ELEMENT-ZZCP_AREA      = gt_wbs_element-ZZCP_AREA.
    BAPI_TE_WBS_ELEMENT-ZZCP_PROG      = gt_wbs_element-ZZCP_PROG.
    BAPI_TE_WBS_ELEMENT-ZZCP_SUBPR     = gt_wbs_element-ZZCP_SUBPR.
**    BAPI_TE_WBS_ELEMENT-ZZCP_FINALDAT  = gt_wbs_element-ZZCP_FINALDAT.
    BAPI_TE_WBS_ELEMENT-ZZCP_TOTBUD    = gt_wbs_element-ZZCP_TOTBUD.
**    BAPI_TE_WBS_ELEMENT-ZZCP_DADHC_REG = gt_wbs_element-ZZCP_DADHC_REG.
**    BAPI_TE_WBS_ELEMENT-ZZCP_DADHC_CEP = gt_wbs_element-ZZCP_DADHC_CEP.
    BAPI_TE_WBS_ELEMENT-ZZCP_PREDBUD   = gt_wbs_element-ZZCP_PREDBUD.
    BAPI_TE_WBS_ELEMENT-ZZCP_CLIENT    = gt_wbs_element-ZZCP_CLIENT.
    BAPI_TE_WBS_ELEMENT-ZZCP_PM_NAME   = gt_wbs_element-ZZCP_PM_NAME.


    GT_EXTENSION_IN-STRUCTURE = 'BAPI_TE_WBS_ELEMENT'.
    GT_EXTENSION_IN-VALUEPART1 = BAPI_TE_WBS_ELEMENT+0(199).
    GT_EXTENSION_IN-VALUEPART2 = BAPI_TE_WBS_ELEMENT+199(171).
    APPEND GT_EXTENSION_IN.

    MOVE-CORRESPONDING gt_wbs_element to wa_wbs_elem.

    AT END OF PROJECT_DEFINITION.
*** Inalise BAPI
      CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

      clear gt_return[].
      CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
        EXPORTING
          I_PROJECT_DEFINITION       = gv_proj
        TABLES
          IT_WBS_ELEMENT             = gt_wbs_element_bapi
          ET_RETURN                  = gt_return
          EXTENSIONIN                = gt_extension_in
*         EXTENSIONOUT               =
        EXCEPTIONS
          error_message              = 1
          others                     = 2.

*** Check GT_RESULT for success
      LOOP AT gt_return where type co 'EA'.
        gv_error = 'X'.
      ENDLOOP.
      IF gv_error is initial.
        CALL FUNCTION 'BAPI_PS_PRECOMMIT'
          TABLES
            ET_RETURN = gt_return_pre.
        LOOP AT gt_return_pre where type co 'EA'.
          gv_error = 'X'.
        ENDLOOP.
      ENDIF.
      IF gv_error is INITIAL.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            WAIT   = '1'
          IMPORTING
            RETURN = GT_RETURN_COMMIT.
        clear gv_write.
        format color 4.
        CONCATENATE 'Success: WBS Attached to Project' gv_proj '-'
               into  gv_write.
        WRITE / gv_write. CLEAR gv_write.
        move-corresponding wa_wbs_elem to gt_wbs_suc.
        gt_wbs_suc-message      = gv_write.
        gt_wbs_suc-message_type = 'S'.
        append gt_wbs_suc.
        format reset.
      else.
        clear gv_write.
        format color 6.
        CONCATENATE 'Error: Attaching WBS to Project' space '-' space gv_proj
                into  gv_write.
        WRITE / gv_write. CLEAR gv_write.
        move-corresponding wa_wbs_elem to gt_wbs_suc.
        gt_wbs_suc-message      = gv_write.
        gt_wbs_suc-message_type = 'E'.
        append gt_wbs_suc.
        format reset.
      ENDIF.
      CLEAR: gv_proj, gt_wbs_element_bapi, gt_extension_in, gt_return_pre, GT_RETURN_COMMIT.
      refresh: gt_wbs_element_bapi, gt_extension_in, gt_return_pre, GT_RETURN_COMMIT.
    endat.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 22:06:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829252#M353547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T22:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating WBS using BAPI_BUS2054_CREATE_MULTI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829253#M353548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Trim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The message comes from (It is S004) in the BAPI_BUS2054_CREATE_MULTI (see below bold).  I would be placing a breakpoint at the point where the BAPI is calling the function PS_BAPI_PREPARE to see if the lv_subrc variable is being set at this stage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      call function 'CJ2054_CREATE'&lt;/P&gt;&lt;P&gt;           exporting&lt;/P&gt;&lt;P&gt;                i_pspid             = i_project_definition&lt;/P&gt;&lt;P&gt;                i_wbs_element       = ls_wbs_element&lt;/P&gt;&lt;P&gt;           tables&lt;/P&gt;&lt;P&gt;                extensionin         = extensionin&lt;/P&gt;&lt;P&gt;           exceptions&lt;/P&gt;&lt;P&gt;                element_not_created = 1&lt;/P&gt;&lt;P&gt;                dates_not_created   = 2.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0 or lv_subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      message e007(cnif_pi) with text-wbs ls_wbs_element-wbs_element&lt;/P&gt;&lt;P&gt;                            into null.&lt;/P&gt;&lt;P&gt;      lv_error = con_yes.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;      message s004(cnif_pi) with text-wbs ls_wbs_element-wbs_element&lt;/P&gt;&lt;P&gt;                            into null.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 22:47:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829253#M353548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T22:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating WBS using BAPI_BUS2054_CREATE_MULTI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829254#M353549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gareth,&lt;/P&gt;&lt;P&gt;Thanks for reply. No error any where, LV_SUBRC set to '0'. I am still not sure even after getting 'S' return WBS object not created?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Trim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 23:03:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829254#M353549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T23:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating WBS using BAPI_BUS2054_CREATE_MULTI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829255#M353550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Trim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK, how about setting a break point at &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if i_method &amp;lt;&amp;gt; con_pro_getdata and&lt;/P&gt;&lt;P&gt;     i_method &amp;lt;&amp;gt; con_wbs_getdata and&lt;/P&gt;&lt;P&gt;     i_method &amp;lt;&amp;gt; con_net_getdata and&lt;/P&gt;&lt;P&gt;     i_method &amp;lt;&amp;gt; con_act_getdata and&lt;/P&gt;&lt;P&gt;     i_method &amp;lt;&amp;gt; con_ael_getdata.&lt;/P&gt;&lt;P&gt;in function PS_BAPI_FINISH to see if we're getting a rollback at this point (at the end of BAPI_BUS2054_CREATE_MULTI.  If so this will not raise an exception (which is not good) but could be why we have the success message but no WBS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 23:10:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829255#M353550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T23:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating WBS using BAPI_BUS2054_CREATE_MULTI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829256#M353551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working! Need to pass Comp code, Bus Area, Contolling and Prfot Cnt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 02:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-creating-wbs-using-bapi-bus2054-create-multi/m-p/1829256#M353551</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T02:30:31Z</dc:date>
    </item>
  </channel>
</rss>

