cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance datasource 0FI_AR_3

Former Member
0 Kudos

Dear experts,

I've appended MATNR to 0FI_AR_3 (RSA6), created project (CMOD), activated the extract structures but still cannot populate ZZMATNR in my extract structure (RSA3).

Appreciate if somebody could look at my codes below and tell me if they are ok..

data: l_s_DTFIAR_3 like DTFIAR_3,

lv_zzmatnr like bseg-matnr.

case i_datasource.

when '0FI_AR_3'.

loop at c_t_data into l_s_DTFIAR_3.

l_tabix = sy-tabix.

clear lv_zzmatnr.

select matnr into lv_zzmatnr from bseg where belnr = l_s_DTFIAR_3-belnr and bukrs = l_s_DTFIAR_3-bukrs and buzei = l_s_DTFIAR_3-buzei and gjahr = l_s_DTFIAR_3-gjahr.

if sy-subrc = 0.

l_s_DTFIAR_3-zzmatnr = lv_zzmatnr.

modify c_t_data from l_s_DTFIAR_3 index l_tabix.

endif.

endselect.

endloop.

endcase.

Thanks a lot for the help!

mael

Message was edited by: mael

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello mael,

could you provide some more info? The coding itself looks fine but you don't describe the error.

I would check the following things:

1. Is the CMOD project active?

2. Set a breakpoint into your coding and start RSA3. If the system doesn't stop in the exit, activate the include and activate the CMOD project again.

3. Debug your coding. Does your select work (Should do)? Is the DTFIAR_3 type correct? Does c_t_data look fine after the loop?`

4. If everything works fine look into the RSA6. You find a field list under the data source. Check if the flag 'Hide field' is turned off for ZZMATNR.

Best regards

Dirk

Former Member
0 Kudos

Thanks for the tips Dirk. Points awarded.

I have some follow-up questions. Extractor 0FI_AR_3 apparently only extracts records with values '01' from field BUZEI (in c_t_data) whereas MATNR is located in records with value '02' in BSEG. Fields BELNR, BUKRS and GJAHR are the same in both.

Is this the reason why I'm not getting ZZMATNR populated? I'm still green in abap.

Thanks for your help.

mael

Former Member
0 Kudos

Hi Mael,

Normally select statement will retrieve data from table based on the filters given in the where condition.

In your given statement, the records will be fetched from database only when all 4 conditions are satisfied.

Hope it is clear.

-Jayasudha