cancel
Showing results for 
Search instead for 
Did you mean: 

Enhancing 0vendor_attr Masterdata Datasource

Former Member
0 Kudos

Hi,

I need to add a field to existing <b>0vendor_attr</b> masterdata datasorce. The field that I want to add comes from the table <b>LFM1</b> and the field name is <b>WAERS</b>. I know the process how to append this field in the extract structure but I don't know how to write the code to fill the field for the exit in EXIT_SAPLRSAP_002 (include zxrus002). Can someone give me sample code where I can simply plug-in the table and field names. I would appreciate your help.

Thanks,

Rao.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rao,

in LFM1 you have more entries for one single vendor (it depends from different purchasing org.)..so, before the code, you have to know where this selection have to be done from a functional point of view !

It's enough to select (UP TO 1 ROWS) the first record found (maybe your WAERS doesn't change from one org to another one..) or something else ?!

Hope it helps!

Bye,

Roberto

Former Member
0 Kudos

Just FYI, the info you need is supplied by 0VEN_PURORG_ATTR datasource !

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Srinivas,

Thanks Srinivas, that was very helpful. I appreciate your help.

Rao.

Former Member
0 Kudos

· The name of the DataSource (0VENDOR_ATTR)

· The name of the extract structure (BIW_LFA1_S)

· The name of the field that was added to the structure (ZZACCTGRP)

· The name of the BW InfoSource (0VENDOR)

· The name of the R/3 table and field that contains the data you need (LFA1-KTOKK)

*********************************************************

Tables: LFA1. "vendor master data tabledata: l_tabix like sy-tabix.

case i_CHABASNM.*Enhancement of Vendor Master Record WHEN '0VENDOR'.

case i_datasource.

WHEN '0VENDOR_ATTR'.

data: l_s_BIW_LFA1_S like BIW_LFA1_S.

loop at i_t_data into l_s_BIW_LFA1_S.

l_tabix = sy-tabix.

select single * from lfa1 where LIFNR = l_s_BIW_LFA1_S-LIFNR

if sy-subrc = 0.

l_s_BIW_lfa1_s-ZZacctgrp = lfa1-ktokk.

modify i_t_data from l_s_BIW_lfa1_s index l_tabix.

endif.

endloop.

endcase.

endcase.

Former Member
0 Kudos

Hi Roberto,

Thanks for your prompt and fast reply. I think I am going to use the imformation that you provided(0ven_org_attr), which meets our requirements. I will give you full points for that info. However, I would appreciate if you or someone can provide me some ABAP code on how to fill a field. If I have the sample code I can learn or I may use that in the future. Again, thanks anyway.

Rao.