Hai,
I am trying to generate 1 report to display min amd max lot size from recipe.for a range of materials of a particular plant and also if the materials have bulk mat as comp, i have to display min and max lot size of that also below its header mat.
I have used AFKO table to pick up min and max lot size.
But i am not able to dispaly the lot size for all the range of materials.
May be my logic to read and display is wrong. please help me.
The code to read and display is as below.
i_finaln int tab has al the i/p materials.
i_int int tab has min and max lot size
i_makt has comp description
i_total has al the components of materials
i_mid has lot size data for components
FORM process_data.
DATA:v_tabix TYPE sy-tabix.
CLEAR:w_int,
w_final.
LOOP AT i_final INTO w_final.
v_tabix = sy-tabix.
READ TABLE i_int INTO w_int WITH KEY matnr = w_final-matnr.
IF sy-subrc IS INITIAL.
w_final-plsvn = w_int-plsvn.
w_final-plsvb = w_int-plsvb.
MODIFY i_final FROM w_final INDEX v_tabix.
CLEAR:v_tabix,
w_final,
w_int.
ENDIF.
ENDLOOP.
CLEAR:w_mid,
w_makt,
w_total.
LOOP AT i_total INTO w_total.
v_tabix = sy-tabix.
READ TABLE i_makt INTO w_makt WITH KEY idnrk = w_total-idnrk.
IF sy-subrc IS INITIAL.
READ TABLE i_mid INTO w_mid WITH KEY idnrk = w_makt-idnrk.
IF sy-subrc IS INITIAL.
w_total-plsvn = w_mid-plsvn.
w_total-plsvb = w_mid-plsvb.
w_total-maktx = w_makt-maktx.
MODIFY i_total FROM w_total INDEX v_tabix.
CLEAR:v_tabix,
w_makt,
w_mid,
w_total.
ENDIF.
ENDIF.
ENDLOOP.
CLEAR:w_f,
w_final,
w_total.
MOVE i_final TO i_f.
REFRESH:i_final.
LOOP AT i_f INTO w_f.
v_tabix = sy-tabix.
APPEND w_f TO i_final.
READ TABLE i_mast INTO w_mast WITH KEY matnr = w_f-matnr.
IF sy-subrc IS INITIAL.
READ TABLE i_total INTO w_total WITH KEY idnrk = w_mast-idnrk.
if sy-subrc IS INITIAL.
w_final = w_total.
APPEND w_final TO i_final.
Please help me....