WORK FLOW SCENARIOS IN SD SAP II

Processing Credit Memo Requests

Each employee in the sales department is allowed to release credit memo requests up to a value of USD 300. The following authorization procedure has been defined for credit memo requests that exceed this limit:

Credit memo requests with a value of between USD 300 and USD 5,000 may only be
released by the group leader.

Credit memo requests that exceed a value of USD 5,000, may only be released by the
sales manager.

Object Types (SD-SLS-RE)

The interface between R/3 functionality and the workflow system is created using object technology.

In the following scenario, the business application object for
Credit memo requests is Object type BUS 2094.

Initial Values (SD-SLS-RE)

In the workflow, the person who releases or processes the credit memo request is decided according to the value of the credit memo request. You can determine two limit values: Amount limit 1 and amount limit 2.
In order to ensure correct, cross-company code credit memo processing, you also need to specify a reference currency. The document currency for the credit memo request is then converted into the reference currency.

The following company codes and their house currencies exist in one company:

Company code 1: House currency FRF
Company code 2: House currency DEM

The employees assigned to the sales organization process the credit memo requests
for company code 1 and company code 2.
A reference currency (for example, USD) is defined in the workflow container. The
net values in the sales documents are converted into the reference currency which
means that the credit memo requests can then be processed and checked,
independently of the currency in the company code.


Workflow Template (SD-SLS-RE)

Definition

The following two workflow templates are delivered in the standard system for credit memo processing:

Identification:WS20000009
Identification code: Credit memos
Long text: Credit memo processing

Identification: WS20000019
Identification code:CMR_CHECK
Long text: Check credit memo requests
For additional information, see:
Flow of Workflow Template [Page 14].

Use

Workflow Template 20000009 Credit Memo Processing

Triggering Event in Workflow Template

Updating the credit memo request triggers the event created for object type BUS2094 which starts the workflow template.

Workflow Container and Data Flow

The information needed for the workflow is contained in the credit memo request. This
information is available as an event parameter in the container for the triggered event and have to be transferred into the workflow container using data flow.
The following data flow definition between the triggering event and the workflow container is therefore defined in the standard system:
Workflow Container Event Parameter Container

WF_Initiator <-- _EVT_Object (credit memo request)
RefCurrency (reference currency)
CUSTCOMPLAINTORDER
(credit memo request)
NetValue_Limit_1
(amount limit 1)
NetValue_Limit_2
(amount limit 2)
End_Flag
(End indicator)
The _WF_Initiator element is available in the workflow container in the standard system, while the other elements listed here have been added to the workflow container.

Terminating Events

The workflow template for credit memo requests is terminated with the Release credit memo request and Reject credit memo request events.
Check Workflow Template 20000019 Credit Memo Processing

Workflow Container

The workflow container contains the end indicator (End_Flag), information about the credit memo request (CUSTCOMPLAINTORDER) and the employee responsible (ResponsibleAgents).

Processor Assignment

All people or organizational units that are assigned to the workflow template are informed.

Maintain Processor Assignment

Depending on the net value of the credit memo request and the defined organizational plan, the employee responsible receives a workitem in his or hers integrated inbox.
For this to take place, you must list the various objects from organization management in Customizing for the SAP Business Workflow who can work with workflow-relevant credit memo requests, for example, jobs or positions. Before you do that, you need to set up the organizational plan.

User Haywood has the group leader position while user Miller is in the sales
manager position.
Flow for Workflow Template

When you create a credit memo request, the created event is triggered for object BUS2094 and the workflow template 20000009 is started.
The system checks how high the net value of the credit memo request is. If the net value is below limit 1 (minimum limit), the system automatically releases the credit memo request in background processing.

If the net value of the credit memo request is over limit value 1, the system
terminates workflow

template 20000009 and initiates workflow template 20000019.

The relevant employee, depending on the value of the credit memo request and the
organizational structure in use (sales organization, distribution channel, division), is then informed of this by the arrival of a work item in their integrated inbox. If the employee releases the credit memo request, the system ends the workflow and deletes the work item from the inbox.

If the employee stops processing the work item, it remains in the inbox until it has been completed and only then is the workflow finished.

If the employee changes any of the determining factors in the credit memo request (such as net value), the net value of the credit memo request has to be re-checked. The system deletes the work item from the inbox.

