cancel
Showing results for 
Search instead for 
Did you mean: 

start routine

Former Member
0 Kudos

hi friends

wat is start routine?? can anyone plz give the detail defnition

thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Raj,

Start Routine - this routine is run exactly once for a data package at the beginning of the update program

The start routine has only these parameters: MONITOR, MONITOR_RECNO, DATA_PACKAGE, RECORD_ALL, SOURCE_SYSTEM and ABORT. DATA_PACKAGE refers to the entire data package. The start routine does not have a return value. It is used to perform preliminary calculations and store these in a global data structure or in a table. You can access this structure or table from other routines.

You have the option of creating a start routine in the transfer rules maintenance screen. This start routine is run for each data package after the data has been written to the PSA and before the transfer rules have been executed. The entire data package in the transfer structure format is used as parameter for the routine.

You can change the data package by adding or deleting records.

If you add or delete records, this might not be detected by the error handling.

The start routine contains a return parameter that causes processing of the entire package to be terminated with an error message for values <> 0.

The option of creating a start routine is available only for the PSA transfer method. The routine is not displayed if you switch to the IDoc transfer method.

Example

In the ERP system, you are loading data using the General Ledger: Transaction Figures DataSource (FI_GL_1) into the DataStore object FIGL: Transaction Figures (0FIGL_O06).

You want to create a start routine that deletes all the records from a data package that have debit and credit postings that are equal to zero.

1. Create a transformation. The source of the transformation has the Total Debit Postings (UMSOL) and Total Credit Postings (UMHAB) fields. They are assigned to the InfoObjects Total Debit Postings (0DEBIT) and Total Credit Postings (0CREDIT).

2. Choose Create Start Routine. The routine editor opens.

3. You go to the local part of the routine. You enter the following lines of code:

----


METHOD start_routine.

*=== Segments ===

FIELD-SYMBOLS:

<SOURCE_FIELDS> TYPE tys_SC_1.

$$ begin of routine - insert your code only below this line -

... "insert your code here

DELETE SOURCE_PACKAGE where UMHAB = 0 and UMSOL = 0

$$ end of routine - insert your code only before this line -

ENDMETHOD. "start_routine

----


The delete statement is the only line you require in order to filter debit and credit postings without values out of the data package.

4. You exit the routine editor.

5. You save the transformation. An edit icon next to the Start Routine indicates that a start routine is available.

Assign Points if it helps you.

Regards,

Sreedhar

Former Member
0 Kudos

Hi,

Start Routines can be created for update rules and transfer rules. During the data transfer process the

coding in the start routine will be called for each data package at the beginning of the update or transfer rule

processing. In the start routine you have access to all records of an entire data package.

In standard routines(Transfer Routine & Update Routine) you have access to a single, currently processed record which has the work area

COMM_STRUCTURE. This routine will be processed for each record after the start routine and is assigned to a

single key figure or characteristic. You can assign new values to the key figure or characteristic by changing

the value of RESULT, at the end of the routine.

for more Details gothrough these.

http://help.sap.com/saphelp_nw04/helpdata/en/b3/0ef3e8396111d5b2e80050da4c74dc/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/21/894eeee0b911d4b2d90050da4c74dc/content.htm

Thanks,

-Vijay