Table declaration in Smartform
Hello Friends,
I am working on smartforms, I have to write some routines and for this I am using some tables which I want to declare as global, so that I can use the tables in my routine without decalring tables again. Please suggest me how to proceed with this.
Thanks,
Shreekant
in ur global data declare ur tables like
wa type wa
itab type itab
in ur types declare
TYPES: BEGIN OF wa,
mvgr4 TYPE mvke-mvgr4, " SIZE
matnr TYPE vepo-matnr, " MATERIAL CODE
end of wa.
types: itab type wa occurs 0.
and just pass ur table to the form routines
Similar Messages
-
Passing an Internal table to the Smartform
Hi Experts,
I have build an internal table in the driver program with some (20 fields) now I need to pass the same internal table to Smartform as importing parameter or Tables Parameter so that I can use the table data for my further processing.
I have searched the forums and its look like I can't pass an Internal table to the smartform unless and until it is defined in the DDIC with the table types.
FYI...
I can't create the DDIC table type as it needs lot of approvals to get it created.
Please help me on how to proceed further.
Thanks in advance.
Regards,
SrinivasI can't create the DDIC table type as it needs lot of approvals to get it created.
It's a shame you need approval for this.
Anyway can you overcome this with field symbols:
- type parameter in Smartform FM with TYPE STANDARD TABLE (or INDEX/SORTED/HASHED - depending which one you use)
- pass your locally typed table
- in SF create the same data type
- declare field symbol with this type
- assign the table from the parameter to this field symbol - this way you can work with the table via field symbol as it would be of the table type
"in SF
TYPES: tt_my_type TYPE TABLE OF my_type..
FIELD-SYMBOLS <tab> TYPE tt_my_type .
"itab is parameter table
ASSIGN itab TO <tab>.
"now you can even address its components
<wa_tab>-field1 = ...
Although FM parameters in general should be typed with DDIC types only, this way you can cheat the system a little bit;)
Regards
Marcin -
Hello Guys,
Im just new in ABAP...and currently using smartforms . Im quite confuse in table width..
my report should be in legal size with 18 columns...dont know what is the exactly size for each column. I tried to use a table width of 300 MM..but once i preview the report..its just so small and the top and bottom size of each cell is large..so it looks like this :
Please give me some advice or technik on what to do:
99,99999
Thanks in advance
aVaDuDzHi
Go through the doc and handle the Table width/height in smartforms
How to create a New smartfrom, it is having step by step procedure
http://sap.niraj.tripod.com/id67.html
Here is the procedure
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
http://sapr3.tripod.com
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.
for Smartforms material
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sap-press.com/downloads/h955_preview.pdf
http://www.ossincorp.com/Black_Box/Black_Box_2.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sap-img.com/smartforms/smartform-tutorial.htm
http://www.sapgenie.com/abap/smartforms.htm
How to trace smartform
http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
http://www.sap-img.com/smartforms/smart-006.htm
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
Re: Need FAQ's
check most imp link
http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
<b>step by step good ex link is....</b>
<b>http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html</b>
Reward points if useful
Regards
Anji -
How to increase the row height of the table in the smartform
Hi,
Can any one say,
How to increase the row height of the table in the smartform.
It is presently show the row width very small, i want to increase the row with of the table in the smartform.
Plase say how can we increase the row height in the smartform.Hi Ravi,
In Smartforms , Select the Table and you can adjust the cell hieghts in OUTPUT OPTIONs TAB.
Reward points if that Helps.
Manish -
How to pass the internal table data to smartforms
Hi Gurus,
I have a problem in passing the internal table data to the smartforms. In the print program
I get the data into one internal table "LT_PRDLBL1". I am passing this internal table to the other in print program by calling the FM_NAME.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = T_SSFCTRLOP
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = T_SSFCOMPOP
USER_SETTINGS = ' '
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
LT_PRDLBL = LT_PRDLBL1
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
In the print program I had defined the internal tables like
Data: lt_prdlbl type standard table of zprdlbl.
Data: Begin of lt_prdlbl1 occurs 0.
include structure zprdlbl.
Data: End of lt_prdlbl1.
How do I define the internal table in the smartform to get the values printed in the smartform?.
<REMOVED BY MODERATOR>
Thanks,
Edited by: Alvaro Tejada Galindo on Apr 21, 2008 1:01 PMNehal,
Thanks for quick response.
In the smartform under the Form Interface->Tables tab
I had defined
LT_PRDLBL LIKE ZPRDLBL. If I define TYPE instead of LIKE I get the error message saying "FLAT TYPES may only be referenced using LIKE for table parameters".
In the main window I have created LOOP, in which I have ticked the internal table and
LT_PRDLBL INTO LT_PRDLBL. In the text node I am passing the values of this internal table
<_PRDLBL-XXXX&.
I am able to get the print but the data is not printing.
Please help me with this.
Thanks, -
Error in ABAP Report TABLES declaration
Hi,
I am a Basis administrator and trying to write a small program for archiving.
I get a folowing error when user the following statement in a report -
TABLES: RSDAARCHREQ.
The error is as follows -
"RSDAARCHREQ" must be a flat structure. You cannot use internal tables,
strings, references, or structures as components. -
I can include all the other tables requred but somehow this particular table gives me this error which I have never encountered earlier. This is BI 7.0 and it is standard SAP transparent table.
Please help me.
I will appreciate it.
Regards,
SumeHi Sume,
Do not declare RSDAARCHREQ in tables.
If you want a internal table declare in the below mentioned way .
data: it_RSDAARCHREQ TYPE STANDARD TABLE OF RSDAARCHREQ.
select * into table
it_RSDAARCHREQ
from RSDAARCHREQ.
Regards
Naresh -
In which table scripts and smartforms are stored
in which tables scripts and smartforms are stored
eg scripts in tadir.Hi this may be of some help.
SD
SALES ORDER/ENQUIRY/QUOTATION
Output type : BA00
ScriptForm Name : RVORDER01
Driver Program Name : RVADOR01
smartform name
DELIVERY NOTE
Output type : LD00
ScriptForm Name : RVDELNOTE
Driver Program Name : RVADDN01
smartform name : LE_SHP_DELNOTE
Smartform Driver Pgm: RLE_DELNOTE
INVOICE
Output type : RD00
ScriptForm Name : RVINVOICE01
Driver Program Name : RVADIN01
smartform name : LB_BIL_INVOICE
Smartform Driver Pgm: RLB_INVOICE
MM
PUCHASE ORDER/RFQ/CONTRACT
Output type : NEU
ScriptForm Name : MEDRUCK
Driver Program Name : SAPMF06P
smartform name : /SMB40/MMPO_L
smartform driver program: /SMB40/FM06P
GOODS RECEIPT
Output type : WE01
ScriptForm Name : WESCHEINVERS1
smartform name : /SMB40/MMGR1_A
smartform driver program: /SMB40/M07DR
GOODS ISSUE
Output type : WA01
ScriptForm Name : WA_SCHEINVERS1
smartform name : /SMB40/MMGI1_A
smartform driver program: /SMB40/M07DR
FI Forms
Account Statement : F140_ACC_STAT_01
Cheque Printing : F110_PRENUM_CHEK
Balance Confirmation: F130_confirm_01
Dunning Form: F150_DUNN_01
check the link below it provides steps to convert sap scripts to smartforms
http://www.ficoexpertonline.com/downloads/Iyer_SmartForms.pdf
SMARTFORMS -Driver Program
PO: /SMB40/FM06P
SO: /SMB40/RVADOR01
GR: /SMB40/M07DR
with regards,
Hema Sundara.
pls give points if u find this helpful. -
DIFF: Field string ,Structure and Internal table declaration
Hai,
what is the diference between Field string ,Structure in ABAP program and Internal table declaration and how it will work ?
Thank you
ASHOK KUMAR.hi,
Look this u will get a good idea.
*& Report ZTYPES *
REPORT ZTYPES .
* Table declaration (old method)
DATA: BEGIN OF tab_ekpo OCCURS 0, "itab with header line
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
END OF tab_ekpo.
*Table declaration (new method) "USE THIS WAY!!!
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0, "itab
wa_ekpo TYPE t_ekpo. "work area (header line)
* Build internal table and work area from existing internal table
DATA: it_datatab LIKE tab_ekpo OCCURS 0, "old method
wa_datatab LIKE LINE OF tab_ekpo.
* Build internal table and work area from existing internal table,
* adding additional fields
TYPES: BEGIN OF t_repdata.
INCLUDE STRUCTURE tab_ekpo. "could include EKKO table itself!!
TYPES: bukrs TYPE ekpo-werks,
bstyp TYPE ekpo-bukrs.
TYPES: END OF t_repdata.
DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0, "itab
wa_repdata TYPE t_repdata. "work area (header line)
Regards
Reshma -
How to use the types declarations in smartforms
hai
already i declared the types in smartfomr global defination, how to call the types to the internal table and workarea, in which please i declare the internal table and work area by using the types structures
for example
types: begin of ty_kna1,
kunnr type kunnr,
name1 type name1,
land1 type land1,
end of ty_kna1.
how to call the above types to internal table and work area in simartforms , in which place i declare the above types to the internal table and workareaHi,
Please see below
**In Types tab
types: begin of ty_kna1,
kunnr type kunnr,
name1 type name1,
land1 type land1,
end of ty_kna1.
Types:ty_t_kna1 type standard table of ty_kna1.
In Global data tab
***Internal table declaration
data:i_kna1 type ty_t_kna1.
***Work area declaration
data:wa_kna1 type ty_kna1.
Regards
Jana -
Internal table declaration - work area and body
Hi all
I have declared my internal table in my program as
data : itab_wa type ZRESULT_LINE,
itab type ZRESULT_ROW.
Where ZRESULT_LINE and ZRESULT_ROW are the structure and table types.
Now I want to add
data: TCOLOR TYPE SLIS_T_SPECIALCOL_ALV.
in my internal table declaration. How can I do this. Please remember I need to have work area and body in my internal table as I have used work area and body in my code.
Waiting..............
Message was edited by: Raju BodaHI,
See the Declarion types of workarea and Internal tables
* Table declaration (old method)
DATA: BEGIN OF tab_ekpo OCCURS 0, "itab with header line
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
END OF tab_ekpo.
*Table declaration (new method) "USE THIS WAY!!!
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0, "itab
wa_ekpo TYPE t_ekpo. "work area (header line)
* Build internal table and work area from existing internal table
DATA: it_datatab LIKE tab_ekpo OCCURS 0, "old method
wa_datatab LIKE LINE OF tab_ekpo.
* Build internal table and work area from existing internal table,
* adding additional fields
TYPES: BEGIN OF t_repdata.
INCLUDE STRUCTURE tab_ekpo. "could include EKKO table itself!!
TYPES: bukrs TYPE ekpo-werks,
bstyp TYPE ekpo-bukrs.
TYPES: END OF t_repdata.
DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0, "itab
wa_repdata TYPE t_repdata. "work area (header line
you need to maintain same structure for both workarea as well Internal table
Regards
Sudheer -
PL/SQL TABLE declarations must currently use binary_integer indexes
Hi,
I am having procedure written in form6i, this procedure is having pl/sql table datatyep "v_suppmesg orcl.err_message.error_tabtype;" this pl/sql datatype is defined in database and the procedure in database is not having any error in it.
But when i am compling my form its giving me error
PL/SQL TABLE declarations must currently use binary_integer indexes
and error point is *"i_rowindex"* in the sentance given below.
*"SET_GROUP_CHAR_CELL (g_suppress_error_colid, v_rowindex, v_suppmesg(i_rowindex));"*
PROCEDURE PRC_A IS
v_rowindex NUMBER (5,0) := 1;
v_suppmesg orcl.err_message.error_tabtype;
BEGIN
g_suppress_error_rgid := FIND_GROUP (g_suppress_error_rgname);
IF ID_NULL (g_suppress_error_rgid)
THEN
g_suppress_error_rgid := CREATE_GROUP (g_suppress_error_rgname, GLOBAL_SCOPE);
g_suppress_error_colid := ADD_GROUP_COLUMN ( g_suppress_error_rgid
, g_suppress_error_colname
, CHAR_COLUMN
, 15);
orcl.err_message.get_messages (v_suppmesg);
FOR i_rowindex IN 1..v_suppmesg.count
LOOP
ADD_GROUP_ROW (g_suppress_error_rgid, END_OF_GROUP);
SET_GROUP_CHAR_CELL (g_suppress_error_colid, v_rowindex, v_suppmesg(i_rowindex));
v_rowindex := v_rowindex + 1;
END LOOP;
ELSE
g_suppress_error_colid := FIND_COLUMN (g_suppress_error_rgname||'.'||g_suppress_error_colname);
END IF;
END Init_Suppress_Message;
can anyone tell me what's wrong in this.I have the folowing compiling and executing fine (Forms 10.1.2):
DECLARE
type t1 is table of VARCHAR2(100) index by BINARY_INTEGER ;
tab t1;
rg_id RecordGroup;
gc_id GroupColumn;
BEGIN
tab(1) := 'One' ;
tab(2) := 'Two' ;
tab(3) := 'Three' ;
rg_id := FIND_GROUP ('RG10');
IF ID_NULL (rg_id)
THEN
rg_id := CREATE_GROUP ('RG10', GLOBAL_SCOPE);
gc_id := ADD_GROUP_COLUMN ( 'RG10'
, 'COL1'
, CHAR_COLUMN
, 15);
--orcl.err_message.get_messages (v_suppmesg);
FOR i IN 1..tab.count
LOOP
ADD_GROUP_ROW ('RG10', END_OF_GROUP);
SET_GROUP_CHAR_CELL ('RG10.COL1', i, tab(i));
END LOOP;
END IF;
END;Francois -
How to avaoid tables declaration in abap object 's
Hi Folks,
I realised that in abap objects we should not declare tables statement, instead we have to declare wa type dbtable. But my qsn is i am using select single * from dbtable in at selection-screen for validation, in that situation in that situation how to avoid table declaration, i tried with select single * dbtable into wa , but still its asking table declaration.
Pls help me out, thanks.
Regards
Vishal<b>method GET_VENDOR_4_USER .
Get the Vendor for the User
data: x_lfa1 type lfa1.
clear vendor.
select
lifnr
into VENDOR
from zsiacvendor
up to 1 rows
where bname = sy-uname.
endselect.
get the name of the vendor
select single *
into x_lfa1
from lfa1
where lifnr = vendor.
endmethod.</b>
The above code works fine for me. -
Dynamic table layout in Smartform
Hi,
Is there a way to have a dynamic table layout in smartform?
The idea is to be able to print any kind of table with fieldsymbols without having to define the table layout/cell layout at design time, or if it's not possible choose one of the predefined line types at runtime. Please don't post how to print out a table using fieldsymbols, this is not the topic of this question.
So I guess you'd need to choose the table line type at runtime or even better, create a table line type at runtime. Is this even possible?
Thanks
Edited by: Stanley Marsh on Oct 16, 2008 12:43 PMhi
good
Tables
You can include static and dynamic tables into a Smart Form. Dynamic tables enable you to display tables whose size is determined only at the moment of their output by the number of the table items to be displayed. Table functions are:
· Line feeds in individual table cells
· Event-controlled output of table headings and footers
· Integrated calculation of grand totals and subtotals
· Colored boxes and shadings in tables
thanks
mrutyun^ -
How to find page subtotal in tables in a smartform?
Hi All,
Can anyone please help me how to find the page subtotal of any field thats populated in a table in a smartform?hi ,
for sub-totals create int.table and work area of type your required db.table and go through the below steps.
1. mention the field in <b>Sort Criteria</b> (you can find in DATA tab inTABLE)based on which you want subtotal for another field.And check the check-boxes Event on SortBegin,Event on SortEnd.
2.then you will get 2 nodes with name of the field u have given.before and after main area. for ex.NTGEW Event on SortBegin
NTGEW Event on SortEnd
( for example you want subtotal based on the weight-wise i.eNTGEW and you want to add cases delivered i.e.LFIMG)
3.pass the data to subtotal internal table from int.table which contains item data or from datadbase. in main area
4.below the <b>NTGEW Event on SortEnd</b> node create one <b>loop</b> and under the loop create <b>programlines</b> there you have to write coding for subtotal like in reports,
loop at it_sub into wa_sub.
at end of <f>
sum.
endloop.
and then create one <b>TEXT</b> and give the variable for ex. &wa_sub-lfimg&(which contains subtotal value)
5.and dont forget you should refresh the int.table of subtotal below the <b>NTGEW Event on SortBegin</b> node.
for <b>totals</b> simply mention in the calculation tab.
regards,
rajkumar.
Message was edited by:
rajkumar -
Dot matrix printers Capable of printing TABLE lines In Smartforms
Hey guys,
we are using EPSON LX-300+ (dot matrix pritner)
but the problem is,
it is not able to print table lines present in a SMARTFORM..
it can print the same table lines presnet in SCRIPT ...
so i want to know,
all the dot matrix printers in the market...
that can print table lines in SMARTFORMS...
(pls suggest the DM printers u are using and dont have this problem..i.e unable to print table lines in SMARTFORMS)
thank you...Hi Sreesudha,
I have used three different line types for the main window.
LTYPE1(Header) : For printing the column heading along with the title for consignor address.
LTYPE2(Main Area) : For printing the line items detail. For the first line, I have to print Material Description and chapter Id and if the same material exists for the second line item, then it should not be printed, so I have written condition for not printing it.
LTYPE3(Footer) : For printing the footer with the net and gross weight details.
And for paragraph format, I have used the custom Para. Format only.
Suggest me ASAP.
Rgds,
JK
Maybe you are looking for
-
Apple TV w/no iPhone, iPad, or iTunes
Does it make sense to use AppleTV if you don't use the other Apple services?
-
Hashtable really thread safe or is there a bug in it ?
Hashtable is said to be thread-safe, so I think it should be true. So I just want someone to tell me what is wrong with my following observation: I downloaded the source code of jdk 1.3.1 and read the file Hashtable.java, that contains the implementa
-
Theme select by user before start the course?
Hi Everyone, I need help of someone. 1. I want create theme selector page by user before start the course every time? 2. I want to change the font size of CC caption (Audio Script/Transcript) by user in run time? Thanks -Sarif
-
Issue drilling on Value Based Hierarchy
I just wanted to post this issue in the hopes that someone else may have run across the same behavior. The issue I am having is that when I build Value Based (i.e. parent/child) hierarchies at some point I am losing the edibility to drill down on tho
-
The Galaxy Note 3 is now receiving Lollipop: http://www.droid-life.com/2015/04/15/verizons-galaxy-note-3-gets-lollipop-today/#more-165547 Samsung Galaxy Note 3 Software Update Benefits | Verizon Wireless