2007 Jul 09 1:21 PM
Hi All,
I have to pass a value "name1" in my smartform for multiple perners.
My table name is itab1. But i am not getting tha values.
please advice.
DATA: BEGIN OF ITAB_EMPNO OCCURS 0,
PERNR LIKE PA0001-PERNR,
END OF ITAB_EMPNO.
SELECT PERNR FROM PA0001 INTO TABLE ITAB_EMPNO WHERE PERNR IN P_PERNR.
SORT ITAB_EMPNO BY PERNR.
DELETE ADJACENT DUPLICATES FROM ITAB_EMPNO.
LOOP AT ITAB_EMPNO.
ITAB1-PERNR = ITAB_EMPNO-PERNR. " passing pernrs in itab1
AT END OF PERNR.
APPEND itab1.
CLEAR ITAB1.
ENDAT.
ENDLOOP.
LOOP AT ITAB1 .
read table it_0002 with key pernr = itab1-pernr.
if sy-subrc = 0.
ITAB1-NAME1 = IT_0002-NAME1.
APPEND ITAB1 .
endif.
ENDLOOP.
thanks & regards,
Preeti
2007 Jul 10 7:26 PM
Second loop is not correct..
U wanted to do sth else but by mistake
U may have to use <b>modify itab1</b> in place of append.
plz tell ur requirement..
Regards
Prax
2007 Jul 10 6:38 PM
Preeti,
In your first loop you are appending ITAB1 with your personnel number.
In your second loop your are again appending ITAB 1 records. Try changing your second append to itab1 to a modify.
Best Regards,
Chris H.
2007 Jul 10 7:26 PM
Second loop is not correct..
U wanted to do sth else but by mistake
U may have to use <b>modify itab1</b> in place of append.
plz tell ur requirement..
Regards
Prax