Combination of call transaction & session methods

hi,
how to combine call transaction & session methods in a single transaction.
give me the exact steps to proceed with the above.

Hi Saritha,
Your question is not clear to me but I am assuming your queestion like this
"Providing choice for user for using either call transaction & Session method for uploading data"
When you generate the BDC (Batch Data Communication options define the processing mode for a batch input session) program with SHDB, you can remove a lot of unwanted fields by copying this customize abap include program.  It allows you to execute the BDC program immediately without filling up those SAP generate fields.  To run background, just run it as a background job.
Execute BDC immediately by replacing the include BDCRECX1
Written by : SAP Basis, ABAP Programming and Other IMG Stuff
                 http://www.sap-img.com
***INCLUDE ZBDCRECX1.
When you generate the program using SHDB, you can replace it
with this if you want to execute it immediately without having
to process it using SM35.
During testing you can used the original include.
For example,
include zbdcrecx1.   "After test
include bdcrecx.     "Before test
Declare your internal table as RECORD
for programs doing a data transfer by creating a batch-input session
and
for programs doing a data transfer by CALL TRANSACTION USING
*SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS SESSION RADIOBUTTON GROUP CTU.  "create session
SELECTION-SCREEN COMMENT 3(20) TEXT-S07 FOR FIELD SESSION.
selection-screen position 45.
PARAMETERS CTU RADIOBUTTON GROUP CTU DEFAULT 'X'. "call transaction
SELECTION-SCREEN COMMENT 48(20) TEXT-S08 FOR FIELD CTU.
*SELECTION-SCREEN END OF LINE.
PARAMETERS: SESSION NO-DISPLAY,
            CTU     NO-DISPLAY DEFAULT 'X'.
*SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) TEXT-S01 FOR FIELD GROUP.
selection-screen position 25.
PARAMETERS GROUP(12).                      "group name of session
SELECTION-SCREEN COMMENT 48(20) TEXT-S05 FOR FIELD CTUMODE.
selection-screen position 70.
PARAMETERS CTUMODE LIKE CTU_PARAMS-DISMODE DEFAULT 'N'.
                                     "A: show all dynpros
                                     "E: show dynpro on error only
                                     "N: do not display dynpro
*SELECTION-SCREEN END OF LINE.
PARAMETERS: GROUP(12) NO-DISPLAY,
            CTUMODE   NO-DISPLAY DEFAULT 'N'.
*SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) TEXT-S02 FOR FIELD USER.
selection-screen position 25.
PARAMETERS: USER(12) DEFAULT SY-UNAME.    "user for session in batch
SELECTION-SCREEN COMMENT 48(20) TEXT-S06 FOR FIELD CUPDATE.
selection-screen position 70.
PARAMETERS CUPDATE LIKE CTU_PARAMS-UPDMODE DEFAULT 'L'.
                                     "S: synchronously
                                     "A: asynchronously
                                     "L: local
*SELECTION-SCREEN END OF LINE.
PARAMETERS: USER(12) NO-DISPLAY DEFAULT SY-UNAME,
            CUPDATE LIKE CTU_PARAMS-UPDMODE DEFAULT 'L' NO-DISPLAY.
*SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) TEXT-S03 FOR FIELD KEEP.
selection-screen position 25.
PARAMETERS: KEEP AS CHECKBOX.       "' ' = delete session if finished
                                     "'X' = keep   session if finished
SELECTION-SCREEN COMMENT 48(20) TEXT-S09 FOR FIELD E_GROUP.
selection-screen position 70.
parameters E_GROUP(12).             "group name of error-session
*SELECTION-SCREEN END OF LINE.
PARAMETERS: KEEP        NO-DISPLAY,
            E_GROUP(12) NO-DISPLAY.
*SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) TEXT-S04 FOR FIELD HOLDDATE.
selection-screen position 25.
PARAMETERS: HOLDDATE LIKE SY-DATUM.
SELECTION-SCREEN COMMENT 51(17) TEXT-S02 FOR FIELD E_USER.
selection-screen position 70.
PARAMETERS: E_USER(12) DEFAULT SY-UNAME.    "user for error-session
*SELECTION-SCREEN END OF LINE.
PARAMETERS: HOLDDATE LIKE SY-DATUM NO-DISPLAY,
           E_USER(12) DEFAULT SY-UNAME NO-DISPLAY.
*SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 51(17) TEXT-S03 FOR FIELD E_KEEP.
selection-screen position 70.
PARAMETERS: E_KEEP AS CHECKBOX.     "' ' = delete session if finished
                                     "'X' = keep   session if finished
*SELECTION-SCREEN END OF LINE.
PARAMETERS: E_KEEP NO-DISPLAY.
*SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 51(17) TEXT-S04 FOR FIELD E_HDATE.
selection-screen position 70.
PARAMETERS: E_HDATE LIKE SY-DATUM.
*SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN SKIP.
PARAMETERS: E_HDATE LIKE SY-DATUM NO-DISPLAY.
*SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TEXT-S10 FOR FIELD NODATA.
PARAMETERS: NODATA DEFAULT '/' LOWER CASE.          "nodata
*SELECTION-SCREEN END OF LINE.
PARAMETERS: NODATA DEFAULT '/' LOWER CASE NO-DISPLAY.
*SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) FOR FIELD SMALLLOG.
PARAMETERS: SMALLLOG as checkbox.  "' ' = log all transactions
                                    "'X' = no transaction logging
*SELECTION-SCREEN END OF LINE.
PARAMETERS: SMALLLOG NO-DISPLAY.
  data definition
      Batchinputdata of single transaction
DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
      messages of call transaction
DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
      error session opened (' ' or 'X')
DATA:   E_GROUP_OPENED.
      message texts
TABLES: T100.
  at selection screen                                                *
AT SELECTION-SCREEN.
group and user must be filled for create session
  IF SESSION = 'X' AND
     GROUP = SPACE OR USER = SPACE.
    MESSAGE E613(MS).
  ENDIF.
  open dataset                                                       *
FORM OPEN_DATASET USING P_DATASET.
  OPEN DATASET P_DATASET IN TEXT MODE.
  IF SY-SUBRC <> 0.
    WRITE: / TEXT-E00, SY-SUBRC.
    STOP.
  ENDIF.
ENDFORM.
  close dataset                                                      *
FORM CLOSE_DATASET USING P_DATASET.
  CLOSE DATASET P_DATASET.
ENDFORM.
  create batchinput session                                          *
  (not for call transaction using...)                                *
FORM OPEN_GROUP.
  IF SESSION = 'X'.
    SKIP.
    WRITE: /(20) 'Create group'(I01), GROUP.
    SKIP.
  open batchinput group
    CALL FUNCTION 'BDC_OPEN_GROUP'
         EXPORTING  CLIENT   = SY-MANDT
                    GROUP    = GROUP
                    USER     = USER
                    KEEP     = KEEP
                    HOLDDATE = HOLDDATE.
    WRITE: /(30) 'BDC_OPEN_GROUP'(I02),
            (12) 'returncode:'(I05),
                 SY-SUBRC.
  ENDIF.
ENDFORM.
  end batchinput session                                             *
  (call transaction using...: error session)                         *
FORM CLOSE_GROUP.
  IF SESSION = 'X'.
  close batchinput group
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    WRITE: /(30) 'BDC_CLOSE_GROUP'(I04),
            (12) 'returncode:'(I05),
                 SY-SUBRC.
  ELSE.
    IF E_GROUP_OPENED = 'X'.
      CALL FUNCTION 'BDC_CLOSE_GROUP'.
      WRITE: /.
      WRITE: /(30) 'Fehlermappe wurde erzeugt'(I06).
    ENDIF.
  ENDIF.
ENDFORM.
       Start new transaction according to parameters                 *
FORM BDC_TRANSACTION USING TCODE.
  DATA: L_MSTRING(480).
  DATA: L_SUBRC LIKE SY-SUBRC.
batch input session
  IF SESSION = 'X'.
    CALL FUNCTION 'BDC_INSERT'
         EXPORTING TCODE     = TCODE
         TABLES    DYNPROTAB = BDCDATA.
    IF SMALLLOG <> 'X'.
      WRITE: / 'BDC_INSERT'(I03),
               TCODE,
               'returncode:'(I05),
               SY-SUBRC,
               'RECORD:',
               SY-INDEX.
    ENDIF.
call transaction using
  ELSE.
    REFRESH MESSTAB.
    CALL TRANSACTION TCODE USING BDCDATA
                     MODE   CTUMODE
                     UPDATE CUPDATE
                     MESSAGES INTO MESSTAB.
    L_SUBRC = SY-SUBRC.
    IF SMALLLOG <> 'X'.
     WRITE: / 'CALL_TRANSACTION',
              TCODE,
              'returncode:'(I05),
              L_SUBRC,
              'RECORD:',
              SY-INDEX.
      IF SY-SUBRC = 0.
         FORMAT COLOR OFF.
         WRITE:/ 'Successfully Process ', MESSTAB, RECORD.
      ELSE.
         FORMAT COLOR COL_NEGATIVE.
         WRITE:/ 'Failed Process ', MESSTAB, RECORD.
      ENDIF.
      LOOP AT MESSTAB.
        SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                  AND   ARBGB = MESSTAB-MSGID
                                  AND   MSGNR = MESSTAB-MSGNR.
        IF SY-SUBRC = 0.
          L_MSTRING = T100-TEXT.
          IF L_MSTRING CS '&1'.
            REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
            REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
            REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
            REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
          ELSE.
            REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
            REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
            REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
            REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
          ENDIF.
          CONDENSE L_MSTRING.
          WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
        ELSE.
          WRITE: / MESSTAB.
        ENDIF.
      ENDLOOP.
      SKIP.
    ENDIF.
Erzeugen fehlermappe ************************************************
    IF L_SUBRC <> 0 AND E_GROUP <> SPACE.
      IF E_GROUP_OPENED = ' '.
        CALL FUNCTION 'BDC_OPEN_GROUP'
             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = E_GROUP
                        USER     = E_USER
                        KEEP     = E_KEEP
                        HOLDDATE = E_HDATE.
         E_GROUP_OPENED = 'X'.
      ENDIF.
      CALL FUNCTION 'BDC_INSERT'
           EXPORTING TCODE     = TCODE
           TABLES    DYNPROTAB = BDCDATA.
    ENDIF.
  ENDIF.
  REFRESH BDCDATA.
ENDFORM.
       Start new screen                                              *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
  CLEAR BDCDATA.
  BDCDATA-PROGRAM  = PROGRAM.
  BDCDATA-DYNPRO   = DYNPRO.
  BDCDATA-DYNBEGIN = 'X'.
  APPEND BDCDATA.
ENDFORM.
       Insert field                                                  *
FORM BDC_FIELD USING FNAM FVAL.
  IF FVAL <> NODATA.
    CLEAR BDCDATA.
    BDCDATA-FNAM = FNAM.
    BDCDATA-FVAL = FVAL.
    APPEND BDCDATA.
  ENDIF.
ENDFORM.

