No real sample code to go through. I suggest reading the very well done Wiki by Markus Klein (sp?) about it. Basically, what you have is...
screen structure <-> conversion class (in/out) <-> infotype structure
The conversion classes act as the middle-man between the front and back end. You can put coding into your in/out conversion classes to perform functionality you need...such as formatting, or checks, etc. You could have a screen structure that encompasses two infotypes for example and then in the conversion classes, you could pass the needed fields to their correct infotype structure.
As a real world example, for ESS, we have a custom infotype for some additional dependent information. We added these fields to the SCREEN structure of our ESS service for dependents. Then, in our conversion class, we take those fields and put them into the custom infotype structure we have while letting all the other fields go on into the standard infotype. This is the idea of "de-coupled"....the backend structure is not dictated by what's on the screen and vice-versa.
Hope this helps.
The best "sample" code I found for this was looking at several of SAPs own standard code examples.....especially the country specific services and such for ESS. I didn't really "get" the conversion classes either until I poked around and looked at how SAP did it. Hope this helps.
Add a comment