on 01-24-2008 6:04 AM
Hi Friends,
I am doing smartforms for the first time and have gone thru the SAP's document for smartforms but still
have few querries which are left unanswered.
Kindly help in clarifying those :
1. If we are retrieving data from driver program and data is in internal table, we will define it in Tables tab
of Form Interface with table type. But I have seen in Import parameters in demo example some import
parameters have structures as there types. Then how do we use those import parameters?
2. How to do total and sub totals for numeric fields? And also how to change amout in words?
3. What is the purpose of Command, Program Lines and Loop with Specific example, so I can understand
what to apply and when to apply out of these?
It would be great if I get fruitful answers of these queries with relevant example and business requirements?
Regards,
Pradeep
1. If we are retrieving data from driver program and data is in internal table, we will define it in Tables tab
of Form Interface with table type. But I have seen in Import parameters in demo example some import
parameters have structures as there types. Then how do we use those import parameters?
If You're importing a table to a smartform You have to get the data from it using a loop or a table structure(in a smartform) to read every line.
When You're importing structure in Import parameters (first tab) You can simply write the data from it in the text fields like: &IS_ADRC-NAME&
2. How to do total and sub totals for numeric fields? And also how to change amout in words?
I think You have to do that in a some custom abap code
3. What is the purpose of Command, Program Lines and Loop with Specific example, so I can understand
what to apply and when to apply out of these?
=> Program Lines - used to add some abap code in the smartform
=> Loop - used to read data from the tables
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi pradeep,
1. If we are retrieving data from driver program and data is in internal table, we will define it in Tables tab
of Form Interface with table type. But I have seen in Import parameters in demo example some import
parameters have structures as there types. Then how do we use those import parameters?
=> generally when u define in table tab u will retrive data using a loop. but if u define in import tab u can directly access that one.
for example: i want to print matnr from mara
in import tab write: abc type mara
in text write: &abc-matnr&
then the value u passed in driver program will b printed in place of matnr.
2. How to do total and sub totals for numeric fields? And also how to change amout in words?
=> to get the totals
if u r printing data using table in smartform. then in for table, u will get its settings, in that select calculations tab. there u select total under operation, give the field name for which u want to have the total, give the target field name in which the total sum will b stored.
for eaxmple: im printing employee details
in the table i have 3 fields- empno, empname, empsal
i have defined a variable sum type i.
now i want to have sum of all employees salary.
now in table -> calculations tab -> give
operation = total
fieldname = empsal
target field = sum
now sum variable will have the total summed value.
3 What is the purpose of Command, Program Lines and Loop with Specific example, so I can understand
what to apply and when to apply out of these?
=> command:
it is to execute the commands like NEW-PAGE etc
program lines:
it is to write the code
here u have input parameter, output parameter n space to write the code
for example: i want to print the data in table MARA
in global definition -> global data tab
it_mara type MARA
in program lines: at input parameter give MARA
at output parameter give it_mara
in space below write: select * from MARA into it_mara.
endselect.
now u can get the data into it_mara. using table u can print them. like this u can write any code here.
or u have 2 variables with values v1,v2
u want to have the sum of them into v3
then: input parameter - v1
v2
output parameter - v3
code - v3 = v1 + v2
loop:
when u have data in a table, u dont want to print all the data. u just want to have the no.of entries in that or sum of one field in that table, then u can use this loop.
hope this helps you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.