cancel
Showing results for 
Search instead for 
Did you mean: 

Data source Enhancement Code Samples

Former Member
0 Kudos

Hi,

I am new to SDN. Glad to meet you all.

I have to work on Data source Enhancements. I am little bit aware of the steps, but very poor at ABAP. So, I request you to provide some code samples with detail explanation.

Thanks in advance,

Aarthi,

aarthi.sap@gmail.com

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

data: l_s_icctrcst like icctrcst,

l_s_icctract like icctract,

l_s_icctrsta like icctrsta,

l_tabix like sy-tabix.

case i_datasource. */ in BW 1.2B case i_isource.

when '0CO_OM_CCA_1'.

loop at c_t_data into l_s_icctrcst.

l_tabix = sy-tabix.

select single * from z0001 where kokrs = l_s_icctrcst-kok

and kostl = l_s_icctrcst-kostl.

if sy-subrc = 0.

l_s_icctrcst-zfield1 = z0001-zfield1.

l_s_icctrcst-zfield2 = z0001-zfield2.

modify c_t_data from l_s_icctrcst index l_tabix.

endif.

endloop.

when '0CO_OM_CCA_2'.

...

when '0CO_OM_CCA_3'.

...

when others.

exit.

endcase.

Former Member
0 Kudos

Hi DST,

Thank you for your information.

I am trying to figure out the solution for my problem from your information.

Thanks,

Aarthi

aarthi.sap@gmail.com

Former Member
0 Kudos

Hi,

Enhancement means in the SAP given datasource If you want to add extra fields.

The procedure is like below.

Take the datasource in which you enhance.

1. If you enhancing in the LO datasaource, take the aprapriate communication strucute append the structure in that structure add the fields you wnat enhance.

If you are enhancing other than LO you take extract structure append the structure and add the fields in that structure.

2. Goto LBWE Tcode take the option called "Maintain Extract structure" take the fields which you enhanced from pool take push in to extract strucure.

If you enhancing other than LO no need to do this.

3. Goto RSA6, take datasource, goto change mode. The enhanced fields Hide option checked, reomove that tick and save it.

4. Goto "CMODE" tcode, If project is already created for that enhancement goto disply mode. If the project is not created give the project name created and give the enhancemet name as "RSAP0001" and save it.

in the component you can find 4 Function modules

EXIT_SAPLRSAP_001 -> Transaction Data

EXIT_SAPLRSAP_002 -> masterdata attributes

EXIT_SAPLRSAP_003 -> Master data Texts

EXIT_SAPLRSAP_004 -> Masterdata Hirarchies.

Take the apprapriate FM and double click on it

there you can find Include name. If you double click on it you can find ABAP editor.

there we have to write the code

example code will be like below.

data: l_s_icctrcst like icctrcst,

l_s_icctract like icctract,

l_s_icctrsta like icctrsta,

l_tabix like sy-tabix.

case i_datasource. */ in BW 1.2B case i_isource.

when '0CO_OM_CCA_1'.

loop at c_t_data into l_s_icctrcst.

l_tabix = sy-tabix.

select single * from z0001 where kokrs = l_s_icctrcst-kok

and kostl = l_s_icctrcst-kostl.

if sy-subrc = 0.

l_s_icctrcst-zfield1 = z0001-zfield1.

l_s_icctrcst-zfield2 = z0001-zfield2.

modify c_t_data from l_s_icctrcst index l_tabix.

endif.

endloop.

when '0CO_OM_CCA_2'.

...

when '0CO_OM_CCA_3'.

...

when others.

exit.

endcase.

This is example code.

Thaks

DST