Batch Input Basics

download Batch Input Basics

of 12

Transcript of Batch Input Basics

  • 8/22/2019 Batch Input Basics

    1/12

    L&T Information Technology Limited - Confidential

    Overview

    SAP SystemExternal System

    Data Batch Input

  • 8/22/2019 Batch Input Basics

    2/12

    L&T Information Technology Limited - Confidential

    Data Transfer Rules

    SAP

    Database

    Table

    External

    Data

    Checks &

    Validations

    External

    Data

    X

  • 8/22/2019 Batch Input Basics

    3/12

    L&T Information Technology Limited - Confidential

    Online Program

    Vendor

    Company Code

    TEST1

    Address

    X

    Name

    Street

    Computers, Inc.

    City Philadelphia

    To check and validate the external

    data, user dialog is simulated

    through an SAP transaction

    (i.e., an online program).

  • 8/22/2019 Batch Input Basics

    4/12

    L&T Information Technology Limited - Confidential

    BDCDATA Structure

    To simulate user dialog,

    you must know the

    following information:

    (1) online program name,

    (2) screen numbers,(3) field names, and

    (4) field values.

    The BDCDATA ABAP/4Dictionary structure is used

    in a batch input program to

    collect this information for

    an entire transaction.

    ABAP/4 Dictionary

    BDCDATA

    PROGRAMDYNPRO

    DYNBEGIN

    FNAM

    FVAL

  • 8/22/2019 Batch Input Basics

    5/12

    L&T Information Technology Limited - Confidential

    Example - Change Vendor

    Vendor

    Company Code

    TEST1

    Address

    X

    Name

    Street

    Computers, Inc.

    123 Main St.

    City Philadelphia

    For our example, we

    will use the ChangeVendor transaction

    (FK02) to add a street

    address to an already

    existing vendor.

  • 8/22/2019 Batch Input Basics

    6/12

    L&T Information Technology Limited - Confidential

    Researching Transaction - 1st Screen

    Vendor

    Company Code

    TEST1

    AddressX

    Step #1Use System > Status

    menu path to determine

    online program name

    (SAPMF02K), screen

    number (0106), andtransaction code (FK02).

    Step #2Use F1 key and Technical

    Info pushbutton in each

    screen field to be filled to

    determine the field name.

    Step #3

    Determine how to proceed

    in the transaction

    (go to the next screen by

    pressing the Enter key).

    Field name = RF02K-LIFNR

    Field name = RF02K-D0110

  • 8/22/2019 Batch Input Basics

    7/12L&T Information Technology Limited - Confidential

    Researching Transaction - 2nd Screen

    Name

    Street

    Computers, Inc.

    123 Main St.

    City Philadelphia

    Step #1Use System > Status

    menu path to determine

    online program name

    (SAPMF02K) and screen

    number (0110).

    Step #2Use F1 key and Technical

    Info pushbutton in each

    screen field to be filled to

    determine the field name.

    Step #3

    Determine how to proceed

    in the transaction (save the

    record by clicking on theSave pushbutton or

    pressing the F11 key).

    Field name = LFA1-STRAS

  • 8/22/2019 Batch Input Basics

    8/12L&T Information Technology Limited - Confidential

    BDC Table Contents

    PROGRAM

    SAPMF02K

    SAPMF02K

    DYNPRO

    0106

    0110

    DYNBEGIN

    X

    X

    FNAM

    RF02K-LIFNRRF02K-D0110

    LFA1-STRAS

    BDC_OKCODE

    FVAL

    TEST1X

    123 Main St.

    /11

    After researching the transaction,

    we can determine the contents of

    the BDC table.

  • 8/22/2019 Batch Input Basics

    9/12L&T Information Technology Limited - Confidential

    Declaring BDC Table

    DATA: BDC_TAB LIKE BDCDATA

    OCCURS 6 WITH HEADER LINE.

    The internal table used to collect the

    transactions information must be

    declared LIKE BDCDATA.

  • 8/22/2019 Batch Input Basics

    10/12L&T Information Technology Limited - Confidential

    Filling BDC Table - Method #1

    FORM FILL_BDC_TAB.

    REFRESH BDC_TAB.

    CLEAR BDC_TAB.

    BDC_TAB-PROGRAM = SAPMF02K.

    BDC_TAB-DYNPRO = 0106.

    BDC_TAB-DYNBEGIN = X.APPEND BDC_TAB.

    CLEAR BDC_TAB.

    BDC_TAB-FNAM = RF02K-LIFNR.

    BDC_TAB-FVAL = TEST1.

    APPEND BDC_TAB.

    CLEAR BDC_TAB.

    BDC_TAB-FNAM = RF02K-D0110.

    BDC_TAB-FVAL = X.

    APPEND BDC_TAB.

    CLEAR BDC_TAB.

    BDC_TAB-PROGRAM = SAPMF02K.

    BDC_TAB-DYNPRO = 0110.

    BDC_TAB-DYNBEGIN = X.

    APPEND BDC_TAB.

    CLEAR BDC_TAB.BDC_TAB-FNAM = LFA1-STRAS.

    BDC_TAB-FVAL = 123 Main St..

    APPEND BDC_TAB.

    CLEAR BDC_TAB.

    BDC_TAB-FNAM = BDC_OKCODE.

    BDC_TAB-FVAL = /11.

    APPEND BDC_TAB.

    ENDFORM.

  • 8/22/2019 Batch Input Basics

    11/12L&T Information Technology Limited - Confidential

    Filling BDC Table - Method #2

    FORM FILL_BDC_TAB.

    REFRESH BDC_TAB.

    PERFORM POPULATE_BDC_TAB

    USING:

    1 SAPMF02K 0106,

    RF02K-LIFNR TEST1,

    RF02K-D0110 X,

    1 SAPMF02K 0110,

    LFA1-STRAS 123 Main St.,

    BDC_OKCODE /11.

    ENDFORM.

    FORM POPULATE_BDC_TAB USINGFLAG VAR1 VAR2.

    CLEAR BDC_TAB.

    IF FLAG = 1.

    BDC_TAB-PROGRAM = VAR1.

    BDC_TAB-DYNPRO = VAR2.

    BDC_TAB-DYNBEGIN = X.

    ELSE.

    BDC_TAB-FNAM = VAR1.

    BDC_TAB-FVAL = VAR2.

    ENDIF.

    APPEND BDC_TAB.

    ENDFORM.

    This two-subroutine method to fill the BDC table is preferable because the

    POPULATE_BDC_TAB subroutine is reusable throughout all batch input programs.

  • 8/22/2019 Batch Input Basics

    12/12L&T Information Technology Limited - Confidential

    Batch Input Methods

    Batch Input SessionMethod #1

    CALL TRANSACTION

    USING StatementMethod #2

    CALL DIALOG StatementMethod #3