0% found this document useful (0 votes)
2K views13 pages

BDC Recording Procedure: Sap Sm35

The document describes the procedure for recording and executing a Batch Data Communication (BDC) in SAP. It involves recording transactions using transaction code SM35, generating an ABAP program from the recording, and executing the program to input batch data into SAP by replaying the recorded transactions. Key steps include recording transactions, generating an ABAP program, checking for errors, and executing the program to input the batch data.

Uploaded by

vidyadhar_k
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 DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views13 pages

BDC Recording Procedure: Sap Sm35

The document describes the procedure for recording and executing a Batch Data Communication (BDC) in SAP. It involves recording transactions using transaction code SM35, generating an ABAP program from the recording, and executing the program to input batch data into SAP by replaying the recorded transactions. Key steps include recording transactions, generating an ABAP program, checking for errors, and executing the program to input the batch data.

Uploaded by

vidyadhar_k
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 DOC, PDF, TXT or read online on Scribd
  • BDC Recording Procedure
  • Procedure of Writing a BDC
  • Procedure of Transfer BDC Using Batch Input
  • BDC Concept and Methods
  • Method of Doing BDC
  • BDCDATA Structure & Sample
  • Procedure to Write a Data Transfer Program

BDC RECORDING PROCEDURE

SAP SM35 SAP SM35 BDC RECORDING 1. Go to SAP Tcode SM35. 2. Press RECORDING 3. Enter the recording session name [always start with Z] use CREATE function. 4. Enter Tcode to be used in the session. Press ENTERS. 5. Enter the required data in the corresponding screen in SAP & make change if necessary. Press SAVE. [During this whole process, the BDC records the movements of the cursor and the data change made in these field, so do not repeat any cursor movements which can re-record the movement and go back to a field where the data has been changed or entered] 6. In Batch Input will appear Recording screen listing the screens, data fields, etc recorded. 7. Press GET TRANSACTION. SAVE the recording. 8. Go back [F3] to the previous screen. Press OVERVIEW Recording: Overview will appear. Choose the "recording done" Press "GENERATE PROGRAM". A popup appears and enter the Program name [start the name with Z always]

Press ENTERS". 9. Enter the title of the program Enter the other attributes: Type - 1[Online program], Status - T [Test program] Application - *[Not application-specific]. SAVE the attributes of the program & create the object as a LOCAL OBJECT. 10. Press "SOURCE CODE" and the code generated by the program is displayed. 11. To check the program created, Change the data back to the original values as in the original record. Check the program for any syntax errors. Use the menu path - Program > Execute. Enter the name of the session & the authorization group for the session. Press EXECUTES" [F8]. Use T/CodeSM35 to go back to the "BDC session overview". Choose the session and process in the background. (see SM35 BDC overview screenshot) Go back to the record to see the changes made by the current BDC session. SAP BDC Procedure of writing BDC PROCEDURE OF WRITING A BDC: 1. Analyze the transaction(s) that you will use to process your batchinput data. You may have already done this when you wrote your data transfer program.

2. Decide on the batch-input method that you wish to use. - BATCH INPUT SESSION (Classical batch input) This is a more comfortable method Restart capability and detailed logging are supported by the batch input management transaction for batch input sessions. - CALL TRANSACTION USING method It offers faster processing if you need it to get your batch input done in the time slot that is available for it. It offers, however, less support for error recovery and management of batch input. (see BDC Method) 3. Write the batch input program. Your program will need to do the following: - read data in, often from a sequential file that has been exported from another system or prepared by a data transfer program - if necessary, perform data conversions or error-checking - prepare the data for batch input processing by storing the data in the batch input data structure, BDCDATA. - generate a batch input session for classical batch input, or process the data directly with CALL TRANSACTION US (see BDC Method)

SAP BDC PROCEDURE OF TRANSFER BDC USING BATCH INPUT PROCEDURE OF TRANSFER DATA USING BAT CH INPUT 1. Analyze the data that is to be transferred to the SAP System to

