Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a variable length records within an internal table?

Former Member
0 Kudos
128

Here is what I did in the program:

TYPES : BEGIN OF type_outerface_tbl,

text(1000) TYPE c,

END OF type_outerface_tbl.

DATA: gw_outerface_tbl TYPE type_outerface_tbl,

gi_outerface_tbl TYPE STANDARD TABLE OF type_outerface_tbl.

The internal outerface table is fix length.

I 'APPEND gw_outerface_tbl TO gi_outerface_tbl'

If the TEXT size vary, how do I define the table?

Thank you very much!

Helen

1 ACCEPTED SOLUTION

Former Member
0 Kudos
76

define as text type string

4 REPLIES 4

Former Member
0 Kudos
77

define as text type string

0 Kudos
76

Here is what I modified:

TYPES: BEGIN OF record_header_1,

recty(1) TYPE c,

awkey(20) TYPE c,

doucmnttype(5) TYPE c,

END OF record_header_1.

DATA: gw_record_header_1 TYPE record_header_1,

gi_record_header_1 TYPE STANDARD TABLE OF record_header_1.

-


TYPES : BEGIN OF type_outerface_tbl,

text TYPE string,

END OF type_outerface_tbl.

DATA: gw_outerface_tbl TYPE type_outerface_tbl,

gi_outerface_tbl TYPE STANDARD TABLE OF type_outerface_tbl.

-


DATA: lw_line TYPE string.

-


CONCATENATE gw_record_header_1-recty

',' gw_record_header_1-awkey

',' gw_record_header_1-doucmnttype

INTO lw_line.

APPEND lw_line TO gi_outerface_tbl.

CLEAR lw_line.

-


I got the following error message:

"LW_LINE" cannot be converted to the line type of 'GI_OUTFERCE_TBL'.

-


Please advise where I did wrong?

Thank you very much!

Helen

Edited by: Helen on Nov 22, 2008 5:45 PM

Edited by: Helen on Nov 22, 2008 5:47 PM

0 Kudos
76

Hi

please check the following code.

TYPES: BEGIN OF record_header_1,

recty(1) TYPE c, "1 1 Record type 'D'

awkey(20) TYPE c, "2 20 bkpf-awkey

doucmnttype(5) TYPE c, "22 5 value 'INV '

END OF record_header_1.

DATA: gw_record_header_1 TYPE record_header_1,

gi_record_header_1 TYPE STANDARD TABLE OF record_header_1.

TYPES : BEGIN OF type_outerface_tbl,

text TYPE string,

END OF type_outerface_tbl.

DATA: gw_outerface_tbl TYPE type_outerface_tbl,

gi_outerface_tbl TYPE STANDARD TABLE OF type_outerface_tbl.

DATA: wa_outerface_tbl TYPE type_outerface_tbl. <----


Define a Work area

DATA: lw_line TYPE string.

CONCATENATE gw_record_header_1-recty ',' gw_record_header_1-awkey ',' gw_record_header_1-doucmnttype INTO lw_line.

wa_outerface_tbl-text = lw_line. <----


pass your text to work area

APPEND wa_outerface_tbl TO gi_outerface_tbl.<----


append work area to your internal table.

CLEAR wa_outerface_tbl.

Thanks,

Sree.

0 Kudos
76

Thank you for your answer. You solved this problem. But there is another problem relate to this. I will create another post.

Thank you very much!

Helen