on 01-25-2019 2:32 PM
Hello Guru's/Experts,
I would want to make the where clause of the loop to be dynamic. Hence i am using the below logic to concatenate my workarea with a string. However this is not working since after concatenating i am getting maktl = xxxx while i need to get a result like maktl = 'XXX' . The preceding and the succeeding literal (') is missing.
Currently it goes to dump :While parsing the logical expression, the system could not interpret token "Z10-11523" in row 0, column 10.
CONCATENATE 'matkl = ' '' lw_mara-matkl'' INTO matkl RESPECTING BLANKS.
LOOP AT <it_dyn> ASSIGNING <lw_dyn> WHERE (matkl).
Endloop.
Could you please help me to get this resolved will be rewarded with points.
Regards,
Bhargav.
Hi,
You have to use '''' to concatenate a single apostrophe.
There might be a new command available now that I'm unaware of, so if this is the case please enlighten me.
Kind regards, Rob Dielemans
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your concatenate should be.
CONCATENATE 'matkl = ' '''' lw_mara-matkl '''' INTO matkl RESPECTING BLANKS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you should wrap your condition in string type...:
lv_con = `field = 'aa'`.
or:
lv_con = |field = 'aa'|.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bhargav,
I'm on an older version so I would suggest not putting lw_mara-matkl in quotes. You want the value of the variable, not the name of the variable.
Instead just use:
CONCATENATE 'matkl = '
lw_mara-matkl
INTO matkl RESPECTING BLANKS.
I'm sure the fancy new ABAP has all kinds of tools to help with this though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.