‎2009 Dec 23 2:21 PM
Hi expert,
I have this code:
DATA: t_appo TYPE STANDARD TABLE OF /bic/cszbw_delpack
INITIAL SIZE 0.
DATA: wa_idx TYPE i.
DATA: wa_source LIKE LINE OF SOURCE_PACKAGE.
LOOP AT SOURCE_PACKAGE INTO wa_source.
wa_idx = sy-tabix.
READ TABLE t_appo TRANSPORTING NO FIELDS
WITH KEY /bic/zc_collo = wa_source-numcl.
IF sy-subrc = 0.
wa_source-brwei = 0.
MODIFY SOURCE_PACKAGE FROM wa_source
INDEX wa_idx
transporting brwei.
ELSE.
ENDIF.
ENDLOOP.after ELSE, I need to insert the wa_source value into t_appo.
How can I do?
May be t_appo is bad declared.
Consider that t_appo cannot have an header line otherwise I'll have an error as
"E:Tables with headers are no longer supported in the OO context."
than, in any loop, t_appo table has to popolated with an record.
because I have to keep in memory all processed records.
Help me please asap?
thank you so much.
‎2009 Dec 23 3:08 PM
In your case, you need to declare something like:
DATA: w_appo TYPE /bic/cszbw_delpackAnd move data from wa_source to w_appo, and use the "APPEND w_appo TO t_appo." I said you in my first post.
‎2009 Dec 23 2:26 PM
Hello,
Try something like this,
DATA: t_appo TYPE STANDARD TABLE OF /bic/cszbw_delpack with header line.
DATA: wa_idx TYPE i.
DATA: wa_source LIKE LINE OF SOURCE_PACKAGE.
LOOP AT SOURCE_PACKAGE INTO wa_source.
wa_idx = sy-tabix.
READ TABLE t_appo TRANSPORTING NO FIELDS
WITH KEY /bic/zc_collo = wa_source-numcl.
IF sy-subrc = 0.
wa_source-brwei = 0.
MODIFY SOURCE_PACKAGE FROM wa_source
INDEX wa_idx
transporting brwei.
ELSE.
move-corresponding wa_source to t_appo.
append t_appo.
ENDIF.
ENDLOOP.
Vikranth
‎2009 Dec 23 2:36 PM
thanks for your reply,
but t_appo is not an internal table with header line!
As my details, the system do not admitted tables with header line.
‎2009 Dec 23 2:41 PM
And because this, you must define a "parallel" workarea for your table. The workarea OO doesn't like is the one created using "WITH HEADER LINE" or "OCCURS n".
‎2009 Dec 23 2:47 PM
Am sorry i dint read your question properly. You could try the suggestion given by Vicenç Lozano
‎2009 Dec 23 3:01 PM
Thanks Vicenç,
I ask you other suggestion.
How can I declared an internal table with only one field and without header line?
‎2009 Dec 23 3:06 PM
It's an easy question:
Table:
DATA: t_table TYPE TABLE OF type_name.Workarea:
DATA: w_table TYPE type_name.Both, using non defined types (data elements/dominions not in SE11)
TYPE: BEGIN OF my_type,
field1 TYPE type_field_1,
...
fieldn TYPE type_field_n,
END OF my_type.
DATA: t_table TYPE TABLE OF my_type, "table
w_table TYPE my_type. "workarea(the field list of my_type can have a single field)
Edited by: Vicenç Lozano on Dec 23, 2009 3:09 PM
‎2009 Dec 23 2:36 PM
Define a workarea (header line) for your internal table
DATA: w_appo TYPE the_same_type_than_your_table.And use an APPEND.
APPEND w_appo TO t_appo.
‎2009 Dec 23 3:08 PM
In your case, you need to declare something like:
DATA: w_appo TYPE /bic/cszbw_delpackAnd move data from wa_source to w_appo, and use the "APPEND w_appo TO t_appo." I said you in my first post.
‎2009 Dec 23 3:20 PM