Workflow template 20000009 receives a terminating event and workflow template 20000019 is triggered. Depending on the value of the item, the relevant employee is informed and receives a work item in their integrated inbox. Once the employee has finished processing the work item (by rejecting or releasing the credit memo request), the workflow is concluded. If the credit memo request is changed, workflow template 20000019 is called up. Processing continues until the credit memo request has either been rejected or released.

Terminating Events


The workflow template for checking credit memo requests is terminated with the Release credit memo request and Reject credit memo request events.

Standard Tasks (SD-SLS-RE)

Definition

Standard tasks are single-step tasks supplied by SAP that describe basic business activities.

RELATED POSTS

WORK FLOW SCENARIOS IN SD SAP I

Processing Credit Memo Requests (SD-SLS-RE)

Purpose

Credit memo requests normally need to be checked by the employee who entered them as well as approved by an additional decision-maker. The value of the credit memo determines who is able to approve it.

Once a credit memo request is created, the system normally creates a billing block. This block prevents you from billing the credit memo request and can only be removed by an authorized employee.

Using the workflow, you can represent the whole business process, with all the people involved, for approving credit memo requests within your company. This enables you to process credit memo requests simply and efficiently. If you do not use the workflow, the system does not control the process flow so you will have to organize the steps in credit memo processing yourself.


If the value of a credit memo request is below a minimum value, the system
automatically releases it for billing by removing the billing block.
If the credit memo request exceeds a certain value, the system automatically informs the employee responsible. She or he receives a work item in their inbox and can process it directly from there.
The employee responsible can cancel, release, or process a credit memo request.
If the employee cancels the request, the system automatically creates a reason for rejection in the credit memo request and ends processing.
If the employee releases the request, the system automatically removes the billing block in the
credit memo request and releases it for billing.
If the employee processes the request, she or he can use all the functions available in the change transaction.
The people informed by the workflow do not need to know either the name of the transaction or the menu path of the transactions involved.

Prerequisites

You have configured the settings in Customizing for the workflow and created an
organizational plan (see Preparation and Customizing (SD-SLS-RE) [Page 17]).

When you create credit memo requests, the system normally sets a billing block, which prevents it from being billed. Only authorized employees may remove this billing block, thus releasing the document for billing. The person who is able to check the credit memo before releasing it depends on the value of the credit memo.
You create the billing block for credit memo requests in Customizing for Sales and
Distribution when you define the order type (Sales and Distribution __Sales __Sales
Documents_ Sales Document Header _ Define sales document types).

When using the workflow for processing credit memo requests, we recommend that you
should only allow the billing block to be removed by the people who are authorized to
release credit memos of any value.


Process Flow

Depending on the value of the credit memo request, the system runs through one of the following processes when you enter a credit memo request:

If the value of the credit memo request is smaller or equal to a certain limit (L1), the system automatically releases the credit memo request. The system removes the
billing block in the background, releasing the credit memo request for billing.
If the value of the credit memo request is between limit L1 and limit L2, or equal to L2, the job responsible is informed that the credit memo request should be checked. All the people assigned to this job receive a work item in their integrated inbox, where they can cancel, release or process the credit memo request.

Cancel credit memo request

The employee has to enter a reason for rejection. The system automatically transfers
the reason for rejection into the credit memo request and stops processing.

Release credit memo request
The system automatically removes the billing block in the credit memo request and
releases the document for billing.

Process credit memo request

Here, the user branches into the “Change sales order” transaction, where they can
use all the functions in this transaction. According to the user’s authorization, he or she can remove a billing block, enter a reason for rejection, or process individual items (for example, delete or add order items, or change the order quantity).

The system checks whether the billing block was removed manually. If there is a
billing block, the system re-checks the value of credit memo request and informs the
employee responsible. This process is repeated until the credit memo request has
either been rejected or released.

RELATED POSTS

WORK FLOW SAP IV

Preparations and Customizing

Determining Responsibilities of the Roles

You must assign SAPorganizationjal object type T024D (MRP controller group). Since the organizational plan is always structured according to you requirements, this step is always necessary.

When you create the assignment, you must specify the plant and the MRP controller so that the MRP controller is uniquely identified. You can create several assignments within your organizational plan.

Executing Task-Specific Customizing

1. Perform task-specific Customizing for SAP Business Workflow.
2. Classify the standard task TS20000477 (Display change management), TS30001203
(Determine possible agent and dispatch), TS20000478 (Create text) and TS20000479
(Display text) as general tasks.
3. Assign the standard task TS20000480 (make change) to the agents who could process it.

