Showing posts with label ABAP BDC COMPLETE. Show all posts
Showing posts with label ABAP BDC COMPLETE. Show all posts

ERP SAP Business Warehouse Information and Reporting

ERP SAP has a module called business warehouse and is popularly called as BW.Here in this post we are going to explain the overview of this erp module and explains you how to extract the required information and how to report it back to authorized people in a detailed manner.Decision makers urgently want dependable data from Production, Purchasing, Gross sales and Distribution, Finance, and Human Assets departments. They require an up-to-date and complete picture of each particular person enterprise area and of the business as a whole. This places appreciable demands on information staging from the underlying information sources.

The data must be stored in a homogeneous and consistent form at a central location where it could be referred to as up. Subsequently, modern data warehouses require a separate database that an unbiased software environment can use to offer the required companies objectively.

Environment friendly evaluation techniques with powerful multi-dimensional visualization are indispensable on the presentation side of the information warehouse. The system must have the power to deal with the data needs of the various user groups.


The demands made on the supply systems are not so high. What is required right here is an economic and comprehensive preparation of the information that is required by the information warehouse.

The following demands are made on an information warehouse:

(1) standardized structuring and presentation of all company data,
(2) a straightforward-to-use, single-level of entry to all company data,
(3) refined enterprise reporting strategies for self-service evaluation in any respect ranges,
(4) fast and cost effective set up,
(5) a excessive performance atmosphere,
(6) data staging from heterogeneous atmosphere,
(7) release of supply programs and IT organization,
(8) data access independent of the source system, and
(9) analysis of information over a selected time period, and the storage of historical info .

SAP BW permits you to analyze data from operational SAP R/three applications or any other business application. You could also extract and analyze information from external sources corresponding to databases, online providers, and the Internet.

The system (information storage, loading and reporting), which is pre configured by Business Content material for core areas and processes, allows you to look at the relationships in each space of your company.

The conclusion of SAP BW aimed for the following:

(1) knowledge warehousing system with optimized information constructions for reporting and evaluation,
(2) separate system,
(3) OLAP engine and tools,
(4) comprehensive knowledge-warehousing architectural base,
(5) automated data warehouse administration, and
(6) pre configuration utilizing SAP global enterprise know-how.

With these targets in mind, SAP has opted for a separate data-warehousing answer that handles
reporting activities as an autonomous business element, even offering a separate server with its
personal database and SAP system: SAP Enterprise Info Warehouse.

The entire requirements and aims mentioned up to now have been met within the conception and architecture of SAP BW. Having implemented SAP BW and its metadata repository ,the shopper has the clear advantage of having the ability to use your complete SAP know-how constructed up over the various years of expertise in developing business software program solutions. SAP R/three programs can be configured as supply programs, and supply data for all SAP Business Content.

INFO OBJECT

Enterprise evaluation-objects like corporations, sales volumes, and so on are referred to as InfoObjects in SAP BW.These InfoObjects might be divided into traits and key figures. Traits will be further divided into models, time traits, and technical traits for example, request ID. Key figures are all information fields which can be used to retailer values or portions like sales volumes, web gross sales, costs, and so on. Traits describe the affiliation of key figures.

InfoCube

The central data containers that kind the basis for reviews and analyses in SAP BW are referred to as InfoCubes. They comprise key figures like sales volumes, incoming orders, precise costs, nd so forth and a link to the characteristics master data of the SAP BW system reminiscent of value facilities, clients, supplies.Key figures and traits are InfoObjects. Every individual InfoCube should contain a self-contained dataset, since queries refer primarily to 1 InfoCube.

Grasp knowledge within the BW system consists of attributes of a attribute for instance, the individual liable for a price heart , in addition to hierarchies and texts of a characteristic. An InfoCube consists of several database tables which can be linked according to the star schema. They include a truth desk that incorporates the InfoCube key figures, as effectively as several surrounding dimension tables that store the links to the characteristics.Every InfoCube has one fact desk and a maximum of 16 dimension tables. Each reality desk can contain a most of 233 key figures.


A dimension can include up to 248 freely available characteristics. InfoCubes are saved in buildings within the SAP BW system. If you need to retailer an InfoCube, you create a new folder or use an present one. This is similar to the strategy used when storing data on your PC: These folders are known as InfoAreas in SAP BW.

InfoProvider

InfoProvider is the super-ordinate time period for an object that you have to use to create stories in Enterprise Explorer (BEx). InfoProviders are objects or views which can be relevant to reporting. InfoProviders include various database metaobjects that ship information for query definitions. The kind of knowledge procurement differs relying on the InfoProvider used. However, the sort of knowledge procurement has no influence on reporting. InfoProviders deliver information that could be analyzed using a query.

There are two sorts of data stores. Bodily shops embody

(1) BasicCubes,
(2) ODS Objects, and
(3) InfoObjects.

Logical views of physical information stores embody

(1) InfoSets,
(2) RemoteCubes,
(3) VirtualInfoCubes, and
(4) MultiProviders.

The earlier figure provides an overview of SAP BW reportable objects, divided into knowledge targets that contain physical knowledge, and InfoProviders that only comprise logical views. From the BEx view, solely InfoProviders are accessed. The way through which the knowledge is modeled is inconsequential to the BEx toolset. Operational Information Store (ODS) An ODS, an information retailer, stores knowledge at the fundamental level . It's normally used to resolve and consolidate datasets. These datasets are sometimes from various knowledge sources and/or supply programs Administrator Workbench (AWB)

