‎2008 Jan 14 4:42 AM
‎2008 Jan 14 4:50 AM
santosh,
Dynamic field means:
In certain conditions you don't know what is the data
type of input fileds.
To catch those values general data variable declaration will not work .For those you need to declare Fields symbles.
EX;
DATA: STR_DYNAMIC type string.
FIELD-SYMBOLS <FS_DYNAMIC> type any.
STR_DYNAMIC = 'st_vbak-vbeln'.
ASSIGN (STR_DYNAMIC) TO <FS_DYNAMIC>.
Don't forget to reward if useful.....
‎2008 Jan 14 4:45 AM
Hi,
You can assign value to the field at runtime
For ex:
DATA: STR_DYNAMIC type string.
FIELD-SYMBOLS <FS_DYNAMIC> type any.
.
STR_DYNAMIC = 'st_vbak-vbeln'.
Here the value in STR_DYNAMIC is actually the fieldname whose value you want to read.
code
ASSIGN (STR_DYNAMIC) TO <FS_DYNAMIC>.
the above step takes the fieldname and then assigns the value stored in that fieldname to the field symbol
Generally Assign statements can give Short Dumps if the assignment is not possible. So recommended approach is check for sy-subrc.
Write the below code in If condition.
code
IF sy-subrc eq 0.
<FS_DYNAMIC> = field_value. "or your value
UNASSIGN <FS_DYNAMIC>. "This step is required to free up assignment
ENDIF.
[/code]
Hope this helps.
Regards
‎2008 Jan 14 4:50 AM
santosh,
Dynamic field means:
In certain conditions you don't know what is the data
type of input fileds.
To catch those values general data variable declaration will not work .For those you need to declare Fields symbles.
EX;
DATA: STR_DYNAMIC type string.
FIELD-SYMBOLS <FS_DYNAMIC> type any.
STR_DYNAMIC = 'st_vbak-vbeln'.
ASSIGN (STR_DYNAMIC) TO <FS_DYNAMIC>.
Don't forget to reward if useful.....