2005 Jun 10 1:47 PM
Hi All,
I am using perform statement in smartforms. But is is not working.
same code is working in script.
Can I use perform in smartforms?
Regards,
Dilip
2005 Jun 10 2:05 PM
In Gobal Definitions, In INTIALIZATION tab you can define a perform and write the FOrm routine in FORMROUTINES tab.
You can also use Code Lines to write you code. FI you are talking about using PERFORM ENDPERFORM kinda of as in script, No you cannot .
But as i said above you can use those places to write your code.
Rgds,
Mano Sri
Hi All,
I am using perform statement in smartforms. But is is not working.
same code is working in script.
Can I use perform in smartforms?
Regards,
Dilip
2005 Jun 10 2:04 PM
Hi Diliip,
Yes you can. In the Global Defenitions of a smartform you see a Tab on the right called 'Form Routines'.
Here you can make your formroutines with the code.
Furtheron in your form (code parts) you can call these formroutines with the Perform statement.
Hope this helps.
Grtz. Marcel Leeraar.
2005 Jun 10 2:05 PM
In Gobal Definitions, In INTIALIZATION tab you can define a perform and write the FOrm routine in FORMROUTINES tab.
You can also use Code Lines to write you code. FI you are talking about using PERFORM ENDPERFORM kinda of as in script, No you cannot .
But as i said above you can use those places to write your code.
Rgds,
Mano Sri
2005 Jun 13 6:38 AM
Hi Mano,
I declare perform in initialization like this.
data data1 like makt-maktx.
PERFORM GET_DATA USING PERFORM GET_DATA IN PROGRAM ZGET_DATA.
USING &IT_RESULT-MATNR&.
CHANGING &DATA1&.
ENDPERFORM.
Here I am writing my code in formruutine, how smartforms identify "IN PROGRAM ZGET_DATA"? OR there is any other syntax?
But I am getting a errot saying that perform is not declared.
Also tell me what to define in initialization & what in
form routines.
Regards,
Dilip
Message was edited by: Diliip Gupchup
2005 Jun 13 7:40 AM
Hi,
Here I am giving you a simple example.
In Global Definition-Global Data,I declared
cnt type I 0(default value).
In Global Definiton-Form Routines,I coded as below.
form calc changing cnt.
cnt = cnt + 1 .
endform.
Then after that Inside the loop, in program lines,I coded
as below and given cnt as both input and output parameter.
perform calc changing cnt.
In text element inside the loop,I tried printing the cnt.
It's printing correctly.
Hope this helps.
2005 Jun 13 8:50 AM
Hi Jayanti,
Thaks for your informative reply.
As you have told following are my declarations :
<b>global data</b> - data1 like makt-maktx.
<b>form routines</b> -
form get_data changing data1.
select single maktx into data1 from makt.
break-point.
select maktx from makt into table it_makt for all entries in it_result1 where matnr eq it_result1-matnr .
endform.
<b>In program lines under loop -
</b>
perform get_data changing data1.
<b>ip/op parameters as data1.</b>
put that DATA1 field in textarea.
But not showing any o/p.
Also i declared it_makt in form interfaces - tables tab.
Is there any part i m missing?
Regards,
Dilip
<b></b><b></b>
2005 Jun 13 9:02 AM
Hi,
In global data,declare data1 & it_makt[ no need in form interfaces]
In form rourines, you are populating both data1 and it_makt.
So changing should be for both data1 & it_makt
and using should be for it_result1[since you are using for all entries]
In program lines,
give data1 & it_makt[] as output parameter
& it_result1[] as input parameter.
from where you are getting it_result?Is it from report or from smartform?
2005 Jun 13 10:21 AM
Hi,
To be more specific.
I worked out according to your requirement.
Just try this.
Global definitions:
Global data:
IT_RESULT1 TYPE STANDARD TABLE OF MARA
IT_MAKT TYPE STANDARD TABLE OF MAKT
MARA TYPE MARA
MAKT TYPE MAKT
WA TYPE MAKT
Form Routines:
FORM get_data TABLES p_it_makt STRUCTURE makt
p_it_result1 structure mara.
select * from makt into table p_it_makt for all entries in
p_it_result1 where matnr = p_it_result1-matnr.
endform.
Program Lines under Main window:
Input parameters:
Mara
It_result1
Output parameters:
It_result1
It_makt
Coding:
select * from mara into table it_result1.
perform get_data tables it_makt
it_result1.
After that , I created a loop .
In that IT_MAKT into wa.
Inside that loop,I created a text element.
Text Element:
Printing the required fields
Reward points for useful answers.If you have any doubt,please get back to me.
2005 Jun 10 2:09 PM
Hi,
You can do so by the text-editor icon available in left side of text element.
Just go and type in the text editor as you do in sap script.
2005 Jun 10 3:21 PM
Hi,
Please refer the following site, this is for sap script. But the same thing you can also do in Smart form
by clicking the text-editor icon.
http://www.sapdevelopment.co.uk/sapscript/sapscript_executeabap.htm
Thanks & Regards,
Venkat Ramanan
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |