‎2008 Oct 23 8:52 PM
hi,
I am trying to append username after reading FM
into a extra field of FM output.
I only see last field in output table.
TYPES: BEGIN OF out_data .
INCLUDE STRUCTURE bxmnodes.
TYPES: uname LIKE XTAB-uname.
TYPES: END OF out_data.
DATA: output_nodes_tbl LIKE bxmnodes OCCURS 0 WITH HEADER LINE .
T_ITAB has list of users..
LOOP AT t_ITAB.
CALL FUNCTION 'FMODULE'
EXPORTING
user_name = t_users-uname
language = t_users-langu_p
sort_nodes = ' '
generate_url = ' '
replace_rfc_variables = ' '
get_rfc_destination_type = ' '
usage_mode = ' '
device = ' '
TABLES
output_nodes_and_texts = output_nodes_tbl.
* GENERATED_URLS = .
MOVE output_nodes_tbl[] TO t_out_data[].
MOVE t_ITAB-uname TO t_out_data-uname.
APPEND t_out_data.
ENDLOOP.Edited by: PRAVEEN s on Oct 23, 2008 9:52 PM
‎2008 Oct 23 9:01 PM
you tryin gto append or to modify all rows with user name
MOVE t_ITAB-uname TO t_out_data-uname.
APPEND t_out_data.
change to
loop at t_out_data.
MOVE t_ITAB-uname TO t_out_data-uname.
modify t_out_data.
endloop.
‎2008 Oct 23 9:05 PM
change the logic like this..
MOVE output_nodes_tbl[] TO t_out_data[].
"here you need to loop the t_out_data and modify the uname
loop at t_out_data .
t_out_data-uname = t_ITAB-uname .
modify t_outdata.
endloop.
‎2008 Oct 23 9:33 PM
I did modifications as per you recommendations.
I see only 1 user -id everytime..
I changed like this..
MOVE output_nodes_tbl[] TO t_out_data[].
LOOP AT t_out_data.
MOVE t_users-uname TO t_out_data-uname.
MODIFY t_out_data TRANSPORTING uname.
ENDLOOP.
APPEND t_out_data.
ENDLOOP.Rgds
Praveen
Edited by: PRAVEEN s on Oct 23, 2008 10:35 PM
‎2008 Oct 23 9:37 PM
LOOP AT t_ITAB.
CALL FUNCTION 'FMODULE'
EXPORTING
user_name = t_users-unameis it t_users or t_itab?
and also check you have duplicate entries in t_itab (you mentioned it consits of users) check it once.
‎2008 Oct 23 9:40 PM
Sorry my mistake ..
It is T_ITAB and it consists of list of users.
I don't have duplicate entries in this table.
Rgds
Praveen
‎2008 Oct 23 9:41 PM
thats what code is doing, it is nested loop, so it will show you last user id in the last row of t_ITAB. that will be the final one left in t_out_data.
you have 2 internal tables t_ITAB and t_out_data. You need to find how you wan tto update t_out_data deepnding on which entry in t_itab,
then move loop at itab statement after FM call
--
FM call
--
loop at t_itab.
loop at t_out_data where key1 = t_itab-key1 <---condition
MOVE t_users-uname TO t_out_data-uname.
MODIFY t_out_data TRANSPORTING uname.
ENDLOOP.
endloop
No need to for append t_out_data at the end
‎2008 Oct 23 9:41 PM
Your logic appears to be faulty. The program clears out t_out_data and reloads it for each loop pass. Is that what you want?
Rob