determine how your existing data should be mapped to the SAP data structure. - Determine structure of the data that is to be transferred into the system. - Using the SAP data structure that you generate in step 2, Determine how the data to be transferred must be mapped to the SAP structure. - Determine whether any data type or data length conversions are required. 2. Generate SAP data structures for incorporation into your data export program. - Use the data structure generation function of the ABAP dictionary to generate data structures for SAP tables in any of several programming languages. - If you are using one of Saps standard batch input programs, then use of this function is required. The standard batch input programs generally require that you use a special predefined data structure. - If you're writing your own batch input procedure, then you will need to determine the data structure on your own. You'll need to analyze the SAP transactions to find the names of the fields that the transaction requires. 3. Code your data transfer program. You can write the program in ABAP or as an external program. 4. Export the data that is to be transferred to a sequential file. Requirements: - The file must use the logical format required by the batchinput program that will import the file (step 6). - Reading and interpreting the file is much easier if you write it in ASCII or EBCDIC (character) format rather than, for example, writing numeric data in hexadecimal format. Character format is required by the pre-defined SAP batch input programs. 5. If necessary, code the ABAP batch input program that will read in the data to be transferred from your file.

SAP supplies ready-to-run batch-input programs for most of the SAP applications. 6. Process the data and add it to the SAP System. You can do this either by: - Generating a batch input session; or - By processing data directly in your batch-input program with the ABAP statement CALL TRANSACTION USING. (see BDC Method) 7. Check that all data has been successfully processed. Method: Analyze the batch input-processing log. If you are using CALL TRANSACTION USING, then you will need to analyze the processing messages collected by your program. 8. Correct and re-process erroneous data. Use the batch-input management function to process erroneous transactions interactively. You can correct data during this interactive processing. SAP has provided special data structure for batch data input for most of the objects. Using these structures, one need not know what tables are required for BDC. SAP has also provided with pre-defined batch input programs for data transfer. But you may still need to write a BDC to meet the requirements since the programs given by SAP may not meet them. You should therefore initialize all of the fields in your batch input data structure with the NODATA character. The default is. If the BDC program does not find a value for a field then it sets the value of that field to.

SAP BDC BDC CONCEPT Programming Interface provides two function modules for scheduling and management of background jobs : 1 BACKGROUND PROCESSING JOBVARIANT SCHEDULE The function is for scheduling a job for execution. It requires ABAP program & need a variant and an start time to execute the program.

BACKGROUND PROCESSING JOBVARIANT_OVERVIEW The function is to manage the jobs To display job logs, spool output, delete inactive jobs etc.

There are two ways to schedule the jobs: A. EXPRESS METHOD Use function module : BP JOBVARIANT SCHEDULE B. FULL CONTROL Use function modules :JOB OPEN, JOB SUBMIT & JOB CLOSE This method gives complete control over the job scheduling options such as job printing, job start time options etc. -- I METHOD OF DOING BDC -- II PROCEDURE TO WRITE A DATA TRANSFER PROGRAM --III PROCEDURE OF TRANSFER DATA USING BATCH INPUT

-- IV PROCEDURE OF WRITING A BDC -- V PROCEDURE OF RECORDING BDC -- VI BDCDATA STRUCTURE & SAMPLE

SAP BDC METHOD OF DOING BDC


METHOD OF DOING BATCH DATA COMMUNICATION BDC is used to transfer data from SAP to SAP system or from a non-SAP system to SAP system. It uses the normal Transaction codes to transfer the data. This method is used to transfer large amount data that is available in electronic form. 1. CLASSICAL METHOD (CREATING BATCH INPUT SESSION) This is the standard method to do a BDC. It offers management of sessions, support for playing back and correcting sessions that contain errors, and detailed logging. BDC program will read the data from a sequential dataset file is stored in a batch-input session. A session is a collection of transaction data for one or more transactions. To run the transactions in the session, you need to execute the session. You can start and monitor the session from System => Services => Batch Input(see screenshot procedure) The batch-input program must not open a session until it has closed the preceding session, So you must close it after transferring data. You may also process Batch input session using background processing system. This method uses the function module BDC OPEN, BDC INSERT and BDC CLOSE to generate the sessions

2. CALL TRANSACTION : Run BDC using CALL TRANSACTION does not create a session. The playback, interactive correction, and logging facilities offered for batch input sessions that are not available for CALL TRANSACTION. This method offers faster processing of data than batch input sessions. It is recommended that if you're having problems getting data entered into your SAP System quickly enough. Your program prepares the data and calls the desired transaction for immediate processing. The most important aspects of CALL TRANSACTION interface are: - Synchronous processing - Transfers data for a single transaction - Synchronous and asynchronous database updating both possible The program specifies which kind of updating is desired. Separate LUW for the transaction The system performs a database commit immediately before and after the CALL TRANSACTION USING statement. Both Batch Input Session & Call Transaction methods above need a

