cancel
Showing results for 
Search instead for 
Did you mean: 

sub totals in SMARTFORMS

Former Member
0 Kudos

Hi all,

I have an internal table in my smartforms with vendor and material and rating of that vendor as the fields in it. I have to show the cumulated score of each vendor individually. So I have sorted the internal table by vendor and then by material in my Global fields node->initialization. I have selected the event Event on Sort end for the field Vendor in the DATA tab . I have selected score field in calculations tab as a field ,operation as Total ,Time->after loop and Initialization option is selected. A node is created for vendor after the body of my Table node. In that I have created text elements to show the cumulated score of vendor after having some some program lines.Every thing is fine. WhenI execute, it's showing dump saying field <Internal table> is unknown.It is neither in one of the specified tables nor defined by a data statement. This dump doesn't come when I deselect this event on sort end. Am I missing any declarations for this event to be executed?Please suggest.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jayasri,

Just check whether you have created a structure and table type in se11 and used the same in the form interface attributes of the smartform

your workarea will be of type structure in se11

and internal table of type tabletype created in se11

regards

padma

Former Member
0 Kudos

Hi Padma, I have created structure in SE11. And I have used LIKE as type reference in Form interfaces.If the header is not created automatically,how did the data display in my smartform through the header line of my output table before I used Event on Sort end? Why didn't it throw any error when the header doesn't exist? How come it shows the data?

Any way this problem is solved now.Thank u.

Former Member
0 Kudos

Hi Padma,

I am facing another problem when calculating subtotals. There will be no.of materials for each vendor.For each material, a score will be there.I have to show the average score for each vendor. For the 1st vendor, it's showing correct score.While calculating the score for the 2nd vendor , the total value and the counter values are not reset to initial values.That's y it's showing wrong score for 2nd vendor.

Values I have mentioned in Calculation tab are:

Opr.n Fldnam Target f. Event Initilztn Reset Sort criterian

Total wa_final-venpr venscore after loop active Sort crit. LIFNR

number count after loop active Sort crit. LIFNR.

Even though the initialization is active , it's not setting the value of target fields to initialized. I am taking the events as adter loop. Am I taking wrong event? I want those target values to be initialized after completion of each vendor.Please help.

Answers (7)

Answers (7)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Jayasri.

I would like to suggest,

Check,

Global Definitions -


> Global data,

Global Definitions -


>Types ,

Global Definitions -


>Initializations -


> Output Type.

Make sure that (SAY) -


> FS_ITAB and T_ITAB are present in all the above areas. (That is Work area and Table)

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

Former Member
0 Kudos

Hi Jayasri,

Create the table line under the Event on Sort End in body and check it..

regards

padma

Former Member
0 Kudos

Hi padma,

I have created the table line under the event on sort end node only.No where syntax error is showing in SMARTFORM. And the internal table has both body and header .I have created the internal table with both header and body in main program and inported into smartform using the reference of a structure using LIKE reference operator.

Former Member
0 Kudos
Former Member
0 Kudos

As you are manipulating the internal table inside the smartform,

1. Declare the structure for the internal table in the u2018TYPESu2019 tab of u2018GLOBAL DEFINITIONu2019.

Eg. TYPES: BEGIN OF st_vendor,

matnr TYPE mara-matnr,

mtart TYPE mara-mtart,

END OF st_vendor.

2. Declare an internal table under the u2018GLOBAL DATAu2019 of u2018GLOBAL DEFINITIONu2019. tab similar to the structure declared in the u2018TYPESu2019 tab of u2018GLOBAL DEFINITIONu2019.

Eg.

Variable name Type Assignment Associated type

IT_VENDOR TYPE TABLE OF ST_VENDOR

3. Now use this internal table for your query under the u2018INITIALIZATIONu2019 tab by declaring the internal table (here in our example IT_VENDOR) name either in the u2018Input parametersu2019 or u2018Output Parametersu2019

Now you can access the internal table through out the nodes.

Hope this will resolve the issue.

Former Member
0 Kudos

actually this internal table is imported from main program.

In my SMARTFORM , I have given a structure as reference for this internal table in Form Interfaces node. There was no dump if I deselect the option of Event on Sort end.Why does it happen so?

Former Member
0 Kudos

Hi,

Have you declared your internal table in the global defintions

Regards,

Sravanthi

Former Member
0 Kudos

declare the all the currency and quantity fields in the global definitions->currency/quantity tab....