on 02-09-2008 11:40 AM
Hi gurus,
The below is the table which i need to develop with the help of smartform.Pls help me out regarding this issue.How to generate and develop form and ABAP Programme.Im new to smartform.Or otherwise any standard programme to develop invoice item datails.......
ITEM DESCRIPTION QTY UNIT UNIT RATE TOTAL COMPL.WORK
10
20
30
Item VBAP-POSNR
Description VBAP-ARKTX
Qty RV45A KWMENG
Unit VBAP-VRKME
Unit rate KOMV-KBETR
Total KOMV-NETWR
Best Answers should be rewarded with high points.Thank you in advance..........
Hi Ramakrishna,
Lets put this simple.
Step1: Just complete your normal driver program where in your internal table has all the fields that you require to display in the Smartform.
Step2: Now create a structure of the same data type of your final internal table.
Step3: Now create a smartform and then in the form interface, in the tables section create a table that has to be passed. (This is very similar to the creation of Function modules, export, import and tables parameters..)
Step4: Now in the driver program call the Function modules
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZNEWSF'
IMPORTING
fm_name = fnam.
CALL FUNCTION fnam
EXPORTING
gv_name = gv_name
TABLES
gt_final_tab = gt_final_tab.
Step5: Now in the main window just create a table and then loop your internal table that you have passed from your driver program.In the table header you can have the desired header.
And in the main body of the table jus display what ever is required, this is done using text elements and in that if you want to display posnr then use &itab-posnr&..
This is pretty simple and just try it out...
Regards,
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
first create a table in the MAIN WINDOW with as many columns and rows you want
define 3 structure in the FORM INTERFACE (import tab)
Ex. itab_i type database table name
...........
In the report create 3 internal table
itab -
type abap
itab1----rv45a
itab2---komv
Then using select query you can fetch values from the database tables to the internal table
Then pass the internal table to the Smartform using Function Module " 'SSF_FUNCTION_MODULE_NAME'
Code for your reference
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Then under each CELL in the table create a text field
Ex.. &itab_i-fieldname&
itab_i means
structure name which u defined inthe FORM INTERFACE
This way u can put value inthe table
Hope this will help u
Thnaks
Krushna
Reward if it make sense to u
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ramakrishna,
first create a structure in se11 with all the fields u need.
or
u can do it in smartform itself at: global definitions -> types
types: begin of tab,
item type vbap-posnr,
description type vbap-arktx,
quantity type RV45A-KWMENG,
unit type VBAP-VRKME,
unitrate type KOMV-KBETR,
total type vbap-NETWR,
end of tab.
in global definitions -> global data
i_tab type table of tab
w_tab type tab
create a table in main window.
split the row into cells as many u required.
in table -> data
give loop from i_tab into w_tab
in header, in each cell create text n give the heading of row like item.
in body, for each cell create text, n give &w_tab-fieldname&
in driver program take the same structure ,create an internal table, write the select statement using inner joins to get the data from multiple tables.
hope the rest u know. i.e. how to execute
first call "ssf_function_module_name"
then the FM related to ur form, pass the values required.
get me if any doubts r not understood.
hope this can help u.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
6 | |
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.