Activate Event Receiver Linkage

The event ChangeManagementOpened (configuration change with conflict) for object type
BUS2002 (network) is the triggereing event for workflow template 20000265 (Change
management) and as such is entered in the event linkage table The terminating event
ChangeManagementClosed (Change management concluded) is also entered in this table.

You can find the table in Event creation _ Status management. You decide wheteher you want to mainatin system settings, if you want to use system statauses, or customer settings, if you want to use your own status profile. In our case, the entry is in the system settings.

The status object (NPH), object type (BUS2002) and the event are maintained here. If you select an entry and double-click on Status restriction in the left-hand screen area, the relevant status is displayed. The Inactive field informs you whether the event is created when the status is set or when the status is revoked (subsequent status set).

To actually start the workflow template, the linkage between the triggering event and the workflow template, as receiver of the event, has to be activated in Customizing for SAP Business Workflow.

The event linkage of the workflow templates must also be activated. To create your own workflow template or to display an existing template, in the SAP Business Workflow menu choose Definition tools _ Tasks/Task groups and then the required maintenance transaction. On the initial screen enter Workflow template in the Task type field and the name of the workflow template. Choose either , , or to create, change or display respectively.The workflow template screen appears. To activiate the workflow, choose the Triggering events tab page and activate the event by clicking on the icon in the column so that a green light appears.

Further Options If you want to use the workflow tempalte without a dispatcher, you must delete the following steps: Display change management (TS20000477), Determine possible agents and dispatch (TS30001203)as well as the user decision Do you want to create a text ?. You can delete single steps in the workflow editor. Select the node to be deleted. In the context menu choose Delete. If you delete the Do you want to create a text ? node, you also delete the dependent nodes Create text (TS20000478) and Display text (TS20000479) and the connecting operators. A dialog box to
this effect appears, which you have to confirm. Apart from deleting the nodes, you must change the agent assignment for the Make change (TS20000480) single step.

Delete the SelectedObject expression and enter role 20000054 MRP controller group.You now have to change the autoamtically generated dat flow from the workflow container to the role container. Delete the Org_Object_ID and choose, using F4 help, the
attribute MRP controller group under network.
Check the workflow template and then activate it.
Operation and Connection to the Application Functionality Changes to the configuration of a sales order can occur frequently. Depending on the change
profile and the status of the network, the system can set the Manual adjustment necessary status.


If you have made the necessary settings in Customizing, the workflow template is active and is started automatically from the application.

RELATED POSTS

WORK FLOW SAP III

Technical Realization

Object Types Used
The interface between the R/3 functionality and the workflow system has been implemented using object technology. As a result, this topic contains information of a more technical nature, than is required for a first overview.

Standard tasks

Standard tasks are single-step tasks delivered from SAP, which describe basic business processes from an organizational point of view. A single-step task always refers to an object method ( technical connection to R/3 functionality) and is linked with possible agents, who are assigned to the relevant part of the organization.
Workflow template The actual business process as been implemented as a workflow template. You can find this workflow template in your R/3 system.


Object Network (BUS2002)

Objects are created in runtime and are the specific instances of pre-defined object types that have been given values. Object types are defined, entering the component, in the Business Object Repository and implemented:

An object Network (BUS2002) exist, for which methods, attributes, and events have been defined that are used by the workflow.
Standard Task TS20000477 Display change management (PSDisplayCM)

Use

In this standard task, the system displays change management for networks to the dispatcher.

He/she then decides which agent is responsible for the change comparison.
Referenced object methods: Object type BUS2002 (network), method

ChangeManagementDisplay (display change management)

Assigning agents: This task should be classed as a general task. General tasks do not have to be assigned to an agent, since they can be carried out by everyone. The agent is determined from the context of the workflow.


Standard Task TS30001203 Determine possible agents and dispatch

Use

This standard task determines the possibe agents for a subsequent task in the workflow. The dispatcher selects an agent from a list of possible agents. This agent is then assigned the singlestep task in the workflow.

Referenced object methods: Object type WF_TASK, method

AllAgentsOfTaskGetAndDispatch (Determine possible agents and dispatch)
Assigning agents: This task should be classed as a general task. General tasks do not have to be assigned to an agent, since they can be carried out by everyone. The agent is determined from the context of the workflow.

