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

Processing Datasets: Open Dataset

This document provides information on processing sequential datasets in ABAP/4 programs. It discusses opening and closing datasets, reading and writing data in binary and text mode, and transferring data between datasets and fields. The document also summarizes the basic steps as defining structures, opening a dataset, writing/reading data, processing records in a loop until the end of the dataset, then closing the dataset.

Uploaded by

go2kaatt
Copyright
© Attribution Non-Commercial (BY-NC)
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)
33 views

Processing Datasets: Open Dataset

This document provides information on processing sequential datasets in ABAP/4 programs. It discusses opening and closing datasets, reading and writing data in binary and text mode, and transferring data between datasets and fields. The document also summarizes the basic steps as defining structures, opening a dataset, writing/reading data, processing records in a loop until the end of the dataset, then closing the dataset.

Uploaded by

go2kaatt
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 16

Sequential Files Processing Datasets

Open Dataset

Process Dataset

Close Dataset

Sequential Files Opening Datasets


OPEN DATASET <dataset name>
FOR INPUT OUTPUT APPENDING BINARY MODE TEXT MODE

IN

IF SY-SUBRC NE 0. . . .

Sequential Files Binary Mode


ABAP/4 program

Text Mode
ABAP/4 program

A B C A B A B C D

A B C A B A B C D
TRANSFER

TRANSFER A B C A B A B C D READ DATASET


ABAP/4 program

A B C
ABAP/4 program

A B

A B C D

READ DATASET A B C A B A B C

A B C A B A B C D

Sequential Files Transferring Data Records

TRANSFER <field> TO <dataset name>.

Sequential file Data rec.

Sequential Files Reading Data Records

READ DATASET <dataset name> INTO <field>.

Sequential file Data rec.

Sequential Files

Closing/Deleting Sequential Datasets

CLOSE DATASET <dataset name>

DELETE DATASET <dataset name>

Sequential Files
Summary
Define structures Open dataset
Write Read

Fill structure Transfer structure

Read data record Process data record

Yes

More records? No

End of dataset? Yes

No

Close dataset

Local Files

WS_UPLOAD/GUI_UPLOAD WS_DOWNLOAD/GUI_DOWNLOAD WS_QUERY

Data Interfaces Batch Input


Non-SAP System SAP R/2 SAP R/3
Queue
Batch Input

Application program

Data Interfaces
Structure of the BDC Table
PROGRAM DYNPRO DYNBEGIN FNAM FVAL

SAPMF02D

0106

X RF02D-KUNNR RF02D-D0110 BDC_OKCODE 4711 X /00 03 CATHYS =UPDA

SAPMF02D

0110

X KNA1-REGI0 KNA1-NAME2 BDC_OKCODE

Data Interfaces
Preparatory Activities
Go through application function Note program names and dynpro numbers Note field names Note dynpro sequence and function codes

Create BDC table structure

Data Interfaces
CALL TRANSACTION BATCH INPUT SESSION
Open Session

Read Data Records

Read Data Records

Fill BDC table


Fill BDC table

Call Transaction

Include BDC table in Session

Close Session

Data Interfaces
CALL TRANSACTION <transaction code> USING MODE UPDATE
<display mode>:

<bdc table> <display mode> <update mode>

A
E N
<update mode>:

Display all
Display only errors No display

S A

Continue processing when update is completed (synchronous) Continue processing immediately

Data Interfaces
CALL FUNCTION BDC_OPEN_GROUP
EXPORTING CLIENT GROUP HOLDDATE KEEP USER

= = = = =

<client> <session name> <lock date> <deletion indicator> <batch user name>

EXCEPTIONS RUNNING QUEUE_ERROR CLIENT_INVALID GROUP_VALID

= 1 = 2 = 3

Data Interfaces
CALL FUNCTION BDC_INSERT
EXPORTING TABLES TCODE = <transaction code>

DYNPROTAB = <bdc_table>

EXCEPTIONS INTERNAL_ERROR NOT_OPEN QUEUE_ERROR TCODE_INVALID

= = = =

1 2 3 4

Data Interfaces

CALL FUNCTION BDC_CLOSE_GROUP


EXCEPTIONS

NOT_OPEN
QUEUE_ERROR

= 1
= 2

You might also like