0% found this document useful (0 votes)
12 views

Chapter 07_ Call Transaction Method

The document outlines the Call Transaction Method for Batch Input within IBM Global Services, detailing how to differentiate between various batch input methods and their error handling processes. It provides examples of changing vendor information using the CALL TRANSACTION and CALL DIALOG statements, along with programming snippets for implementation. Additionally, it discusses synchronous versus asynchronous updates and emphasizes the need for manual error handling in batch input programs.

Uploaded by

Aniruddha_Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Chapter 07_ Call Transaction Method

The document outlines the Call Transaction Method for Batch Input within IBM Global Services, detailing how to differentiate between various batch input methods and their error handling processes. It provides examples of changing vendor information using the CALL TRANSACTION and CALL DIALOG statements, along with programming snippets for implementation. Additionally, it discusses synchronous versus asynchronous updates and emphasizes the need for manual error handling in batch input programs.

Uploaded by

Aniruddha_Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18

IBM Global Services

Call Transaction Method

Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Objectives

 The participants will be able to:


 Describe the Call Transaction Method for Batch Input.
 Differentiate the different batch input methods.

2 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Overview

PROGRAM DYNPRO DYNBEGIN FNAM FVAL


SAPMF02K 0106 X
RF02K-LIFNR TEST1
RF02K-D0110 X
SAPMF02K 0110 X
LFA1-STRAS 123 Main St.
BDC_OKCODE =UPDA
BDC Table

Create Batch Input Use in “CALL Use in “CALL DIALOG”


Session TRANSACTION” statement
(BDC Program) statement

3 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Differences in Batch Input Methods

When is the SAP How are errors


database updated? handled?

Automatically by the
Create batch During the processing of
system during the
input session the batch input session
processing of the batch
input session
(BDC Program):

During the execution of Must be handled in the


CALL TRANSACTION: the batch input program batch input program
CALL DIALOG:

4 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Example - Change Vendors

To illustrate the “CALL TRANSACTION” and “CALL DIALOG”


methods, we will use the example to change vendors coming
from a sequential file.

Vendor TEST1 Vendor TEST2

Company Code Company Code

X Address X Address

Name Computers, Inc. Name Computer Land

Street 123 Main St. Street 10 Walnut St.

City Philadelphia City Boston

5 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

“CALL TRANSACTION USING” Statement

CALL TRANSACTION <transaction code>


USING <bdc internal table>
MODE <display mode>
UPDATE <update mode>
MESSAGES INTO <msg int. table>.

<display mode> <update mode>


A: display all S: synchronous
E: display errors only A: asynchronous
N: no display

6 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

“CALL TRANSACTION USING” Statement (Contd.)

CALL TRANSACTION <transaction code>


USING <bdc internal table>
MODE <display mode>
UPDATE <update mode>
MESSAGES INTO <msg int. table>.

<display mode> <update mode>


A: display all S: synchronous
E: display errors only A: asynchronous
N: no display L: local update

7 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Example #1 - Declaration Section

REPORT YDI00007.

Step #1 DATA: BDC_TAB TYPE STANDARD TABLE OF BDCDATA


INITIAL SIZE 6,
WA_BDC_TAB TYPE BDCDATA.
INFILE(20) VALUE ‘./bc180_file4’.

Step #2 DATA: BEGIN OF INREC,


VENDNUM TYPE LIFNR,
STREET TYPE STRAS_GP,
END OF INREC.
PARAMETERS: DISPMODE DEFAULT ‘A’,
UPDAMODE DEFAULT ‘S’.

** This program is continued on the next slide **


8 Data Interfaces | Dec-2008 © 2005 IBM Corporation
IBM Global Services

Example #1 - Main Program


START-OF-SELECTION.
Step #3 OPEN DATASET INFILE
FOR INPUT IN TEXT MODE.
DO.
Step #4 READ DATASET INFILE INTO INREC.
IF SY-SUBRC <> 0.
Step #5 EXIT.
ENDIF.
Step #6 PERFORM FILL_BDC_TAB.
CALL TRANSACTION ‘FK02’
Step #7 USING BDC_TAB
MODE DISPMODE
UPDATE UPDAMODE.
Step #8 IF SY-SUBRC <> 0.
WRITE: / ‘Error’.
ENDIF.
ENDDO.
Step #9 CLOSE DATASET INFILE.

