Skip to Content

How to Comparing 2 internal table and get the different records

I have 2 internal tables with the same structure. GT_AFPO and GT_AFPO. I wanna looping GT_AFPO that not in GT_AFPO2.

 
SELECT a~matnr a~aufnr a~psmng a~wemng a~amein a~ltrmi b~objnr c~stat
  FROM afpo AS a
  JOIN aufk AS b ON a~aufnr = b~aufnr
  JOIN jest AS c ON b~objnr = c~objnr
  INTO CORRESPONDING FIELDS OF TABLE gt_afpo
  FOR ALL ENTRIES IN gt_mard
  WHERE a~matnr = gt_mard-matnr AND a~pwerk = p_werks
  AND c~stat = 'I0002'
  AND c~inact = ''
    .
SELECT a~aufnr FROM afpo AS a
      JOIN aufk AS b ON a~aufnr = b~aufnr
      JOIN jest AS c ON b~objnr = c~objnr
     INTO CORRESPONDING FIELDS OF TABLE gt_afpo2
     WHERE a~matnr = gw_mara-matnr AND a~pwerk = p_werks
    AND c~stat = 'I0076' AND c~inact = ''.
    
    LOOP AT gt_afpo INTO gw_afpo WHERE matnr = gw_mara-matnr.
      lv_qty_pro = lv_qty_pro + gw_afpo-psmng.
    ENDLOOP.
Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.