So "-" separate fields value and "|" separate Entries and what I want is obtain a tabla like this using Autogenerate.
I know the quantity of entries and fields (iRows and iFields). I manage to get it work but hardcoding stuff, I cant manage to make it work in a generic form without hardcoding the number of fields in the subfield statement
Re: Help: Generate Table from a long string variable with Autogenerate
Sorry, perhaps I expressed in the wrong way... English isn't my native language. What I want is to avoid enumerate the "fields number" (marked in red)
For i=1 to $(iRows)
LET row = SubField('$(vData)','|',i);
SubField('$(row)','-',1) AS Field1,
SubField('$(row)','-',2) AS Field2,
SubField('$(row)','-',3) AS Field3,
SubField('$(row)','-',4) AS Field4
In this example I have 4 fields but I need to be generic, not always will be 4 fields. Im working with macros to retrieve data from SAP Tables and depending of the Table the field varies. I know the max field number (variable iField) but what I need is to "iterate" them to avoid "hard coding" the fields numbers.
The fields allways will be separated by "-" and the entries with "|" but the number of fields and row are not allways the same.
So I have to make a script Load thats is able to read
LET vData = '20140108-Sunny|20140107-Cold|20140107-Snow';
For example the For iterate the iRows wharever the amount... I need that but also for the fields, is there a way to acomplish this ? in another words I want to "emulate" the logic behind having two nested For (one for the rows and another for the fields).