Skip to Content

Hi all,

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:

/wp-content/uploads/2013/10/capture_20131006_101431_292419.png

/wp-content/uploads/2013/10/capture_20131006_101448_292420.png

This is repeated…..

/wp-content/uploads/2013/10/capture_20131006_101703_292422.png

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.

/wp-content/uploads/2013/10/capture_20131006_103220_292423.png

it_axis_y : represent the vertical axis, this will contain the label data .

/wp-content/uploads/2013/10/capture_20131006_103203_292430.png

it_cell_v : Contain the actual data and pointer information relating to the axis .

And now lets dive into the code:

Class Y_R_EITAN_TEST_31_03_CL

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” .

/wp-content/uploads/2013/10/capture_20131006_113225_292452.png

Program Y_R_EITAN_TEST_31_03

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:

/wp-content/uploads/2013/10/capture_20131006_114407_292453.png

/wp-content/uploads/2013/10/capture_20131006_114426_292482.png

/wp-content/uploads/2013/10/capture_20131006_114502_292483.png

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 .

SmartForm Y_R_EITAN_TEST_31_03

The form source is y_r_eitan_test_31_03.xml (attach file)

Note the use of Y_R_EITAN_TEST_31_03_CL=>

/wp-content/uploads/2013/10/capture_20131006_120303_292484.png

To report this post you need to login first.

15 Comments

You must be Logged on to comment or reply to a post.

  1. Suhas Saha

    Hello Eitan,

    Finally some originality in the ABAP forums. In the recent times the quality of the blogs/documents have been poor 😐 & your blog is a welcome relief 😳 .

    Thanks,

    Suhas

    (0) 
    1. Eitan Rosenberg Post author

      Hello Suhas ,

      Thanks for a very encouraging remarks.

      I am blushing over here… 😳

      I promise that I will try to be interesting and if I fail please let me know .

      Regards.

      (0) 
  2. SG Sg

    Hi Elintan,

    This is helpful document, 🙂 🙂 in all recent activities of SCN  😉 😉 i had came across this issue. 😐 😐

    Thanks for Sharing with us.

    Regards,

    Giri

    (0) 

Leave a Reply