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: 

Batch input inside a ABAP Class method?

Former Member
0 Kudos

Can I do a simple batch input inside a ABAP Class method? Is it possible?

I'm new to objects and I need to do a batch input (Call Transaction) that was once in a report.

I can't use performs inside methods, so how shoul i do it?

Thanks

Mario

1 REPLY 1

MarcinPciak
Active Contributor
0 Kudos

Yes, you can do it. The method is nothing more for class but the same which subroutine (form) is for program.

So map all the subroutines from the program to methods, all global data objects to class attributes. Make all those which have to be exposed public and the ones to internal calculation private . Inside write your functional code (the one which BDC program uses in subroutines) and pretty much that's it.

Then create another local program which instantiates the class object and calls its public methods (like i.e adding new row to BDC table based on the parameters). BTW such BDC table should be a private class attribute (not to be changed directly, but only by class methods). Then at the end call the method (i.e. batch_entry ) which calls the transaction passing this BDC table.

Anyhow, by rewriting the code to OO one, you don't really gain to much in this respect. You can still work with your procedural coding, but for training I think this might be a good example.

Regards

Marcin