Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

reg.reports

Former Member
0 Likes
375

Hi Experts,

I written on report stock History by commidity, with tables ltap, lips,likp and lfm1 . in the selection screen i given material is sample1.for sample1 i have the 74 records . in the output iam getting only 47 records , iam not getting the problem , iam sending the code please see that and suggest me.

loop at gt_ltap into gs_ltap.

if sy-subrc = 0.

gs_output-matnr = gs_ltap-matnr.

gs_output-maktx = gs_ltap-maktx.

gs_output-nista = gs_ltap-nista.

gs_output-tanum = gs_ltap-tanum.

gs_output-qdatu = gs_ltap-qdatu.

gs_output-vbeln = gs_ltap-vbeln.

endif.

loop at gt_lips into gs_lips where vbeln = gs_ltap-vbeln and

posnr = gs_ltap-posnr.

if sy-subrc = 0.

gs_output-vkgrp = gs_lips-vkgrp.

endif.

read table gt_likp into gs_likp with key vbeln = gs_lips-vbeln Binary search.

if sy-subrc = 0.

gs_output-kunnr = gs_likp-kunnr.

gs_output-lifnr = gs_likp-lifnr.

endif.

read table gt_lfm1 into gs_lfm1 with key lifnr = gs_likp-lifnr Binary search.

if sy-subrc = 0.

gs_output-ekgrp = gs_lfm1-ekgrp.

endif.

append gs_output to gt_output.

clear gs_output.

endloop.

endloop.

for above loop in gt_ltap iam having 74 records , for gt_output iam having 47 only.

rewards are help answers.

thanks & regards,

N.Narasimha rao.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
350

Hi,

Before reading the internal tables ,sort them by the key field in ascending order

1 REPLY 1
Read only

Former Member
0 Likes
351

Hi,

Before reading the internal tables ,sort them by the key field in ascending order