Skip to Content

This document explains about enhancing a datasource with new ZZ field and gets it populated from the underlying database table.

This document has been explained with an example. You can create new one based on this document.

Datasource information:

Generic datasource                                : ZBI_EKKO_AK

Datasource built upon table                    : EKKO

Datasource type                                    : Transaction datasource

New field name in datasource                 : ZZTAXJRDN

Source from which new field fetches data : EKPO-TXJCD.

Kindly follow the procedure as shown in the screenshots below to get it done which is self explanatory:

Got T-code: RSA6

Select the datasource for which we need to enhance a new field.

Img2.JPG

If the extract structure does not have append structure in it, then create new append structure.

Click on “Enhance extract structure”.

Img3.JPG

Give your own naming convention starts with Z.

Img4.JPG

Enter short description.

Img5.JPG

We need to include the below mentioned field in the datasource from the table EKPO.

Img6.JPG

Enter the unique component name starts with ZZ.

Component type is Field name (TXJCD) from EKPO.

Img7.JPG

Activate the append structure upon completion.

If append structure already exist  in extract structure, then include new filed in that existing append structure.

Again got RSA6 and select your datasource and click on display.

Img9.JPG

It shows that newly created field is shown in the datasource.

But the hide field and Field only are marked. So, we need to uncheck both the fields. Or else those fields will not be replicated to BW side.

Img10.JPG

Uncheck those two fields.

Save the datasource.

Img12.JPG

You can confirm the same from the extract structure created for this datasource.

Img13.JPG

We have done with the creation of new filed in the datasource. Now we need to populate the field with the values from the table field EKPO- TXJCD which is from different table.

Goto t-code: CMOD.

Get the project in which the Enhancement RASP0001 is assigned. Click on display.

Note: Enhancement RASP0001 can be assigned to only one project. So, we need to search for that project.

Img15.JPG

Click on Components.

Img16.JPG

You can see four function calls. Each function call is intended for different datasource type.

EXIT_SAPLRSAP_001 – for Transaction datasource enhancement.

EXIT_SAPLRSAP_002 – for Attribute datasource enhancement.

EXIT_SAPLRSAP_003 – for Text datasource enhancement

EXIT_SAPLRSAP_004 – for Hierarchy datasource enhancement

Double click the first function since we are enhancing transactional datasource.

Img17.JPG

In the source code tab Double click on include program as shown below:

Img24.JPG

And create the code part as shown below.

TABLES: ekpo.
DATA: l_s_icctrcst LIKE s001biws,
      l_counter,
      l_s_icctract
LIKE icctract,
      l_s_icctrsta
LIKE icctrsta,
      l_tabix     
LIKE sy-tabix.
CASE i_datasource.

  WHEN ‘ZBI_EKKO_AK’.

    DATA:  l_s_zoxid30165 LIKE zoxid30165.

    LOOP AT c_t_data INTO l_s_zoxid30165.
      l_tabix = sy-tabix.

      SELECT SINGLE * FROM ekpo
       
WHERE ebeln = l_s_zoxid30165-ebeln.

      IF sy-subrc = 0.
        l_s_zoxid30165-zztaxjrdn = ekpo-txjcd.
       
MODIFY c_t_data FROM l_s_zoxid30165 INDEX l_tabix.
     
ENDIF.

    ENDLOOP.

*WE CAN INCLUDE MANY DATASOURCE LIKE THIS HERE
ENDCASE.

Activate the include program after completion of coding and come out of the screen.

Now its time for testing to check whether the field is getting populated with values.

Goto t-code RSA3.

Enter the datasource name and some entries for particular document number which contains value for newly added field. Click on execute.

Img26.JPG

It extracted one entry from the table EKKO.

Img27.JPG

Click on ALV grid to display the record.

Img28.JPG

The newly added field “Tax jurisdiction” got populated with value from the table EKPO.

Img29.JPG

We can confirm the entry from the table EKPO.

Img30.JPG

After completion of above steps, we can proceed with replicating the datasource from BW and assign new info-object for this newly added field.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply