‎2020 Dec 10 5:09 PM
I have a very deep structure that is:
TYPES: BEGIN OF ty_header,
version TYPE string,
END OF ty_header.
TYPES: BEGIN OF ty_company_info,
comptin TYPE string,
fydateend TYPE string,
bookcateg TYPE numc2,
acccodemaskg TYPE string,
acccodemaska TYPE string,
acccodemaskt TYPE string,
chartcode TYPE string,
chartdescr TYPE string,
END OF ty_company_info.
TYPES: BEGIN OF ty_relations,
acc TYPE char14,
reltype TYPE numc2,
END OF ty_relations,
tt_relations TYPE TABLE OF ty_relations WITH EMPTY KEY.
TYPES: BEGIN OF ty_accounts,
acc TYPE string,
descr TYPE string,
cat TYPE i,
acckind TYPE string,
relations TYPE tt_relations,
vatcat TYPE numc2,
vatprc TYPE p,
vatexemptreason TYPE string,
busacttype TYPE numc2,
tradetype TYPE numc2,
offactcode TYPE string,
isdeduction TYPE char1,
deductionoffcodedet TYPE string,
deductionoffcode TYPE string,
stampdutyoffcode TYPE string,
taxoffcode TYPE string,
extrataxoffcode TYPE string,
deductvattype TYPE numc2,
END OF ty_accounts,
tt_accounts TYPE TABLE OF ty_accounts WITH EMPTY KEY.
TYPES: BEGIN OF ty_adata,
companyinfo TYPE ty_company_info,
accounts TYPE tt_accounts,
END OF ty_adata,
tt_adata TYPE TABLE OF ty_adata WITH EMPTY KEY.
TYPES: BEGIN OF ty_accledg,
header TYPE ty_header,
data TYPE tt_adata,
END OF ty_accledg.
DATA: str_accledg TYPE ty_accledg.
when I am trying to do the below
APPEND VALUE #( acc = '01' descr = 'Elias test' cat = 11 ) TO str_accledg-data-accounts.
The error is ""STR_ACCLEDG-DATA" is a table without a header line and therefore does not have a component called "ACCOUNTS"."
What is wrong?
Thanks
‎2020 Dec 10 5:32 PM
Hi,
str_accledg-data is of type tt_adata, so a table.
So:
str_accledg = VALUE #(
Data = VALUE #( ( "table with one line
Accounts = VALUE #( ( "table with one line
acc = '01'
descr = 'Elias test'
cat = 11
) )
) )
).
‎2020 Dec 10 5:32 PM
Hi,
str_accledg-data is of type tt_adata, so a table.
So:
str_accledg = VALUE #(
Data = VALUE #( ( "table with one line
Accounts = VALUE #( ( "table with one line
acc = '01'
descr = 'Elias test'
cat = 11
) )
) )
).
‎2020 Dec 10 6:53 PM
That was my thought. Get the brackets right. Or do it classically and then figure it out.
‎2020 Dec 10 5:37 PM
The str_accledg is a structure.
The data is a table.
The companyinfo is a structure
The account is a table and
the relations is a table.
Why I need a header for str_accledg.
Thanks
‎2020 Dec 10 5:43 PM