Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BDC

Former Member
0 Kudos

Hi m writing a test so i need a small answer..

Explain Direct Input method

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

DIRECT INPUT

About Direct Input

In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not simulate the online transaction. 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. Direct input checks the data thoroughly and then updates the database directly.

You can start a Direct Input program in two ways;

Start the program directly

This is the quickest way to see if the program works with your flat file. This option is possible with all direct input programs. If the program ends abnormally, you will not have any logs telling you what has or has not been posted. To minimize the chance of this happening, always use the check file option for the first run with your flat file. This allows you to detect format errors before transfer.

Starting the program via the DI administration transaction

This transaction restarts the processing, if the data transfer program aborts. Since DI document are immediately posted into the SAP D/B, the restart option prevents the duplicate document posting that occurs during a program restart (i.e., without adjusting your flat file).

Direct input is usually done for standard data like material master, FI accounting document, SD sales order and Classification for which SAP has provided standard programs.

First time you work with the Direct Input administration program, you will need to do some preparation before you can transfer data:

- Create variant

- Define job

- Start job

- Restart job

<b>Reward points for useful Answers</b>

Regards

Anji

5 REPLIES 5

Former Member
0 Kudos

Hi

DIRECT INPUT

About Direct Input

In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not simulate the online transaction. 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. Direct input checks the data thoroughly and then updates the database directly.

You can start a Direct Input program in two ways;

Start the program directly

This is the quickest way to see if the program works with your flat file. This option is possible with all direct input programs. If the program ends abnormally, you will not have any logs telling you what has or has not been posted. To minimize the chance of this happening, always use the check file option for the first run with your flat file. This allows you to detect format errors before transfer.

Starting the program via the DI administration transaction

This transaction restarts the processing, if the data transfer program aborts. Since DI document are immediately posted into the SAP D/B, the restart option prevents the duplicate document posting that occurs during a program restart (i.e., without adjusting your flat file).

Direct input is usually done for standard data like material master, FI accounting document, SD sales order and Classification for which SAP has provided standard programs.

First time you work with the Direct Input administration program, you will need to do some preparation before you can transfer data:

- Create variant

- Define job

- Start job

- Restart job

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Hi,

Direct Input :

With direct input, data from the data transfer file is first checked to see if it meets various criteria and then transferred directly into the R/3 System. The R/3 database is updated directly with the transferred data.

There are two ways to trigger direct input:

Start the program directly: Note that the system does not generate an error log, nor is it possible to restart the system if an error occurs.

Direct input in the background: In this case, you can restart processing if the program terminates or logical errors occur (material missing, for example). The ability to restart the system ensures that data cannot be posted twice to the database, as the program can be reset to where it terminated. Using the trace you can correct any errors that occurred.

Direct input also has the advantage that it places little load on the system.

You can transfer the following data transfer objects using the direct input method:

Material masters

Accounting documents

Sales documents

Fixed assets

Classification

If you are working with test data, start the direct input directly. For the final data transfer, SAP strongly recommends that you use Transaction BMVO.

Note that with background processing, the input file cannot be stored on the presentation server. Access to presentation server files is only possible when you are working online.

You can find further information on direct input in the Basis documentation BC - Basis Programming Interfaces.

Activities

On the initial screen of the Data Transfer Workbench, enter the logical or physical name of the transfer file into which you have converted your legacy data.

Choose Goto ® Execute data transfer.

The system displays the transaction for direct input (Transaction BMV0).

Further steps to be taken depend on the transfer object and are therefore included in the object-specific documentation.

Reward points

if useful.

Regards

Murugan Arumugam

Former Member
0 Kudos

Hi..

you can use DI when u r going upload large amount of data for single application.

Better example where direct input method will be used is... uploading the data for material master.....it includes lot of views so its very much difficult to capture all the views and record the tcode and map the data in such conditions its better to go with DI methods

Advantages:

In session method or Call Transaction method while uploading the data u do the validation by fallowing the screen sequence and field sequence where as in DI validations can be done set of code so this make the process very fast so its advantageous to upload large amout of data.

you always use the standard sap provided program for this.

Here in DI method very important thing is structure of flat file... so to know the structure first of all you have to download the data for one record into the internal table with the use of the same program then with the use of that structure u have to desing the flat file and upload the data.

Regards,

Padmam.

Former Member
0 Kudos

Direct Input.

Without calling the screens but all the validations should be done and only for master datas upload.

Direct Input method:

1. Only for error free datas and also master data

updation.

2. It will directly updates the database table. No

screens involved.

3. Transaction BMVO or Program RBMVSHOW has been

used.

BDC(Batch Input Session):

1. Screens will be called programmatically.

2. First sessions will be created then we'll run the seesions in SM35 transaction.

3.Synchronous database update. After the processing the session only database update will occur.

Differences between Call Transaction and Sessions Method:

Session method.

1) synchronous processing.

2) can tranfer large amount of data.

3) processing is slower.

4) error log is created

5) data is not updated until session is processed.

6) generally used for back ground jobs.

7) at atime we can update to more than one screens.

Call transaction.

1) asynchronous processing

2) can transfer small amount of data

3) processing is faster.

4) errors need to be handled explicitly

5) data is updated automatically

6) for background n fore ground jobs.

7) at atime we can update to a single screen.

Direct Input method:

Without calling the screens but all the validations should be done and only for master datas upload.

1. Only for error free datas and also master data updation.

2. It will directly updates the database table. No screens involved.

3. Transaction BMVO or Program RBMVSHOW has been used.

For BDC:

http://myweb.dal.ca/hchinni/sap/bdc_home.htm

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&;

http://www.sap-img.com/abap/learning-bdc-programming.htm

http://www.sapdevelopment.co.uk/bdc/bdchome.htm

http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm

http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm

http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html

Check these link:

http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm

http://www.sap-img.com/abap/question-about-bdc-program.htm

http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/

http://www.planetsap.com/bdc_main_page.htm

Reward points for useful Answers

Former Member
0 Kudos

Hi

<u><b>Direct Input Method</b></u>

Among the methods of data transfer through BDC, direct input method is the one that is used, especially in case of transferring large amount of data. In order to enhance the batch input procedure, the system offers you with the direct input technique.

There is a distinction between the batch input technique and this technique. Unlike batch input technique, this technique does not create sessions. Instead, it stores the data directly. Moreover, it does not process screens. The data has to be entered directly into the corresponding database tables. The system calls a number of function modules which execute necessary checks, if any required. In the case of errors, the direct input technique has a facility to restart the entire mechanism. However, if you want to restart the entire mechanism in case you faced an error, then direct input programs must be executed in the background only. One has to use program RBMVSHOW or Transaction BMV0 to maintain and start these programs.

<u><b>Call Transaction:</b></u>

Speed.

Synchronous process.

SYnc. and Async both update possible.

Error handling thro Message structure BDCMSGCOLL.

Single Transaction.

<u><b>Batch Input Session:</b></u>

Slow.

Asynchronous process.

SYnc. update possible.

Error log is created in the SM35.

Multiple Transaction possible.

<u><b>Direct Input.</b></u>

Without calling the screens but all the validations should be done and only for master datas upload.

<u><b>Direct Input method:</b></u>

1. Only for error free datas and also master data

updation.

2. It will directly updates the database table. No

screens involved.

3. Transaction BMVO or Program RBMVSHOW has been

used.

<u><b>BDC(Batch Input Session):</b></u>

1. Screens will be called programmatically.

2. First sessions will be created then we'll run the seesions in SM35 transaction.

3.Synchronous database update. After the processing the session only database update will occur.

<u><u><b>Direct Input method:</b></u></u>

Without calling the screens but all the validations should be done and only for master datas upload.

1. Only for error free datas and also master data updation.

2. It will directly updates the database table. No screens involved.

3. Transaction BMVO or Program RBMVSHOW has been used.

<b>For BDC:</b>

http://myweb.dal.ca/hchinni/sap/bdc_home.htm

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&;

http://www.sap-img.com/abap/learning-bdc-programming.htm

http://www.sapdevelopment.co.uk/bdc/bdchome.htm

http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm

http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm

http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html

<b>

Check these link:</b>

http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm

http://www.sap-img.com/abap/question-about-bdc-program.htm

http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/

http://www.planetsap.com/bdc_main_page.htm

BDC using Call transaction involves calling an SAP transaction in back ground from within the ABAP

program. The process involves building an Internal BDC table containing the screen information needed to

execute the required transaction and then passing this to the Call transaction command

The full procedure for creating a BDC program is as follows:

For a BDC upload you need to write a program which created BDC sessions.

<u><b>Steps:</b></u>

1. Work out the transaction you would use to create the data manually.

2. Use transaction SHDB to record the creation of one material master data.

Click the New recording button or the Menu - Recording - Create

3. Save the recording, and then go back a screen and go to the overview.

4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording.

5. Edit the program. You will see that all the data you entered is hard-coded into the program. You need to make the following changes:

5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated).

5.2 After the open-group, Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data.

5.3. After perform bdc_transaction, add the endloop.

Execute the program. It will have options to create a batch session or to process directly.

<u><b>These are all my finds . Might be it will be useful to you.</b></u>

Direct call of transactions, session handling:

/nxxxx This terminates the current transaction, and starts transaction xxxx

/n This terminates the transaction. This generally corresponds to pressing F15 to go back.

/nend This termiantes all separate sessions and logs off (corresponds to System - Logoff).

/nex This terminates all separate sessions and logs off immediately (without any warning!).

/oxxxx This opens a new session and starts transaction xxxx in This session.

/o This lists existing sessions and allows deletion or opening of a new session.

/i This terminates the current session (corresponds to System End

/i1, /i2,... This terminates the session with the number given.

.xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse).

<b>Batch</b>

The following commands can be entered in correction mode ('Process in foreground' or 'Display errors only') when processing a batch input session:

/n This terminates the current batch input transaction and characterizes it as

/bdel This deletes the current batch input transaction.

/bend This terminates batch input processing and sets the session to Failed

/bda This switches from Display errors only to Process in foreground

/bde This switches from Process in foreground to Display errors only

ABAP/4

/h This switches into debugging mode.

/hs This switches into debugging mode and activates the debugging of system functions.

<b>Buffer</b>

<b><u>WARNING:</u></b> Resetting buffers can significantly change the performance of the entire system for a long time.