common data structure for storing the instructions and data for SAP transactions. To transfer data from an SAP system to another SAP system you may use RFC or CPI-C. The data transfer program should convert the data that has to transfer into the SAP system as required by the SAP data structure or the transactions using it. A conversion of the data types could be necessary at times. In case of data type mismatch, convert the data types to type C. And this data transfer program should be able to export the data in SAP format to a sequential file. The BDC program reads the data from this file during the upload of the data into the SAP system 3. CALL DIALOG : This method is not recommended to be used to do a BDC if you can enter data by way of sessions or CALL TRANSACTION USING. In this method, your program prepares data for a sequence of dialog screens, and calls a dialog module for immediate processing. The most important aspects of the CALL DIALOG interface are: Synchronous processing - Transfers data for a sequence of dialog screens - No separate database update for the dialog A database update occurs only when the calling program executes a commit operation. - Shares LUW with calling program - No batch input processing log is generated

The data and the necessary action to be performed in order to enter the data into the SAP is stored in Batch Input data structure (BDCDATA). This structure is used in all the three methods mentioned above

SAP BDC BDCDATA STRUCTURE & SAMPLE The diagram below shows how to declare the structure in your ABAP program and the fields contained in the structure

This BDCDATA structure can contain data for one transaction at a time. You first create a BDCDATA structure. Then fill the structures with data using either create session method or call transaction method. And then create it again for the next transaction. If your BDC involves more than one transaction, then this process will be in a loop. Build the structure line by line using MOVE and APPEND statements. Before building each line, reset the header line of the internal table with the CLEAR statement. The first record for each screen must contain information that identifies the screen: program name, screen name and a start-of-screen indicator. You record this information in the PROGRAM, DYNPRO, and DYNBEGIN fields of the BDCDATA structure. This sample BDCDATA starts a screen. The record specifies the program and screen identifiers. With BDCDATA-DYNBEGIN, the record shows that batch input data for a new screen is starting:

BDCDATA-PROGRAM ='sapms38m'. BDCDATA-DYNPRO ='0100'. BDCDATA-DYNBEGIN ='x'. APPEND BDCDATA. After the dynpro-start record, you must add a record for each field that is to receive a value. You need fill only the FNAM and FVAL fields. This sample BDCDATA enters a value into a field. The FNAM field identifies the target field by its table and field names. FVAL specifies the value that is to be entered: BDCDATA-FNAM ='RS3SM-FUNC_EDIT'. BDCDATA-FVAL ='x'. APPEND BDCDATA. The command field is identified by a special name in batch input, BDC OKCODE. This name is constant and always identifies the command field. This sample record would execute the save function. It uses the function key assignment of save, which is Fl 1. A function key number must be prefixed with the / (slash) character: BDCDATA-FNAM = 'BDC OKCODE'. BDCDATA-FVAL = '/11'. This sample record also executes save, but uses the function code instead of the function key assignment. All functions, whether they are displayed in menus or as buttons, are identified by function codes. A function code must be prefixed with the = character. BDCDATA-FNAM =`BDC_OKCODE'. BDCDATA-F VAL ='=UPDA'. Some screen fields need multiple values, one on each line. To provide input to one of these loop fields, you must use an explicit line index BDCDATA-FNAM ='fieldx (5)'. BDCDATA-FVAL ='value'. The line index (in the example: (5), line 5) indicates in which loop line on the screen values are to appear.

To position the cursor on a particular field, you must use the special cursor field: BDCDATA-FNAM ='BDC_CURSOR'. BDCDATA-FVAL ='fieldx'. To position the cursor on a loop field, you must use again an index:BDCDATA-FNAM ='BDC_CURSOR'. BDCDATA-FVAL ='feldy(5)'. After finishing the BDC, to return to the SAP Main Menu, from the text input screen in the ABAP editor, for example, the following BDCDATA records are necessary to leave the transaction: BDCDATA-PROGRAM = `SAPMSEDT'. "Leave text input field BDCDATA-DYNPRO = `2310'. BDCDATA-DYNBEGIN = `X'. BDCDATA-FNAM = 'BDC OKCODE'. BDCDATA-FVAL = `/3' "Back function key BDCDATA-PROGRAM = `SAPMS38M'. "Leave ABAP editor BDCDATA-DYNPRO = `0100'. .BDCDATA-DYNBEGIN = `X'. BDCDATA-FNAM = `BDC OKCODE'. BDCDATA-FVAL = `/15'. "Quit function key SAP BDC BDC CONCEPT PROCEDURE TO WRITE A DATA TRANSFER PROGRAM : 1. Analyze the structure of the existing data and specify the conversions that are required to fill the SAP data structures. 2. Generate the SAP data structure If the program is written in ABAP, you need only include e required tables in your program with the TABLES statement. 3. Initialize the SAP data structure. 4. Fill the structure with data, performing any conversions and errorchecking that are required. 5. Write the sequential file that is typically required for making the data available to the batch input program in the SAP System.