Standard Task TS20000478 Create Text (PS-CreaText)

Use

In this standard task, the dispatcher creates a text for the agent.
Referenced object methods: Object type STD_TEXT, method Create (create text)
Assigning employees: This task should be classed as a general task. General tasks do not have to be assigned to an agent, since they can be carried out by everyone. The agent is determined from the context of the workflow.

Standard Task TS20000479 Display Text (PS-DispText)

Use

In this standard text the agent sees the text that the dispatcher created.
Referenced object methods: Object type STD_TEXT, method ReplaceAndDisplay (replace
text symbols)

Assigning agents:s This task should be classed as a general task. General tasks do
not have to be assigned to an agent, since they can be carried out by everyone. The agent is determined from the context of the workflow.

Standard Task TS20000480 Make Change (PS-EditCM)

Use

In this standard task when an agent opens the work item, he/she goes directly to
change mangement for networks, to make the necessary change steps.

Referenced object methods: Object type BUS2002 (network), method

ChangeManagementEdit (make change)

This is ansynchronous method, which means that it can only be completed if another,
terminating, event occurs. In this case, this event is the successful execution of a change comparison for the corresponding network. The work item remains until the event occurs. The terminating event ChangeManagementClosed is defined in the task on the corresponding tab page.

Assigning agents: Here you should enter all the possible agents for confirmation
change management, since the dispatcher sees them in a list. You can assign agents in the task basic data.

You can also define the task as a general task and let the dispatcher choose the agent.
Standard role 20000054 MRP Controller Group (MRPContGroup)

Use roles to specify the agents for tasks or the addressees for messages.
Determining all the agents with the relevant attribute is refered to as role resolution. Each role has a role parameter container that contains the values used in role resolution.

Technical Realization

Entering a role is just one of several ways of finding the responsible agents or addressees. It is also possible to find someone via a suitable organization object (position, job, organization unit) or an expression with reference to the workflow container.

Role resolution is facititated by the SAP organization object MRP Controller Group
(MRP_Controller_Group). The key for the MRP controller group is T024D.
SAP organization object types (short: SAP OrgObjectTypes) represent organizational units on the object type level in the Business Object Repository. Organizational units are used to group employees together and to describe these groups. The key of the SAP organizational object type MRP controller group consists of the plant and the MRP controller.

The object type BUS2002 receives a MRPControllerGroup attribute that represents a object type reference to the SAP organizational object type MRP controller group.
The assignment of the SAP organizational object type MRP controller group to an organizational unit or a position results allows the responsible agent group to be determined at runtime. Since the role entry parameter is BUS2002, the role resolution searches the whole organizational plan for departments that are linked with objects of the type MRP controller group.

All employees in such an organizational unit or position receive the work item.
The role determines the agents for the single step Display Change management. The agents found determine the responsible agent.

RELATED POSTS

WORK FLOW SAP II

Standard tasks

Standard tasks are single-step tasks delivered from SAP, which describe basic business processes from an organizational point of view. A single-step task always refers to an object method ( technical connection to R/3 functionality) and is linked with employees, who are assigned to the relevant part of the organization.

Standard Task TS20000653:

Abbreviation: PurchOrdPS
Description: Change order network
Referenced object methods, characteristics
Object type: BUS2002
Method: DisplayPurchaseOrderChange
Characteristics: synchronous , with dialog

Process Flow

If there are changes in a network that affect ordered materials or services (quantities or dates), the affected materials are sorted according to purchasing group (in the purchase order). The event PurchaseOrderChange is then triggered for object type BUS2002 for each purchasing group.

The event BUS2002.PurchaseOrderChange is the triggering event for the standard task
TS20000653. It has the following parameters:

Parameter Description

PurchasingGroup Purchasing group
TodoList Internal table containing the changed materials and services
The following data flow has been defined between the event PurchaseOrderChange and the task TS20000653:

Task container Event parameter container

Network _Evt_Object
Start date _Evt_Creation_Date
Start time _Evt_Creation_Time
Triggered by _Evt_Creator
Simple todo list TodoList
Purchasing group PurchasingGroup
The standard task uses the role 00900010 (purcahsing group). It determines all users linked with the relevant purchasing group. If no users have been linked the purchasing in SAP Organization Management, all the users linked to the standard task receive a work item.


Preparations and Customizing

As well as the general Customizing that guarantees the smooth performance of the workflow system, it is also necessary to carry out special Customizing for standard task TS20000653.

Maintaining Employee Assignments

Assign standard task TS20000653 to the employees who could need it. To do so, choose in Customizing Project System _ Workflow _ Configure Standard Tasks for Workflow in the Project System or proceed as follows:
1. On the SAP Easy Access menu choose Tools _ Business Workflow _ Development _
Tasks/Task groups _ Display.
2. Choose Tasks/task groups _ Display and enter the standard task TS20000653
3. Assign the standard task TS20000653 to the users in the organizational unit that is to process the task in your company.
Link Purchasers to Organization Management
If you only want the purchaser responsible to receive a work item (instead of all the possible agents of the standard task TS20000613), link the purchaser to SAP Organizational Management. To do so, use the Customizing activity Project System _ Workflow _ Configure Standard Tasks for Workflow in Project System _ Customizing tasks or proceed as follows:

1. On the SAP Easy Access menu choose Tools _ Business Workflow _ Development
Definition tools _SAP org. objects _ Create assignment.
The Assignment to SAP organizational objects initial screen appears.
2. Enter the organizational object.
3. In the Org. object type field enter T024.

Activating the Event Linkage
The PurchaseOrderChange event for the object type BUS2002 is the triggering event for the standard task TS20000653. Before the standard task can be started event linkage must be activated. To do so, choose in Customizing Project System _ Workflow _ Configure Standard Tasks for Workflow in the Project System or proceed as follows:
1. On the SAP Easy Access menu choose Tools _ Business Workflow _ Development
Definition tools _ Tasks/Task groups_ Display.

The Task: Display screen appears.

2. Enter the standard task TS20000653, choose and go to the Triggering events tab page.
3. Activate the event by clicking on the iicon in the column so that a green light appears.
Maintaining Order Type-Dependent Parameters You must define whether the standard task TS20000653 is to be started for each order type (network type)and plant. Use Customizing activity Project System _ Workflow _ Configure
Standard Tasks for Workflow in the Project System _ Network Type Parameters:

Overview.


Operation

When you execute a work item for standard task TS20000653, you see a screen split into two sections:
On the left-hand side is an overview list of the materials or services. There is checkbox for each material/service. You can use these checkboxes to indicate which materials/services you have already processed.

A red light in front of a material or service means that another work item has been created for this material or service after the current work item was created.
By double-clicking on a material or service in the overview list you can display the detailed data on the right-hand screen.

You can edit exsiting purchase orders or create new ones. A new purchase order does not appear immediately in the table of existing purchase orders. The purchase order has to be saved to the database first. After it has been saved you can display the purchase order by:

Choosing Refresh
Double-clicking on the material or service in the overview list.

You can always interrupt processing of a work item by choosing Cancel, Back or Exit. You can then resume work later. Choose Close Workflow to finish the workflow.

Configuration Change Management (PS)

Purpose

A network can be created for a configurable product from the sales order using assembly processing. The characteristic value assignment is passed directly from the configurable material to the network, and the relevant activities, activity elements, components, PRTs, etc. are selected.

If the configuration of the material, which has an assembly order involving a network, is later changed, a change comparison is started for the network. Objects are added to or deleted from the network. The system tries to make this change comparison automatically. If conflicts arise, the network receives the Manual adjustment necessary status and the change steps have to be processed manually.

The changes to the configuration are made in Sales by the responsible employee. However, an employee in project planning makes the changes to the network. To facilitate communication between the two departments and to avoid long processing times, a workflow template has been created to automate this business process.

Process Flow

The triggering event for this workflow is a conflict during a change comparison, which means that that the Manual adjustment necessary status is set. The flow of the workflow template is as follows:

A dispatcher determines which employee in project planning should make the change
comparison. He/she makes this decision after seeing the network. The dispatcher is determined via a role, that evaluates the network data and the structure of the organization. The dispatcher can then create a text that is sent to the chosen employee. The employee sees this text and can then start processing the network immediately. The workflow finishes when the change comparison is concluded successfully.


RELATED POSTS

WORK FLOW SAP I

Workflow

Purpose

SAP Business Workflow has the technology and tools for automated control and processing of cross-application processes.
You can use workflow within the Project System to automate and integrate the performance of cross-application and cross-department processes within one project.
The Project System uses _ Predefined standard tasks in purchasing, confirmation, and during configuration changes _ Workflow tasks in milestones, which can also be user-defined.