Administrator Workbench (AWB) is a workplace for SAP BW administrators. AWB capabilities are used to configure, control, and administrate SAP BW. SAP BW permits the analysis of knowledge from operative SAP functions as nicely as all different business applications and exterior data sources resembling databases, online companies, and the Internet . AWB features allow you to control, monitor, and maintain all data procurement processes. SAP BW permits Online Analytical Processing (OLAP) for staging info from giant amounts of operative and historical data. OLAP know-how permits multi-dimensional analyses in holding with numerous business perspectives.

The BW server, which is pre configured by Business Content material for core areas and processes, permits you to look at the relationships in every area inside your company. Business Content gives focused data to companies, divided into roles. This helps your workers to hold out their tasks. As well as roles, Enterprise Content contains different pre configured objects akin to InfoCubes,queries, key figures, and characteristics. These objects facilitate the implementation of SAP BW.The Business Explorer (BEx) element gives users with in depth evaluation options.

ERP Master data and data warehouse concept

ABAP BDC COMPLETE SERIES

Learn BATCH DATA PROCESSING step by step here which is a important part of SAP ABAP.

Here you can also learn regarding table controls in BDC and sample codes.

Here they are

SAP ABAP BDC PART 1

SAP ABAP BDC PART 2

SAP ABAP BDC PART 3

SAP ABAP BDC PART 4

SAP ABAP BDC PART 5

SAP ABAP BDC PART 6

SAP ABAP BDC PART 7

SAP ABAP BDC PART 8

SAP ABAP BDC PART 9

SAP ABAP BDC PART 10

SAP ABAP BDC PART 11

SAP ABAP BDC PART 12 BDC SAMPLE CODE FOR XD01

SAP ABAP BDC PART 13 BDC SESSON METHOD SAMPLE CODE

SAP ABAP BDC TABLE CONTROL


ABAP TOPIC WISE COMPLETE COURSE

ABAP 51 Days Complete Course
ABAP Dictionary
OOPS in ABAP
BDC
SAP Scripts
SAP Scripts Controls
SAP Smart Forms
Real Time ABAP Programming Reports
SAP Interview Questions
Syntax for ABAP Programming
ABAP Interface Programming
Financial and Controlling Sample Reports 

SAP ABAP Complete Course Daywise

SAP ABAP complete course welcomes you and it is the place where you can every thing regarding sap programming right from what is a report is to what are the user exits and what are the BAPI's are.

This FIFTY SEVEN DAY COURSE will teach every thing regarding SAP ABAP ,right from basics to most advanced topics.

Let us start browsing day wise

What is SAP R/3 Introduction to best ERP MySAP

SAP NAVIGATION DAY 1

SAP ARCHETECHERE DAY 2

ABAP WORK BENCH TOOLS DAY 3

ABAP DATA OBJECTS DAY 4

SAP DATA BASE DIALOG DAY 5

INTERNAL PROGRAM MODULSRIZATION DAY 6

USER DIALOGS AND LISTS DAY 7

USER DIALOG AND SELECTION DAY 8

USER DIALOGS AND SCREEN DAY 9

REUSE COMPONENTS IN ABAP DAY 10

MANAGING ABAP PROJECT OBJECTS DAY 11

ABAP DICTIONARY INTRODUCTION DAY 12

PERFORMANCE DURING TABLE ACCESS IN ABAP DAY 13

DATA CONSISTENCY IN ABAP DAY 14

DEPENDENCIES IN ABAP DICTIONARY DAY 15

CHANGING DATA BASE TABLES IN SAP DAY 16

DATA BASE VIEWS IN ABAP DAY 17

SEARCH HELP USING ABAP DAY 18

ABAP RUN TIME ENVIRONMENT DAY 19

DATA TYPES AND DATA OBJECTS DAY 20

ABAP STATEMENTS DAY 21

ROLE OF INTERNAL TABLE IN ABAP DAY 22

ABAP SUB ROUTINES DAY 23

FUNCTION GROUPS AND FUNCTION MODULES IN ABAP DAY 24

CALLING PROGRAMS AND PASSING DATA IN SAP DAY 25

TECHNIQUES FOR LIST CREATION DAY 26

LOGICAL DATA BASES LDB DAY 28

SELECTOIN SCREEN FOR ABAP PROGRAM DAY 29

PROGRAMMING DATA RETRIVAL IN ABAP DAY 30

SAP QUARY ADMISTRATION DAY 31

DATA FORMATION FOR OUTPUT DAY 32

SAVING LISTS IN BACK GROUND DAY 33

ALV GRID CONTROL IN REPORTS DAY 34

INTERACTIVE REPORTS BASICS DAY 35

PROGRAM INTERFACE AN INTRODUCTION DAY 36

INTERACTIVE REPORT LIST TECHNIQUES DAY 37

SCREEN PROGRAMMING AN INTRODUCTION DAY 38

SCREEN ELEMENTS FOR OUTPUT ABAP REPORT DAY 39

SCREEN ELEMENTS FOR INPUT DAY 40

SCREEN ELEMENTS AND SUB SCREENS DAY 41

SCREEN ELEMENTS IN TABLE DAY 42

CONTEXT MENU IN THE SCREEN DAY 43

LISTS IN SCREEN PROGRAMMING DAY 44

DATA BASE UPDATAS AN OVERVIEW DAY 45

LWS AND CLINET SERVER DAY 46

SAP LOCK CONCEPT DAY 47

ORGANIZING DATA BASE UPDATS DAY 48

COMPLEX LUW PROCESSING DAY 49

AUTHORIZATION CHECKS IN ABAP DAY 50

CHANGING THE SAP STANDARD DAY 51

ENHANCEMENTS TO ABAP DICTIONARY DAY 52

BUSINESS TRANSACTION EVENTS IN SAP DAY 53

ENHANCEMENTS USING CUSTOMER EXITS DAY 54

BUSINESS ADD-IN'S IN SAP DAY 55

MODIFICAITONS TO SAP DAY 56

MODIFICATIONS TO SAP EXTENDED DAY 57

Master data for sap

Batch Input Recording for inbound Idoc

The batch input (BTCI) recorder (SHDB) is a precious tool to develop inbound IDocs. It records any transaction like a macro recorder. From the recording, an ABAP fragment can be created.This lets you easily create data input programs without coding new transactions.The BTCI recorder lets you record the screen sequences and values entered during a transaction. It is one of the most precious tools in R/3 since release 3.1. It allows a fruitful cooperation between programmer and application consultant.

The section below will show you an example of how the transaction SHDB works.With the recording, you can easily create an ABAP which is able to create BTCI files.You will be asked for a session name and the name of the transaction to record.Then you can enter the data into the transaction as usual.After you finished the recording, you have the possibility to generate ABAP coding from it. This will be a sequence of statements which can generate a batch input session, which is an exact replay of the recorded one.

The generated program contains an include BDCRECXX which contains all the FORM routines referenced.To make the recorded code usable for other programs, you should make a function module out of it. Starting with release 4.5A the recorded code provides a feature to automatically generate such a function module.

How to Use the Recorder Efficiently

This routine replaces BDCRECXX to allow executing the program generated by SHDB via a call transaction instead of generating a BTCI file.

The SHDB transaction creates an ABAP from the recording. When you run this ABAP, it will generate a BTCI group file, with exactly the same data as in the recording.

The recorder is able to generate an ABAP. Releases before 4.5A include a routine BDCRECXX. This include contains FORM routines which fill the BDCDATA table and execute the routines BDC_OPEN_GROUP and BDC_CLOSE_GROUP. These are the routines which create batch input files.

If we modify this FORM routines a little bit, we can make the ABAP replay the recording online via a CALL TRANSACTION, which is much more suitable for our development and testing purposes. If you replace the standard include BDCRECXX with the shown one ZZBDCRECXX, you can replay the recording online.

Starting with release 4.5A you can create a function module from the recording.This function module replaces the recorded constants with parameters and gives you the option to choose between a batch input file or a direct call transaction.

A remark on screen processing, if there are table controls (scroll areas). If you enter many lines or try to extend a list, it will be impossible to tell where to place the cursor. Therefore, most transactions provide a menu option that positions the list in a calculable manner. If you choose a new item, most transactions will either pop up a detail screen or will position the list, so that the next free line is always line 2.If this feature is not provided in a transaction, it is regarded as a malfunction by SAP and can be reported to SAPNET/OSS.

ZZBRCRECXX_FB_GEN: Generate a Function from Recording

The ABAP generated by SHDB is a very useful tool for developers. However, it does not replace the recorded constants by variables.The following routine generates a function module from the recording. All you have to do is put the coding below in an include.

Give it the name ZZBDCRECXX_FBGEN.

Then replace the include BDCRECXX in the recording with ZZBDCRECXX_FBGEN.

When you execute the ABAP, a function module in an existing function group will be created. The created function will contain the recording with all the constants replaced by variables, which show in the function module interface.

The following useful routine is written for releases up to 4.0B. In release 4.5B a similar functionality is provided. You can generate a function module from the recording transaction directly.Before you generate the function, a function group must exist. This you have to do manually. The function group must also contain the include ZZBDCRECXX to have the declarations of the referenced FORM routines.

The created function module should work without modification for testing at least.However, you probably will need to modify it, e.g. by adding a loop for processing multiple entries in a table control (scroll area).


RELATED POST

RFC AND TROUBLE SHOOTING


SAP definition,full form,over veiw and introduction

What is SAP Full form and its definition part one

ABAP BDC TABLE CONTROL

BDC table control is an area on the screen in which you can display data in tabular form. You process it using a loop. Table controls are comparable to step loop tables. While a table control consists of a single definition row, step loop blocks may extend over more than one row. Table controls are more flexible than step loops, and are intended to replace them

When you need to handle a scenario like in sales order,it may contain more than one material,if you have more than one material We have to use table control,it will have number of columns and number of rows.

Table controls allow you to enter, display, and modify tabular data easily on the screen

Check this code,


PARAMETERS: file1 LIKE rlgrap-filename.

************************************************************************
*Internal Table Declarations
************************************************************************

DATA: BEGIN OF itab OCCURS 0,
matnr(18) TYPE c, "MaterialNumber
werks(4) TYPE c, "Plant
vdatu(10) TYPE c, "Valid From Date
bdatu(10) TYPE c, "Valid To Date
lifnr(10) TYPE c, "Vendor Number
ekorg(4) TYPE c, "Purchasing Organization
feskz TYPE c, "Fixed
autet TYPE c, "MRP Indicator
END OF itab.

