‎2008 Jul 29 12:30 PM
Hi
My requirement is i have one table with 4 userdefined fields. In future there may be a chance of adding few more userdefined fields. So each time whenever they are changing the table i have to change the RFC so for avoiding this i am creating one RFC for inserting datas into DB table. Two import parameters are field name & field value. So based on the fieldname that value should be added in that place of the DB table. How can i write code for that. please help me.
‎2008 Jul 29 12:34 PM
Hi
You can achieve this using Field symbols
assign component 'field1' of structure <fs_dynamic_tab> to <fs_field1>
then assign the value to the FS and update the table.
‎2008 Jul 29 12:38 PM
‎2008 Jul 29 12:39 PM
Yes you can do like that.
Selection parameters, select options will be changed to IMPORTING PARAMETERS.(all these parameters should be pass by value).
And If your report contains some Output. then You have to use export or Table parameters For Output table parameters.
and write your code in source code tab.
‎2008 Jul 29 12:40 PM
In RFC's can we use field symbols..
can u give me small example. i never worked on field symbols.
‎2008 Jul 29 12:47 PM
Hi
try this
create data ls_tabn like line of <dbtab>.
assign ls_tabn->* to <ls_final>.
concatenate lw_tabn va_vbeln into lw_fname separated by '-'.
assign component lw_fname of structure <ls_final>
to <ls_fieldval>.
if sy-subrc = 0.
<ls_fieldval> = (value).
endif.
Insert into <dbtab> from <ls_final>
‎2008 Jul 29 12:54 PM
i am not clear.. i have to declare field symbol na
Here what is ls_final & ls_fieldval.
Edited by: Hima on Jul 29, 2008 1:55 PM
‎2008 Jul 29 1:29 PM
Hi,
field symbol is nothing but workarea.
u need not to clear the fieldsymbols.