Preparations and Customizing

Use

To use Workflow in the Project System, you must make the following settings in Customizing for Workflow and the Project System:

Maintain your company’s organization structure
Link the predefined standard tasks with the authorized people in your company
Activate existing event receiver links between triggering events and consuming
workflow tasks.

Name a technical person responsible for each standard workflow template.
Determine whether a work item should be created and make the appropriate setting in
Customizing for network type parameters.
Determine whether a work item should be created if there is a deviation in the duration and work, and make the appropriate setting in Customizing for confirmation parameters.


Standard Tasks in the Project System

SAP has predefined the following standard workflow tasks and provided them with the Project System:
Standard Task TS20000653: Purchase Order Change
If you change dates or quantities of material components in a network with externally processed activities, for which a purchase order has already been created, the system automatically creates a work item.

The purchasing agent receives a message in the mail system regarding the changes that need to be made. This person can then make the necessary changes to the purchase order directly from the mail system.

Standard task TS00007944: Enter actual data

You can create a work item for confirmation from the information system. The pool of
confirmations can be sent to various addresses, for example, to a user or a work center.

Standard Task TS00008015: Deviation in the Confirmation is too Large
If the duration or work exceeds the values you defined in the confirmation parameters in Customizing, the system automatically creates a work item: The MRP controller receives a work item by mail and can display the confirmation or network. The MRP controller can also use the mail system to contact the person who made the confirmation.


Standard Task TS00200040: Change Network
SAP has predefined this standard task which you can use as a model for creating your own standard tasks and workflow tasks for the milestones in a network. This standard task calls up the change network transaction. You can use it to define your own standard tasks and workflow tasks.

WS20000265 Configuration Change Management
This workflow template contains the following standard tasks:
TS20000477 Display change management
TS20000478 Create text
TS20000479 Display text
TS20000480 Make change
User-defined Standard Tasks and Workflow Tasks in

Milestones

You can use the milestone function start workflow task in a network to start:

Standard tasks
Tasks
Workflow tasks

depending on the status of the activity to which the milestone is assigned. You can use network and activity data for the task.
The tasks must meet certain conditions. For more information on how to define user-defined standard and workflow tasks, refer to the Implementation Guide for the Project System under Workflow .


Purpose

If, during network processing, either an external material (non-stock item) or an external service (external activity/service activity) has to be procured, a purchase requisition is created. This is procesed by the purchaser, who creates on or more purchase orders. This is noted in the network.
If changes occur in the nezwork with regards to the ordered materials or services (changed quantities or dates), the sytem automatically changes the purchase requisition. However, any purchase orders that have already been created must be changed manually by the responsible purchaser.

Process Flow

You can use the SAP Business Workflow to inform the responsible purchaser, if based on a change in a network

The required quantity or the requirements date of an external material or service changes or
An external material item or external activity is deleted or
An external activity becomes an internal activity or
The external material or service is no longer required, because the network now has the Technically completed status

And one or more purchase orders have been created for the purchase requisition
The purchaser receives a work item, in which all the relevant changes that affect the external materials or services are listed. He/she can view the purchase requisitions and the existing purchase orders that are affected. It is also possible to edit the purchase orders and to create new orders.



Technical Implementation

Object Types

The interface between the R/3 functionality and the workflow system has been
implemented using object technology. As a result, this topic contains information of a more technical nature, which is now required for a first overview.

In this context, the following object types are important:
BUS2002: Network
Position in the object repository: Project System
T024: Purchasing group
Position in the object repository: Materials management _ Sales

RELATED POSTS

BDC SAP X

(23) 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

BDC SAP IX

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 mechnism, 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
For more information, see the respective program documentation.

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 SAP VIII

