Skip to content

Source: Inline

Nuno Godinho edited this page May 20, 2019 · 1 revision

The INLINE source type is as simple as it gets. If you like math, we can say it implements the Identity function: it returns what it gets.

It is used for all those cases in which the program already has the needed data.

Examples

  • The DB format expects just a table name as data. This is a very common scenario in which the inline content will simply be used to provide the table name to it;
  • We have XML data in a string variable. We use the INLINEcontent to provide this data to the XML format.

How to use it

It is implemented in class ZCL_ABAK_SOURCE_INLINE.

DATA o_source_inline TYPE REF TO zcl_abak_source_inline.
CREATE OBJECT o_source_inline
  EXPORTING
    i_content = 'Hello world'.

And then you feed it to ZCL_ABAK_FACTORY=>GET_CUSTOM_INSTANCE() together with an instance to a FORMAT class.

Use GET_CUSTOM_INSTANCE() only if really needed

Using custom components is the only situation in which you need to explicitly instantiate these classes. If you're using built-in SOURCE and FORMAT types this will be automatically done for you by the other factory static methods.

Clone this wiki locally