Similar Messages

  • Call trx & Session method..?

    hi guru's.,
    can anybody plz tell , why session method is using instead of Call trx method while there is large amt of data is available, eventhough session method is slower than Call Trx...?
    Thanks & regards.,
    Chandra

    Hi,
    Session method.
    1) synchronous processing.
    2) can tranfer large amount of data.
    3) processing is slower.
    4) error log is created
    5) data is not updated until session is processed.
    6) generally used for back ground jobs.
    7) at atime we can update to more than one screens.
    Call transaction.
    1) asynchronous processing
    2) can transfer small amount of data
    3) processing is faster.
    4) errors need to be handled explicitly
    5) data is updated automatically
    6) for background n fore ground jobs.
    7) at atime we can update to a single screen.
    For BDC:
    http://myweb.dal.ca/hchinni/sap/bdc_home.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sapdevelopment.co.uk/bdc/bdchome.htm
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    call Transaction or session method ?
    Vasanth

  • How to handle the call transaction in method of a custom business object

    Hello all,
    There is a custom report " RPTCORAPP" for approving leaves . As per my requirement i have develop a copy of leave workflow and for approval process i have call  "RPTCORAPP" in Custom method of custom object. i have made a transaction for this custom report for approving attendances. I am calling this method though call transaction statement within method.
    Problem: while approving the attendance workitem is not disappearing from the portal. Problem is due to call transaction statement.
                   once workitem come to the user, user click on it. control goes to the report, which display all the leave to approve on
                   the portal.
                   If after approving/ rejecting attendance user close the screen.workflow remain in the "process" status.Control wont come  back after call transaction statement in the method.
                 At the same time if user clicks on back button inspite of closing the screen. it is working fine. workitem disappears from the portal.
    How to handle the scenarion. if after approving/rejecting, i want the control to come back to the NEXT STATEMENT after call transactionstatement in my method.
    Please help it out........:)

    Hi swami,
    thanks for reply. but i am not using BDC in my method. iam just calling a custom transaction thriugh statement
    Call transaction 'ZHR_APPROVE_CLINOUT'. This transaction directly run the report RPTCORAPP and display all the request.

  • Session Method & Call Transaction

    Hi Firends,
                     On what basis call transaction & session method
    choose it?
    venkat

    Hi Venkat,
    Even though both call transaction and session method do the same job there are some differences.
    1. If no. of records to be uploaded is less (<500) u can as well choose call transaction method but if the no. of records is more (>10000) u need to choose session method as call transaction will create some performance issues.
    2. If u want to execute the program in future u can create a session and keep it ready so that u can execute it at any point of time. That is not possible in call transaction method.
    Regards,
    Asif Ali Khan

  • D/W BAPI and sesssion ,call transaction

    Hi ,
    can any one help me in finding difference from BAPI and call transaction ,session method .
    If you can provide any URL that can be vary  useful .
    Thank u,
    Mahendra.

    Hi Mahendra,
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    BAPI stands for Business API(Application Program Interface).
    Please check these links which will give you step by step for learning BAPI.
    http://www.erpgenie.com/sap/abap/bapi/example.htm
    http://www.sap-img.com/bapi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/b46c1e53c111d395fa00a0c94260a5/content.htm
    http://www.sappoint.com/abap/bapiintro.pdf#search=%22BAPI(SAP)%22
    http://www.erpgenie.com/sap/abap/bapi/index.htm
    http://www.erpgenie.com/sap/abap/bapi/conventions.htm
    http://www.erpgenie.com/sapgenie/docs/BAPI%20Programming.doc
    http://64.233.167.104/custom?q=cache:eyMZ5qPOH-0J:www.erpgenie.com/sapgenie/docs/BAPI%2520Intro.doc+bapi&hl=en&ct=clnk&cd=6&ie=UTF-8&client=pub-2723892367221695
    http://64.233.167.104/custom?q=cache:c7cwsXMxq-UJ:www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf+bapi&hl=en&ct=clnk&cd=1&ie=UTF-8&client=pub-6389415953938571
    http://www.sapgenie.com/abap/bapi/example.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    List of all BAPIs
    http://www.planetsap.com/LIST_ALL_BAPIs.htm

  • Call transaction BDC with different user id

    Hello,
    We have a BDC program for creating Invoice using "CALL TRANSACTION VF01" method. But there are are few user IDs accessing this program who do not have authorisation to VF01. So requirement is to create Invoice with a common user id.
    Please help if it is possible to call transaction with different user id. Please also provide you inputs if you can suggest some other way to fulfill this requirement.
    Thanks & Regards,
    Rohit

    Hi Rohit,
    if users are not authorized to post invoice, why is it required to surpass the checks?
    A Question the business should answer.
    It should not be the consultants obligation to find doubtable ways.
    Regards
    Clemens

  • Session method and call transaction methos which one is the sap recomonded

    hi
    PLease give me the answer to these questions.
    session method and call transaction methos which one is the sap recomonded why .
    2) if we want to maintain BDC program in all the systems.wt to d0

    Hi Revethi,
    Here is the difference between the Session and Call Transaction method.
         Session
    Session method supports both small amount of data aswell as large amount of data
    2) data processing is asynchronus and data updation is synchronus.
    3) it process multiple apllication while perfomaning validations.
    4) in session method data will be updated in data base only after processing session only.
    5) system provide by default logfile for handling error records.
    6) it supports both foreground aswell as background process
    in bdc we use FM ... bdc_open_group " for creating Session
    bdc_insert " adding transaction and bdcdata table for updating database
    bdc_close_group " for closing Session
          Call Transaction
    Call transaction exclusively for small amout of data
    2) it supports only one apllication while perfoming validations
    3) there is no default logfile, We can explicitly provide logic for creating logfile for handling error records.
    we can create logfile by using structure....BDCMSGCOLL
    4) it doesn't support background processing.
    5) data processing is synchronous and Data updation is Synchronous( default), in
    this method also supports daya updation in asynchronus process also.
    Syntax:
    Call transaction <transaction-name> using BDCDATA
    mode <A/N/E> update <L/A/S>
    messages into BDCMSGCOLL.

  • Error while updating data using session and call transaction method

    Hi all,
        i have to update data using MM01 transaction from flat file to database.i have used both session method and call transaction method to do that.in both the methods data has been transferred from internal tables to screens but while updating the data that is by clicking the ok-code at the end of the transaction iam getting a dialogue box stating
       SAP EXPRESS DOCUMENT "UPDATE WAS TERMINATED" RECEIVED FROM AUTHOR "SAP".
      please tell whether the problem lies and solution for that.
                                       thanks and regards.

    hi,
    check your recording.check whether u saved your material no in recording or not.
    once again record the transacton mm01.
           MATNR LIKE RMMG1-MATNR,
           MBRSH LIKE RMMG1-MBRSH,
           MTART LIKE RMMG1-MTART,
           MAKTX LIKE MAKT-MAKTX,
           MEINS LIKE MARA-MEINS,
           MATKL LIKE MARA-MATKL,
           BISMT LIKE MARA-BISMT,
           EXTWG LIKE MARA-EXTWG,
    these are the fields which u have to take in internal table.
    this is the record which i took in my flatfile.use filetype as asc and hasfieldseperator as 'X'.
    SUDHU-6     R     ROH     MATSUDHU     "     001     7890     AA
    i did the same.but i didn't get any error.

  • Difference between call transaction and session method

    Hello Experts.
    i have one doubt.
    suppose if we have 100 records to upload, and we got an error in 55 record. In this case what will call trans will do and what will session will do.
    i mean the call trans will process 56th record or not . will it stop at 55 itself. What will session will do in this case.
    thank you so much for all the replies.

    Hi shiva,
    In the Call transaction Method,
    It will process all the records if the Update Mode is 'N', it will store all the error messages in BDCMSGCOLL structure. The errored records would be stored in that structure.
    In Session Method,
    It stops in the 55th error record, it wont move further.
    Edited by: Raj on May 21, 2008 9:23 PM

  • Error in CALL TRANSACTION and SESSION Method

    I have 8 records (1,2,3,4,5,6,7,8) to update into SAP database using CALL TRANSACTION and SESSION Method. If there is a error in 6th record. What happens in both call transaction and session method.
    Please let me know which records will process and what about the error record. How to process only the error record if all other records have updated into database.

    Hi Patil_sumeet,
    if your code for this is not protected secret of some federal agency, you may read [How to post code in SCN, and some things NOT to do...|How to post code in SCN, and some things NOT to do...; and then post relevant lines here.
    According to the facts presented until know it may have been better to ask Radio Eriwan
    Regards
    Clemens

  • When do we go for a Call Transaction or Session Method in BDC

    Hi All,
    Please let me know the scenario when we will go in for
             1. Call Transaction
              2.Session Method.
    What is the main difference between Call Transaction and Session Method
    Regards

    hi,
    Use the CALL TRANSACTION USING statement
    Summary: With CALL TRANSACTION USING, the system processes the data more quickly than with batch input sessions. Unlike batch input sessions, CALL TRANSACTION USING does not automatically support interactive correction or logging functions.
    Your program prepares the data and then calls the corresponding transaction that is then processed immediately.
    The most important features of CALL TRANSACTION USING are:
    Synchronous processing
    Transfer of data from an individual transaction each time the statement CALL TRANSACTION USING is called
    You can update the database both synchronously and asynchronously
    The program specifies the update type
    Separate LUW (logical units of work) for the transaction
    The system executes a database commit immediately before and after the CALL TRANSACTION USING statement
    No batch input processing log
    Create a session on the batch input queue.
    Summary: Offers management of sessions, support for playing back and correcting sessions that contain errors, and detailed logging.
    Your program prepares the data and stores it in a batch input session. A session is a collection of transaction data for one or more transactions. Batch input sessions are maintained by the system in the batch input queue. You can process batch input sessions in the background processing system.
    Your program must open a session in the queue before transferring data to it, and must close it again afterwards. All of these operations are performed by making function module calls from the ABAP program.
    The most important aspects of the session interface are:
    Asynchronous processing
    Transfers data for multiple transactions
    Synchronous database update
    During processing, no transaction is started until the previous transaction has been written to the database.
    A batch input processing log is generated for each session
    Sessions cannot be generated in parallel
    The batch input program must not open a session until it has closed the preceding session.
    <b>Hope this is helpful, DO reward.</b>

  • When we have to go for session method, when we have to go for call transact

    when we have to go for session method, when we have to go for call transaction method if i have a 3000 records in flat file. which is better? why

    Data Transfer
    During the process of data transfer, data is transferred into the SAP R/3 System. This transfer is from an external system to SAP R/3 system. Whenever you transfer data from an external system into an R/3 System, you can use data transfer because it is installed and regularly transfers data from an external system into an R/3 System.
    As discussed, with the help of BDC, you can transfer the required data from a non-SAP system to an SAP system. For this kind of data transfer you are required to write an ABAP program. This ABAP program would help to export the concerned data to a sequential dataset file. The data in this file has to be stored. This should be stored in a format, which is acceptable to SAP batch input program. But, to transfer data from a SAP system to another SAP system, you can take the aid of RFC or CPI-C.
    SAP application supports the data transfer of numerous SAP business objects. The said data transfer program specifies the data format definition, which is necessary to import the data into the R/3 System. There are three methods available for transferring data:
    Direct Input:
    In this method the SAP function modules execute the consistency checks. However, there are other means of checking with the help of screens. The Direct Input Method has considerable performance advantages.
    Call Transaction:
    In this method you can check the data consistency with the help of screen logic.
    Batch Input Session:
    In this method data consistency is checked with the help of screen logic.
    Direct Input Method
    Among the methods of data transfer through BDC, direct input method is the one that is used, especially in case of transferring large amount of data. In order to enhance the batch input procedure, the system offers you with the direct input technique.
    There is a distinction between the batch input technique and this technique. Unlike batch input technique, this technique does not create sessions. Instead, it stores the data directly. Moreover, it does not process screens. The data has to be entered directly into the corresponding database tables. The system calls a number of function modules which execute necessary checks, if any required. In the case of errors, the direct input technique has a facility to restart the entire mechanism. However, if you want to restart the entire mechanism in case you faced an error, then direct input programs must be executed in the background only. One has to use program RBMVSHOW or Transaction BMV0 to maintain and start these programs.
    Call Transaction Method
    Call Transaction method is another method used for Data Transfer. In this type of method your program will use the ABAP statement CALL TRANSACTION USING in order to run a SAP transaction. In this type external data need not be deposited in a session for being processed later on. Instead, the entire batch input process takes place inline in your program.
    Here, the data transfer program must convert the data that has to be transferred into the SAP system. This is as per requirement by the SAP data structure or the transaction which is using it. It is to be remembered that a conversion of the data types may be necessary at different times during the process.
    Suppose there is a data type mismatch then you have to convert the data types to type C. In this regard the data transfer program should be capable of exporting the data in SAP format to the sequential file. At the time of uploading the data into the SAP system, the BDC program reads the data from the abovementioned sequential file.
    Batch Input Session Method
    This is the third method for data transfer. If you use the batch input method to transfer data, then you should remember that an ABAP program has to read the external data which is to be entered in the R/3 System. Subsequently, it stores the concerned data a "batch input session." The batch Input session records the actions which are required in the process of transferring data into the system. This can be done by using normal SAP transactions.
    As soon as the program generates the said session, you will be able to run the session in order to execute the SAP transactions in it. Moreover, you can start the session, and at the same time, can monitor a session with the help of batch input management function. For this you have to choose:
    System à Services à Batch input. Moreover, you can have the session run in the background processing.
    Writing a Data Transfer Program
    If you want to write a data transfer program, you have to follow the steps mentioned below.
    Firstly, you will analyze the structure of the existing data. Subsequently, your job is to specify the conversions, which are essential to fill the SAP data structures.
    Secondly, you have to generate the SAP data structure. In case the program is written in ABAP, you will require only the required tables in the concerned program with the help of TABLES statement.
    Thirdly, you will have to initialize the SAP data structure.
    Fourthly, fill the structure with data, performing any conversions and error checking that are required.
    Finally, you will write the sequential file. In the SAP system this sequential file is typically required for making the data available to the batch input program.
    Batch Input Method
    Batch input method is a type of data transfer method. It is used for bulk data transfer; it is one of the primary ways by which data can transferred into the R/3 System. This method is not for near real-time data transfers.
    There are various typical uses of batch input. One of the ways includes the one-time import of data. This import of data is from a legacy system into a newly installed R/3 System. In addition to it, another typical use is for periodic (i.e. hourly, daily..., and so on) transfers of data. These transfers are from external systems or legacy systems which are still in use into R/3 system where all enterprise data is consolidated.
    The R/3 applications deliver different programs for batch input, which are ready to be used. However, in some cases a customer has to write his or her own batch input program. This is required in order to convert the concerned data from a legacy System or from a proprietary format into an R/3 data format.
    The process flows for a batch input are discussed below.
    Data Transfer Decision-Making: It is with a decision to transfer data from an external source into R/3 that the process of batch input begins. It is probable that the external source may be a legacy system that is being replaced. A one-time bulk data transfer is foreseen in this regard. Alternatively, the external source may be an external system that is to remain in use. In this case, a regularly recurring bulk data transfer is foreseen.
    Setting up Batch-Input for Data Transfers: If R/3 standard one-time or regular data transfers are required, then by means of customizing settings in the R/3 Customizing System in SAP ASAP set up will occur. You must set up custom batch input procedures by hand, which means the system administrator must schedule the data conversion program that creates the batch input session. The system administrator and the batch input programmer must determine the following: how frequently data is made available from the external system, how frequently the conversion program should run, and whether the conversion program runs in R/3 (ABAP program) or in a host system (external program).
    Processing Batch Input Sessions: When a batch input session is processed, then the actual transfer of data into R/3 takes place. Little attention is required in processing of batch input sessions by the system administrator. Usually, the starting of batch input sessions is automated by the system administrator. If necessary, the administrators can also start batch input session explicitly from transaction SM35.
    Checking Batch Input Sessions: For a system administrator the routine activity is to check daily or more frequently in transaction SM35 whether all batch input sessions have been completed successfully. It is the schedule for running batch input sessions on which the schedule for checking sessions depends upon. For doing this check the R/3 System provides easy-to-use batch input management tools.
    Analyzing Errors: It is the duty of the system administrator to analyze the problem if one or more transactions in a session end in errors. Usually, the assistance of the affected data entry specialist or department for this analysis will be needed by the system administrator. In the situation where the problem was caused by incorrect data conversion or incorrect generation of the batch input session then the programmer who wrote the data conversion program may also need to be involved.
    Error Handling in Batch Input Method
    It is found that most problems usually fall into one of the following two categories discussed below.
    In this case either required data is missing from the batch-input session or invalid data has been included in the session. Errors in the data conversion program or the presence of unexpected types of data or incorrect data in the legacy database are the possible external causes of this type of problem. Within R/3, the causes for this type of problem include incorrect or incomplete customizing in an application. For example, a legacy data type may not have been foreseen in the check table entries made in application customizing.
    This case mainly includes technical/programming problems. The data is entered by a batch input session by running R/3 transactions non-interactively. Therefore, a typical technical or programming problem is the incorrect identification of one of the data fields in a transaction. Thus, the conversion program may not fill a required data field or may have provided invalid values.
    Conclusion
    I have gone through the details of batch data communication and various methods used to transfer data. One can make use of BDC to transfer data from a SAP to SAP system. In addition, it can transfer data from a non SAP system to SAP system too. I have discussed the various methods of BDC and the error handling in the respective methods.
    Thanks,
    Shankar

  • Log file in session and call transaction methods

    Hi Experts,
    How to see log file in session and call transaction methods?

    hi
    If its a session then goto SM35, select ur session and then u can see log button over there at the top... that will give the log
    If its a call transaction then in ur program u need to declare internal table IT_MSGS like this
    DATA:  IT_MSGS LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
      LOOP AT IT_SALES.
        PERFORM POPULATE_BDC.
        CALL TRANSACTION 'VA01' USING IT_BDCDATA
                                      MODE MODE
                                      UPDATE UPDATE
                                      MESSAGES INTO IT_MSGS.
        IF NOT IT_MSGS[] IS INITIAL.
          LOOP AT IT_MSGS.
            CALL FUNCTION 'FORMAT_MESSAGE'
              EXPORTING
                ID        = IT_MSGS-MSGID
                LANG      = 'EN'
                NO        = IT_MSGS-MSGNR
                V1        = IT_MSGS-MSGV1
                V2        = IT_MSGS-MSGV2
                V3        = IT_MSGS-MSGV3
                V4        = IT_MSGS-MSGV4
              IMPORTING
                MSG       = V_MSG
              EXCEPTIONS
                NOT_FOUND = 1
                OTHERS    = 2.
            IF SY-SUBRC <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
            WRITE:/ V_MSG.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    This will create a log for you, dont forget to award points if found helpful

  • I want to use both call transaction and session method in the same

    Hi,
              1. I want to use call transaction and session method in a single trans..how to do?
              2. I have 1000 records in it 500 records is updated using call transaction remaining 500 i hve to update with session how to do?
              3. Multiple transaction is possible in call transaction how?

    I suggest you try fulfilling your requirements yourself and come back with specific problems along the way.

  • How to send error record to session in call transaction method

    Hi experts,
    I want to send only the error record to session while executing the program in call transaction method. please give me example on this
    regards,
    siva kumar

    One logiv that I can suggest is that after you have got the details of the record in error, you write another perform build_Session and put the below logic in that.
    Logic:
    1. Build a internal table for the error records similar to the internal table you used for looping for the call transaction. In short this internal table will have only the records that have an error in call transaction.
    2. Copy the recordign that you have done before and put it in the perform inside the loop and build the BDC table.
    3. Then .using this BDC table you can build the BDC session.
    - Guru
    Reward points for helpful answers
    3.

Maybe you are looking for

  • Help needed for Query writing

    Hi, I've select query to retrive the data in the following order Sequnce ID Model Barcode 1 Dell 123 2 Dell 124 3 Dell 125 4 HP 126 5 hp 127 6 hp 128 7 apple 129 8 apple 130 I want the following to be selected round robin for Dell and Hp laptop alone

  • Switch between views in the Document window

    This question was posted in response to the following article: http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7fb6a.h tml

  • By using OID how to unzip the folder and load bunch of .csv files

    Hi All bellow is the my scenario. in my scenarion we have created FTP folder that will load the .zip files(Every Day). .zip files that will contain bunch of .csv file (flat files) and by using OID need to extract the .zip file and load the all .csv f

  • Firefox is failing to kill it's own process when closing, taking 50% resource in taskmanager.

    when clocing Firefoc 3.6 it is not killing of the firefox.exe and therfore running at 50% resource in the background. It has only started doing this since i updated to the new version 3.6.14 Any help on this matter would be appreciated. Regards TheFe

  • Illustrator won't download?

    I am trying to download illustrator again, and it keeps giving me a download error.  It says "Installation failed. read more" I click it then it says: Exit Code: 7 Please see specific errors below for troubleshooting. For example, ERROR: ------------