‎2022 Feb 03 9:01 AM
Hello Folks,
I am trying the below code to set up array of strings in internal table.
types: tt_input type standard table of string with default key.
data(gt_input) = value tt_input( ( 'string1' ) ( 'string2' ) ).
But it shows syntax error '"string1'" and the row type of "GT_INPUT" are incompatible.'
When I try to set array of integers I face no proplem.
types: tt_input type standard table of i with default key.
data(gt_input) = value tt_input( ( 1 ) ( 2 ) ).
Any thoughts please ?
‎2022 Feb 03 9:03 AM
types: tt_input type standard table of string with default key.
data(gt_input) = value tt_input( ( `string1` ) ( `string2` ) ).to generate string use ` not ' (it will generate char)
‎2022 Feb 03 9:03 AM
types: tt_input type standard table of string with default key.
data(gt_input) = value tt_input( ( `string1` ) ( `string2` ) ).to generate string use ` not ' (it will generate char)
‎2022 Feb 03 9:09 AM
‎2022 Feb 03 9:11 AM
‎2022 Feb 03 9:15 AM
Sorry, what do you mean ? having integer in the string ? or generate a type from the data you receive ... ?
‎2022 Feb 03 9:24 AM
something like this [ `string1`,`string2`,100,200,'string3` ] , having an array of integers and strings in the same internal table. is it possible ?
if we have a way to generate type from the data we receive that would be great to know too.
‎2022 Feb 03 9:58 AM
types: tt_input type standard table of string with default key.
data(gt_input) = value tt_input( ( `string1` ) ( `string2` ) ( conv #( 100.00 ) ( |{ my_integer }| ) ).the dynamic generation is not an easy task. the key words are RTTS
for example https://blogs.sap.com/2017/09/29/dynamic-programming-in-abap-part-3-an-example-abap-rtts/