<?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_PRODORDCONF_CREATE_TT problem. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471107#M221436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have to use the BAPI_TRANSACTION_COMMIT with wait set to X after BAPI_PRODORDCONF_CREATE_TT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more check you can add in the program is to check whether the object you are trying to update is locked using the function ENQUEUE_READ and introduce a wait if the object is locked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the sample code below&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'ENQUEUE_READ'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      gclient               = sy-mandt&lt;/P&gt;&lt;P&gt;      gname                 = p_tablename&lt;/P&gt;&lt;P&gt;      garg                  = p_tablekey&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      number                = p_number&lt;/P&gt;&lt;P&gt;      subrc                 = p_subrc&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      enq                   = pt_enq&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      communication_failure = 1&lt;/P&gt;&lt;P&gt;      system_failure        = 2&lt;/P&gt;&lt;P&gt;      OTHERS                = 3.&lt;/P&gt;&lt;P&gt;    IF p_number GT 0.&lt;/P&gt;&lt;P&gt;      WAIT UP TO 2 SECONDS.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kiran&lt;/P&gt;&lt;P&gt;Please mark useful answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kiran Raorane&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Aug 2006 10:31:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-22T10:31:55Z</dc:date>
    <item>
      <title>BAPI_PRODORDCONF_CREATE_TT problem.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471106#M221435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi !!&lt;/P&gt;&lt;P&gt;BAPI_PRODORDCONF_CREATE_TT crates goods movements which are triggered in backround. When i use that bapi in loop i very often gets an COGI error - MAterial Plant data is blocked by user (for ingriediens). How to wait for finish of that background goods movemnts process ?? (i have tried erliaer with enque deque logic for it but it doesnt work ).&lt;/P&gt;&lt;P&gt;BR, Jacek.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jacek Slowikowski&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jacek Slowikowski&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 10:24:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471106#M221435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T10:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PRODORDCONF_CREATE_TT problem.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471107#M221436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have to use the BAPI_TRANSACTION_COMMIT with wait set to X after BAPI_PRODORDCONF_CREATE_TT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more check you can add in the program is to check whether the object you are trying to update is locked using the function ENQUEUE_READ and introduce a wait if the object is locked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the sample code below&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'ENQUEUE_READ'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      gclient               = sy-mandt&lt;/P&gt;&lt;P&gt;      gname                 = p_tablename&lt;/P&gt;&lt;P&gt;      garg                  = p_tablekey&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      number                = p_number&lt;/P&gt;&lt;P&gt;      subrc                 = p_subrc&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      enq                   = pt_enq&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      communication_failure = 1&lt;/P&gt;&lt;P&gt;      system_failure        = 2&lt;/P&gt;&lt;P&gt;      OTHERS                = 3.&lt;/P&gt;&lt;P&gt;    IF p_number GT 0.&lt;/P&gt;&lt;P&gt;      WAIT UP TO 2 SECONDS.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kiran&lt;/P&gt;&lt;P&gt;Please mark useful answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kiran Raorane&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 10:31:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471107#M221436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T10:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PRODORDCONF_CREATE_TT problem.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471108#M221437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do it  that way. Commit is set with wait. And for all ingrediens i am trying to set enque and then deque...but still i have errors..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&amp;lt; Jacek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 10:35:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471108#M221437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T10:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PRODORDCONF_CREATE_TT problem.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471109#M221438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need to set the lock explicitly in your program as the BAPI will take care of it. What I had suggested earlier is to check whether the object (Material in your scenario) is locked before the BAPI is called for processing the 2nd record in the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function ENQUEUE_READ will return the a value greater then 0 in the parameter NUMBER if the object is locked. If the object is locked you can introduce a WAIT of 2 seconds and then continue processing. You can also consider adding the above logic in a DO 2 TIMES - ENDDO loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kiran&lt;/P&gt;&lt;P&gt;*Please reward useful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 10:43:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471109#M221438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T10:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PRODORDCONF_CREATE_TT problem.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471110#M221439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what i am doing now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT lt_bapi2017_gm_item_create INTO&lt;/P&gt;&lt;P&gt; ls_bapi2017_gm_item_create . "wai until all ingrediens are dequeed.&lt;/P&gt;&lt;P&gt;          GET RUN TIME FIELD t_1.&lt;/P&gt;&lt;P&gt;          d_t = 0.&lt;/P&gt;&lt;P&gt;          sy-subrc = 9.&lt;/P&gt;&lt;P&gt;          WHILE d_t &amp;lt;= 600000000 AND sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;            CALL FUNCTION 'ENQUEUE_EMMARCE'&lt;/P&gt;&lt;P&gt;             EXPORTING&lt;/P&gt;&lt;P&gt;            mode_marc            = 'E'&lt;/P&gt;&lt;P&gt;            mandt                = sy-mandt&lt;/P&gt;&lt;P&gt;            matnr                = ls_bapi2017_gm_item_create-material&lt;/P&gt;&lt;P&gt;            werks                = ls_bapi2017_gm_item_create-plant&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_MATNR              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_WERKS              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            _scope               = '3'&lt;/P&gt;&lt;P&gt;            &lt;U&gt;wait                = gc&lt;/U&gt;x&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  _COLLECT             = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             EXCEPTIONS&lt;/P&gt;&lt;P&gt;               foreign_lock         = 1&lt;/P&gt;&lt;P&gt;               system_failure       = 2&lt;/P&gt;&lt;P&gt;               OTHERS               = 3&lt;/P&gt;&lt;P&gt;                      .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            GET RUN TIME FIELD t_2.&lt;/P&gt;&lt;P&gt;            d_t = t_2 - t_1.&lt;/P&gt;&lt;P&gt;          ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          CALL FUNCTION 'DEQUEUE_EMMARCE'&lt;/P&gt;&lt;P&gt;             EXPORTING&lt;/P&gt;&lt;P&gt;            mode_marc            = 'E'&lt;/P&gt;&lt;P&gt;            mandt                = sy-mandt&lt;/P&gt;&lt;P&gt;            matnr             = ls_bapi2017_gm_item_create-material&lt;/P&gt;&lt;P&gt;            werks                = ls_bapi2017_gm_item_create-plant&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_MATNR              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  X_WERKS              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            _scope               = '3'&lt;/P&gt;&lt;P&gt;            &lt;U&gt;synchron                = gc&lt;/U&gt;x.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  _COLLECT             = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CLEAR lt_bapi_coru_return[].&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT' "create order  do material movements.&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            post_wrong_entries = lv_post&lt;/P&gt;&lt;P&gt;            testrun            = lv_testrun&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;            return             = ls_bapiret1&lt;/P&gt;&lt;P&gt;          TABLES&lt;/P&gt;&lt;P&gt;            timetickets        = lt_bapi_pp_timeticket&lt;/P&gt;&lt;P&gt;            goodsmovements     = lt_bapi2017_gm_item_create&lt;/P&gt;&lt;P&gt;            link_conf_goodsmov = lt_bapi_link_conf_goodsmov&lt;/P&gt;&lt;P&gt;            detail_return      = lt_bapi_coru_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF lv_testrun IS INITIAL.&lt;/P&gt;&lt;P&gt;          EXIT.&lt;/P&gt;&lt;P&gt;        ELSE.&lt;/P&gt;&lt;P&gt;          IF ls_bapiret1 IS INITIAL.&lt;/P&gt;&lt;P&gt;            CLEAR lv_testrun.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF ls_bapiret1 IS INITIAL. "commit work.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       COMMIT WORK AND WAIT.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          wait = gc_x.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Setup current confirmation number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      READ TABLE lt_bapi_pp_timeticket ASSIGNING &amp;lt;bapi_tickets&amp;gt;&lt;/P&gt;&lt;P&gt;                 INDEX 1.&lt;/P&gt;&lt;P&gt;      IF sy-subrc IS INITIAL.&lt;/P&gt;&lt;P&gt;        e_confirmation-rueck_current = &amp;lt;bapi_tickets&amp;gt;-conf_no.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      e_subrc = 1.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that code is processed in loop. Therericaly my logic of deques an enques should work similiar to enque_read ...&lt;/P&gt;&lt;P&gt;BR, JAcek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jacek Slowikowski&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 11:01:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471110#M221439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T11:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PRODORDCONF_CREATE_TT problem.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471111#M221440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacek,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; Try this ..... it should resolve your problem.&lt;/P&gt;&lt;P&gt; Just before calling the BAPI put in this statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET UPDATE TASK LOCAL.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The reason is when a BAPI is called mostly the data is updated in a separate update task. Which takes a few mins before the actuall update happens. Since you need to call the BAPI in a loop using the above statement will solve ur issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/41/7af4d7a79e11d1950f0000e82de14a/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/41/7af4d7a79e11d1950f0000e82de14a/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Cheers&lt;/P&gt;&lt;P&gt; VJ &lt;/P&gt;&lt;P&gt; If it helps dont forget to mark points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 11:05:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471111#M221440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T11:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PRODORDCONF_CREATE_TT problem.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471112#M221441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have tried that. Problem is that update of matertial movements is still triggered not locally. so set update task local is no soution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jacek Slowikowski&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 11:09:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471112#M221441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T11:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PRODORDCONF_CREATE_TT problem.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471113#M221442</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; The only other option is use the DEQUEUE_ALL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Try DEQUEUEing after the commit. Here is a sample coding.


* Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
     exporting
          goodsmvt_header  = gm_header
          goodsmvt_code    = gm_code
     importing
          goodsmvt_headret = gm_headret
          materialdocument = gm_retmtd
     tables
          goodsmvt_item    = gm_item
          return           = gm_return.
 
if not gm_retmtd is initial.
  commit work and wait.
  call function 'DEQUEUE_ALL'.
  write:/ gm_retmtd.
else.
  commit work and wait.
  call function 'DEQUEUE_ALL'.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The above works in most of the cases but not a recommended way to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Cheers&lt;/P&gt;&lt;P&gt; VJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 11:12:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-prodordconf-create-tt-problem/m-p/1471113#M221442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T11:12:16Z</dc:date>
    </item>
  </channel>
</rss>

