2009 Jan 01 12:39 PM
Hi All,
Can you please suggest the syntax for assigning field symbols for the below requirement:
field-symbols: <fs_zzbol> type any.
data : l_zzbol(30).
if sy-tcode eq 'ME21N'.
l_zzbol = '(SAPLMEPO)EKKO-ZZBOL'.
elseif sy-tcode eq 'ME21'.
l_zzbol = '(SAPMM06E)EKKO-ZZBOL'.
endif.
Now my doubt is : how to assign l_zzbol to <fs_zzbol>?
Like 1. assign l_zzbol to <fs_zzbol>.
or 2. assign (l_zzbol) to <fs_zzbol>.
It would be helpful if you suggest me the reason.
Thanks,
Sanjeet
Hi All,
Can you please suggest the syntax for assigning field symbols for the below requirement:
field-symbols: <fs_zzbol> type any.
data : l_zzbol(30).
if sy-tcode eq 'ME21N'.
l_zzbol = '(SAPLMEPO)EKKO-ZZBOL'.
elseif sy-tcode eq 'ME21'.
l_zzbol = '(SAPMM06E)EKKO-ZZBOL'.
endif.
Now my doubt is : how to assign l_zzbol to <fs_zzbol>?
Like 1. assign l_zzbol to <fs_zzbol>.
or 2. assign (l_zzbol) to <fs_zzbol>.
It would be helpful if you suggest me the reason.
Thanks,
Sanjeet
2009 Jan 01 1:08 PM
Hi,
Take that field l_zzbol as one of fields in that fileld symbol.
than move that fileld (l_zzbol) tho that filed symbol <fs_zzbol>-zzbol. (filed what you taken )
and modify that table with that field symbol with transporting that fileld.
Thanks
2009 Jan 01 1:20 PM
There is no field attached to the <fs_zzbol>.
This has been just defined as :
field symbols :<fs_zzbol> type any.
So I can not modify using transporting key word.
It is basically the concept of Static and Dynamic Field Symbol that I am not able to diffrerentiate.
Thanks,
Sanjeet
2009 Jan 01 4:33 PM
Hi Sanjeet... try this way..
field-symbols: <fs_zzbol> type any.
if sy-tcode eq 'ME21N'.
assign '(SAPLMEPO)EKKO-ZZBOL' to <fs_zzbol>.
elseif sy-tcode eq 'ME21'.
Assign '(SAPMM06E)EKKO-ZZBOL' to <fs_zzbol>.
endif.
2009 Jan 01 9:09 PM
Hi Sanjeet,
Basically when you assing field to field symbol you write
assign field_name to <field_symbol>. In this case you don't know at runtime what field you want to take the value from, (definitelly it is not field_name but name of the field which is in the field_name
i.e. (SAPLMEPO)EKKO-ZZBOL ). Therefore you can write this:
assing ('(SAPLMEPO)EKKO-ZZBOL') to <field_symbol>.
...which in turn can be replaced with.
l_zzbol = '(SAPLMEPO)EKKO-ZZBOL'.
assign (l_zzbol) to <fs_zzbol>.
Golden rule:always ask yourself if you know which field you are addressing. If you can't statically evaluate it ( field_name is not of interest here but what is in it), you must put it in brackets (meaning system will get its name during runtime from field_name ).
Hope it will clarify how to use field symbol.
Regards
Marcin
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |