‎2015 Feb 27 9:14 AM
Hi All,
I have created a dynamic table in driver program and filled the data.
But in the form designing, how to declare the dynamic tables?
Kindly assist.
Regards,
Aj...
‎2015 Feb 27 11:57 AM
Hi Ajay,
Dynamic internal table, we can use in driver program, We can move the internal table value from driver program to smartform in the following way.
In order to create the structure, it is required to create the structure in SE11.
Convert the Dynamic internal table to static internal table. Create the structure in SE11, use the same structure in both driver program and smartform and move the values to smartform.
"Run the Loop
LOOP AT <dyn_table> INTO <fs_line>.
"Assign the value
ASSIGN COMPONENT 'BWART' OF STRUCTURE <fs_line> TO <fs_value>.
"Check value is initialized
IF <fs_value> IS ASSIGNED.
"Assign to final work area
WA_FINAL-BWART = <FS_value>.
ENDIF.
"Append final internal table
APPEND WA_FINAL TO IT_FINAL.
"Clear WA
CLEAR WA_FINAL.
ENDLOOP.
I hope at the end, in both the cases, we are suppose to mention the structure field name in table text-field as shown in above screenshot. I recommend to create the structure and convert dynamic internal table to static internal table using the above code.
Regards
Rajkumar Narasimman
‎2015 Feb 27 11:57 AM
Hi Ajay,
Dynamic internal table, we can use in driver program, We can move the internal table value from driver program to smartform in the following way.
In order to create the structure, it is required to create the structure in SE11.
Convert the Dynamic internal table to static internal table. Create the structure in SE11, use the same structure in both driver program and smartform and move the values to smartform.
"Run the Loop
LOOP AT <dyn_table> INTO <fs_line>.
"Assign the value
ASSIGN COMPONENT 'BWART' OF STRUCTURE <fs_line> TO <fs_value>.
"Check value is initialized
IF <fs_value> IS ASSIGNED.
"Assign to final work area
WA_FINAL-BWART = <FS_value>.
ENDIF.
"Append final internal table
APPEND WA_FINAL TO IT_FINAL.
"Clear WA
CLEAR WA_FINAL.
ENDLOOP.
I hope at the end, in both the cases, we are suppose to mention the structure field name in table text-field as shown in above screenshot. I recommend to create the structure and convert dynamic internal table to static internal table using the above code.
Regards
Rajkumar Narasimman