<?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: Problem in BDC program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643779#M877467</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Anubhav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call transaction starts a new session. So if you lock the person number using f_enqueue before calling the transaction and if the transaction again tries to lock the person number using enqueue, it will fail and give the message "The personal number could not be locked".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no guaranteed method to do what you want. What you can do is to reduce the chance of getting this error. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call enqueue. If you can successfully lock the personal number, call dequeue and call this transaction. In case of failure, just call dequeue and give the message and exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so the code should be like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call enqueue&lt;/P&gt;&lt;P&gt;If success&lt;/P&gt;&lt;P&gt;call dequeue&lt;/P&gt;&lt;P&gt;call transaction.&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;call dequeue.&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why it is not guaranteed. It is possible that between your dequeue and the enqueue of the transaction, someone else locks it again. But you know the chances are less.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note: I made one assumption in the above description: the transaction PA30 also enqueues the personal number, but it looks logical from your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last words: Try to find a BAPI to post the data into the system. BAPIs are much more better and faster in doing the job. For getting the right BAPI, try to post a query in relevant section (I don't know  which section). As BAPIs works in the same session as caller, you can directly use enqueue before calling the BAPI and dequeue later for achieving your goal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Rakesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Apr 2008 06:54:04 GMT</pubDate>
    <dc:creator>rakesh_kumar</dc:creator>
    <dc:date>2008-04-13T06:54:04Z</dc:date>
    <item>
      <title>Problem in BDC program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643777#M877465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI to all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is one existing BDC program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;coding as follows...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM f_update_pa9015  USING  f_ovtm  STRUCTURE  t_ovtm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA :  l_date    TYPE  char10,&lt;/P&gt;&lt;P&gt;          l_value   TYPE  char10,&lt;/P&gt;&lt;P&gt;          l_opt     TYPE  ctu_params,&lt;/P&gt;&lt;P&gt;          e_mess    TYPE  bdcmsgcoll OCCURS 40 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR: bdcdata, bdcdata[], l_date, l_value, e_mess, e_mess[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      input  = f_ovtm-datum&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      output = l_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_value = f_ovtm-ovrtm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM bdc_dynpro      USING 'SAPMP50A' '1000'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                '=INS'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'RP50G-PERNR'&lt;/P&gt;&lt;P&gt;                                 keytable-pernr.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'BDC_SUBSCR'&lt;/P&gt;&lt;P&gt;                                '/1PAPAXX/HDR_19000A                     0100SUBSCR_HEADER'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'BDC_SUBSCR'&lt;/P&gt;&lt;P&gt;                                'SAPMP50A                                0320SUBSCR_ITMENU'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'BDC_SUBSCR'&lt;/P&gt;&lt;P&gt;                                'SAPMP50A                                0330SUBSCR_TIME'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'BDC_SUBSCR'&lt;/P&gt;&lt;P&gt;                                'SAPMP50A                                0350SUBSCR_ITKEYS'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                'RP50G-SUBTY'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'RP50G-CHOIC'&lt;/P&gt;&lt;P&gt;                                '9015'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM bdc_dynpro      USING 'MP901500' '2000'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                'P9015-BEGDA'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                'UPD'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'P9015-BEGDA'&lt;/P&gt;&lt;P&gt;                                 l_date.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'P9015-ENDDA'&lt;/P&gt;&lt;P&gt;                                 l_date.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'P9015-ESTDT'&lt;/P&gt;&lt;P&gt;                                 l_date.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'P9015-BETRG'&lt;/P&gt;&lt;P&gt;                                 l_value.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'P9015-WAERS'&lt;/P&gt;&lt;P&gt;                                 'INR'.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'P9015-YYREASN'&lt;/P&gt;&lt;P&gt;                                 f_ovtm-ovtxt.&lt;/P&gt;&lt;P&gt;  l_value   = f_ovtm-apphr.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'P9015-YYACTHR'&lt;/P&gt;&lt;P&gt;                                 l_value.&lt;/P&gt;&lt;P&gt;  CLEAR l_value.&lt;/P&gt;&lt;P&gt;  l_value   = f_ovtm-anzhl.&lt;/P&gt;&lt;P&gt;  PERFORM bdc_field       USING 'P9015-YYCALHR'&lt;/P&gt;&lt;P&gt;                                 l_value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR : l_opt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_opt-dismode = 'N'.&lt;/P&gt;&lt;P&gt;  l_opt-updmode = 'S'.&lt;/P&gt;&lt;P&gt;  l_opt-defsize = 'X'.&lt;/P&gt;&lt;P&gt;  l_opt-racommit = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;bold&lt;/STRONG&gt; PERFORM f_dequeue_employee USING keytable-pernr.&lt;/P&gt;&lt;P&gt;  CALL TRANSACTION 'PA30' USING bdcdata OPTIONS FROM l_opt&lt;/P&gt;&lt;P&gt;  MESSAGES INTO e_mess.&lt;/P&gt;&lt;P&gt;  PERFORM f_enqueue_employee USING keytable-pernr.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;bold&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT e_mess WHERE msgtyp = 'E' OR msgtyp = 'A'.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    e_mess-msgtyp = 'E'.&lt;/P&gt;&lt;P&gt;    e_mess-msgid  = '333'.&lt;/P&gt;&lt;P&gt;    e_mess-msgnr  = 'S1'.&lt;/P&gt;&lt;P&gt;    e_mess-msgv1  = 'Error in Posting OT Tracking for Date'.&lt;/P&gt;&lt;P&gt;    e_mess-msgv2  = l_date.&lt;/P&gt;&lt;P&gt;    APPEND e_mess. CLEAR e_mess.&lt;/P&gt;&lt;P&gt;    PERFORM f_display_errors TABLES e_mess.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " f_update_pa9015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the error 'Personal number(s) could not be locked'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;message appeared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It post the data in screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to stop processing if some other person is working on same PERNR(Emp no).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it the right to use first dequeue and then enqueue function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide me where is the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anubhav Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2008 07:00:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643777#M877465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-12T07:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in BDC program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643778#M877466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;
