Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Passing value for multiple perners in smartform - VERY URGENT

Former Member
0 Kudos
75

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos
51

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

2 REPLIES 2

Former Member
0 Kudos
51

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.

Former Member
0 Kudos
52

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