<?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 Session method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080813#M975735</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to process a session with 500 records? For every 100 records i want create one session, so for 500 records i want create 5 sessions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible in BDC?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jun 2008 14:40:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-27T14:40:48Z</dc:date>
    <item>
      <title>Session method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080813#M975735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to process a session with 500 records? For every 100 records i want create one session, so for 500 records i want create 5 sessions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible in BDC?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 14:40:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080813#M975735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T14:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Session method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080814#M975736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Kancham,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Split the data into 5 internal table each with 100 records and loop through the tables and call BDC_INSERT in each loop and assign a unique session name  ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 14:44:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080814#M975736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T14:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Session method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080815#M975737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in the program put the counter...for the input.then do like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop a itab.&lt;/P&gt;&lt;P&gt;c = c + 1.&lt;/P&gt;&lt;P&gt;if c = 100 .&lt;/P&gt;&lt;P&gt;session name = 'test1'.&lt;/P&gt;&lt;P&gt;elseif  c = 200.&lt;/P&gt;&lt;P&gt;session name = 'test2'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 14:44:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080815#M975737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T14:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Session method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080816#M975738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;create an block in the selection screen ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* BDC Options
selection-screen begin of block b_bdc with frame title text-b02.
parameters: p_uname  like sy-uname default sy-uname obligatory,
                                               "User Id
            p_sname(10) type c default 'DCDxx_' obligatory,
                                               "Session
            p_maxtrn(10) type n        default 5000.
"Max transaction Counter
selection-screen end of block b_bdc.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then as per the maximun transations per data you can write the logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* Delete duplicate rows from source data
  delete adjacent duplicates from i_src.

  describe table i_src lines l_count.

  if l_count gt 0.

*   Initialize the transaction couter and Create the initial BDC session
    clear: v_transcounter,
           l_subrc,
           i_bdc,
           l_tabix2,
           l_tabix3.
    refresh i_bdc.

    perform sub_openbdc using uname
                              sname
                        changing l_subrc.

    if l_subrc = 0.

* Add the appropriate BDC code to the current open BDC session for each
* record in the internal table.
      loop at i_src.
* Holds the current sy-tabix
        l_tabix2 = sy-tabix.

* For each combination of group and group counter

        at new  prgrp.

* Increment transaction counter
          v_transcounter = v_transcounter + 1.


* Clear the BDC table counter
          l_tabix = 0.

* Clear the flag.
          clear l_save_flag.

        endat.

        at end of meins.
          l_save_flag = c_check.
        endat.
        l_tabix = l_tabix + 1.
        l_tabix3 = l_tabix3 + 1.

*      To be implemented in the custom-code
        perform sub_generatebdc using i_src
                                      l_tabix
                                      l_tabix3
                                      l_save_flag.


*   Ensure the BDC data table is empty
* For the last record in same header insert the BDC table
        if l_save_flag = c_check.
          call function 'BDC_INSERT'
            exporting
              tcode            = tcode
            tables
              dynprotab        = i_bdc
            exceptions
              internal_error   = 1
              not_open         = 2
              queue_error      = 3
              tcode_invalid    = 4
              printing_invalid = 5
              posting_invalid  = 6
              others           = 7.

          if sy-subrc ne 0.
            clear wa_sessions.
            wa_sessions-sname = v_sname.
            wa_sessions-trans = v_transcounter.
            wa_sessions-status = c_check.
            wa_sessions-message = 'BDC record insert failed'(103).
            append wa_sessions to i_sessions.
          endif.
          refresh i_bdc.
          l_tabix = 0.
          l_tabix3 = 0.

*   Exceeded current BDC sessions transaction capacity. Close current
*   BDC session and create a new session.
          if v_transcounter = maxtrn
          or l_tabix2 = l_count.

            perform sub_closebdc.

*   When it is the last record in the table, do not open session
            if l_tabix2 ne l_count.
              perform sub_openbdc using    uname     "username
                                           sname     "session name
                                  changing l_subrc.  "sy-subrc
              if l_subrc ne 0.
                exit.
              endif.           " For l_subrc
            endif.             " For l_tabix2
          endif.               " For v_transcounter
        endif.
      endloop.
    endif.         " For l_count
  endif.


* Display summary report
  perform sub_stopclock.

  perform sub_displayuploadsummary tables i_sessions   "Session Details
                                   using  fname        "File Name
                                          l_count.     "Table index
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 14:59:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080816#M975738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T14:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Session method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080817#M975739</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;firstly you append your session names to an internal table.&lt;/P&gt;&lt;P&gt;As you already loop the records and for every 100th sy-tabix value  and for every hundered records read that name internal table with index...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or when ever the modulous of the sy-tabix is 0 then read the session name internal table.&lt;/P&gt;&lt;P&gt;like...&lt;/P&gt;&lt;P&gt;   100 / 100 = 1 is quotient.  and remainder 0.&lt;/P&gt;&lt;P&gt;   200 / 100 = 2.   &lt;/P&gt;&lt;P&gt;   300 / 100 = 3.&lt;/P&gt;&lt;P&gt;   400 / 100 = 4.&lt;/P&gt;&lt;P&gt;   500 / 100 = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;store that quotients in a variable and if mod is zero read the session name internal table with index of quotient variable...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Read table &amp;lt;session_name&amp;gt; into &amp;lt;work area&amp;gt; index &amp;lt;quotient variable&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this would solve your problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Narin Nandivada.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 15:05:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080817#M975739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T15:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Session method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080818#M975740</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;take a counter where you r loop the records and  if counter eq 100 exit, say..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop itab&lt;/P&gt;&lt;P&gt;bdc data......&lt;/P&gt;&lt;P&gt;add 1 to counter.&lt;/P&gt;&lt;P&gt;if counter = 0.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with luck,&lt;/P&gt;&lt;P&gt;pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 15:07:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/session-method/m-p/4080818#M975740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T15:07:27Z</dc:date>
    </item>
  </channel>
</rss>

