2007 Apr 27 12:01 PM
can someone help me with this....
how to read data.....and move it to internal table....
the requirement is as:
<b>Get the Participant details in an internal table IT_FINAL_PAR</b>
Loop through IT_PA0002 and move Personnel number (PERNR), Personnel ID Number (PERID), Last name (NACHN), First name (VORNA), Gender Key (GESCH), Date of Birth (GBDAT) into a final internal table for Participant data IT_FINAL_PAR.
Read the internal table IT_PA0006 to get the corresponding House Number and Street
(STRAS), City (ORT01), Postal code (PSTLZ), State (STATE), 2nd address line (LOCAT) by comparing Personnel Number (PERNR)and move those retrieved field values to the final internal table for Participant data IT_FINAL_PAR.
can someone help me with this....
how to read data.....and move it to internal table....
the requirement is as:
<b>Get the Participant details in an internal table IT_FINAL_PAR</b>
Loop through IT_PA0002 and move Personnel number (PERNR), Personnel ID Number (PERID), Last name (NACHN), First name (VORNA), Gender Key (GESCH), Date of Birth (GBDAT) into a final internal table for Participant data IT_FINAL_PAR.
Read the internal table IT_PA0006 to get the corresponding House Number and Street
(STRAS), City (ORT01), Postal code (PSTLZ), State (STATE), 2nd address line (LOCAT) by comparing Personnel Number (PERNR)and move those retrieved field values to the final internal table for Participant data IT_FINAL_PAR.
2007 Apr 27 12:07 PM
Loop at IT_PA0002 Into WA_PA0002 .
WA_FINAL_PAR-PERNR = WA_PA0002-PERNR.
...
..
..
Clear WA_PA0006.
Read Table IT_PA0006 into WA_PA0006 with key Pernr = WA_PA0002-PERNR.
if Sy-Subrc = 0.
WA_FINAL_PAR-STRAS = WA_PA0006-STRAS.
..
.
EndIf.
EndLoop.
santhosh
Message was edited by:
Kaluvala Santhosh
2007 Apr 27 12:09 PM
SORT IT_PA0006 BY PERNR.
LOOP AT IT_PA0002.
MOVE-CORRESPONDING IT_PA0002 TO IT_FINAL_PAR.
READ TABLE IT_PA0006 WITH KEY PERNR EQ IT_PA0002-PERNR BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE-CORRESPONDING IT_PA0006 TO IT_FINAL_PAR.
ENDIF.
APPEND IT_FINAL_PAR.
ENDLOOP.
2007 Apr 27 12:15 PM
Hi,
you could try the following:
* work areas
data: W_PA0002 like line of IT_PA0002[],
W_PA0006 like line of IT_PA0006[],
W_FINAL_PAR like line of IT_FINAL_PAR[].
loop at IT_PA0002 into W_PA0002.
clear W_FINAL_PAR.
* move values from IT_PA0002
W_FINAL_PAR-PERNR = W_PA0002-PERNR.
W_FINAL_PAR-PERID = W_PA0002-PERID.
* read address values from IT_PA0006
read table IT_PA0006 into W_PA0006 with key pernr = W_PA0002-pernr.
if sy-subrc = 0.
* move fields from IT_PA0006
W_FINAL_PAR-STRAS = W_PA0006-STRAS.
....
endif.
append W_FINAL_PAR to IT_FINAL_PAR.
endloop.
2007 Apr 27 12:16 PM
Try out the following code:-
loop at it_pa0002.
move-corresponding it_pa0002 to it_final_par.
read table it_pa0006 with key pernr = it_pa0002-pernr.
if sy-subrc eq 0.
move-corresponding it_pa0006 to it_final_par.
endif.
append it_final_par.
clear it_final_par.
endloop.
Regards,
Pankaj Agarwal.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |