‎2007 Mar 12 3:22 PM
I have an internal table with three columns say.
emp_id emp_name emp_position
1 abc supervisor
2 xya manager
3 kok executive
i have a selection screen
parameter: emp_id,
emp_name,
emp_position.
now i enter the required fields in the parameter. say
emp_id = 3
emp_name = kok
emp_position = senior executive
then the internal table field should look as follows
emp_id emp_name emp_position
1 abc supervisor
2 xya manager
3 kok senior executive <- see the last column of
last row.
how do we to this.
pls help me
‎2007 Mar 12 3:25 PM
read table itab
with key emp_id = emp_id.
if sy-subrc eq 0.
itab-emp_position = emp_position.
modify itab.
endif.
‎2007 Mar 12 3:32 PM
sort itab by emp_id emp_name emp_position.
read table itab with key emp_id = emp_id
emp_name = emp_name
emp_position = emp_position BINARY SEARCH.
if sy-subrc eq 0.
write : / itab-emp_id itab-emp_name itab-emp_position.
endif.
‎2007 Mar 12 3:33 PM
hi,
if your int. table has header line,do like the below.
<b>move emp_position to itab-emp_position.
loop at itab.
modify itab transporting emp_position where emp_id = itab-emp_id
and emp_name = itab-emp_name.
endloop.</b>
<b>if it doesn't have header line</b>,decalre work area explicitly and do as below,
<b>loop at temp into wa_itab.
wa_itab-price = '5000'.
modify itab from wa_itab transporting price where connid = temp-conn.
skip.
endloop.</b>
Regards,
award points for al helpful answers
Message was edited by:
sowjanya s
‎2007 Mar 12 3:35 PM
Hello John,
DO like this:
Sort Itab by emp_id emp_name emp_position.
Read table itab with key emp_id = emp_id
emp_name = emp_name
emp_position = emp_postion.
if sy-subrc eq 0.
process...
endif.Regards,
Vasanth
‎2007 Mar 12 3:40 PM
Hi
try this out. It will work
LOOP AT itab WHERE emp_id EQ <b>emp_id.</b>(This is the parameter)
itab-emp_name = emp_name.
itab-emp_position = emp_position.
MODIFY itab.
ENDLOOP.
Award points if found helpful.
‎2007 Mar 12 3:40 PM
Hi,
Check this code:
FIELD-SYMBOLS: <FS> LIKE LINE OF ITAB.
SORT ITAB BY EMP_ID.
READ TABLE ITAB ASIGNING <FS>
WITH KEY EMP_ID = EMP_ID
BINARY SEARCH.
IF SY-SUBRC EQ 0.
<FS>-EMP_NAME = EMP_NAME.
<FS>-EMP_POSITION = EMP_POSITION.
ENDIF.
‎2007 Mar 12 3:47 PM
hi,
my fault. in the paramter id
parameter: emp_id,
emp_column, *its not emp_name
emp_value. *its not emp_position
so its the column name which i have to enter in the second paramter.
say if enter 'emp_postion' as the value in emp_column in the paramter field.
then value of emp_postion has to change with the emp_value.
this is my issue......
i am sorry for misleading you guys.
thank you