THE PURPOSE OF ANALYZING DATA IS : - To gather the transaction code that is to used - List of the required fields for input - Field names, types and lengths - To note the screen numbers involved &  program names for the screen. There are two ways by which you can achieve the above, 1. Go to System => Status Run the transaction and note the information of Screen No. & Program name 2. Place the cursor in the field and press Fl for Technical Information of the fields.

Common questions

Powered by AI

Preparing a data transfer program for BDC involves several strategic steps within SAP. Firstly, a thorough analysis of the existing data structure is crucial, identifying necessary mappings and conversions to conform to SAP data structures . This involves generating the required SAP data structures using tools like the ABAP Dictionary, ensuring that field types and lengths align between systems . The next step is to write the actual data transfer program, either in ABAP or as an external program, with focus on correct data reading and conversion logic . Creating a sequential file to facilitate batch input processing is essential, focusing on correct logical formatting, typically in ASCII or EBCDIC format . Error-checking mechanisms must be ingrained in the program to validate data entries and handle exceptions. Finally, after loading the data, validation against processing logs or messages is necessary to ensure all data is successfully integrated . These steps ensure a structured approach to data integration, addressing both data integrity and process efficiency challenges inherent in BDC operations.

The classical batch input method creates a batch input session where transaction data is recorded and processed. It supports session management, detailed logging, and error correction through interactive correction sessions. Each session must be closed before another is opened . This method is more robust in terms of error handling as it allows for the correction of data errors post-processing . In contrast, the CALL TRANSACTION method processes transactions immediately without creating a session, which is faster but offers limited error recovery options . There is no detailed logging or interactive correction available, making it less suitable for complex transactions where error recovery is critical . The implications are that classical batch input is more suitable for transactions requiring detailed monitoring and error handling, whereas CALL TRANSACTION is preferable for scenarios demanding higher speed and lower overhead without extensive error management .

The choice of CALL DIALOG for BDC over BATCH INPUT SESSION or CALL TRANSACTION comes with certain implications. CALL DIALOG is characterized by synchronous processing and the lack of a separate batch input processing log, making it less suitable for scenarios requiring detailed audit trails and error tracking . Unlike BATCH INPUT SESSION, which provides robust error handling and transaction replay capabilities, CALL DIALOG lacks these features, limiting error correction and auditing . Also, it doesn’t allow for batch processing, as it deals with direct transaction screens and updates occur only when the calling program executes a commit operation . Despite these limitations, CALL DIALOG might be suitable in use cases involving limited transactions, requiring immediate processing without the need for detailed logging or manual error rectification, such as one-off, urgent data entry tasks . Its synchronous nature allows for real-time transaction processing, making it useful where immediate application feedback is necessary, but the complexity and volume of data do not justify the use of other methods .

Writing a batch input program in ABAP poses several challenges. Primarily, ensuring accurate data mapping from source to SAP structures can be complex, requiring thorough analysis of both source data and target SAP data structures . Addressing these challenges involves leveraging the ABAP Dictionary to generate necessary data structures and accurately mapping each field . Error handling is another significant challenge, with the need to anticipate data conversion issues and implement comprehensive validation mechanisms within the program . This necessitates integrating robust error-checking routines and testing the BDC program extensively to identify potential data discrepancies or transaction failures prior to live execution. Additionally, performance can be a concern when processing large volumes of data. Optimizing loops, leveraging efficient data structures, and utilizing parallel processing where possible can mitigate performance issues . These strategies, coupled with detailed planning and testing, ensure the successful implementation of an ABAP-based batch input program.

