cancel
Showing results for 
Search instead for 
Did you mean: 

Populating additional fields through exit

Former Member
0 Kudos

Hi,

I need help creating a simple user exit to populate fields I added to a datasource.

Generic Datasource uses a view that contains one field belnr from table RBKP.

I enhanced the structure with append to add fields a, b, c.

Data for a,b,c has to come from table EKBE based on the common field belnr AND the following conditions:

EKBE-c = ‘b’ and

EKBE-C = ‘2’

If the value of blrn doesn exist in ekbe, no need to populate additional fields.

Please help create the user exit. Not an include…I have to use a program.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

data:begin of itab occurs 0,

belnr type ekbe-belnr,

a type ekbe-a,

b type ekbe-b,

c type ekbe-c,

end of itab.

select belnr a b c from ekbe into itab for all entries in e_t_data where c ='b' and c = '2'.

data:i_tab like standard table of e_t_data with header line.

i_tab[] = e_t_data[].

loop at i_tab.

read table itab with key belnr = i_tab-belnr.

i_tab-a = itab-a.

i_tab-b = itab-b.

i_tab-c = itab-c.

modify i_tab index sy-tabix.

endloop.

e_t_data[] = i_tab[].

regards

pls assign points if helpful.

Former Member
0 Kudos

Thanks for your response. I need to accomplish this using sub-routines. Using the format with FORM and ENDFORM statements. How would the approach be different.

Thanks,