It should therefore only be used where there is a good reason tdso. As of release 3.0B system administator authorization is required (authorization object (S_ADMI_FCD). The action is noted in the system log.

/$SYNC This resets all buffers of the application server

/$CUA This resets the CUA buffer of the application server

/$TAB This resets the TABLE buffers of the application server

/$NAM This resets the nametab buffer of the application server

/$DYNP This resets the screen buffer of the application server

<b>Check this sample report</b>

*-----------------------------------------------------------------------
* Data declaration
TABLES: ekko, ekpo.
 
TYPES: BEGIN OF t_ekko,
    ebeln TYPE ekko-ebeln,
    waers TYPE ekko-waers,
    netpr TYPE ekpo-netpr,
    err_msg(73) TYPE c,
 END OF t_ekko.
 
DATA: it_ekko  TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      wa_ekko  TYPE t_ekko,
      it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      wa_error TYPE t_ekko,
      it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      wa_success TYPE t_ekko.
 
DATA: w_textout            LIKE t100-text.
DATA: gd_update TYPE i,
      gd_lines TYPE i.
 
*Used to store BDC data
DATA: BEGIN OF bdc_tab OCCURS 0.
        INCLUDE STRUCTURE bdcdata.
DATA: END OF bdc_tab.
 
*Used to stores error information from CALL TRANSACTION Function Module
DATA: BEGIN OF messtab OCCURS 0.
        INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
 
 
*-----------------------------------------------------------------------
*Screen declaration
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
                                    TITLE text-001. "Purchase order Num
SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.
 
SELECTION-SCREEN END OF BLOCK block1.
 
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME
                                    TITLE text-002. "New NETPR value
PARAMETERS:  p_newpr(14)   TYPE c obligatory.  "LIKE ekpo-netpr.
SELECTION-SCREEN END OF BLOCK block2.
 
 
************************************************************************
*START-OF-SELECTION
START-OF-SELECTION.
 
* Retrieve data from Purchase order table(EKKO)
  SELECT ekko~ebeln ekko~waers ekpo~netpr
    INTO TABLE it_ekko
    FROM ekko AS ekko INNER JOIN ekpo AS ekpo
      ON ekpo~ebeln EQ ekko~ebeln
   WHERE ekko~ebeln IN so_ebeln AND
         ekpo~ebelp EQ '10'.
 
 
************************************************************************
*END-OF-SELECTION
END-OF-SELECTION.
 
* Check data has been retrieved ready for processing
  DESCRIBE TABLE it_ekko LINES gd_lines.
  IF gd_lines LE 0.
*   Display message if no data has been retrieved
    MESSAGE i003(zp) WITH 'No Records Found'(001).
    LEAVE TO SCREEN 0.
  ELSE.
*   Update Customer master data (instalment text)
    LOOP AT it_ekko INTO wa_ekko.
      PERFORM bdc_update.
    ENDLOOP.
*   Display message confirming number of records updated
    IF gd_update GT 1.
      MESSAGE i003(zp) WITH gd_update 'Records updated'(002).
    ELSE.
      MESSAGE i003(zp) WITH gd_update 'Record updated'(003).
    ENDIF.
 
* Display Success Report
* **********************
*   Check Success table
    DESCRIBE TABLE it_success LINES gd_lines.
    IF gd_lines GT 0.
*     Display result report column headings
      PERFORM display_column_headings.
*     Display result report
      PERFORM display_report.
    ENDIF.
 
* Display Error Report
* ********************
*   Check errors table
    DESCRIBE TABLE it_error LINES gd_lines.
*   If errors exist then display errors report
    IF gd_lines GT 0.
*     Display errors report
      PERFORM display_error_headings.
      PERFORM display_error_report.
    ENDIF.
  ENDIF.
 
 
*&---------------------------------------------------------------------*
*&      Form  DISPLAY_COLUMN_HEADINGS
*&---------------------------------------------------------------------*
*       Display column headings
*----------------------------------------------------------------------*
FORM display_column_headings.
  WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
  SKIP.
  WRITE:2 'The following records updated successfully:'(013).
  WRITE:/ sy-uline(42).
  FORMAT COLOR COL_HEADING.
  WRITE:/      sy-vline,
          (10) 'Purchase Order'(004), sy-vline,
          (11) 'Old Netpr'(005), sy-vline,
          (11) 'New Netpr'(006), sy-vline.
  WRITE:/ sy-uline(42).
ENDFORM.                    " DISPLAY_COLUMN_HEADINGS
 
 
*&---------------------------------------------------------------------*
*&      Form  BDC_UPDATE
*&---------------------------------------------------------------------*
*       Populate BDC table and call transaction ME22
*----------------------------------------------------------------------*
FORM bdc_update.
  PERFORM dynpro USING:
      'X'   'SAPMM06E'        '0105',
      ' '   'BDC_CURSOR'      'RM06E-BSTNR',
      ' '   'RM06E-BSTNR'     wa_ekko-ebeln,
      ' '   'BDC_OKCODE'      '/00',                      "OK code
 
      'X'   'SAPMM06E'        '0120',
      ' '   'BDC_CURSOR'      'EKPO-NETPR(01)',
      ' '   'EKPO-NETPR(01)'  p_newpr,
      ' '   'BDC_OKCODE'      '=BU'.                      "OK code
 
* Call transaction to update customer instalment text
  CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
         MESSAGES INTO messtab.
* Check if update was succesful
  IF sy-subrc EQ 0.
    ADD 1 TO gd_update.
    APPEND wa_ekko TO it_success.
  ELSE.
*   Retrieve error messages displayed during BDC update
    LOOP AT messtab WHERE msgtyp = 'E'.
*     Builds actual message based on info returned from Call transaction
      CALL FUNCTION 'MESSAGE_TEXT_BUILD'
           EXPORTING
                msgid               = messtab-msgid
                msgnr               = messtab-msgnr
                msgv1               = messtab-msgv1
                msgv2               = messtab-msgv2
                msgv3               = messtab-msgv3
                msgv4               = messtab-msgv4
           IMPORTING
                message_text_output = w_textout.
    ENDLOOP.
 
*   Build error table ready for output
    wa_error = wa_ekko.
    wa_error-err_msg = w_textout.
    APPEND wa_error TO it_error.
    CLEAR: wa_error.
  ENDIF.
 
* Clear bdc date table
  CLEAR: bdc_tab.
  REFRESH: bdc_tab.
ENDFORM.                    " BDC_UPDATE
 
 
*---------------------------------------------------------------------*
*       FORM DYNPRO                                                   *
*---------------------------------------------------------------------*
*       stores values to bdc table                                    *
*---------------------------------------------------------------------*
*  -->  DYNBEGIN                                                      *
*  -->  NAME                                                          *
*  -->  VALUE                                                         *
*---------------------------------------------------------------------*
FORM dynpro USING    dynbegin name value.
  IF dynbegin = 'X'.
    CLEAR bdc_tab.
    MOVE:  name TO bdc_tab-program,
           value TO bdc_tab-dynpro,
           'X'  TO bdc_tab-dynbegin.
    APPEND bdc_tab.
  ELSE.
    CLEAR bdc_tab.
    MOVE:  name TO bdc_tab-fnam,
           value TO bdc_tab-fval.
    APPEND bdc_tab.
  ENDIF.
ENDFORM.                               " DYNPRO
 
 
*&---------------------------------------------------------------------*
*&      Form  DISPLAY_REPORT
*&---------------------------------------------------------------------*
*       Display Report
*----------------------------------------------------------------------*
FORM display_report.
  FORMAT COLOR COL_NORMAL.
* Loop at data table
  LOOP AT it_success INTO wa_success.
    WRITE:/      sy-vline,
            (10) wa_success-ebeln, sy-vline,
            (11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,
            (11) p_newpr, sy-vline.
    CLEAR: wa_success.
  ENDLOOP.
  WRITE:/ sy-uline(42).
  REFRESH: it_success.
  FORMAT COLOR COL_BACKGROUND.
ENDFORM.                    " DISPLAY_REPORT
 
 
*&---------------------------------------------------------------------*
*&      Form  DISPLAY_ERROR_REPORT
*&---------------------------------------------------------------------*
*       Display error report data
*----------------------------------------------------------------------*
FORM display_error_report.
  LOOP AT it_error INTO wa_error.
    WRITE:/      sy-vline,
            (10) wa_error-ebeln, sy-vline,
            (11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,
            (73) wa_error-err_msg, sy-vline.
  ENDLOOP.
  WRITE:/ sy-uline(104).
  REFRESH: it_error.
ENDFORM.                    " DISPLAY_ERROR_REPORT
 
 
*&---------------------------------------------------------------------*
*&      Form  DISPLAY_ERROR_HEADINGS
*&---------------------------------------------------------------------*
*       Display error report headings
*----------------------------------------------------------------------*
FORM display_error_headings.
  SKIP.
  WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
  SKIP.
  WRITE:2 'The following records failed during update:'(008).
  WRITE:/ sy-uline(104).
  FORMAT COLOR COL_HEADING.
  WRITE:/      sy-vline,
          (10) 'Purchase Order'(009), sy-vline,
          (11) 'Netpr'(010), sy-vline,
          (73) 'Error Message'(012), sy-vline.
  WRITE:/ sy-uline(104).
  FORMAT COLOR COL_NORMAL.
ENDFORM.                    " DISPLAY_ERROR_HEADINGS

<u><b>Check this link for creating BDC with Screen shots</b></u>

http://www.sapdevelopment.co.uk/bdc/bdc_recording.htm

<b>

Check this link on BDC doubts</b>

http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm

Reward all helpfull answers

Regards

Pavan