Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

smartform design?

Former Member
0 Likes
7,342

when we are calling smartform with driver program and passing form interface parameters in function module genarated by smartform is it mandatory to declare internal table in bcz we already passing data data

     1.  Global settings :

           Form interface

           Variable name    Type assignment   Reference type

           ITAB               TYPE                  Table Structure

    2. about looping is it mandatory at form level or we can do looping in driver program.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
7,116

For the first question the answer is 'Yes'. It is so because the Function Module for the smartform is generated with the form interface parameters as the import parameter to the FM. You can check this by creating a smartform without any form interface parameters and calling it in the driver program.

The screenshot above shows the import parameters of my smartform's FM. The last entry is the one which I have declared in my interface parameters and that is added in to the import parameters.

For the 2nd question also the answer is 'Yes'.

16 REPLIES 16
Read only

Former Member
0 Likes
7,116

Hi SAP ABAP ,

It is not mandatory to loop at form level , you can loop in driver program and you can pass the internal table into the form.

Thanks,

S.Rajendranath Raparthi.

Read only

Former Member
0 Likes
7,116

This message was moderated.

Read only

former_member209120
Active Contributor
0 Likes
7,116

Hi

when we are calling smartform with driver program and passing form interface parameters in function module genarated by smartform is it mandatory to declare internal table in bcz we already passing data data

      1.  Global settings :

           Form interface

           Variable name    Type assignment   Reference type

           ITAB               TYPE                  Table Structure

You should declar ITAB in Form interface ->Tables like this

    2. about looping is it mandatory at form level or we can do looping in driver program.

Yes like this

Please see this link for more about smartforms

linke removed by moderator - banned site

Message was edited by: Matthew Billingham

Read only

Former Member
0 Likes
7,116

1. Yes it is mandatory to pass the parameter if you are creating it in Form Interface. But you can pass Default Value their to make it optional.

2. You can loop inside Smartform itself. It's completely upto you.

Read only

jogeswararao_kavala
Active Contributor
0 Likes
7,116

Hi,

In smartforms driver program, it is always better to create a structure through SE11, on which the internal table is defined.

The SF interface table also should be assigned to the same structure.

This is to prevent 'Type' errors which often trouble very much.

In the following example, this structure is ZPM_MS101.

In the following example internal table ITAB1 is interfaced from the Driver program.

Now see the following screen-shots to understand the process:

-Jogeswara Rao K

Read only

Former Member
0 Likes
7,116

hi ,

to get the data in the Smart Form

1) Declare internal table  in smart form of the same type (Form Interface)

2) loop Internal table in the smartform

       I think its mandatory to loop at the form level

Read only

Former Member
0 Likes
7,117

For the first question the answer is 'Yes'. It is so because the Function Module for the smartform is generated with the form interface parameters as the import parameter to the FM. You can check this by creating a smartform without any form interface parameters and calling it in the driver program.

The screenshot above shows the import parameters of my smartform's FM. The last entry is the one which I have declared in my interface parameters and that is added in to the import parameters.

For the 2nd question also the answer is 'Yes'.

Read only

0 Likes
7,116

Hi ,

Yes it is mandatory to pass the internal table parameter though you are declaring in the driver program because the function module is generated by  smart form attributes and you can loop in smartform or either in driver program.

Regards

Khaleel

Read only

0 Likes
7,116

This message was moderated.

Read only

mayur_priyan
Active Participant
0 Likes
7,116

Hi,

When you are trying to call the smartform through a driver program you need to pass the values defined in the FORM INTERFACE. And thus if you have maintained a table in the interface then you need to pass the appropriate values.

The looping depends on the coder, it is better to use the LOOP option within the TABLE node of the smartform.

Read only

0 Likes
7,116

Hii

sap abap

Step to be followed are:

1> Create a structure in SE11 with ur require number of fields.

2> Declare a internal table under global setting form interface.

In the picture T_VBRP is a internal table of structure type ZVBRP created in SE11.

3>create a main window to display the item data in smart form.

Here in the picture in data tab looping the internal table T_VBRP into X_VBRP.

Here we can also specify the where condition.

Since a FM is generated by the smart form with import parametes.

So it is mandatory to declare internal table in form interface.

For looping the internal table, it's better in terms of output to loop in smart forms.

Then call ur generated FM into ur driver program.

Regards

Syed

Read only

0 Likes
7,116

This message was moderated.

Read only

Former Member
0 Likes
7,116

Hi,

In Form Interface of Global settings in smartform you can declare the variables that you want to link with smartform. You can either declare Internal table in Tables tab. Or else you can declare a Structure in Import tab.

It is not mandatory that you need to loop at form level. If you are using an internal table, you can pass all the records at once to smartform and you can loop at smartform level.

Or else you can loop the internal table in the driver program and pass each row in a structure to smartform.

Always better to pass whole internal table with data to smartform and loop inside smartform.

If you don't loop the internal table, no data will be displayed in the output.

Regards,

Shahanaz Hussain.

Read only

0 Likes
7,116

This message was moderated.

Read only

0 Likes
7,116

First

you need to identify what data you require in your smartform!!

thats the most important

then you need to pass that thru the İnterface!!!

Its better to pass more data then less incase you need

in the smartform if there is alot of processing overhead you can decrease the table you are passing from the report.

The report you will call this smartform can be a standard sap transaction or a Z transaction

Read only

anubhab
Active Participant
0 Likes
7,116

Hello,

Answer for your first question: Yes, it's mandatory to declare internal table in the interface of smartform. Until unless you define it in smartform interface, it won't be able to understand what inputs its getting. Only if you declare the internal table in interface of smartform, then only, when you call the function module in ABAP editor, you will get the internal table as exporting parameter or else you won't get it. So it's mandatory.

Answer for your second question: If you just want to pass an final internal table and just display that in smartform, then you need not to use loop within smartform. But, if you want to perform any calculation on the data in the internal table, then you need to loop at that table inside the smartforms only. In the second case, if you use loop in main program, it won't perform as expected.

Hope this helps.

Regards,

Anubhab