DATA: bdcdata LIKE TABLE OF bdcdata WITH HEADER LINE.

************************************************************************
*VARIABLES Declarations
************************************************************************
DATA: wa1 LIKE LINE OF itab. "Workarea for ITAB
DATA: n TYPE i, "Check
count TYPE i.
DATA: cnt(2), "Counter
wa(15). "Workarea to hold concatenatedvalue
DATA v_msg(100).
DATA: flag.
DATA: file TYPE string.

************************************************************************
*Initialization event
************************************************************************

INITIALIZATION.

************************************************************************
*At-selection-screen event
************************************************************************

*To provide Input help for file name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR file1.


CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = file1.

***********************************************************************
*START-OF-SELECTION EVENT
***********************************************************************

START-OF-SELECTION.

MOVE file1 TO file.


CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file
filetype = 'ASC'
has_field_separator = 'X'
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.

*To populate BDCDATA and start data transfer

LOOP AT itab .

* To validate Plant range

IF itab-werks = '1000' OR itab-werks = '2000'
OR itab-werks = '1008'.

AT NEW werks.

CLEAR: n.
cnt = 1.

PERFORM bdc_dynpro USING 'SAPLMEOR' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EORD-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EORD-MATNR'
itab-matnr.
PERFORM bdc_field USING 'EORD-WERKS'
itab-werks.
PERFORM bdc_dynpro USING 'SAPLMEOR' '0205'.


CONCATENATE 'EORD-EKORG(' cnt ')' INTO wa.

PERFORM bdc_field USING 'BDC_CURSOR'
wa.

PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
ENDAT.

IF n = 12.


READ TABLE bdcdata WITH KEY fval = '=BU'.
bdcdata-fval = '=NS'.
MODIFY bdcdata INDEX sy-tabix TRANSPORTING fval.


PERFORM bdc_dynpro USING 'SAPLMEOR' '0205'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EORD-VDATU(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.

cnt = 2.
n = 2.
ENDIF.



CONCATENATE 'EORD-VDATU(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-vdatu.

CONCATENATE 'EORD-BDATU(' cnt ')' INTO wa.

PERFORM bdc_field USING wa
itab-bdatu.
CONCATENATE 'EORD-LIFNR(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-lifnr.
CONCATENATE 'EORD-EKORG(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-ekorg.
CONCATENATE 'RM06W-FESKZ(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-feskz.
CONCATENATE 'EORD-AUTET(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-autet.

IF n <> 12.
n = cnt.
ENDIF.
cnt = cnt + 1.


AT END OF werks.

CALL TRANSACTION 'ME01' USING bdcdata
UPDATE 'S'
MODE 'A'.


CLEAR:bdcdata,bdcdata[].


CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = sy-msgid
lang = 'EN'
no = sy-msgno
v1 = sy-msgv1
v2 = sy-msgv2
v3 = sy-msgv3
v4 = sy-msgv4
IMPORTING
msg = v_msg.

WRITE:/ v_msg.
CLEAR: bdcdata,bdcdata[],flag.


ENDAT.

ENDIF.
ENDLOOP.


*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.

ENDFORM.

*----------------------------------------------------------------------*
* Insert field values
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
IF NOT fval IS INITIAL.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
CLEAR wa.
ENDFORM.


Sample code 2

THis is example to upload the Bank details of the Vendor which has the TC.

REPORT zprataptable2
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 0,
i1 TYPE i,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
END OF itab.

DATA : BEGIN OF jtab OCCURS 0,
j1 TYPE i,
banks LIKE lfbk-banks,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF jtab.

DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.

DATA : c TYPE i.



INCLUDE bdcrecx1.

START-OF-SELECTION.

CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\first1.txt'
filetype = 'DAT'
TABLES
data_tab = itab.

CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\second.txt'
filetype = 'DAT'
TABLES
data_tab = jtab.



LOOP AT itab.


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-BUKRS'
itab-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
itab-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
itab-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-LAND1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFA1-ANRED'
itab-anred.
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_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-BANKN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
cnt = 0.
LOOP AT jtab WHERE j1 = itab-i1.
cnt = cnt + 1.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-banks.

CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankl.

CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankn.
IF cnt = 5.
cnt = 0.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.


PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDLOOP.


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 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-FDGRV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFB1-AKONT'
itab-akont.
PERFORM bdc_field USING 'LFB1-FDGRV'
itab-fdgrv.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-WAERS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFM1-WAERS'
itab-waers.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
PERFORM close_group.



Header file:


1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr
2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr

TC file:

1 in sb 11000
1 in sb 12000
1 in sb 13000
1 in sb 14000
1 in sb 15000
1 in sb 16000
1 in sb 17000
1 in sb 18000
1 in sb 19000
1 in sb 20000
1 in sb 21000
1 in sb 22000
2 in sb 21000
2 in sb 22000

RELATED POSTS

BDC for SAP ABAP Ten

BATCH INPUT RECORDING FOR TRANSACTION RUNS:

This section tells you how to use the recording functions of batch input.For more information, refer to these sections:

a)Recording features
b)Sample program
c)Special recording features



(24) BATCH INPUT AUTHORIZATIONS:

