on 10-19-2016 9:56 AM
Hello,
I have two dropdown by index in my webdynpro where I can get two string values. The first is a string that i would like to use as column name in a 'where condition' of a delete statement, the second is the value to which the field should be equal. How can I use the value of this strings in a where condition?
I tried to use brackets but it doesn't work.
my code is:
data: lv_attr type string,
lv_field type string.
* lv_condition type string,
* tmp type string,
* lt_temptab TYPE TABLE OF ZTEST_SFLIGHT,
* ls_temptab LIKE LINE OF lt_temptab,
* dref type ref to data.
WD_CONTEXT->GET_CHILD_NODE( name = 'NODE_DELETEFORM' )->GET_ATTRIBUTE( EXPORTING NAME = 'VALUE' IMPORTING VALUE = lv_attr ).
WD_CONTEXT->GET_CHILD_NODE( name = 'NODE_TABFIELDS' )->GET_ATTRIBUTE( EXPORTING NAME = 'FIELDS' IMPORTING VALUE = lv_field ).
delete from ztest_sflight where (lv_field) eq (lv_attr).
this worked for me!!!
data: lv_attr type string,
lv_field type string,
s type string.
WD_CONTEXT->GET_CHILD_NODE( name = 'NODE_DELETEFORM' )->GET_ATTRIBUTE( EXPORTING NAME = 'VALUE' IMPORTING VALUE = lv_attr ).
WD_CONTEXT->GET_CHILD_NODE( name = 'NODE_TABFIELDS' )->GET_ATTRIBUTE( EXPORTING NAME = 'FIELDS' IMPORTING VALUE = lv_field ).
concatenate lv_field '=' 'lv_attr' into s SEPARATED BY space.
delete from ztest_sflight where (s).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Build your whole where condition into field symbol.
For E.g:
concatenate <fs_attr> = <lv_field> and move it to <fs>
DELETE FROM ZTEST_SFLIGHT WHERE <fs>.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try using field symbols instead of strings(assign the value of strings to the field symbols).
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FIELD-SYMBOLS: <fs> TYPE string.
ASSIGN lv_field TO <fs>.
WD_CONTEXT->GET_CHILD_NODE( name = 'NODE_DELETEFORM' )->GET_ATTRIBUTE( EXPORTING NAME = 'VALUE' IMPORTING VALUE = lv_attr ).
WD_CONTEXT->GET_CHILD_NODE( name = 'NODE_TABFIELDS' )->GET_ATTRIBUTE( EXPORTING NAME = 'FIELDS' IMPORTING VALUE = lv_field ).
delete from ztest_sflight where <fs> eq lv_attr.
if I write this way and try to activate , an error message says "field <fs> unknown"
actually the problem is only with lv_field, because if I write "where carrid = lv_attr" it works. But I would like to take the value of the field from dropdown by index.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.