Skip to Content
Author's profile photo Eitan Rosenberg

The case of “dynamic columns in smartform”

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

Assigned Tags

      18 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Eitan Rosenberg
      Eitan Rosenberg
      Blog 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.

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Former Member
      Former Member

      Good Information ...Thanks....

      Author's profile photo Sijin Chandran
      Sijin Chandran

      Hello Eitan ,

      Reminds me Matrix Processing done in C classes.

      Good one , useful Idea for sure.

      Thanks.

      Author's profile photo Ramesh Babu Srikakollu
      Ramesh Babu Srikakollu

      Good One and interesting too..

      Author's profile photo Arpit Gupta
      Arpit Gupta

      Hi Eitan,

      Awsome post.... keep up the good work...

      Author's profile photo jeetendra singh
      jeetendra singh

      Hi Eitan,

      Good one ... I have achieved same in ALV report 😳 .

      Good to see for Smartforms 🙂 .

      Loved your work.

      Regards,

      Jeetendra

      Author's profile photo Eitan Rosenberg
      Eitan Rosenberg
      Blog Post Author

      Hi,

      With ALV it is much simpler.

      You just have to create enough columns.....

      See here:
      http://scn.sap.com/message/14337353#14337353

      http://scn.sap.com/servlet/JiveServlet/download/14337353-185507/y_r_eitan_test_06_03.txt.zip

      Eitan.

      Author's profile photo Aneel Munawar
      Aneel Munawar

      Its working perfect according to  my requirement.

      Thanks.

      Author's profile photo stallone christian
      stallone christian

      Well Good work.

      But, I am able to generate complete dynamic smartform without smartform 😉

      Author's profile photo Florian Henninger
      Florian Henninger

      Well,

      that should end in an own blog and not throwing some words into other content 😈 .

      ~Florian

      Author's profile photo Eitan Rosenberg
      Eitan Rosenberg
      Blog Post Author

      Hi ,

      Great idea please share....

      Regards.

      Author's profile photo Ahmed Saleh
      Ahmed Saleh

      i can not find the attached file ...

      Author's profile photo Maecy Mariano
      Maecy Mariano

       

      The link for attached file is disabled. 🙁

      Author's profile photo Former Member
      Former Member

      Hi,

      Can u please provide code for the solution , all the links are disabled now.

      Author's profile photo Jose Dario Jaimes Alviarez
      Jose Dario Jaimes Alviarez

      Hi,

      Anyone has the files attached?

      I'll appreciate it a lot!

      Author's profile photo Masoud Eb
      Masoud Eb

      Hi , goooooooooood job

      Where is the attachment?