Pre-defined batch input programs in SAP are designed to handle standard data transfer needs, simplifying the implementation process by providing ready-to-use templates and structures for common transactions . They ensure compliance with SAP standard practices and reduce the programming effort required for basic data uploads. However, custom BDC programs become necessary when specific business requirements or unique transaction scenarios are not adequately addressed by these standard solutions. Situations requiring customized error handling, complex data transformations, or integration with non-standard SAP modules can necessitate bespoke programs, as the pre-defined options may lack flexibility to adapt to unique field mappings, data conversions, or business logic that specific organizational processes demand . Moreover, when performance optimizations or tailored logging and reporting are required, custom solutions provide the necessary adaptability that standard programs may not offer .

The NODATA character in BDC programs plays a critical role in handling fields that are not intended to be modified during transaction execution. Its primary function is to signal that a specific field in the transaction should remain unchanged when there is no corresponding input value provided in the BDCDATA structure . Its use is essential to avoid unintentional overwriting or alteration of existing data in the SAP system. By initializing fields with the NODATA character, BDC programs effectively differentiate between empty fields meant for data entry and those that should preserve their current state . The consequence of this setup is to maintain data integrity, ensuring that only specified fields are impacted by the batch input process, thus preventing data corruption or loss during the execution of BDC sessions . This approach facilitates more precise data management, especially when dealing with large datasets where certain transactional fields must remain static across multiple records.

Transaction code SM35 is crucial in SAP for managing and executing BDC sessions. It provides a comprehensive interface to view, process, and handle batch input sessions . The key steps involved include initially navigating to SM35 where existing sessions can be reviewed. Users can then select a specific session, allowing for detailed insight into recorded data, cursor movements, and changes made during the session. Execution can proceed in batch mode or in the foreground, depending on user preference . SM35 allows users to handle sessions interactively, providing options to correct and reprocess erroneous data directly. Additionally, it supports the generation of detailed logs for troubleshooting purposes, thereby serving as an all-in-one tool for overseeing BDC operations . The execution flexibility and detailed logging features of SM35 make it an essential part of the BDC workflow for ensuring successful data transfers and transaction executions.

The BDCDATA structure in SAP systems is crucial for executing and managing BDC processes, serving as a blueprint for data entry and transaction automation. Its components include fields such as PROGRAM, DYNPRO, DYNBEGIN, FNAM, and FVAL . PROGRAM stores the name of the SAP application program, DYNPRO denotes the screen number, and DYNBEGIN indicates the start of a screen within BDC data processing. FNAM identifies the specific screen field to be populated, while FVAL contains the value to be entered into the field . These elements collectively allow for structured and systematic data input, ensuring each screen and field in a transaction is handled as per predefined instructions. BDCDATA facilitates converting conceptual data structures into actionable steps that a BDC program can execute, supporting batch input sessions or CALL TRANSACTION methods by accurately populating and managing data fields .

In a BDC program, the MOVE and APPEND statements are fundamental for constructing the BDCDATA structure. MOVE is utilized to assign values from source fields to the corresponding target fields within the BDCDATA record. This step is crucial for setting screen identifiers, field names, and input values appropriately . APPEND is then used to add this fully prepared record to the BDCDATA internal table. It signals the end of setting values for a single record and stores the record into the BDCDATA structure for batch input processing . The interaction between MOVE and APPEND allows a BDC program to systematically build each piece of the BDCDATA one transaction at a time, line-by-line. This method ensures that all necessary details for data entry, such as screen fields and values, are correctly placed in sequence, facilitating accurate batch processing. This systematic filling and appending ensure the data is structured correctly, enabling seamless execution of the BDC procedure across the designated transaction screens .

In the context of BDC batch job management, the function BACKGROUND PROCESSING JOBVARIANT SCHEDULE is used for scheduling a job for execution. It requires specifying an ABAP program, a variant, and a start time to execute the program . This function is focused on planning and ensuring that batch jobs are executed according to a predefined schedule. In contrast, JOBVARIANT_OVERVIEW provides management capabilities for the job after it has been scheduled and executed. It allows users to display job logs, view spool output, and manage inactive jobs, offering a more retrospective and administrative function compared to the scheduling focus of JOBVARIANT SCHEDULE . Thus, while the former is primarily concerned with job initiation, the latter deals with ongoing job management and monitoring post-scheduling.

You might also like