05-05-2006 11:26 AM
Hello Everybody
Plz tell me,
what is the basis for deciding method of uploading data(transaction/session/lsmw/bapi) ??
suppose
if we need to upload master data (eg. customer data), then which method will we prefer and why ??
Thanks
05-05-2006 11:30 AM
Rashmi,
In the order or preference
LSMW - As we don't have to do any customer coding here.
BAPI - Execution is faster and easy to find the errors
CALL TRANSACTION / SESSION - depends on your usage, if you the errors to be logged by the system, then go for Session, CALL TRANSACTION, you can do your own error handling.
Regards,
Ravi
Note : Please mark the helpful answers
05-05-2006 11:34 AM
Hi rashmi,
1. In my opinion, this can be the sequence,
of prefered methods, in their order :
a) LSMW = no coding, even functional consultant can do
b) BAPI = straight and simple (least coding, fastest)
c) Session = coding required, but automatic error handling
d) transaction = coding required, error handling also required
regards,
amit m.
05-05-2006 11:40 AM
Hai Rashmi
Better way is
1. Using LSMW
2. Using BDC Call Transaction.
also Iam sending LSMW Direst Input Method & BDC Call Transaction
for LSMW
Using Tcode MM01 -- Maintain the source fields are
1) mara-amtnr char(18)
2) mara-mbrsh char(1)
3) mara-mtart char(4)
4) makt-maktx char(40)
5) mara-meins char(3)
the flate file format is like this as follows
MAT991,C,COUP,Srinivas material01,Kg
MAT992,C,COUP,Srinivas material02,Kg
AMT993,C,COUP,Srinivas material03,Kg
MAT994,C,COUP,Srinivas material04,Kg
MAT995,C,COUP,Srinivas material05,Kg
goto Tcode LSMW
give Project Name
Subproject Name
object Name
Press Enter -
Press Execute Button
It gives 13 radio-Button Options
do the following 13 steps as follows
1) select radio-Button 1 and execute
Maintain Object Attributes
select Standard Batch/Direct Input
give Object -- 0020
Method -- 0000
save & Come Back
2) select radio-Button 2 and execute
Maintain Source Structures
select the source structure and got to click on create button
give source structure name & Description
save & Come Back
3) select radio-Button 3 and execute
Maintain Source Fields
select the source structure and click on create button
give
first field
field name matnr
Field Label material Number
Field Length 18
Field Type C
Second field
field name mbrsh
Field Label Industrial Sector
Field Length 1
Field Type C
Third field
field name mtart
Field Label material type
Field Length 4
Field Type C
fourth field
field name maktx
Field Label material description
Field Length 40
Field Type C
fifth field
field name meins
Field Label base unit of measurement
Field Length 3
Field Type C
save & come back
4) select radio-Button 4 and execute
Maintain Structure Relations
go to blue lines
select first blue line and click on create relationship button
select Second blue line and click on create relationship button
select Third blue line and click on create relationship button
save & come back
5) select radio-Button 5 and execute
Maintain Field Mapping and Conversion Rules
Select the Tcode and click on Rule button there you will select constant
and press continue button
give Transaction Code : MM01 and press Enter
after that
1) select MATNR field click on Source filed(this is the field mapping) select MATNR and press Enter
2) select MBRSH field click on Source filed(this is the field mapping) select MBRSH and press Enter
3) select MTART field click on Source filed(this is the field mapping) select MTART and press Enter
4) select MAKTX field click on Source filed(this is the field mapping) select MAKTX and press Enter
5) select MEINS field click on Source filed(this is the field mapping) select MEINS and press Enter
finally
save & come back
6) select radio-Button 6 and execute
Maintain Fixed Values, Translations, User-Defined Routines
Create FIXED VALUE Name & Description as MM01
Create Translations Name & Description as MM01
Create User-Defined Routines Name & Description as MM01
after that delete all the above three just created in the 6th step
FIXED VALUE --MM01
Translations --MM01
User-Defined Routines --MM01
come back
7) select radio-Button 7 and execute
Specify Files
select On the PC (Frontend) -- and click on Create button(f5)
give the path of the file like "c:\material_data.txt"
description : -
separators as select comma radiao- button
and press enter save & come back
😎 select radio-Button 8 and execute
Assign Files
Save & come back
9) select radio-Button 9 and execute
Read Files
Execute
come back
come back
10) select radio-Button 10 and execute
Display Imported Data
Execute and press enter
come back
Come back
11) select radio-Button 11 and execute
Convert Data
Execute
come back
Come back
12) select radio-Button 12 and execute
Display Converted Data
Execute & come back
13) select radio-Button 13 and execute
Start Direct Input Program
select the Program
select continue button
go with via physical file
give the lock mode as 'E'
and execute
For BDC Call Transaction
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
Thanks & Regards
Sreenivasulu P
05-05-2006 11:45 AM
hi srini
this is venkat
can u send me one example code for BAPI
regards venkat
05-05-2006 11:40 AM
05-05-2006 11:41 AM
HI
GOOD
THERE IS NO SUCH KIND OF PARAMETERS WHICH WILL DECIDE THAT WHICH METHOD YOU R GOING TO USE FOR THE DATA UPLOAD.ITS ALL DEPENDS UPON YOUR REQUIREMENT AND THE DECESSION TAKEN BY YOUR PROJECT MANAGER.
WE CAN USE MANY FUNCTIONALITIES TO DO OUR JOB BUT WE HAVE TO USE ONE,SO ITS ALL AS PER THE REQUIREMENT.
THANKS
MRUTYUN
05-05-2006 11:54 AM
Hi Rashmi,
The basis for deciding which method to upload the master data can be considered on the following things :
1. Customer Requirement.
2. Bulkiness of the data.
3. how much effort is required.
4. Whether error handling is to be done explicitly or automatically.
Detailed Description :
By the way the most preffered order now is :
<b>1. LSMW :</b> Latest tool and less effort / coding is required. It covers all the methods :
by standard Batch/ Direct input,
by Batch Input Recording,
by Buisness Object Method , and
IDoc ( Intermidiate Document) .
<b>2. BAPI :</b>
BAPI is an abbreviation used for Business Application Programming Interface. These are interfaces within the business framework to link SAP components to one another and SAP components with third-party components.
The SAP Business Objects are an essential part of the Business Framework and the prerequisites for interoperability. SAP Business Objects cover a broad range of R/3 business data and processes and can be accessed using BAPIs. The SAP Business Objects and their BAPIs thus provide an object-oriented view of R/3 business functionality.
<b>3. BDC :</b>
It can be done in two ways :
a ). Session : it handles error implicitly .
Transaction: error handling is explicit.
b ). Call transaction is 6 times faster than session .
c ). Session can handle multiple transactions while, call transaction can handle one transaction at a time.
d ) Session method is used to handle basically very lage amount of data .
Hope these points clarify your doubt .
Regards,
Kunal.