Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Re:Reg BDC's

Hi,

Iam very confused with BDC's,very new to this topic, i need any one's guidance from scratch,when to go to SHDB for recording ,when to write BDC program , I need different BDC example codes with explanations and steps

I hope experts u can help me

Tags:
Former Member
Former Member replied

hi,

Here enclosing the procedure on How to write BDC Programme using Session and Call transaction…

BDC Flow

Text file ---> Internal table ---> Database

File Functions

Upload --> Uploads from text file to internal table (displays the

popup to change the path)

Ws_upload ---> directly inputs from text file to internal table

download ---> downloads from internal table to text fine (populating

internal table with select statement)

Ws_download ---> directly downloads to the text file.

Modes of file types are: DAT, BIN and ASC

Structure of BDCDATA:

Program Name

Screen Number

Dynbegin (default 'X')

FNam

FVal

BDC is for transferring data from Non SAP system to SAP System.

This can be done in 3 methods:

1) Session Method

2) Call Transaction

3) Direct Input

In Session method, we can create a session and need to select the

session through SM35 transaction code. By clicking the process only

the transaction executes.

In Call transaction method, directly populate in database. There

are 3 modes ie., A, N and E (ie., All screens, no screens and error

screens)

Syntax: Call transction 'MM01' using bdcdata mode 'A/N/E'.

BASIC STEPS COMMON FOR SESSION AND CALL TRANSCATION METHODS

SESSION METHOD

1) Declaring internal table which you will be populating text file

information (ie., legacy data)

2) Creating internal table like BDCDATA.

3) Call upload function which we will be making some changes ie.,

file name, filetype (DAT, BIN, ASC) and tables.

4) Call function BDC_OPEN_GROUP. Remove comment for exporting,

client, key and user. The value for the user is sy-uname, key is

'X' and client is sy-mandt.

5) Loop at internal table

6) within the loop we will be having perform statements calling

subroutines (ie., screens)

7) Within the loop BDC_INSERT.

Changes in the function modules to remove comments for exporting,

tcode (transaction code) and table as BDCDATA.

Require to refresh BDCDATA.

8)Close the internal table loop using endloop

9)Call BDC_CLOSE_GROUP

10) Difine subroutines.

CALL TRANSACTION METHOD

1) Creating internal table from text information as input

2) Internal table for BDCDATA.

3) Call Upload function

4) Loop at internal table

5) refresh BDCDATA and write the subroutines

6) Syntax for Call transaction:

CALL TRANSACTION 'MM01' USING BDCDATA MODE 'A/N/E'.

7) Close the loop using endloop

8) Define subroutines.

regards,

pavan

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question