‎2007 Apr 04 9:03 PM
Hi Group,
Couls anyone help me in the smartforms . I have got 6 tables from which i have to fetch the data and generate a smartform.
i am able to get the data into the internal tables but when i am passing the data to the smartform its not accepting it and returns a dump.
i am declaring 6 structures for ty_ekko,ty_ekpo,etc., in the form interface
it_ekko type ty_ekko.
i am declaring the work areas like wa_ekko type ekko in the global def tab.
please tell me where i am wrong..
‎2007 Apr 05 5:51 AM
Hi,
You r filling the data in the internal tables & passing these tables to smartform,right?
So,instead of workareas (structures) you have to define internal tables in your smartform.The structure of Internal tables & work areas, that u declare in smartform & ur application program should be same.
I hope this will solve ur problem.Please reward points if u find it useful.
regards,
RK.
‎2007 Apr 04 9:11 PM
Hi
I do not know which type of error you are getting, anyways here is the link which will explain you to create a New smartfrom, it is having step by step procudre
http://sap.niraj.tripod.com/id67.html
Here is the procidure
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
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.
Regards
Sudheer
‎2007 Apr 05 5:51 AM
Hi,
You r filling the data in the internal tables & passing these tables to smartform,right?
So,instead of workareas (structures) you have to define internal tables in your smartform.The structure of Internal tables & work areas, that u declare in smartform & ur application program should be same.
I hope this will solve ur problem.Please reward points if u find it useful.
regards,
RK.
‎2007 Apr 05 3:51 PM
Hi RK,
I will explain u the scenario.
I have designed a selection screen in which the parameter is p_vbeln.
then i have 6 internal tables by name it_ekko,it_ekpo,it_adrc,it_too1w,it_lfa1,it_kna1 which gets the vendor, customer details etc.,
The problem occurs in declaring this in smartforms.
i am getting the data into the intenal tables perfectly its only not reaching the smartforms
can u tell me how the declaration should be in the smartforms
show me the sample how and where exactly we declare it in smartforms.
hoping for a positive reply.
regards
Jackson
‎2007 Apr 05 4:18 PM
Hi Redfriend
there are two ways to go with
1.define structures in se11 and define your smartform internal tables of that structure types.
2.as you have declared some structure for your internal tables in the report , the same should be declared in the smartform so that it holds data in the layout.
for this the delcaration part should be done in the global definition
under global definition,go with types tab,deifne your structure with types statement.
and in the global data define your internal tables with TYPE REF TO your type structure defined in the types .
now under initialization you can write all select statements through which you will get data into the internal tables.
There is no need to write select statements in the driver program using this just pass the selection screen variable to the form thats it
this way you can solve your problem
Hope its understandable
Reward points if helpful.
Regards
zarina
‎2007 Apr 05 6:08 PM
hi Zarina
can u give me ur email id .. i have done that but there seems to be a problem .. Could you help me in this.
Regards
Jackson
‎2007 Apr 06 6:21 AM
‎2007 Apr 06 6:30 AM
Hi,
I assume that the internal tables are exactly same as database table. I mean they are define with reference type to database table. For example,
DATA: lit_ekko LIKE STANDARD TABLE OF ekko WITH HEADER LINE.and similarly the other tables.
If you want to pass the tables in Smartforms, then you have to <b>defined them into "Table" tab of 'Form interface'.</b>
The "table" tab has three columns. In your case, you will define tables like this.
Parameter name Type Assignment Reference Type
-------------- --------------- --------------
IT_EKKO LIKE EKKO
IT_EKPO LIKE EKPO
IT_ADRC LIKE ADRC
IT_T001W LIKE T001W
IT_LFA1 LIKE LFA1
IT_KNA1 LIKE KNA1Let me know if you still have a problem.
Regards,
RS
‎2007 Apr 06 7:53 AM
Hi,
In smartform click on 'Global settings' node.
Double click on 'Form Interface',then click on 'Tables' tab.
Under this tab,define ur tables as below:
it_ekko like ekko
it_ekpo like ekpo
it_adrc like adrc
it_t001w like t001w
it_lfa1 like lfa1
it_kna1 like kna1
Hope this will work.
regards,
rajesh.
‎2007 Apr 06 6:30 AM
hi,
u said that ur declaring 6 structures for ty_ekko,ty_ekpo,etc., in the form interface like it_ekko type ty_ekko.
i think u need to give the standard type here..
like..........ex: it_ekko like ekko
it_ekpo like ekpo.
juss try it once..
‎2007 Apr 09 1:36 PM
Hi Rj
any luck
i have just send you a mail asking you to change the form name frm ZSdn_help to ZTEST(Which is the one you gave to your form ).
Reward points if helpful
Regards
Zarina