You need no special authorization - other than the ABAP/4 run time authorization (authorization object S_PROGRAM -- to run a program that creates batch input. Any user can create batch input sessions.

Starting processing for a session once it is in the queue is another matter, however. To start sessions, you need the authorizations described in "Managing Batch Input Sessions" in the System Services guide.


RELATED POSTS

SAP WORK FLOW PART ONE

SAP journey from R/3 towards MySAP.com
sap internet transaction architecture
SAP internet transaction application components

BDC for SAP ABAP Nine

Error Analysis and Restart Capability

Unlike "classical" batch input processing using sessions, CALL TRANSACTION USING processing does not provide any special handling for incorrect transactions. There is no restart capability for transactions that contain errors or produce update failures.You can handle incorrect transactions by using update mode S (synchronous updating) and checking the return code from CALL TRANSACTION USING. If the return code is anything other than 0, then you should do the following:


write out or save the message table use the BDCDATA table that you generated for the CALL TRANSACTION USING to generate a batch input session for the faulty transaction. You can then analyze the faulty transaction and correct the error using the tools provided in the batch input management facility.

20) USING CALL DIALOG WITH BATCH INPUT:

A program that uses CALL DIALOG to submit batch input should perform the following steps:

1. For the screens you want processed, fill all desired fields.
2. Use a CALL DIALOG statement to call the dialog module and to pass it to the BDCDATA table.

The MODE parameter in the CALL statement is explained in Using CALL TRANSACTION USING for Batch Input(19).

Example

CALL DIALOG 'DIALOG1' USING BDCDATA MODE 'E'.


(21) DIRECT INPUT:

To enhance the batch input procedure, the system offers the direct input technique, especially for transferring large amounts of data. In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not process screens.

To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to be able to activate the restart mechanism, direct input programs must be executed in the background only.

To maintain and start these programs, use program RBMVSHOW or the transaction BMV0.

Examples for direct input programs are:

Program Application

RFBIBL00 FI
RMDATIND MM
RVAFSS00 SD
RAALTD11 AM
RKEVEXT0 CO-PA


22) SAMPLE BATCH INPUT PROGRAM:

The following program demonstrates both the creation of sessions, and the use of CALL TRANSACTION USING.
REPORT RJBDC200 LINE-SIZE 120.
*----------------------------------------------------------------*
* Add a line in a report *
*----------------------------------------------------------------*
PARAMETERS : BDCTYPE TYPE C DEFAULT 'M',
" M = Create batch input session
" T = Call transaction
"---------------------------------------------------*
" Only used for batch input sessions *
"---------------------------------------------------*
GROUP(12) TYPE C DEFAULT 'BDCTEST',
" group name of session
USER(12) TYPE C DEFAULT SY-UNAME,
" user name for starting the
" session in background
KEEP(1) TYPE C,
" ' ' = delete session after processing
" 'X' = keep session after successful
" processing
HOLDDATE LIKE SY-DATUM,
"---------------------------------------------------*
" Only used for call transaction *
"---------------------------------------------------*
DMODE TYPE C DEFAULT 'A'.
" Display mode
" 'A' = display all screens
" 'E' = display only errors
" 'N' = display nothing
*----------------------------------------------------------------*
* Batch input data for a single transaction *
*----------------------------------------------------------------*
DATA: BEGIN OF BDCDATA OCCURS 0.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
DATA: BEGIN OF MESSTAB OCCURS 0.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSTAB.
*----------------------------------------------------------------*
* Generate batch input *
* *
*----------------------------------------------------------------*
CASE BDCTYPE.
WHEN 'M'.
PERFORM CREATE_GROUP.
EXIT.
WHEN 'T'.
PERFORM CALL_TRANSACTION.
EXIT.
ENDCASE.
*----------------------------------------------------------------*
* *
* Create batch input session *
* *
*----------------------------------------------------------------*
FORM CREATE_GROUP.
WRITE: / 'Create group'.
"------------------------------------------------------------*
" Open batch input group *
"------------------------------------------------------------*
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = GROUP
USER = USER
KEEP = KEEP
HOLDDATE = HOLDDATE.
WRITE: / 'BDC_OPEN_GROUP rc ='(999), SY-SUBRC.
"------------------------------------------------------------*
" Insert first transaction *
"------------------------------------------------------------*
PERFORM GEN_BDC_DATA.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'SE38'
TABLES
DYNPROTAB = BDCDATA.
WRITE: / 'BDC_INSERT rc ='(999), SY-SUBRC.
"------------------------------------------------------------*
" Insert second transaction *
"------------------------------------------------------------*
PERFORM GEN_BDC_DATA.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'SE38'
TABLES
DYNPROTAB = BDCDATA.
WRITE: / 'BDC_INSERT rc ='(999), SY-SUBRC.
"------------------------------------------------------------*
" Close batch input group *
"------------------------------------------------------------*
CALL FUNCTION 'BDC_CLOSE_GROUP'.
WRITE: / 'BDC_CLOSE_GROUP rc ='(999), SY-SUBRC.
ENDFORM. " End CREATE_GROUP
*----------------------------------------------------------------*
* *
* Call Transaction Using *
* *
*----------------------------------------------------------------*
FORM CALL_TRANSACTION.
WRITE: / 'Call Transaction RC ='(999).
PERFORM GEN_BDC_DATA.
CALL TRANSACTION 'SE38' USING BDCDATA MODE DMODE MESSAGES INTO
MESSTAB.
WRITE: SY-SUBRC, SY-MSGTY, SY-MSGID, SY-MSGNO, SY-MSGV1.
WRITE: / ' ', SY-MSGV2.
WRITE: / ' ', SY-MSGV3.
WRITE: / ' ', SY-MSGV4.
ENDFORM. " End CALL_TRANSACTION
*----------------------------------------------------------------*
* *
* Create batch input data for *
* transaction SE38 *
* *
*----------------------------------------------------------------*
FORM GEN_BDC_DATA.
DATA: LINE LIKE BDCDATA-FVAL.
REFRESH BDCDATA.
*------------------------------------------------------------*
* First screen of transaction *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMS38M' '0100'.
PERFORM BDC_FIELD USING 'RS38M-PROGRAMM' 'RJBDC999'.
PERFORM BDC_FIELD USING 'bdc_cursor' 'chap'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'.
*------------------------------------------------------------*
* In editor, go to bottom of report *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
PERFORM BDC_FIELD USING 'RSTXP-TDCOMMLINE' 'BOT'.
*------------------------------------------------------------*
* Insert line into report *
*----------------------------------------------------- ------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
PERFORM BDC_FIELD USING 'RSTXP-TDLINECOM(17)' 'I'.
*------------------------------------------------------------*
* Go to bottom of report again *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
PERFORM BDC_FIELD USING 'RSTXP-TDCOMMLINE' 'BOT'.
*------------------------------------------------------------*
* Modify line in report and save report *
* (Enter f11 in ok-code) *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
LINE = 'Batchinput'.
LINE+20 = SY-DATUM.
LINE+30 = SY-UZEIT.
PERFORM BDC_FIELD USING 'RSTXP-TDLINE(17)' LINE.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/11'.
*------------------------------------------------------------*
* Leave the editor (enter f3 in ok-code) *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/3'.
*------------------------------------------------------------*