** This program is continued on the next slide **

9 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Example #1 - Main Program (Contd.)


START-OF-SELECTION.
Step #3 OPEN DATASET INFILE
FOR INPUT IN TEXT MODE.
DO.
Step #4 READ DATASET INFILE INTO INREC.
IF SY-SUBRC <> 0.
Step #5 EXIT.
ENDIF.
Step #6 PERFORM FILL_BDC_TAB.
CALL TRANSACTION ‘FK02’
Step #7 USING BDC_TAB
MODE DISPMODE
UPDATE UPDAMODE.
Step #8 IF SY-SUBRC <> 0.
WRITE: / ‘Error’.
ENDIF.
ENDDO.
Step #9 CLOSE DATASET INFILE.

** This program is continued on the next slide **

10 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Example #1 - Subroutines
FORM FILL_BDC_TAB. FORM POPULATE_BDC_TAB USING
FLAG TYPE C
REFRESH BDC_TAB. VAR1 TYPE C
VAR2 TYPE C.
PERFORM POPULATE_BDC_TAB CLEAR WA_BDC_TAB.
USING: IF FLAG = ‘1’.
WA_BDC_TAB-PROGRAM = VAR1.
‘1’ ‘SAPMF02K’ ‘0106’, WA_BDC_TAB-DYNPRO = VAR2.
‘ ’ ‘RF02K-LIFNR’ INREC- WA_BDC_TAB-DYNBEGIN = ‘X’.
VENDNUM, ELSE.
‘ ’ ‘RF02K-D0110’ ‘X’, WA_BDC_TAB-FNAM = VAR1.
WA_BDC_TAB-FVAL = VAR2.
‘1’ ‘SAPMF02K’ ‘0110’, ENDIF.
‘ ’ ‘LFA1-STRAS’ INREC-STREET, APPEND WA_BDC_TAB TO
‘ ’ ‘BDC_OKCODE’ ‘=UPDA’. BDC_TAB.

ENDFORM. ENDFORM.

Notice that the vendor number and street values are coming from the
file’s records read into the “INREC” structure.

11 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Error Handling

Write an error report.

Send the record(s) in error to


an error file.

Create a batch input session


with the record(s) in error.

12 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

BDC Program Flow

Declare BDC Table Fill BDC Table

Create & Record Program Collect Transaction Information

Batch Input Sessions

Process Batch Input Methods

Call Transaction

13 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Synchronous versus Asynchronous

DO. DO.
... ...
PERFORM FILL_BDC_TAB. PERFORM FILL_BDC_TAB.
CALL TRANSACTION ‘FK02’ CALL TRANSACTION ‘FK02’
USING BDC_TAB USING BDC_TAB
MODE ‘N’ MODE ‘N’
UPDATE ‘S’. UPDATE ‘A’.
IF SY-SUBRC <> 0. IF SY-SUBRC <> 0.
WRITE: / ‘Error’. WRITE: / ‘Transaction error’.
ENDIF. ENDIF.
ENDDO. ENDDO.

With synchronous updating, we can With asynchronous updating, we


check SY-SUBRC to determine the can check SY-SUBRC to determine
success of the transaction and the the success of the transaction only,
actual update to the database. not the actual update to the
database.

14 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Demonstration

 Creation of a custom BDC program and changing customer address with


transaction XD02 (Change Customer) using the Call transaction method.

15 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Practice

 Creation of a custom BDC program and changing customer address with


transaction XD02 (Change Customer) using the Call transaction method.

16 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Summary

 If you use the “CALL TRANSACTION” or “CALL DIALOG” statement, errors are
not handled automatically by the system. Errors must be handled in the batch
input program.
 The “CALL TRANSACTION” statement executes an online program. When this
transaction is completed, processing returns to the “calling” program.

17 Data Interfaces | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Questions

 What are the different batch input methods present in SAP for data upload?
 What is the difference between synchronous and asynchronous update?

18 Data Interfaces | Dec-2008 © 2005 IBM Corporation

You might also like