Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

internal loop logic.

I have two internal tables gt_vbak & gt_knvp

and they have values as

Internal table :gtvbak_

VBELN VKORG BSTNK KUNNR J_3ADEPM kunn2

6049039794|6055 |MTEST1EDI_2 |6006921000| | |

6049039797|6055 |MTEST1EDI_2 |6006921000| | |

Internal table gtknvp_

KUNNR KUNN2 VKORG SPART PARVW

6006921000|6006923307|6055 |01|WE |

6006921000|6006923308|6055 |0 |WE |

My below logic is not working in updating 6006923307 & 6006923308 values in gt_vbak interal table's corresponding kunn2. In two records also gt_vbak-kunn2 values is storing as 6006923308 .

How can I write this logic in this case like both kunnr and vkorg of both itabs are same ?

LOOP AT gt_vbak INTO wa_vbak.

*READ TABLE gt_knvp INTO wa_knvp

*with key kunnr = wa_vbak-kunnr

*vkorg = wa_vbak-vkorg.

LOOP AT gt_knvp INTO wa_knvp

WHERE kunnr = wa_vbak-kunnr

AND vkorg = wa_vbak-vkorg.

wa_vbak-kunn2 = wa_knvp-kunn2.

ENDLOOP. " LOOP AT gt_knvp INTO wa_knvp

THANKS IN ADV

Tags:
replied

you knwo your requirements better. go thru those one more time and see if the code does the same.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question