2009 May 27 8:48 PM
Hi All,
Since a couple of days, I am trying to solve the problem of using COLLECT statement against content of table which is :
F1.... type CHAR key
Fn.... type CAHR key
T1 ....type DEC 7,2
I am loadint the teble to internal table, and trying to perform COLLECT on it, but it says, that non-key fields to collect have to be type: I,P or F. I need to collect field which in table reflects type DEC 7,2. Do You have any idea how to solve it ???
regards, tomek
2009 May 27 8:59 PM
I don't see a problem with what you are trying to do. Would you please post the code that declares your internal table and the COLLECT statement?
Rob
Hi Rob again,
thank You for and idea of possible solution - I had than another confiusion with Unicode incompatibility, but this I think, I will be able to ssolve by myself.
thank You, again, tomek (trying to play more and more with ABAP )
Edited by: Tomasz Przyluski on May 30, 2009 12:36 PM
2009 May 27 8:59 PM
I don't see a problem with what you are trying to do. Would you please post the code that declares your internal table and the COLLECT statement?
Rob
2009 May 27 9:16 PM
Here it comes:
declaration:
DATA: T_TABLE TYPE SORTED TABLE OF Z_TABLE WITH UNIQUE KEY
RLDNR
RYEAR
RTCUR
RPMAX
RPRCTR
SPRCTR
RACCT
KTOPL
KTOSL
BKLAS
WITH HEADER LINE,
S_TABLE TYPE Z_TABLE.
code:
COLLECT S_TABLE INTO T_TABLE.
in Z_TABLE there are the last non key filelds of type: DEC(7,2), which are to be collected
and it gives syntax error while compiling: I can only use collect command for fields of type: I, P or F
Any glue ???
regards, tomek
2009 May 27 9:21 PM
2009 May 27 9:24 PM
Z_TABLE in not declared in TABLES: section. Should it be present there ?
2009 May 27 9:32 PM
Probably not. Is it declared in SE11 or locally in your program?
Rob
2009 May 27 9:35 PM
It is defined in SE11, all leading fields exept last one, belong to key, last field is DECIMAL 7,2 type
regards, tomek
2009 May 27 9:45 PM
Well, this passes a syntax check:
TYPES: BEGIN OF z_table,
rldnr,
ryear,
rtcur,
rpmax,
rprctr,
sprctr,
racct,
ktopl,
ktosl,
bklas,
t1(7) TYPE p DECIMALS 2,
END OF z_table.
DATA: t_table TYPE SORTED TABLE OF z_table WITH UNIQUE KEY
rldnr
ryear
rtcur
rpmax
rprctr
sprctr
racct
ktopl
ktosl
bklas
WITH HEADER LINE,
s_table TYPE z_table.
COLLECT s_table INTO t_table.Rob
2009 May 27 9:49 PM
Rob,
Thank You for Your effort, I will try Your suggestion, and check if it fulfills my expectation soon.
regards, tomek
2009 May 30 11:36 AM
Hi Rob again,
thank You for and idea of possible solution - I had than another confiusion with Unicode incompatibility, but this I think, I will be able to ssolve by myself.
thank You, again, tomek (trying to play more and more with ABAP )
Edited by: Tomasz Przyluski on May 30, 2009 12:36 PM
2009 May 30 11:38 AM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |