Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP coding in LSMW

Former Member
0 Kudos

Hi All,

A)Is it possible to write ABAP coding in LSMW, if yes where can we do this. and

B)During the First Step of LSMW we come across 1. Standard/Batch Direct Input

2.Batch input recording

3.Business Object Method (BAPI)

4.IDOC(intermediate document)

which one to use and when to use?

C) what are the advantages/disadvantages of LSMW compared to other data transfer methods like BDC.

please let me know the answers for above.

useful answers will be rewarded for the same.

Regards,

Yellappa.

11 REPLIES 11

Former Member
0 Kudos

Hi,

A) Yes. you can write routines,conversion in LSMW in 6th step.

B)Depends on the client requirement (Business requirement)

C) It is flexible rather than BDc, No programming knowlege required, So Functional consultants can also setup LSMW.

Regards

Bhupal Reddy

0 Kudos

Hi Bhupal,

you are saying that we can write write subroutines and conversion routines. can we do the processing in that as we do in BDC.

also Can you please explain the difference between the four methods like BAPI, IDOC etc and in performance wise which one would be better

Regards,

Yellappa.

rahulkavuri
Active Contributor
0 Kudos

hi u can do it during

A) the field mapping step, for every field we will have EDITOR and there we can write the code

B) batch input recording, this makes things easier, depensing on the level of comfort level people use others

C) if u want to use complex coding then we shud gor for BDC's and in case of urgent attention if u want to avoid the workflow process then also we need to use LSMW over BDC's and directly export

We generally use LSMW in case of updation of large databases

https://forums.sdn.sap.com/click.jspa?searchID=571986&messageID=2480758

award points if found helpful

0 Kudos

Hi Rahul,

How do we handle the errors in LSMW. Can we schedule it in background.

Regards,

Yellappa.

0 Kudos

hi

we can schedule LSMW background job in SM35, and if at all any errors occured we can get them in LOG created

errors occured in the log show the reason for error

award points if found helpful

0 Kudos

Hi Rahul,

I awarded the points for your helpful answers.

Can you answer the questions i asked to Mr. Bhupal and Mr. Ashvendar.

Regards,

Yellappa.

Former Member
0 Kudos

Hi Yellappa,

A) You can write ABAP code in LSMW. Go to following step "Maintain Field Mapping and Conversion Rules". Just write click on a filed in change mode & choose option "INSERT RULE". It will give you one popup screen. In this popup screen choose option "ABAP Code". Here you can write your code.

Ashven

0 Kudos

Hi Ashvender,

Is the ABAP code in LSMW only for input validation or we can do our own coding kinding of thing.

Regards,

Yellappa

0 Kudos

yes we can write coding in LSMW .

U can capture the error records & download it in .txt or .xls or .csv files by writing coding in End of processing block in Maintain field mapping & conversion rules step.

U can declare datas as in se38 also in global data definition & declaration block.

U can validate ur input append it in internal table & process it.

to capture error & continue the process we use skip_record.

check it.

0 Kudos

hi

for q posed to ashvinder, its used only for validation of the input records and their corresponding processing, i will explain a simple scenario,

1. if u want to transfer data a part of which has already been created in the system. You

want to decide at runtime whether the data is created or changed.

u can write this coding in corresponding field

2. You want to "skip" a record depending on a certain condition, i.e. this record shall not be converted and transferred to the output file.

3. Duplicate a Record

If want complex pricing procedures u cant do that in LSMW, u need to go for BDC's

for ur question about what to use, BAPI or IDOC, check this link

http://www.sap-img.com/abap/ale-bapi.htm

http://searchsap.techtarget.com/generic/0,295582,sid21_gci1089362,00.html?bucket=ETA&topic=299357

award points if found helpful

Message was edited by:

Rahul Kavuri