(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 figures show the 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 SAP VII

(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 SAP VI

(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 SAP V

(11) SELECTING A BATCH-INPUT METHOD:

When you generate batch input in ABAP/4, you have three options for submitting the data to batch input processing. Only the first two methods can be recommended without reservation. The third method, by way of CALL DIALOG, is outmoded. CALL DIALOG Is less comfortable than the other methods. You should use it only if you must.


Create a session on the batch input queue.

Summary: Standard method. Offers management of sessions, support for playing back and correcting sessions that contain errors, and detailed logging.

Your program prepares the data and stores it in a batch input session. A session is a collection of transaction data for one or more transactions. Batch input sessions are maintained by the system in the batch input queue. You can process batch input sessions in the background processing system.

Your program must open a session in the queue before transferring data to it, and must close it again afterwards. All of these operations are performed by making function module calls from the ABAP/4 program.

The most important aspects of the session interface are:

Asynchronous processing
Transfers data for multiple transactions
Synchronous database update

During processing, no transaction is started until the previous transaction has been written to the database.

A batch input processing log is generated for each session
Sessions cannot be generated in parallel

The batch input program must not open a session until it has closed the preceding session.

Use the CALL TRANSACTION USING statement

Summary:

Offers faster processing of data than batch input sessions. Recommended if you're having problems getting data entered into your SAP System quickly enough. The playback, interactive correction, and logging facilities offered for batch input sessions are not available for CALL TRANSACTION USING.
Your program prepares the data and calls the desired transaction for immediate processing.

The most important aspects of the CALL TRANSACTION USING 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.
No batch input processing log is generated

Use the CALL DIALOG statement

Summary:

Not recommended if you can enter data by way of sessions or CALL TRANSACTION USING.
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

(12) USING THE BATCH INPUT DATA STRUCTURE:

The batch input structure stores the data that is to be entered into SAP System and the actions that are necessary to process the data. You can think of the structure as storing the script that the SAP System is to follow in processing batch input data.

The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION USING or CALL DIALOG.

The diagram below shows how to declare the structure in your ABAP/4 program and the fields contained in the structure.



BDCDATA Structure

Information structure: A BDCDATA structure can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is therefore as follows:

Create a BDCDATA structure
Write the structure out to a session or process it with CALL TRANSACTION USING; and then

Create a BDCDATA structure for the next transaction that is to be processed.

Within a BDCDATA structure, data is organized by the screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure:

The screen identifier record is followed by a separate BDCDATA record for each value that is to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:

data that is entered into screen fields
function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save.
cursor-positioning commands.

The transaction to which a BDCDATA structure refers is identified separately. If your program writes data to a batch input session, then the transaction is specified in the call to the BDC_INSERT function module. This function module writes a BDCDATA structure out to the session. If your program processes data with CALL TRANSACTION USING, then the transaction is specified directly in this statement.

The following table shows what the contents of a BDCDATA structure might look like. This BDCDATA structure would add a line to a report in transaction SE38, the ABAP/4 Editor:

BDCDATA Structure for Adding a Line to a Report (Transaction SE38)

PROGRAM DYNPRO DYNBEGIN FNAM FVAL
----------------- ------------- ----------------- -------------------------- ----------
SAPMS38M 0100 X
RS38M-PROGRAMM
RS38M-FUNC_EDIT X
BDC_OKCODE =CHAP (Change function code)
SAPMSEDT 2310 X
RSTXP-TDLINECOM(1) B-
SAPMSEDT 2310 X
BDC_CURSOR RSTXP- TDLINECOM(1)
RSTXP-TDLINE(1) BDC Test Text
BDC_OKCODE /11 (Save function key)
SAPMSEDT 2310 X
BDC_OKCODE /3 (Back function key)
SAPMS38M 0100 X
BDC_OKCODE /15 (Quit function key)

Fields: The fields in the BDCDATA structure are as follows:

PROGRAM

Name of the program. Length (8). The PROGRAM field is not case-sensitive. Set this field only in the first record for the screen.

DYNPRO

Number of the screen. Length (4). Set this field only in the first record for the screen.

DYNBEGIN

Indicates the first record for the screen. Length (1). Set this field to X only in the first record for the screen. (Reset to ' ' (blank) for all other records.)

FNAM

Name of a field in the screen. Length (35). The FNAM field is not case-sensitive.

FVAL

Value for the field named in FNAM. Length (132). The FVAL field is case-sensitive. Values assigned to this field are always padded on the right if they are less than 132 characters. Values must be in character format.

Finding function codes and program and field names: Please see Analyzing SAP Transactions(4) for more information.

Data formatting requirements: Please see Data Conversions(6) for more information.


RELATED POSTS

Content

Privacy Policy

The articles are copyrighted to Technical Information and can only be reproduced given the author's permission.Information furnished in the blog is collected from various Resources.This blog does not host any files on its server. Please report any broken links in comment. If u have any queries contact me at technicalinformation.websites@gmail.com