* Leave transaction se38 (enter f15 in *
* ok-code) *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMS38M' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/15'.
ENDFORM. "End GEN_BDC_DATA
*----------------------------------------------------------------*
* *
* In the batch input data, start a new screen *
* *
*----------------------------------------------------------------*
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "End BDC_DYNPRO
*----------------------------------------------------------------*
* *
* In the batch input data, insert a field *
* *
*----------------------------------------------------------------*
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDFORM.

-----------------------------------------------------------------------------------------------

RELATED POSTS

BDC PART TEN
SAP journey from R/3 towards MySAP.com
sap internet transaction architecture
SAP internet transaction application components

BDC for SAP ABAP Eight

(18) PROCESSING BATCH INPUT SESSIONS:

When you create a batch input session, it remains in the batch input queue until it is explicitly started. Session processing can be started in two ways:

An on-line user can start the session using the batch input menu options. (To access the batch input options, choose System-->Services-->Batch Input.)

You can submit the background job RSBDCSUB to start a session in background processing. If several sessions have the same name, RSBDCSUB starts them all.It's possible to coordinate the generation and execution of a session in the background processing system.

You can, for example, schedule both the batch input program and RSBDCSUB in the background. If you designate the batch input job as the predecessor for RSBDCSUB, then RSBDCSUB will be started automatically when the batch input job successfully completes.Alternatively, you can schedule both the batch input program and RSBDCSUB as job steps in a single background job. In this case, however, RSBDCSUB is started even if the batch input program should terminate abnormally.

For detailed information about processing batch input sessions, see MANAGING BATCH INPUT SESSIONS(B) in the System Services guide. You'll find this guide in the Basis library, system administration section, on the SAP documentation CD-ROM.


(19) USING CALL TRANSACTION USING FOR BATCH INPUT:


Processing batch input data with CALL TRANSACTION USING is the faster of the two recommended batch input methods. In this method, batch input data is processed inline in your batch input program.Error recovery, restarting, and management of batch input processing are all more comfortable if you use "classical" batch input processing by way of batch input sessions. CALL TRANSACTION USING is therefore recommended only if batch input sessions do not run fast enough to meet your requirements.For more information on choosing a batch input method, please see Selecting a Batch-Input Method(11) .


A program that uses CALL TRANSACTION USING to submit batch input should perform the following steps:

1. Prepare a BDCDATA structure for the transaction that you wish to run. The requirements for filling the BDCDATA structure are the same as for "classical" batch input using sessions. For more information, please see Using the Batch Input Data Structure(12).

2. With a CALL TRANSACTION USING statement, call the transaction and pass the BDCDATA structure to it as batch input. For example:

CALL TRANSACTION 'SE38' USING BDCDATA
MODE 'A'
UPDATE 'S'.
MESSAGES INTO MESSTAB.

The Mode Parameter

The MODE parameter lets you specify whether the batch input processing should be displayed to you as it happens. You can choose between three modes:

A Display everything.All screens and the data that goes in them appear when you run your program. This is the default setting for MODE in CALL TRANSACTION USING.

N Display nothing.All screens are processed invisibly, regardless of whether there are errors or not. Control returns to your program as soon as transaction processing is finished. (Database updates however, may have taken place or may have not have taken place, depending on the value of the UPDATE parameter.)

E Display errors only. The transaction goes into display mode as soon as an error in one of the screens is detected. You can then correct the error.The display modes are the same as those that are available for processing batch input sessions.

