on 11-03-2006 2:59 PM
Hi All,
I would like to delete records when
AC_DOC_TYP i not equal to to 'ZR' and GL account number is greater than 3 I wrote down this code, but doesn't seem to work. Can someone please assist me. Thanks and here my current code
<b>delete DATA_PACKAGE where AC_DOC_TYP ne 'ZR' and GL_ACCOUNT(1) >= '4'.</b>
Asad
Hi again,
your problem is also that GL_ACCOUNT is char type. Normally, SAP does not allow anymore arithmetic operations on such objets.
Just let us know with '0000000004'.
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I said the dynamic specification of components using character-type data objects in parentheses is not supported here.
So you cannot write the ABAP statement
Delete ..... where ABAPFIELD(3) <condition>.
But only
Delete ..... where ABAPFIELD <condition>.
Is that the reason because I wrote a not nice code but correct!
Note that on the char type the condition will could be mantained, at runtime the processor convert the variable in the type necesary for the condition if is possible (ex if there are no-number and the condition is > that's not possible).
Regards,
Sergio
Message was edited by: Sergio Locatelli
Hi,
Using a loop will not help, as the problem is not there.
Your problem is with the hard coding on GL_ACCOUNT. Its length is 10. Do you think that 4 is at the first or the last position?
Try with GL_ACCOUNT(1) >= '0000000004'
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The dynamic specification of components using character-type data objects in parentheses is not supported here
You can substitute the code with:
loop at DATA_PACKAGE where AC_DOC_TYP ne 'ZR'.
if DATA_PACKAGE-GL_ACCOUNT(1) GE '4'.
delete DATA_PACKAGE.
endif.
endloop.
Hi Asad,
did you resolve your problem?
Message was edited by: Sergio Locatelli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Setence seems correct, are you sure the position for >= 4 is the first one? GL account should have filled by 0 by the left...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
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.