BIT: How to add a table inside a BIT Class

Attention: The actions on this post are done by changing the SAP standard code. Do it at your own risk.

If you ever investigate this topic you already know that it is technically impossible to add a table inside BIT Class.

The purpose of this post is to explain how can we make multiple changes in the system to create the illusion that a BIT Class has a table inside. With this solution you will be able to:

  • Ingest a BIT that contains a table inside
  • Store the information of the table
  • Display the table in the BIT Monitor

Example:

The BIT CLASS XPTO is required to have a table with the field ZZ_A, ZZ_B and ZZ_C

Step 1 – Create a custom structure with the fields of the table

Create the structure ZST_BIT_TABLE with the fields ZZ_A, ZZ_B and ZZ_C

Step 2 – Create a custom table to store the information received on the interface

Create the table ZBIT_TABLE with the fields:

Key (any field that can be used to link the information in the table with the BIT):

  • SourceTransactionType
  • SourceTransactionID

Other fields

  • .INCLUDE ZST_BIT_TABLE

Step 3 – Create 2 custom table types to be used in the interface

Table Type: ZTT_BIT_TABLE

  • .INCLUDE ZST_BIT_TABLE

Table Type ZTT_BIT with the following structure:

  • .INCLUDE /1FE/1XPTO0IT_API
  • ZTABLE type ZTT_BIT_TABLE

Step 4 – Copy the FM /1FE/XPTO_BIT_CREATE_API

In the new function module ZXPTO_BIT_CREATE_API, the type of the table “IT_BIT_IT” should be replaced from the /1FE/1XPTO0IT_API to the new ZTT_BIT.

Then a logic should be added, to populate the table ZBIT_TABLE.

Step 5 – Enhance the BIT Monitor

You can ask to a developer to display the table in the BIT monitor, to create the illusion that the table ZBIT_TABLE is inside a BIT.

For example add a new field on the ALV named “Counter” with the number of entries in the table ZBIT_TABLE related to the BIT displayed.

Then make it clickable so when an user click on it, it pops up a small ALV with the information of the table ZBIT_TABLE.

Leave a Comment