当前位置:网站首页>SAP ABAP BDC (batch data communication) -018

SAP ABAP BDC (batch data communication) -018

2022-07-07 05:47:00 Boating in rainy days

SAP ABAP BDC( Batch data communication )-018

Introduction to batch input

Batch input is usually used to convert data from non R/3 System transfer to R/3 System or in R/3 Data transmission between systems .

It is a data transmission technology , Allows you to automatically transfer data sets to screens that belong to transactions , So as to transmit to SAP System . Batch input is controlled by the batch input session .

In this tutorial , You will learn :

  • Introduction to batch input
  • Batch input method
  • Batch input process
  • To write BDC Program
  • Create a batch input session
  • Batch input recorder

Batch input session

Combine a series of transaction calls with input data and user operations . Batch input sessions can be used to perform dialog transactions in batch input , Some or all of the screens are handled by the session . Batch input sessions are stored in the database as database tables , And when accessing transactions, it can be used as an internal table in the program .

matters needing attention

  • BDI By performing normal SAP Business to work , Just like users , But it will automatically execute transactions . All screen verification and business logic verification will be completed when batch data input is used .
  • It is suitable for inputting large amounts of data .
  • No manual interaction

Batch input method

SAP There are two ways to transfer old data to R/3 The basic method of the system .

  1. Classic batch input method .
  2. Call transaction method .

Classic batch input method

In this method ,ABAP/4 The program reads the external data to SAP System and stored in the batch input session .

After creating a session , You can run a session to execute SAP Business .

This method uses OPEN、BDC_INSERT and BDC_CLOSE BDC_ Function modules

Batch input session can be through 3 There are ways to deal with

  1. In the foreground
  2. Backstage
  3. During processing , Display error

If you want to test data transmission , Batch input session should be processed in the foreground or using error display .

If you want to perform data transmission or test its performance , Then the session should be processed in the background .

Precautions about classical batch input method

  • Synchronous processing
  • Transfer data of multiple transactions .
  • Synchronize database updates .
  • A batch input process log will be generated for each session .
  • Cannot generate session in parallel .

Call transaction method .

In this method ,ABAP/4 Program usage CALL TRANSACTION USING Statement to run SAP Business .

The whole batch input process is carried out online in the program
 Insert picture description here

matters needing attention :

  • Faster data processing
  • Asynchronous processing
  • Transfer data for a single transaction .
  • Do not generate batch processing logs .

Batch input process

 Insert picture description here

You usually follow the following sequence of steps to develop batch input for your organization

  1. Analyze legacy data . Determine how to map the data to be transferred to SAP structure . Also pay attention to the necessary data type or data length conversion .
  2. Generate SAP data structure .
  3. Export data to a sequential file . Please note that , Predefined SAP The batch input program requires character format .
  4. If not used SAP Provided BDC Program , Please code your batch input program . Select the appropriate batch input method according to the situation .
  5. Process data and add it to SAP System .
  6. Analyze process logs . For those who do not create the correct log CALL TRANSACTION Method , Please use the message collected by the program .
  7. From the results of process analysis , Correct and reprocess the wrong data .

To write BDC Program

You can observe the following process to write BDC Program

  1. Analyze transactions to process batch input data .
  2. Determine the batch input method to use .
  3. Read data from sequential file
  4. Perform data conversion or error checking .
  5. Store the data in the batch input structure ,BDCDATA.
  6. Generate batch input sessions for classic batch input , Or use CALL TRANSACTION USING Statements directly process data .

Batch input data structure

Batch input data structure declaration

DATA : BEGIN OF < bdc table>

OCCURS <occurs parameters>.

INCLUDE STRUCTURE BDCDATA.

DATA:END OF <bdc table>.

Field name Type Length DescriptionPROGRAM CHAR 8 Module poolDYNPRO NUMC 4 Dynpro numberDYNBEGIN CHAR 1 Starting a dynpro FNAM CHAR 35 Field nameFVAL CHAR 80 Field value

The order of fields in the data of a particular screen makes no sense

matters needing attention

  • fill BDC Data time , Please make sure to consider user settings . This is particularly relevant for filling in fields involving numbers ( Such as quantity , amount of money ). User settings determine the grouping characters of numbers , for example : According to user settings , The number 50000 can be written as 50,000.00 or 50.000,00.
  • Compress quantity and quantity fields FVAL Field , Align them to the left .
  • Please note that , In filling BDC Data table , Should pass BDC All fields filled in are treated as character type fields .
  • On some screens , Use BDC When populating values in table controls , You must write down the number of lines that exist on the default size of the screen and the code for as many lines as possible . If more rows have to be filled , It must be “ Page down ” Function to write code .
  • The number of lines displayed in the above scheme will vary according to the screen size used by the user . therefore , Always write code for standard screen sizes , And make BDC Always work with standard screen size , Regardless of how the user keeps their screen size .

Create a batch input session

  1. Use function modules BDC_OPEN_GROUP Open the batch input session .
  2. For every transaction in the session :
  3. stay BDCDATA Fill in the values of all screens and fields processed in the transaction .
  4. Transfer transactions to have BDC_INSERT Conversation .
  5. Use BDC_CLOSE_GROUP Close the batch input session

Batch input recorder

Batch input recorder ( System > service > Batch input > Recorder ) Record manually entered transactions , And create a batch input session , Can be used later SM35 perform .

 Insert picture description here

  • By selecting “ Recording ” Button to start the batch input recorder .
  • The recording file name is a user-defined name , It can match the batch input session name that can be created from the recording file .
  • Input SAP Transaction and start posting the transaction .
  • Complete posting SAP After the transaction , You can choose to get the transaction and save to end the record , Or select the next transaction and post another transaction .
  • After saving the recording file , You can create batch input sessions and... From recorded files / Or generate a batch input program from a recorded file .
  • Now you can analyze the batch input session you created just like any other batch input session .
  • The program generated by the batch input recorder function is a powerful tool for data interface programmers . It provides a solid foundation , Then it can be changed according to the customer's requirements .
原网站

版权声明
本文为[Boating in rainy days]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207062343165614.html