Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to convert flat to deep structure ?

hi all, i hava a problem. this is my code:

TYPES: BEGIN OF mytype,

f1(14) TYPE C,

f2(24) TYPE C,

f3(9) TYPE C,

f4(6) TYPE C,

f5(4) TYPE N,

f6(5) TYPE N,

Myfield (8) TYPE F,

END OF mytype.

DATA: mylocaltable TYPE TABLE OF mytype WITH HEADER LINE.

.............................

read data from CSV file and put it to mylocaltable, it works fine ))), but next:

DATA: OUTPUT TYPE TABLE OF DEEP_STRUCTURE_TYPE WITH HEADER LINE.

DATA: deepstructure LIKE LINE OF OUTPUT-message_type-line.

LOOP AT mylocaltable.

MOVE-CORRESPONDING mylocaltable to deepstructure.

APPEND deepstructure TO OUTPUT-message_type-line.

ENDLOOP.

TRY.

CREATE OBJECT PROXY.

CALL METHOD PROXY->Message_Out

EXPORTING

OUTPUT = OUTPUT.

COMMIT WORK.

ENDTRY.

there is a error message on line "Myfield (8) TYPE F,":

"Myfield" must be a character like data object (data type C, N, D, T or STRING) .

in the DEEP structure OUTPUT the field "Myfield" has XSD:DOUBLE type (in XI).

Please help me to solve this problem. Thanks.

P.S. the data for "Myfield" can be like "12345678,12345678" - i mean it's float and has max length - 16.

Not what you were looking for? View more on this topic or Ask a question