Hi Experts,
I am not able to figure out How populate an internal table field with data of another internal table field based on conditions.
internal table A and B is having data like this:
Internal table A
| work order A | operation | start date |
|---|---|---|
| work order 1 | operation 1 | wo 1 date 1 |
| work order 1 | operation 2 | wo 1 date 2 |
| work order 1 | operation 3 | wo 1 date 3 |
| work order 1 | operation 4 | wo 1 date 4 |
| work order 2 | operation 1 | wo 2 date 1 |
| work order 3 | operation 1 | wo 3 date 1 |
| work order 3 | operation 2 | wo 3 date 2 |
| work order 3 | operation 3 | wo 3 date 3 |
INTERNAL TABLE B work order B | operation | start date |
|---|---|---|
| work order 1 | operation 1 | wo 1 date 1 |
| work order 1 | operation 3 | wo 1 date 3 |
| work order 1 | operation 4 | wo 1 date 4 |
| work order 2 | operation 1 | wo 2 date 1 |
| work order 3 | operation 2 | wo 1 date 3 |
now i have to populate table B start date into table A start date in such a way..
Just a brief Idea..
if record in internal table A have entry in internal table B then populate the start date of internal table B into internal table A.
if record in internal table A does not have corresponding entry in internal table B then populate the start date of previous record of the same work order if found else populate start date of the next record of that same work order if found.
Final data in internal table A : Should have entries like this
| work order A | operation | start date |
|---|---|---|
| work order 1 | operation 1 | wo 1 date 1 |
| work order 1 | operation 2 | wo 1 date 1 |
| work order 1 | operation 3 | wo 1 date 3 |
| work order 1 | operation 4 | wo 1 date 4 |
| work order 2 | operation 1 | wo 2 date 1 |
| work order 3 | operation 1 | wo 3 date 2 |
| work order 3 | operation 2 | wo 3 date 2 |
| work order 3 | operation 3 | wo 3 date 3 |
'
thank you!!