Hi Anubhav Gupta,

Reverse the operation .First Enquee second Dequee.
Just check the documentation.

[http://help.sap.com/saphelp_46c/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm|http://help.sap.com/saphelp_46c/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm]
Thanks,
Venkat.O
&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2008 07:56:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643778#M877466</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2008-04-12T07:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in BDC program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643779#M877467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Anubhav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call transaction starts a new session. So if you lock the person number using f_enqueue before calling the transaction and if the transaction again tries to lock the person number using enqueue, it will fail and give the message "The personal number could not be locked".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no guaranteed method to do what you want. What you can do is to reduce the chance of getting this error. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call enqueue. If you can successfully lock the personal number, call dequeue and call this transaction. In case of failure, just call dequeue and give the message and exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so the code should be like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call enqueue&lt;/P&gt;&lt;P&gt;If success&lt;/P&gt;&lt;P&gt;call dequeue&lt;/P&gt;&lt;P&gt;call transaction.&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;call dequeue.&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why it is not guaranteed. It is possible that between your dequeue and the enqueue of the transaction, someone else locks it again. But you know the chances are less.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note: I made one assumption in the above description: the transaction PA30 also enqueues the personal number, but it looks logical from your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last words: Try to find a BAPI to post the data into the system. BAPIs are much more better and faster in doing the job. For getting the right BAPI, try to post a query in relevant section (I don't know  which section). As BAPIs works in the same session as caller, you can directly use enqueue before calling the BAPI and dequeue later for achieving your goal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Rakesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Apr 2008 06:54:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643779#M877467</guid>
      <dc:creator>rakesh_kumar</dc:creator>
      <dc:date>2008-04-13T06:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in BDC program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643780#M877468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rakesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks For your reaponse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually after getting 'Personal no. could not be locked'       Error message, Over time is posted and again it shows in uapproved list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    My requirement is that if that message appeares, it should stop processing and should not process further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anubhav Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 07:08:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643780#M877468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T07:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in BDC program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643781#M877469</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;After displaying that error message write the following statement :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 07:31:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-bdc-program/m-p/3643781#M877469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T07:31:39Z</dc:date>
    </item>
  </channel>
</rss>

