‎2007 Aug 25 12:21 PM
hi experts,
i have developed a alv report in which ,from this table i m showing output.......
TYPES:BEGIN OF S_FINAL ,
MATNR TYPE MARD-MATNR, "for material number
WERKS TYPE MARD-WERKS, "for plant id
LGORT TYPE MARD-LGORT, "Storage location
LABST TYPE MARD-LABST, "opening stock
INSME TYPE MARD-INSME, "Stock in quality inspection
SPEME TYPE MARD-SPEME, "Blocked stock
EINME TYPE MARD-EINME, "Totl Stck of All Restricted Batches
RETME TYPE MARD-RETME, "Blocked Stock Returns
LIFNR TYPE MSEG-LIFNR, "vendors number
MAKTX TYPE MAKT-MAKTX, "for material description
NAME1 TYPE T001W-NAME1, "plant name
NAME2 TYPE LFA1-NAME1, "vendors name
LABST_TM TYPE MARD-LABST, "target monthly
LABST_CL TYPE MARD-LABST, "closing stock
LABST_RT TYPE MARD-LABST, "receive today
LABST_RTLD TYPE MARD-LABST, "receive till date
LABST_RTY TYPE MARD-LABST , "receive till year
LABST_IT TYPE MARD-LABST, "issued today
LABST_ITLD TYPE MARD-LABST, "issued till date
LABST_ITY TYPE MARD-LABST, "issued till year
<b> BWART TYPE MSEG-BWART, "movement type</b>
<b>MBLNR TYPE MSEG-MBLNR, "material doc number</b>
EISBE_CL TYPE MARC-EISBE , "closing balance
EISBE TYPE MARC-EISBE, "safety stock
LGOBE TYPE T001L-LGOBE, "Description of storage location
P_DATE TYPE SY-DATUM, "for previous date
<b>GPTXT TYPE T750E-GPTXT, "for remarks</b>
END OF S_FINAL.
DATA:ITAB_FINAL TYPE STANDARD TABLE OF S_FINAL WITH HEADER LINE.
the fields which are bolds i m not showing in the output using for some calculation thatsit.
now the user is saying to make smartforms in which ,the data which are coming in the alv display will come in the smartforms,for this gurus how will i pass this internal tables into the smartforms.plz let me know the syntax and where sud i define the internal tables in the smartforms and how....plz help me as i m new to smartforms...
‎2007 Aug 25 12:28 PM
Hey rajat,
Passing data into a smart form is very easy,
if you go to your smart form from transaction SMARTFORMS, just define a tables parameter on the form interface. This table type must be of the same type as your report data table (You may have to create a dictionary structure for this).
This tables parameter will appear on the smart form function module parameter list, when it is called.
‎2007 Aug 25 1:00 PM
Hi Rajat
for this first you have to create a smartform let say zsmartform
and in the zsmartform you need to pass the table name in the form interface third tab table. In this you need to give the table name like the database structure of your fields which you are using in the table like the structure of S_final in your example case .
and for passing the table from your print program you need to call two function module
first one is
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = VAR
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
In this you need to give your smartform name and taking the function module which is generated for each smartform in a variable var.
which var is of type RS38L_FNAM.
you can find the function module name in environment function module name in smartform
and after that you need to call this function module in your print program and than replace the name of that function module with var .
like
CALL FUNCTION VAR
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
it = TABLE_NAME
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.
and in tables give your table name.
than it will be available in smartform