The Update Parameter

The UPDATE parameter lets you specify how updates produced by a transaction should be processed. You can select between these modes:

A Asynchronous updating

In this mode, the called transaction does not wait for any updates it produces to be completed. It simply passes the updates to the SAP update service.Asynchronous processing therefore usually results in faster execution of your batch input program.

Asynchronous processing is NOT recommended for processing any larger amount of data. This is because the called transaction receives no completion message from the update module in asynchronous updating. The calling batch input program, in turn, cannot determine whether a called transaction ended with a successful update of the database or not.

If you use asynchronous updating, then you will need to use the update management facility (transaction SM12) to check whether updates have been terminated abnormally during session processing. Error analysis and recovery is less convenient than with synchronous updating.

S Synchronous updating

In this mode, the called transaction waits for any updates that it produces to be completed. Execution is slower than with asynchronous updating because called transactions wait for updating to be completed. However, the called transaction is able to return any update error message that occurs to your program. It's much easier for you to analyze and recover from errors.

L Local updating

If you update data locally, the update of the database will not be processed in a separate process, but in the process of the calling program. (Refer to the keyword documentation of SET UPDATE TASK LOCAL for more information.)

The Messages Parameter

The MESSAGES specification indicates that all system messages issued during a CALL TRANSACTION USING are written into the internal table . The internal table must have the structure BDCMSGCOLL.

Example

You can have system messages issued by transaction SE38 (bottom of example) collected in table MESSTAB with the following coding:

DATA BEGIN OF BDCDATA OCCURS 100.
INCLUDE STRUCTURE BDCDATA.
DATA END OF BDCDATA.

DATA BEGIN OF MESSTAB OCCURS 10.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA END OF MESSTAB.

DATA REPORT(8).

BDCDATA-PROGRAM = 'SAPMS38M'.
BDCDATA-DYNPRO = '0100'.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
CLEAR BDCDATA.
BDCDATA-FNAM = 'RS38M-PROGRAMM'.
BDCDATA-FVAL = REPORT.
APPEND BDCDATA.
...
CALL TRANSACTION 'SE38' USING BDCDATA MODE 'N'
MESSAGES INTO MESSTAB.

The following return codes from CALL TRANSACTION USING and the system fields that contain message information from the called transaction. As the return code chart shows, return codes above 1000 are reserved for batch input.

If you use the MESSAGES INTO option, then you do not need to query the system fields shown below; their contents are automatically written into the message table. You can loop over the message table to write out any messages that were entered into it.


RELATED POSTS

BDC PART NINE
What is SAP and Why do we are in need of It
What is SAP Full form and its definition part one
sap internet transaction architecture
SAP internet transaction application components

BDC for SAP ABAP Seven

(14) CREATING BATCH INPUT SESSIONS:

One of the two recommended ways to process batch input data is to store the data in a batch input session. This session can then be run in the SAP System to enter the batch input data into the system.In general, preparing a session is the best and most comfortable way to process batch input data.

However, you may wish to use the alternate method, CALL TRANSACTION USING, if your batch input sessions cannot be run quickly enough. For more information on choosing the best batch input method, see Selecting a Batch-Input Method(11) .

Creating, Filling, and Closing a Batch Input Session

To create a session, program the following procedure using the following BDC_ function modules:

1. Open the batch input session using function module BDC_OPEN_GROUP(15) .
2. For each transaction in the session:


a. Fill the BDCDATA structure with values for all screens and fields that must be processed in the transaction. For more information, please see Using the Batch Input Data Structure(12).
b. Transfer the transaction to the session with BDC_INSERT(16) .

3. Close the batch input session with BDC_CLOSE_GROUP(17).

The following topics describe these function modules. See Sample Batch Input Program(22) for an example of how the function modules are used.


(15) CREATING A SESSION WITH BDC_OPEN_GROUP :

Use the BDC_OPEN_GROUP function module to do the following create a new session. Once you have created a session, then you can insert batch input data into it with BDC_INSERT.You cannot re-open a session that already exists and has been closed. If you call BDC_OPEN_GROUP with the name of an existing session, then an additional session with the same name is created.A batch input program may have only one session open at a time. Before opening a session, make sure that any sessions that the program closes any sessions that it previously had opened.


BDC_OPEN_GROUP takes the following EXPORTING parameters:

CLIENT

Client in which the session is to be processed.
Default: If you don't provide a value for this parameter, the default is the client under which the batch input program runs when the session is created.


GROUP

Name of the session that is to be created. May be up to 12 characters long.
Default: None. You must specify a session name.

HOLDDATE

Lock date. The session is locked and may not be processed until after the date that you specify.Only a system administrator with the LOCK authorization for the authorization object Batch Input Authorizations can unlock and run a session before this date.
Format: YYYYMMDD (8 digits).
Default: No lock date, session can be processed immediately. A lock date is optional.

KEEP

Retain session after successful processing. Set this option to the value X to have a session kept after it has been successfully processed. A session that is kept remains in the input/output queue until an administrator deletes it.

Sessions that contain errors in transactions are kept even if KEEP is not set.
Default: If not set, then sessions that are successfully processed are deleted. Only the batch input log is kept.


USER

Authorizations user for background processing. This is the user name that is used for checking authorizations if a session is started in background processing. The user must be authorized for all of the transactions and functions that are to be executed in a session.Otherwise, transactions will be terminated with "no authorization" errors.

