Recently there were some posts regarding dynamic columns in smart form.
So I thought I will share an idea how to make life a little more easier when you are facing such a pesky requirement.
Also I hope people will look at the code and verify that it is working well…
The input for this program is table SPFLI .
The program output:
This is repeated…..
The idea was to create a data model that will represent a matrix in the program.
The matrix is represented by intenal tables:
it_axis_x : represent the horizontal axis, this will contain the headers data.
it_axis_y : represent the vertical axis, this will contain the label data .
it_cell_v : Contain the actual data and pointer information relating to the axis .
And now lets dive into the code:
All the data elements that are shared by the program and the smartform are stored in this class .
Every thing is in the “PUBLIC SECTION” .
The main forms are:
FORM get_data_1 : This form read the input table and transform the data into matrix .
I put a BREAK-POINT statement so we can look at the data:
FORM prt_data_1 : This form receive the matrix and print the matrix slice by slice.
Since I need to call the smartform in a loop I am using functions SSF_OPEN and SSF_CLOSE .
The form source is y_r_eitan_test_31_03.xml (attach file)
Note the use of Y_R_EITAN_TEST_31_03_CL=>