Skip to Content
avatar image
Former Member

Dynamic Smartform - Matrix structure

Hi All

i have a requirement to create a table dynamically in a matrix format. i am new to smartforms

scenario is something like

1) My internal table structure

*Article   Store	Quantity*
1a	    S303	    2
2a	    S304            3
3a 	    S305	    2 
4a 	    S306	    4
5a	    S307	    5
1b	    S303	    2
2b	    S304	    3
3b	    S305	    2
4b	    S306	    4
5b	    S307	    5

i want my smartform to be like

*Article	S303	    S304	S305	    S306	S307*
					
1a	         2	     3	          2	      4	           5
				 	
1b	         2	     3	          2	      4    	   5

suggest me how can i achieve this.thanks in advance.

Internal table structure may vary time to time

Regards

Chaitanya.A

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 20, 2009 at 04:24 AM

    HI Chaitanya,

    Use the event begin of sort by the store in the smartform.

    Regards,

    Sravanthi

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sravanthi

      Thank you for quick reponse.my internal table structure is not constant always.

      i am very new to this smartforms. can you please explain me in detail .

      Thanks and Regards

      Chaitanya.A

  • avatar image
    Former Member
    Apr 20, 2009 at 07:54 AM

    Article Store Quantity

    1a S303 2

    2a S304 3

    3a S305 2

    4a S306 4

    5a S307 5

    1b S303 2

    2b S304 3

    3b S305 2

    4b S306 4

    5b S307 5

    for this same internal table you have one more filed like char1.

    new internal table is

    Article Store Quantity char1

    1a S303 2 a

    2a S304 3 a

    3a S305 2 a

    4a S306 4 a

    5a S307 5 a

    1b S303 2 b

    2b S304 3 b

    3b S305 2 b

    4b S306 4 b

    5b S307 5 b

    here you can take 2 varibles like

    data: var1 type char 250,

    var2 type char250,

    lv_n(3) type n.

    lv_n = 20

    loop at newitab into wa_itab.

    concatenate ' 10 char space' wa_itab-store into var1+lv_n(20).

    concatenate ' 10 char space' wa_itab-Quantity into var2+lv_n(20). .

    at end of char1.

    append var1 to final interbal table

    append var2 to final interbal table

    clear lv_n.

    lv_n = 20.

    endat.

    lv_n = lv_n + 20.

    endloop.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

      Thank you..

      if i use your solution , what will be the structure of my Internal table and work area as my structure will not be constant always.

      Regards

      Chaitanya.A