‎2006 Jul 25 11:32 AM
Dear All
i am new programmer in ABAP any one explain BDC concept
Thanks and Regards
Suresh
‎2006 Jul 25 11:32 AM
Use this Program....
report ZABSALES_ORDER no standard page heading line-size 255.
TABLES: vbak, vbap.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECTION-SCREEN BEGIN OF BLOCK salesblock WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1.
PARAMETERS : Order_ty LIKE vbak-auart DEFAULT 'OR'
modif id SC1,
Customer LIKE kuagv-kunnr OBLIGATORY VALUE CHECK,
Purchase LIKE vbkd-bstkd OBLIGATORY VALUE CHECK,
Material LIKE vbap-matnr OBLIGATORY VALUE CHECK,
Quantity LIKE rv45a-kwmeng OBLIGATORY VALUE CHECK.
SELECTION-SCREEN END OF BLOCK salesblock.
SELECTION-SCREEN END OF SCREEN 500.
CALL SELECTION-SCREEN 500.
*At selection-screen on Order_ty.
*IF Order_ty <> 'OR'.
MESSAGE E080(ZVIKALP).
ENDIF.
start-of-selection.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE'
'=UER1'.
perform bdc_field using 'VBAK-AUART'
Order_ty.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'VBKD-BSTKD'
Purchase.
perform bdc_field using 'KUAGV-KUNNR'
Customer.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'04/05'.
perform bdc_field using 'BDC_OKCODE'
'SICH'.
perform bdc_field using 'RV45A-KETDAT'
'06-05-2005'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'05-29-2005'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
Material.
perform bdc_field using 'RV45A-KWMENG(01)'
Quantity.
perform bdc_dynpro using 'SAPLSPO2' '0101'.
perform bdc_field using 'BDC_OKCODE'
'=OPT1'.
CALL TRANSACTION 'VA01' USING bdcdata
MODE 'N'
UPDATE 'A'
MESSAGES INTO messtab.
loop at messtab.
if messtab-msgtyp = 'S'.
FORMAT COLOR 5.
elseif messtab-msgtyp = 'E'.
FORMAT COLOR 6.
ENDIF.
write: / messtab-msgtyp, messtab-msgnr.
endloop.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'SC1'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
----
Start new screen *
----
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
----
Insert field *
----
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> ' '.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
‎2006 Jul 25 11:33 AM
report ZABSALES_ORDER no standard page heading line-size 255.
TABLES: vbak, vbap.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECTION-SCREEN BEGIN OF BLOCK salesblock WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1.
PARAMETERS : Order_ty LIKE vbak-auart DEFAULT 'OR'
modif id SC1,
Customer LIKE kuagv-kunnr OBLIGATORY VALUE CHECK,
Purchase LIKE vbkd-bstkd OBLIGATORY VALUE CHECK,
Material LIKE vbap-matnr OBLIGATORY VALUE CHECK,
Quantity LIKE rv45a-kwmeng OBLIGATORY VALUE CHECK.
SELECTION-SCREEN END OF BLOCK salesblock.
SELECTION-SCREEN END OF SCREEN 500.
CALL SELECTION-SCREEN 500.
*At selection-screen on Order_ty.
*IF Order_ty <> 'OR'.
MESSAGE E080(ZVIKALP).
ENDIF.
start-of-selection.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE'
'=UER1'.
perform bdc_field using 'VBAK-AUART'
Order_ty.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'VBKD-BSTKD'
Purchase.
perform bdc_field using 'KUAGV-KUNNR'
Customer.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'04/05'.
perform bdc_field using 'BDC_OKCODE'
'SICH'.
perform bdc_field using 'RV45A-KETDAT'
'06-05-2005'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'05-29-2005'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
Material.
perform bdc_field using 'RV45A-KWMENG(01)'
Quantity.
perform bdc_dynpro using 'SAPLSPO2' '0101'.
perform bdc_field using 'BDC_OKCODE'
'=OPT1'.
CALL TRANSACTION 'VA01' USING bdcdata
MODE 'N'
UPDATE 'A'
MESSAGES INTO messtab.
loop at messtab.
if messtab-msgtyp = 'S'.
FORMAT COLOR 5.
elseif messtab-msgtyp = 'E'.
FORMAT COLOR 6.
ENDIF.
write: / messtab-msgtyp, messtab-msgnr.
endloop.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'SC1'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
----
Start new screen *
----
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
----
Insert field *
----
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> ' '.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
‎2006 Jul 25 11:33 AM
report ZABSALES_ORDER no standard page heading line-size 255.
TABLES: vbak, vbap.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECTION-SCREEN BEGIN OF BLOCK salesblock WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1.
PARAMETERS : Order_ty LIKE vbak-auart DEFAULT 'OR'
modif id SC1,
Customer LIKE kuagv-kunnr OBLIGATORY VALUE CHECK,
Purchase LIKE vbkd-bstkd OBLIGATORY VALUE CHECK,
Material LIKE vbap-matnr OBLIGATORY VALUE CHECK,
Quantity LIKE rv45a-kwmeng OBLIGATORY VALUE CHECK.
SELECTION-SCREEN END OF BLOCK salesblock.
SELECTION-SCREEN END OF SCREEN 500.
CALL SELECTION-SCREEN 500.
*At selection-screen on Order_ty.
*IF Order_ty <> 'OR'.
MESSAGE E080(ZVIKALP).
ENDIF.
start-of-selection.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE'
'=UER1'.
perform bdc_field using 'VBAK-AUART'
Order_ty.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'VBKD-BSTKD'
Purchase.
perform bdc_field using 'KUAGV-KUNNR'
Customer.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'04/05'.
perform bdc_field using 'BDC_OKCODE'
'SICH'.
perform bdc_field using 'RV45A-KETDAT'
'06-05-2005'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'05-29-2005'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
Material.
perform bdc_field using 'RV45A-KWMENG(01)'
Quantity.
perform bdc_dynpro using 'SAPLSPO2' '0101'.
perform bdc_field using 'BDC_OKCODE'
'=OPT1'.
CALL TRANSACTION 'VA01' USING bdcdata
MODE 'N'
UPDATE 'A'
MESSAGES INTO messtab.
loop at messtab.
if messtab-msgtyp = 'S'.
FORMAT COLOR 5.
elseif messtab-msgtyp = 'E'.
FORMAT COLOR 6.
ENDIF.
write: / messtab-msgtyp, messtab-msgnr.
endloop.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'SC1'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
----
Start new screen *
----
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
----
Insert field *
----
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> ' '.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
‎2006 Jul 25 11:35 AM
Hai Suresh Kumar
Go through the following Document & Examples
Just check these links.
BDC SESSION
CALL TRANSACTION
CALL DIALOG
What is BDC or batch input
The Batch Input is a SAP technic that allows automating the input in transactions. It lies on a BDC (Batch Data Commands) scenario.
BDC functions:
・ BDC_OPEN_GROUP : Opens a session group
・ BDC_CLOSE_GROUP : Closes a session
・ BDC_INSERT : Insert a BDC scenario in the session
・ The ABAP statement "CALL TRANSACTION" is also called to run directly a transaction from its BDC table.
It runs the program RSBDCSUB in order to launch automatically the session. The session management is done through the transaction code SM35.
The object itself is maintanable through the transaction SE24.
BDC methods:
Method
Description
Parameters
OPEN_SESSION
Opens a session
SUBRC (Return Code ? 0 OK)
SESSIONNAME (Session to be created)
CLOSE_SESSION
Closes a session
None
RESET_BDCDATA
Resets the BDC Internal Table...
None. Normally, for internal purpose
BDC_DYNPRO
Handles a new screen
PROGNAME (Name of the program)
DYNPRONR (Screen Number)
BDC_FIELD
Puts a value on the screen
FIELDNAME (Name of the field)
FIELDVALUE (Value to be passed)
CONSTRUCTOR
Constructor - Initializes NO_DATA
NODATA (No data character). The constructor is called automatically when the object is created.
RUN_SESSION
Launches a session with RSBDCBTC
None
CALL_TRANSACTION
Calls a transaction with the current BDC Data
MODE (Display Mode)
UPDATE (Update Mode)
TCODE (Transaction to be called)
BDC_INSERT
Inserts the BDC scenario in the session
TCODE (Transaction to be called)
BDC techniques used in programs:
1) Building a BDC table and calling a transaction,
2) Building a session and a set of BDC scenarios and keeping the session available in SM35,
3) Building a session and lauching the transaction right after closing the session.
-
BDC using Call Transaction
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 (See code example).
The full procedure for creating a BDC program is as follows:
-
What is the difference between batch input and call transaction in BDC?
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.
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
-
BATINPUT/DIRECT INPUT
-
A: Batch-inputs can not be used to fill the "delivery due list" screen because it is not a dynpro. This is a standard SAP report. A SAP report (check with "System -> Status") may be called using SUBMIT sentence with the appropriate options . It is preferred to call a report than create a Batch-input program.
GO THROUGH THIS LINK
http://www.guidancetech.com/people/holland/sap/abap/zzsni001.htm
check with this code
include bdcrecx1.
tables : mara.
data : begin of it_mara occurs 0,
matnr like mara-matnr,
mbrsh like mara-mbrsh,
mtart like mara-mtart,
maktx like makt-maktx,
meins like mara-meins,
end of it_mara.
start-of-selection.
perform upload_data.
perform open_group.
loop at it_mara.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
it_mara-matnr.
perform bdc_field using 'RMMG1-MBRSH'
it_mara-mbrsh.
perform bdc_field using 'RMMG1-MTART'
it_mara-mtart.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'MAKT-MAKTX'
it_mara-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
it_mara-meins.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
perform bdc_transaction using 'MM01'.
endloop.
perform close_group.
&----
*& Form upload_data
&----
text
----
--> p1 text
<-- p2 text
----
FORM upload_data .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'c:\mat_bdc.txt'
FILETYPE = 'ASC'
TABLES
DATA_TAB = it_mara.
IF SY-SUBRC = 0.
SORT IT_MARA BY MATNR.
ENDIF.
ENDFORM. " upload_data
flat file structure is
PRANIT_011 CCOUP This is Testing material kg
PRANIT_012 CCOUP This is Testing material kg
PRANIT_013 CCOUP This is Testing material kg
PRANIT_014 CCOUP This is Testing material kg
PRANIT_015 CCOUP This is Testing material kg
when your selecting views
this particular material will belongs to Po/Sales or some other areas .
when you select basic 1 --it gives description
select basic 2 -- it gives tax ,amount, base unit of measurement
Example 2)
report Z_CALLTRANS_VENDOR_01
no standard page heading line-size 255.
Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of it_lfa1 occurs 0,
KTOKK like lfa1-ktokk,
NAME1 like lfa1-name1,
SORTL like lfa1-sortl,
LAND1 like lfa1-land1,
end of it_lfa1.
End generated data section ***
data : it_bdc like bdcdata occurs 0 with header line.
*DATA: IT_MESSAGES TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE.
*DATA: LV_MESSAGE(255).
data : it_messages like bdcmsgcoll occurs 0 with header line.
data : V_message(255).
data : V_flag.
data : V_datum1 type sy-datum.
data : begin of it_mesg occurs 0,
message(100),
end of it_mesg.
*V_datum1 = sy-datum-1.
parameters : P_Sess like APQI-GROUPID.
start-of-selection.
perform Get_data.
*perform open_group.
loop at it_lfa1.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-KTOKK'
it_lfa1-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-LAND1'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
perform bdc_field using 'LFA1-NAME1'
it_lfa1-name1.
perform bdc_field using 'LFA1-SORTL'
it_lfa1-sortl.
perform bdc_field using 'LFA1-LAND1'
it_lfa1-land1.
call transaction 'XK01' using it_bdc
mode 'N'
update 'S'
messages into it_messages.
if sy-subrc <> 0.
if V_flag <> 'X'.
perform open_group.
V_flag = 'X'.
endif.
perform bdc_transaction. "using 'XK01'.
endif.
perform format_messages.
refresh : it_bdc,it_messages.
.
endloop.
if V_flag = 'X'.
perform close_group.
endif.
&----
*& Form Get_data
&----
text
----
--> p1 text
<-- p2 text
----
FORM Get_data .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\srinu_vendor.txt'
FILETYPE = 'DAT'
TABLES
DATA_TAB = it_lfa1
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " Get_data
&----
*& Form bdc_dynpro
&----
text
----
-->P_0061 text
-->P_0062 text
----
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR it_BDC.
it_BDC-PROGRAM = PROGRAM.
it_BDC-DYNPRO = DYNPRO.
it_BDC-DYNBEGIN = 'X'.
APPEND it_BDC.
ENDFORM.
----
Insert field *
----
FORM BDC_FIELD USING FNAM FVAL.
CLEAR it_BDC.
it_BDC-FNAM = FNAM.
it_BDC-FVAL = FVAL.
APPEND it_BDC.
ENDFORM.
&----
*& Form format_messages
&----
text
----
--> p1 text
<-- p2 text
----
FORM format_messages .
loop at it_messages.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = it_messages-MSGID
LANG = 'EN'
NO = it_messages-MSGNR
V1 = it_messages-MSGV1
V2 = it_messages-MSGV2
V3 = it_messages-MSGV3
V4 = it_messages-MSGV4
IMPORTING
MSG = V_message
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write : / V_message.
clear : V_message.
endloop.
ENDFORM. " format_messages
&----
*& Form open_group
&----
text
----
--> p1 text
<-- p2 text
----
FORM open_group .
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = P_Sess
HOLDDATE = V_datum1
KEEP = 'X'
USER = SY-UNAME
.
IF SY-SUBRC = 0.
write : / 'Session Creating wit Name : ',P_Sess.
ENDIF.
ENDFORM. " open_group
&----
*& Form close_group
&----
text
----
--> p1 text
<-- p2 text
----
FORM close_group .
CALL FUNCTION 'BDC_CLOSE_GROUP'.
ENDFORM. " close_group
&----
*& Form bdc_transaction
&----
text
----
-->P_0132 text
----
FORM bdc_transaction. "USING VALUE(P_0132).
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'XK01'
POST_LOCAL = NOVBLOCAL
PRINTING = NOPRINT
SIMUBATCH = ' '
CTUPARAMS = ' '
TABLES
DYNPROTAB = it_bdc
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " bdc_transaction
Regards
Sreenivasulu P
‎2006 Jul 25 11:37 AM
Hello,
BDC (Batch Data Communication) is used to transfer large amount of data that is available in electronic form. It uses the normal SAP transaction codes to transfer the data.
Two types of methods are offered by SAP for BDC.
1. Batch-input session method (Classical method)
In this method, the data that is read by the BDC is stored in a batch-input session and the session needs to be executed to run the transactions in the session. It supports restart-capability and detailed logging facility. Also it helps in the management of the sessions as well correcting/re-processing the sessions that contain errors.
A session is a collection of transaction data for one or more transactions and can also be executed in the background.
2. Call Transaction method
This method uses the ABAP statement CALL TRANSACTION USING . to run a transaction but doesnt create a session. Thus it offers faster processing but with less support for error recovery and batch input management.
Hope the above helps you.
Regards
Anurag
Regards
Anurag
‎2006 Jul 25 11:39 AM
Hi Suresh,
As u r new to BDC jus try like this- BDC is Batch Data Communication which is used to transfer data frm SAP to SAP as well as SAP to NON-SAP system.
This is done using recording using TXN SHDB.
Just go in TXN SHDB write any TXN like FB50, VA01, ME21, ME41, MIGO, IW51, IW31, MM01, MB1A, VK11, VF01, VL01 so on... and enter ne name for it like ZFB50 start recording whatever steps u'll perform will return as a BDC with Prog and field names going back again on TXN SHDB u'll see a session of name
ZFB50 and also an option of program and Function Module written on the application toolbar jus click on ne of them it will create a prog or FM based on what u had clicked and hence u can run it...
Hope this helps u.
Regards,
Seema.
‎2006 Jul 25 11:43 AM
Open the transaction SHDB & do recording of ur tranaction.
After that u can make program or function module of that recording.
There r two methods
transaction method & session method.
‎2006 Jul 25 11:47 AM
Hi Suresh,
Chk out the content based on BDC or chk this link
http://www.sap-img.com/bdc.htm
Batch Data Communication or BDC is a batch interfacing technique that SAP developed. It is mainly used for uploading data into the SAP R/3 system. BDC works by simulating the user input from transactional screen via an ABAP program.
The data input data file will come in the form of a flat file which the user save as file type txt file or prn file from the Microsoft Excel program. An Abaper will create a program to read the text file and upload into the SAP system.
Normally, the tcode SHDB will be used to record the transaction code the user used. After, the simulation, the Abaper can generate a sample program and modify from there. It makes the programming easier and faster.
For a BDC upload you need to write a program which created BDC sessions.
Steps:
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.
These are all my finds . Might be it will be useful to you.
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).
Batch
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.
Reward points if helpful.
Regards,
Harini
‎2006 Jul 25 12:17 PM
Hi,
Have a look at these good links-
<b>BDC</b>
http://www.sap-img.com/bdc.htm
www.sappoint.com/abap/bdcconcept.pdf
www.sap-img.com/abap/learning-bdc-programming.htm
www.sap-img.com/abap/question-about-bdc-program.htm
www.sapdevelopment.co.uk/bdc/bdchome.htm
www.planetsap.com/bdc_main_page.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
<b>Table control in BDC</b>
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Mark useful answers.
Regards,
Tanuja.