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

how to write code in smartforms

Former Member
0 Likes
2,705

Hello Abapers,

I am new to smartform.I dont know where to declare internal tables,Data fetchings(selection queries) for headers and line items from database. what to declare in <b>form interface</b> and in <b>global definitions</b>.

Please Give your valuable sugeestions to me.

Regards

Maruthi

9 REPLIES 9
Read only

Former Member
0 Likes
1,689

Hi ,

Give ur mail id . I will send a document .

Regards ,

Senthil

Read only

Former Member
0 Likes
1,689

hi.

Define all ur structures in types tab.

declare the internal tables, work areas in the initialization.

declare all the variables used in global definitions.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,689

Hi,

If you are going to pass parameters fro driver program,declare those variable in form interface.If it is table,declare it in form interface->tables.

If the variables are used inside only in smartform,then declare it in global definitions.

Read only

Former Member
Read only

Former Member
0 Likes
1,689

hi

check out this link.

http://sap.niraj.tripod.com/id67.html

reward if helpful.

Message was edited by:

Sathiya kumar

Read only

Former Member
0 Likes
1,689

hi maruthi,

1.In form interface you have to give the variables or structures or tables...which you wanto pass form ur driver program

2. in the <b>global difination-->globaldata</b> you can declare data vartibles or structures ot tablei which u want to use in you smartforms..

3. if u want to write code in the smartform <b>global defination>initialization</b> you can wrinte select querys and code wht ever u want.. but you have to pass the varibles in inputparameters and output rprameters which u use them inside the initialization

Please Close this thread.. when u r problem is solved

Reward if Helpful

Regards

Naresh Reddy K

Read only

Former Member
0 Likes
1,689

Hi Maruthi,

In Form interface you can declare structures as well as tables. In Import Tab you can declare sturcutres & in tables tab you can declare tables. this data should be populated from your print program. Call the smartform in your Print program & pass the data to declared structures & tables.

The tables you declares in smartforms you can use loop & use the data of table.

For reading line item of table you need to use loop.

Right click on window & select Create then Flow logic & Loop.

in this loop provide you internal table name & work area.

For writing code in smartform follow this:

Right click on window & select Create then Flow logic & Program lines.

Ashven

Read only

Former Member
0 Likes
1,689

Hi Maruti,

For writing the code in your smartform you need to have that table in the global declaration for the smartform..... you can create a structure for that or else you can declare the structure in the smartform itself in the '<b>types</b>' tab of <b>'global declaration'</b> .....

after that please write click where you have to write the code and then goto

<b>Flow Logic -


> Program Lines</b> for writing the code ... then

drag and drop the same field for getting the desired output..

The form inteface tab --- > table contains all the tables which you are importing from the driver program.

In the global interface part you can declare the workareas of the type of the tables which you are importing in the internal table... work areais basically beacuse in the table for printing the details you have to loop at the internal table using some workarea .....

.. also if you are a new learner then please start with the smartforms using ....... parameters.....i.e pass only one value for which you want to get the output and try to print the basic report then try for other functionalities of teh msartforms

Message was edited by:

JAYANT KUMAR

Read only

Former Member
0 Likes
1,689

hi maruthi,

u can declare all ur work areas and internal table in global data section of global definitions.....

in types section of global definitions u can declare all ur user-defined structures....

in initialization section of global definitions u can give all ur select queries..

mentioning all ur importing and exporting parameters...

in form painter u can create the layout as designed by ...

that is u can place windows on ur form painter and customize the window height, length manually by dragging the window corners...

u can create window, graphic, address or text for ur window created....

u can also create a table for ur window...by mentioning the header fields , main area fields and footer section for ur table look like to be displayed in the layout of ur smartform...

ur smartform can be executed using driver program or just by using a function module

in form interface u can declare if u r using any parameters

as

parameter name - pr_vebeln

type assignment - type

assoiciated type - vbak-vbeln

.....

.