The user can be of type dialog or background. Dialog users are normal interactive users in the SAP System. Background users are user master records that are specially defined for providing authorizations for background processing jobs.


(16) ADDING DATA TO A SESSION: BDC_INSERT :

Use the BDC_INSERT function module to add a transaction to a batch input session. You specify the transaction that is to be started in the call to BDC_INSERT. You must provide a BDCDATA structure that contains all of the data required to process the transaction completely.


BDC_INSERT takes the following parameters:

TCODE

The code of the transaction that is to be run.
For help in finding the transaction code of a function, see Analyzing SAP Transactions(4) .
TCODE is an EXPORTING parameter in the function module.

POST_LOCAL

Parameter to update data locally. If POST_LOCAL = 'X', data will be updated locally.(refer to the keyword documentation of SET UPDATE TASK LOCAL for more information)

DYNPROTAB

The BDCDATA structure that contains the data that is to be processed by the transaction.
DYNPROTAB is a tables parameter in the function module.
For information on filling the structure, see Programming Techniques: Entering Data and Executing Functions(13).


(17) CLOSING A SESSION: BDC_CLOSE_GROUP :

Use the BDC_CLOSE_GROUP function module to close a session after you have inserted all of your batch input data into it. Once a session is closed, it can be processed.


BDC_CLOSE_GROUP needs no parameters. It automatically closes the session that is currently open in your program.You must close a session before you can open another session from the same program.You cannot re-open a session once it has been closed. A new call to BDC_OPEN_GROUP with the same session name creates a new session with the same name.


RELATED POSTS

BDC PART 8
sap internet transaction server introduction
sap internet transaction architecture
SAP internet transaction application components

BDC for SAP ABAP Six

(13) PROGRAMMING TECHNIQUES :

ENTERING DATA AND EXECUTING

FUNCTIONS:

a)Sample Code: Filling the BDCDATA Structure
b)Identifying a Screen
c)Entering a Value in a Field
d)Executing a Function
e)Entering Values in Loop Fields
f)Positioning the Cursor
g)Ending a Transaction

a)Sample Code: Filling the BDCDATA Structure:

The following form routine shows how the BDCDATA structure should be filled. 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.Special techniques, such as placing the cursor, are not shown in this example.

Example:

Assume in this example that the BDCDATA structure has been declared as BDCDAT in the ABAP/4 program:

FORM Fill-BDC-Table
REFRESH BDCDAT

" Start new DYNPRO
CLEAR BDCDAT
MOVE: TO BDCDAT-PROGRAM.
TO BDCDAT-DYNPRO.
'X' TO BDCDAT-DYNBEGIN.
APPEND BDCDAT.

" Enter fields and values for DYNPRO
CLEAR BDCDAT.
MOVE: TO BDCDAT-FNAM.
TO BDCDAT-FVAL.
APPEND BDCDAT.
CLEAR BDCDAT.
MOVE: TO BDCDAT-FNAM.
TO BDCDAT-FVAL.
APPEND BDCDAT.
...
...
" Start next DYNPRO
CLEAR BDCDAT.
MOVE: TO BDCDAT-PROGRAM.
TO BDCDAT-DYNPRO.
'X' TO BDCDAT-DYNBEGIN.
APPEND BDCDAT.
ENDFORM.


b) Identifying a Screen:

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:

Example:

BDCDATA-PROGRAM = 'sapms38m'.
BDCDATA-DYNPRO = '0100'.
BDCDATA-DYNBEGIN = 'x'.
APPEND BDCDATA.



c) Entering a Value in a Field:

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:

Example:

BDCDATA-FNAM = 'RS38M-FUNC_EDIT'.
BDCDATA-FVAL = 'x'.
APPEND BDCDATA.


d)Executing a Function:

You can execute a function in a transaction by entering the function code or function key number in the command field of an SAP session. You use the FNAM and FVAL fields to enter this information, just as you would for normal screen fields.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 F11. A function key number must be prefixed with the / (slash) character:

Example:

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.

Example:

BDCDATA-FNAM = 'BDC_OKCODE'.
BDCDATA-FVAL = '=UPDA'.


e)Entering Values in Loop Fields

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 :

Example:

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.


f)Positioning the Cursor:

To position the cursor on a particular field, you must use the special cursor field:

Example:

BDCDATA-FNAM = 'BDC_CURSOR'.
BDCDATA-FVAL = 'fieldx'.

To position the cursor on a loop field, you must use again an index:

Example:

BDCDATA-FNAM = 'BDC_CURSOR'.
BDCDATA-FVAL = 'fieldy(5)'.


g)Ending a Transaction: You can successfully complete processing of a transaction in batch input in either of two ways:

leave the transaction and return to the SAP main menu.
trigger an update of the database.

Ending a Transaction

Example:

Returning to the SAP main menu: From the text input screen in the ABAP/4 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/4 editor
BDCDATA-DYNPRO = '0100'.
BDCDATA-DYNBEGIN = 'X'.

BDCDATA-FNAM = 'BDC_OKCODE'.
BDCDATA-FVAL = '/15'. "Quit function key


RELATED POSTS

BDC 7
What is SAP and Why do we are in need of It
What is SAP Full form and its definition part one
sap internet transaction architecture
SAP internet transaction application components