cancel
Showing results for 
Search instead for 
Did you mean: 

data source enhancements

Former Member
0 Kudos

hi experts ,please tell me the use of writing ABAP code while working with the enhancements

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As we will fetch data from standard data sources. Sometimes user will ask other fields data which are not available in the data sources. Then will go do the data source enhancement, the below:

In ECC go to RSA6 select the data source which you want to enhance, double click ok on Extract structure, and append the new fields to this, activate the same.

Now you have to write the code to fetch the data for newly added fields in the data source. You can take help from Abaper or you find code examples in sdn.

Write the code in CMOD u2013 click on your project u2013 select the respective FM, double click write the code.

Once you are done with your code you can check RSA3, the data is coming or not for new fields.

For more details you can refer the links above threads.

Hope it helps you.

Thanks

Riyez

Former Member
0 Kudos

excellent ,thanks for telling in step by step

Answers (2)

Answers (2)

former_member210571
Participant
0 Kudos

Hi,

The below link might help you why and how we do data source enhancements.

Previously we use write code in user exit but now a days we prefer BADI for enhancement

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80e32c8b-3d2d-2e10-2795-9e251437f...

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/3001894b-b1fb-2910-77ba-e80b6f2053b7

former_member182343
Active Contributor
0 Kudos

Hi Kumar,

I faced this issue...

I have done datasource enhancement to get Delivery costs(DMBTR) from EKBZ table to EKPO table structure.

In EKPO having 3 items - data is like this -

EBELN--- EBELLP POQTY

415150901--10 --- 30

415150901---20 --- 40

415150901---30 --- 40

In EKBZ data is like this

EBELN- EBELLPGR qty--Delivery cost(DMBTR)

415150901---10 -- 40--10

415150901--10 -- 40---20

415150901---20 - 205

After writing code in CMOD - code is

WHEN '2LIS_02_ITM'.

DATA :C_T_DATA1 type table of MC02M_0ITM,

WA_MC02M_0ITM LIKE MC02M_0ITM.

LOOP AT C_T_DATA INTO WA_MC02M_0ITM.

IF WA_MC02M_0ITM-ALIEF = '0'.

DELETE C_T_DATA index sy-tabix .

ENDIF.

ENDLOOP.

c_t_data1] = c_t_data[.

sort C_T_DATA1 by ebeln ebelp.

LOOP AT C_T_DATA1 INTO WA_MC02M_0ITM.

SELECT DMBTR FROM EKBZ INTO WA_MC02M_0ITM-ZZDMBTR

WHERE EBELN = WA_MC02M_0ITM-EBELN

AND EBELP = WA_MC02M_0ITM-EBELP

AND MENGE = WA_MC02M_0ITM-AKTWE.

MODIFY C_T_DATA1 FROM WA_MC02M_0ITM index sy-tabix transporting zzdmbtr .

endselect.

Hope it may helps you.