2008 Jun 03 7:12 AM
Dear all,
Kindly help me to Display a SMARTFORM using Selection screen.
Thanks.
2008 Jun 03 7:51 AM
Hope this sample code helps :
TYPES:
BEGIN OF t_makt,
matnr TYPE matnr,
maktx TYPE maktx,
spras TYPE spras,
END OF t_makt.
BEGIN OF t_final,
ebeln TYPE ebeln,
aedat TYPE erdat,
ernam TYPE ernam,
burks TYPE bukrs,
lifnr TYPE elifn,
ebelp TYPE ebelp,
matnr TYPE matnr,
maktx TYPE maktx,
menge TYPE bstmg,
meins TYPE bstme,
netwr TYPE bwert,
peinh TYPE epein,
spras TYPE spras,
END OF t_final,
DATA : i_final TYPE STANDARD TABLE OF t_final,
wa_final TYPE t_final,
i_makt TYPE STANDARD TABLE OF t_makt,
wa_makt TYPE t_makt,
v_index TYPE sy-tabix.
DATA: /1BCDWB/SF00001009 TYPE RS38L_FNAM.
**********************SELECTION-SCREEN****************************************
SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: v_ebeln LIKE ekko-ebeln. "Purchasing Document
SELECTION-SCREEN : END OF BLOCK blk1.
*******************************************************************************************
SELECT
a~ebeln
a~aedat
a~ernam
a~bukrs
a~lifnr
b~netwr
b~matnr
b~meins
b~ebelp
b~menge
b~netwr
b~peinh
INTO CORRESPONDING FIELDS OF TABLE i_final
FROM ekko AS a INNER JOIN ekpo AS b
ON aebeln = bebeln WHERE a~ebeln EQ V_ebeln.
SELECT matnr maktx FROM makt
INTO TABLE i_makt FOR ALL ENTRIES IN i_final
WHERE matnr = i_final-matnr AND spras = 'EN'.
IF sy-subrc = 0.
SORT i_final BY matnr.
ENDIF.
LOOP AT i_final INTO wa_final.
v_index = sy-tabix.
READ TABLE i_makt INTO wa_makt WITH KEY matnr = wa_final-matnr
BINARY SEARCH.
IF sy-subrc = 0.
wa_final-maktx = wa_makt-maktx.
ENDIF.
MODIFY i_final FROM wa_final INDEX v_index TRANSPORTING maktx .
ENDLOOP.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_SF14'
IMPORTING
FM_NAME = /1BCDWB/SF00001009
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION '/1BCDWB/SF00001009'
EXPORTING
v_ebeln = V_EBELN
IMPORTING
TABLES
i_final = I_FINAL
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Edited by: Gaurav Deep on Jun 3, 2008 8:52 AM
Hope this sample code helps :
TYPES:
BEGIN OF t_makt,
matnr TYPE matnr,
maktx TYPE maktx,
spras TYPE spras,
END OF t_makt.
BEGIN OF t_final,
ebeln TYPE ebeln,
aedat TYPE erdat,
ernam TYPE ernam,
burks TYPE bukrs,
lifnr TYPE elifn,
ebelp TYPE ebelp,
matnr TYPE matnr,
maktx TYPE maktx,
menge TYPE bstmg,
meins TYPE bstme,
netwr TYPE bwert,
peinh TYPE epein,
spras TYPE spras,
END OF t_final,
DATA : i_final TYPE STANDARD TABLE OF t_final,
wa_final TYPE t_final,
i_makt TYPE STANDARD TABLE OF t_makt,
wa_makt TYPE t_makt,
v_index TYPE sy-tabix.
DATA: /1BCDWB/SF00001009 TYPE RS38L_FNAM.
**********************SELECTION-SCREEN****************************************
SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: v_ebeln LIKE ekko-ebeln. "Purchasing Document
SELECTION-SCREEN : END OF BLOCK blk1.
*******************************************************************************************
SELECT
a~ebeln
a~aedat
a~ernam
a~bukrs
a~lifnr
b~netwr
b~matnr
b~meins
b~ebelp
b~menge
b~netwr
b~peinh
INTO CORRESPONDING FIELDS OF TABLE i_final
FROM ekko AS a INNER JOIN ekpo AS b
ON aebeln = bebeln WHERE a~ebeln EQ V_ebeln.
SELECT matnr maktx FROM makt
INTO TABLE i_makt FOR ALL ENTRIES IN i_final
WHERE matnr = i_final-matnr AND spras = 'EN'.
IF sy-subrc = 0.
SORT i_final BY matnr.
ENDIF.
LOOP AT i_final INTO wa_final.
v_index = sy-tabix.
READ TABLE i_makt INTO wa_makt WITH KEY matnr = wa_final-matnr
BINARY SEARCH.
IF sy-subrc = 0.
wa_final-maktx = wa_makt-maktx.
ENDIF.
MODIFY i_final FROM wa_final INDEX v_index TRANSPORTING maktx .
ENDLOOP.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_SF14'
IMPORTING
FM_NAME = /1BCDWB/SF00001009
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION '/1BCDWB/SF00001009'
EXPORTING
v_ebeln = V_EBELN
IMPORTING
TABLES
i_final = I_FINAL
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Edited by: Gaurav Deep on Jun 3, 2008 8:52 AM
2008 Jun 03 7:13 AM
2008 Jun 03 7:16 AM
hi! Jayathilaka
is it executing the smartform output using the selection screen nput.
just create a report with normal select-ptions: format. at perform output call the FM for the smatforms.
Regards,
Nagulan
2008 Jun 03 7:17 AM
hi there
in ur print program, create the selection criteria for the selection screen...and using the select statement fetch the data from the dictionary tables to ur internal tables...
call the SSF_FUNCTION_MODULE_NAME and the func module created automaticaly on the activation of ur smartform...
in ur smart form,in the text editors of ur windows write
&itab-field_name& ...
the report whwn executed,will display the smart form with the data fetched based on ur selection screen inputs...
reawrd if helpful
regards
niharika
2008 Jun 03 7:22 AM
Hi For this , you would have to make one report with the selection Screen .
Fetch the data you want to display in the smartforma and pass this data to the smartform .
The function module used is SSF_FUNCTION_MODULE_NAME. Give the smartform name as import parameter for this function module .
After this call the function u retrieved by using the above function module and pass all the data u want to display in this function module .
Hope this will help
2008 Jun 03 7:51 AM
Hope this sample code helps :
TYPES:
BEGIN OF t_makt,
matnr TYPE matnr,
maktx TYPE maktx,
spras TYPE spras,
END OF t_makt.
BEGIN OF t_final,
ebeln TYPE ebeln,
aedat TYPE erdat,
ernam TYPE ernam,
burks TYPE bukrs,
lifnr TYPE elifn,
ebelp TYPE ebelp,
matnr TYPE matnr,
maktx TYPE maktx,
menge TYPE bstmg,
meins TYPE bstme,
netwr TYPE bwert,
peinh TYPE epein,
spras TYPE spras,
END OF t_final,
DATA : i_final TYPE STANDARD TABLE OF t_final,
wa_final TYPE t_final,
i_makt TYPE STANDARD TABLE OF t_makt,
wa_makt TYPE t_makt,
v_index TYPE sy-tabix.
DATA: /1BCDWB/SF00001009 TYPE RS38L_FNAM.
**********************SELECTION-SCREEN****************************************
SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: v_ebeln LIKE ekko-ebeln. "Purchasing Document
SELECTION-SCREEN : END OF BLOCK blk1.
*******************************************************************************************
SELECT
a~ebeln
a~aedat
a~ernam
a~bukrs
a~lifnr
b~netwr
b~matnr
b~meins
b~ebelp
b~menge
b~netwr
b~peinh
INTO CORRESPONDING FIELDS OF TABLE i_final
FROM ekko AS a INNER JOIN ekpo AS b
ON aebeln = bebeln WHERE a~ebeln EQ V_ebeln.
SELECT matnr maktx FROM makt
INTO TABLE i_makt FOR ALL ENTRIES IN i_final
WHERE matnr = i_final-matnr AND spras = 'EN'.
IF sy-subrc = 0.
SORT i_final BY matnr.
ENDIF.
LOOP AT i_final INTO wa_final.
v_index = sy-tabix.
READ TABLE i_makt INTO wa_makt WITH KEY matnr = wa_final-matnr
BINARY SEARCH.
IF sy-subrc = 0.
wa_final-maktx = wa_makt-maktx.
ENDIF.
MODIFY i_final FROM wa_final INDEX v_index TRANSPORTING maktx .
ENDLOOP.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_SF14'
IMPORTING
FM_NAME = /1BCDWB/SF00001009
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION '/1BCDWB/SF00001009'
EXPORTING
v_ebeln = V_EBELN
IMPORTING
TABLES
i_final = I_FINAL
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Edited by: Gaurav Deep on Jun 3, 2008 8:52 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |