04-26-2008 12:31 PM
want to create BDC program(in SAP version ecc6.0) for transaction for CS01 (Create Material BOM). where in first screen i have 1st four fields and in second screen(in Material tab) I have many rows of data to be updated in table control where no of rows of data differ from material to material.
Can anybody suggest me with coding.....
thanks.
04-28-2008 3:02 PM
04-28-2008 6:58 PM
hi naresh,
pls see the below link
http://www.sap-img.com/abap/program-loads-the-bill-of-material.htm
Example :BDC Program Of BOM In Retail. ... CALL FUNCTION 'BDC_INSERT' EXPORTING TCODE = 'CS01' * POST_LOCAL = NOVBLOCAL * PRINTING = NOPRINT * SIMUBATCH ...
Go to the transaction SHDB.
Give the name for the recording.
Enter the transaction code for which u want the recording isto be done. ( CS01)
Navigate through the transaction by entering the required values and save the document.
The code is automatically generated for your recording.
This code can be used in your BDC program.
or follow this
hi,
recording is task of functional but if u required thengo tcode shdv and follow the steps.................
SHDB -> Opens an interface -> Click on New Recordings pushbutton from appn. toolbar -> Specify Recording Name -> Specify Tcode (MM01) -> Click on Continue -> Opens MM01 Screen -> Specify Sample Data -> Click on Select View pushbutton from appn. toolbar -> Opens an interface -> Select First view (Basic Data 1) -> Click on Continue -> Opens another interface -> Specify short description for the material -> Specify units of measurement -> Save -> Opens an interface with defined field and their values -> Save -> Come back -> Select Recording Object -> Click on Program pushbutton from appn. toolbar to autogenerate the BDC source code -> Opens an interface -> Specify Program Name -> Select Transfer From Recording radiobutton -> Click on Source Code pushbutton -> Opens SE38 Editor with autogenerated code -> Specify following code after include statement
since confusion also giving step by step
SHDB is the Transaction code to call Recording Method.
Navigations to use Recording Method:
-
SHDB -> Opens an interface -> Click on New Recordings pushbutton from appn. toolbar -> Specify Recording Name -> Specify Tcode (MM01) -> Click on Continue -> Opens MM01 Screen -> Specify Sample Data -> Click on Select View pushbutton from appn. toolbar -> Opens an interface -> Select First view (Basic Data 1) -> Click on Continue -> Opens another interface -> Specify short description for the material -> Specify units of measurement -> Save -> Opens an interface with defined field and their values -> Save -> Come back -> Select Recording Object -> Click on Program pushbutton from appn. toolbar to autogenerate the BDC source code -> Opens an interface -> Specify Program Name -> Select Transfer From Recording radiobutton -> Click on Source Code pushbutton -> Opens SE38 Editor with autogenerated code -> Specify following code after include statement:
include bdcrecx1.
DATA : BEGIN OF ITAB OCCURS 0,
STR(255),
END OF ITAB.
DATA ITAB1 LIKE MARA OCCURS 0 WITH HEADER LINE.
Specify following code after start-of-selection statement:
start-of-selection.
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = 'C:\COUP.TXT'
FILETYPE = 'ASC'
TABLES
DATA_TAB = ITAB.
LOOP AT ITAB.
SPLIT ITAB-STR AT ',' INTO ITAB1-MATNR ITAB1-MBRSH ITAB1-MTART
ITAB1-MEINS.
APPEND ITAB1.
ENDLOOP.
Specify Loop-Endloop statement for the bdc-dynpro, bdc-field and bdc_transaction statements as follows:
perform open_group.
LOOP AT ITAB1.
.
.
.
ENDLOOP
perform close_group.
-> Save -> Activate -> Execute -> Choose Call Transaction or Session method to process the datas.
The advantage of Recording Method is finally after executing the program, we can choose either Session method or Call Transaction method.
regards
karthik