<?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: Call transaction and BDC session in same program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955902#M66271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Frederic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jul 2005 13:53:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-08T13:53:34Z</dc:date>
    <item>
      <title>Call transaction and BDC session in same program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955898#M66267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am using call transaction method to post the document and if the call transaction fails I need to create a BDC session for later processing and return the session ID. I am okay with the call trasaction part but I don't know how create a session if call trasaction fails. Can somebody please help me figure out this problem?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chandu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 13:30:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955898#M66267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T13:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Call transaction and BDC session in same program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955899#M66268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call transaction ... using wt_bdcdata ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne space.&lt;/P&gt;&lt;P&gt;  call function 'BDC_OPEN_GROUP' ....&lt;/P&gt;&lt;P&gt;  call function 'BDC_INSERT' ...   (using wt_bdcdata)&lt;/P&gt;&lt;P&gt;  call function 'BDC_CLOSE_GROUP' ....&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you need to call the batch immediatly look at the program RSBDCSUB&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frédéric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 13:36:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955899#M66268</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2005-07-08T13:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Call transaction and BDC session in same program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955900#M66269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the following code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL TRANSACTION 'V-03' USING W_BDCDATA MODE 'N' UPDATE 'S'
                                 MESSAGES INTO W_MESSTAB.

* Si subrc &amp;lt;&amp;gt; 0 : Batch input
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    W_COMPT_ERR = W_COMPT_ERR + 1.
    IF W_COMPT_ERR EQ 1.
*      Open BI
       PERFORM TREAT_BDC TABLES WE_BDCDATA
                           USING P_BATCH ' ' 'O'. 

    ENDIF.
* Insert BI
  PERFORM TREAT_BDC TABLES WE_BDCDATA
                       USING ' ' 'V-03' 'I'.
  ELSE.
    REFRESH W_BDCDATA.
  ENDIF.

...


* closing of bi  session if created
  IF W_COMPT_ERR &amp;gt; '0'.
    PERFORM TREAT_BDC TABLES WE_BDCDATA
                          USING ' ' 'V-03' 'C'.
  ENDIF.



*-------------------------------------------------------*
*       FORM TREAT_BDC
**------------------------------------------------------
*     Error treatment creating a Bacth Input session
*------------------------------------------------------
*- wf_bdcdata: internal table type BDCDATA,       
*- wf_dossier:  Batch Input session name wf_trans:   
* transaction code    
*     - wf_mode: O, I, OR C. 
*----------------------------------------------------*
FORM TREAT_BDC TABLES WF_BDCDATA
                     USING WF_DOSSIER WF_TRANS WF_MODE.


* Open Batch Input
  IF WF_MODE = 'O'.
    CALL FUNCTION 'BDC_OPEN_GROUP'
       EXPORTING
              CLIENT              = SY-MANDT
*         DEST                = FILLER8
              GROUP               = WF_DOSSIER
*         HOLDDATE            = FILLER8
*         KEEP                = FILLER1
              USER                = SY-UNAME
*         RECORD              = FILLER1
*    IMPORTING
*         QID                 =
         EXCEPTIONS
              CLIENT_INVALID      = 1
              DESTINATION_INVALID = 2
              GROUP_INVALID       = 3
              GROUP_IS_LOCKED     = 4
              HOLDDATE_INVALID    = 5
              INTERNAL_ERROR      = 6
              QUEUE_ERROR         = 7
              RUNNING             = 8
              SYSTEM_LOCK_ERROR   = 9
              USER_INVALID        = 10
              OTHERS              = 11.

    IF SY-SUBRC &amp;lt;&amp;gt; 0.
      MESSAGE E016 WITH WF_DOSSIER.
    ENDIF.

  ENDIF.


* Call BDC_INSERT
  IF WF_MODE = 'I'.
    CALL FUNCTION 'BDC_INSERT'
         EXPORTING
              TCODE            = 'V-03'
*         POST_LOCAL       = NOVBLOCAL
*         PRINTING         = NOPRINT
         TABLES
              DYNPROTAB        = W_BDCDATA
    EXCEPTIONS
         INTERNAL_ERROR   = 1
         NOT_OPEN         = 2
         QUEUE_ERROR      = 3
         TCODE_INVALID    = 4
         PRINTING_INVALID = 5
         POSTING_INVALID  = 6
         OTHERS           = 7.

    IF SY-SUBRC &amp;lt;&amp;gt; 0.
      MESSAGE E017 WITH WF_TRANS.
    ENDIF.
    REFRESH W_BDCDATA.
  ENDIF.


* Closing Batch Input
  IF WF_MODE = 'C'.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
         EXCEPTIONS
              NOT_OPEN    = 1
              QUEUE_ERROR = 2
              OTHERS      = 3.

    IF SY-SUBRC &amp;lt;&amp;gt; 0.
      MESSAGE E018.
    ENDIF.
  ENDIF.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erwan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 13:42:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955900#M66269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T13:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Call transaction and BDC session in same program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955901#M66270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Erwin. I really appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 13:52:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955901#M66270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T13:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Call transaction and BDC session in same program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955902#M66271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Frederic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 13:53:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955902#M66271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T13:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Call transaction and BDC session in same program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955903#M66272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After calling the call transaction i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;    call transaction tcode using bdcdata&lt;/P&gt;&lt;P&gt;                     mode   ctumode&lt;/P&gt;&lt;P&gt;                     update cupdate&lt;/P&gt;&lt;P&gt;                     messages into messtab.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then perform this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at messtab.&lt;/P&gt;&lt;P&gt;  if messtab-msgtyp ne 'S'.&lt;/P&gt;&lt;P&gt;           &amp;lt;i&amp;gt;&amp;lt; call BDC_INSERT to create a session.&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When messtab-msgtyp is not equal to 'S' the recors have failed and hence a session will be created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Kathir~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 13:58:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955903#M66272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T13:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Call transaction and BDC session in same program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955904#M66273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it helps, can u please reward me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erwan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 13:58:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955904#M66273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T13:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Call transaction and BDC session in same program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955905#M66274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erwan,&lt;/P&gt;&lt;P&gt;I did try to reward you but I got some error message. how do I do that?&lt;/P&gt;&lt;P&gt;chandu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 15:38:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transaction-and-bdc-session-in-same-program/m-p/955905#M66274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T15:38:17Z</dc:date>
    </item>
  </channel>
</rss>

