Reputation: 611
We have a table that is filled by a program with a web service. This table has customer data like custno, name tele1, tele2, addr etc. They want to add emails but they do not know how many fields each customer has. They told me that we can handle this by adding an Append Structure to the table. I look in the internet but I can't find a way to do this with Append Structure.
What they want is to have 1 record for Elias with all his data and under this to put his 3 email.
Can we do it with Append Structure and how.
Thanks in advance
PS. This is an important correction. This is not a DB table but it is a structure. This Structure ws_customer is used as IMPORT in order to pass the customer data for creating or updating the sap customer. So they asked from me to add an APPEND STRUCTURE and add dynamically as much emails as the customer has. For example the customer ELIAS with CUSTNO 145 ADDRESS BROWN 6 has emails [email protected], [email protected] and [email protected]. The Append Structure will have 1 field and for the record of this customer we will have 3 emails.
Is it possible to do this?
Upvotes: 0
Views: 484
Reputation: 88
why don't you add a table of email adresses to this structure? in my oppinion, you could do it just the way JozsefSzikszai described it.
When you have your structure, you can append a table to this structure and then you can always add as much email adresses to this table as you want
a example could look like this:
TYPES BEGIN OF your_structure,
field1 TYPE string,
field2 TYPE string,
email TYPE STANDARD TABLE OF string,
END OF your_structure.
when you then have your variable of the type your_structure, you can add email adresses like this:
DATA your_variable TYPE your_structure.
INSERT '[email protected]' INTO TABLE your_variable-email.
When your_structure is a DDIC structure and not defined by code, you could append the table to the DDIC structure and use it just the same way
Upvotes: 2