Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

what is Difference between batch input method & session method

Former Member
0 Kudos
1,033

what is Difference between batch input method & session method.

Advance thanx

7 REPLIES 7

Former Member
0 Kudos
181

Batch Input or session is one and the same

http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm

Regards,

Santosh

Former Member
0 Kudos
181

Hi Praveen,

<b>Session method.</b>

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.

<b>Call transaction.</b>

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

<b>plz reward points if helpful or if it solves ur query.</b>

Thanks

Chinmay

0 Kudos
181

Can you tell me how to handle errors in bothe methods.

Thanx in Advance

Former Member
0 Kudos
181

Hi,

<b>Session method.</b>

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.

<b>Call transaction.</b>

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

Regards

Sudheer

Former Member
0 Kudos
181

BDC:

Batch Data Communication (BDC) is the process of transferring data from one SAP System to another SAP system or from a non-SAP system to SAP System.

Types of BDC :

CLASSICAL BATCH INPUT (Session Method)

CALL TRANSACTION

BATCH INPUT METHOD:

Features:

Asynchronous processing.

Synchronous updating in database update.

Transfer data for more than one transaction.

Batch input processing log will be generated.

During processing, no transaction is started until the previous transaction has been written to the database.

CALL TRANSACTION METHOD :

Features:

Synchronous processing. The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.

Updating the database can be either synchronous or asynchronous. The program specifies the update type.

Transfer data for a single transaction.

Transfers data for a sequence of dialog screens.

No batch input processing log is generated.

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

Rewards if helpfull

Regards

Pavan

former_member198270
Active Contributor
0 Kudos
181

hi Praveen ,

<b>Batch input</b> is a method to upload mass data in batch (nightly jobs etc). Direct input method can also be scheduled for nightly jobs, but they are different in uploading the data into the system. Function modules, update statements are used in direct input method. Batch input program can use call transaction or std SAP programs to upload data. Depending on the load of data, you might want to decide whether to use batch input or direct input method in migration project. Batch input method is better for handling more data load.

session method:

1.Data is not updated in database tabel unless session is processed.

2.no sy-subrc is returned.

3.Error log is created for error records.

4.updataion in database table is always synchronous.

<i>Reward points if helpful .</i>

Regards,

Amber S

Former Member
0 Kudos
181

hi,

Session method provides errorl log by default

goto SM35->error log.

In call transaction we have to handle error records using BDCMSGCOLL and FORMAT_MESSAGES.

after calltrnsaction logic check for sy-subrc <> 0.

then loop at bdcmsg.

error msgs.

endloop.

check below example.

REPORT ZSR_BDC_CT_ERROR.

DATA: BEGIN OF ITAB OCCURS 0,

LIFNR LIKE RF02K-LIFNR,

KTOKK LIKE RF02K-KTOKK,

NAME1 LIKE LFA1-NAME1,

SORTL LIKE LFA1-SORTL,

LAND1 LIKE LFA1-LAND1,

SPRAS LIKE LFA1-SPRAS,

END OF ITAB.

DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE,

it_error like itab occurs 0 with header line,

BDCMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'z:\ct.txt'

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

DATA_TAB = ITAB

  • EXCEPTIONS

  • FILE_OPEN_ERROR = 1

  • FILE_READ_ERROR = 2

  • NO_BATCH = 3

  • GUI_REFUSE_FILETRANSFER = 4

  • INVALID_TYPE = 5

  • NO_AUTHORITY = 6

  • UNKNOWN_ERROR = 7

  • BAD_DATA_FORMAT = 8

  • HEADER_NOT_ALLOWED = 9

  • SEPARATOR_NOT_ALLOWED = 10

  • HEADER_TOO_LONG = 11

  • UNKNOWN_DP_ERROR = 12

  • ACCESS_DENIED = 13

  • DP_OUT_OF_MEMORY = 14

  • DISK_FULL = 15

  • DP_TIMEOUT = 16

  • OTHERS = 17

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT ITAB.

