Académique Documents
Professionnel Documents
Culture Documents
Code samples are intended for educational use only, not deployment. They are untested and
unsupported by SAP. SAP disclaims all liability to any person in respect to any damage that is
incurred, whether wholly or partially, from use of the code.
Applies To:
ABAP
Summary
This step-by-step code sample helps you upload data using BDC.
Procedure
Give the t-code shdb in the command field.
Give a name to the recording and the t-code you want to record.
E.g.:
Recording : ZMAT_UPLOAD
Transaction code : MM01
When you click save, it takes you to t-code (MM01) you would like to do recording for
upload.
Record carefully. Fill in the details you want to upload. In this case I have entered the
material no, industry sector, material type, material description and basic unit of measure.
Then the Transaction recorder – edit recording ZMAT_UPLOAD screen is displayed. You
can edit your recording or just save it and click back button.
Enter the program name say ZMAT_UPLOAD.Select the transfer from recording option.
Save it.Give the program title, type as executable program and click source code button
at the bottom.
include bdcrecx1.
start-of-selection.
perform open_group.
Perform close_group.
From the above code it is clear that recording has been created using matnr = my
material 10 , industry sector = p , material type = zoh , description = my material10 ,
basic unit of measure = g. For our case I have assumed industry sector and material type
to be constant and have not included in flat file.
The colored lines in the below code are the changes made to the sap generated program
, to upload our data.
*Programmed by : Kavitha
Bhuvaneswaran..................................*
report ZMAT_UPLOAD
no standard page heading line-size 255.
*types
declaration.........................................................
.................*
start-of-selection.
perform open_group.
endloop.
Perform close_group.
C:\Documents and
Settings\KAVITHA\Desktop\material.txt
If you are using the call transaction method you can select the run mode in the initial
screen itself. (see page 5).Then we must browse for the flat file.(see page 6).
SAP will not be held liable for any damages caused by using or misusing of the code and
methods suggested here, and anyone using these methods, is doing it under his/her own
responsibility.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the
content of the technical article, including any liability resulting from incompatibility between the
content of the technical article and the materials and services offered by SAP. You agree that you
will not hold SAP responsible or liable with respect to the content of the Technical Article or seek
to do so.
Copyright © 2004 SAP AG, Inc. All Rights Reserved. SAP, mySAP, mySAP.com,
xApps, xApp, and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP AG in
Germany and in several other countries all over the world. All other product,
service names, trademarks and registered trademarks mentioned are the
trademarks of their respective owners.