REFRESH BDCTAB.

PERFORM BDC_DYNPRO USING 'SAPMF02K' '0100'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RF02K-KTOKK'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'RF02K-LIFNR'

ITAB-LIFNR.

PERFORM BDC_FIELD USING 'RF02K-KTOKK'

ITAB-KTOKK.

PERFORM BDC_DYNPRO USING 'SAPMF02K' '0110'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'LFA1-SPRAS'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'LFA1-NAME1'

ITAB-NAME1.

PERFORM BDC_FIELD USING 'LFA1-SORTL'

ITAB-SORTL.

PERFORM BDC_FIELD USING 'LFA1-LAND1'

ITAB-LAND1.

PERFORM BDC_FIELD USING 'LFA1-SPRAS'

ITAB-SPRAS.

PERFORM BDC_DYNPRO USING 'SAPMF02K' '0120'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'LFA1-KUNNR'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_DYNPRO USING 'SAPMF02K' '0130'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'LFBK-BANKS(01)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENTR'.

PERFORM BDC_DYNPRO USING 'SAPLSPO1' '0300'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=YES'.

CALL TRANSACTION 'XK01' USING BDCTAB MODE 'A' UPDATE 'A' MESSAGES INTO BDCMSG.

*LOOP AT BDCMSG.

if sy-subrc <> 0.

move-corresponding itab to it_error.

endif.

READ TABLE BDCMSG WITH KEY MSGTYP = 'E'.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = BDCMSG-MSGID

LANG = 'EN'

NO = BDCMSG-MSGNR

V1 = BDCMSG-MSGV1

V2 = BDCMSG-MSGV2

V3 = BDCMSG-MSGV3

V4 = BDCMSG-MSGV4

IMPORTING

MSG = BDCMSG-MSGV1

  • 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 😕 BDCMSG-MSGNR,BDCMSG-MSGV1.

ENDLOOP.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE = BIN_FILESIZE

filename = 'z:\cerror.txt'

FILETYPE = 'ASC'

  • APPEND = ' '

WRITE_FIELD_SEPARATOR = 'X'

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH = FILELENGTH

TABLES

data_tab = it_error

  • FIELDNAMES = FIELDNAMES

  • EXCEPTIONS

  • FILE_WRITE_ERROR = 1

  • NO_BATCH = 2

  • GUI_REFUSE_FILETRANSFER = 3

  • INVALID_TYPE = 4

  • NO_AUTHORITY = 5

  • UNKNOWN_ERROR = 6

  • HEADER_NOT_ALLOWED = 7

  • SEPARATOR_NOT_ALLOWED = 8

  • FILESIZE_NOT_ALLOWED = 9

  • HEADER_TOO_LONG = 10

  • DP_ERROR_CREATE = 11

  • DP_ERROR_SEND = 12

  • DP_ERROR_WRITE = 13

  • UNKNOWN_DP_ERROR = 14

  • ACCESS_DENIED = 15

  • DP_OUT_OF_MEMORY = 16

  • DISK_FULL = 17

  • DP_TIMEOUT = 18

  • FILE_NOT_FOUND = 19

  • DATAPROVIDER_EXCEPTION = 20

  • CONTROL_FLUSH_ERROR = 21

  • OTHERS = 22

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

&----


*& Form dynpro

&----


FORM BDC_DYNPRO USING P_P1

P_P2.

CLEAR BDCTAB.

BDCTAB-PROGRAM = P_P1.

BDCTAB-DYNPRO = P_P2.

BDCTAB-DYNBEGIN = 'X'.

APPEND BDCTAB.

ENDFORM. " dynpro

&----


*& Form bdc_field

&----


FORM BDC_FIELD USING P_P3

P_P4.

CLEAR BDCTAB.

BDCTAB-FNAM = P_P3.

BDCTAB-FVAL = P_P4.

APPEND BDCTAB.

ENDFORM. " bdc_field

if helpful reward points