2007 May 03 10:28 AM
Hi All,
I have created one smartform. and calling that smartform from a report. But report is only calling the smartform but not showing the value against the field.
plz check my code and let me know that where i have commited mistake.
For example suppose i have mentioned bukrs then iwhen i am calling SF through report it must show the value of BUKRS.
giving my code below.....
plz get back to me.
&----
*& Report ZTEMP_SF_TEST
*&
&----
*&
*&
&----
REPORT ZTEMP_SF_TEST.
tables: eban.
data: itab1 like zmm_preq_mpur occurs 0 with header line.
data: lines like tline occurs 1.
data: fm_name type rs38l_fnam.
initialization.
perform display_smartform.
&----
*& Form display_smartform
&----
text
----
--> p1 text
<-- p2 text
----
form display_smartform .
CALL FUNCTION '/1BCDWB/SF00000014'
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
itab1 = ITAB1
lines = LINES
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.
*CALL FUNCTION '/1BCDWB/SF00000001'
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
ITAB1 = itab1
lines = lines
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.
endform. " display_smartform
2007 May 03 10:38 AM
Hi abhay,
Declare Function module i think it willsolve ur problem. use the function module
call function 'SSF_FUNCTION_MODULE_NAME'
Regards,
Pavan
2007 May 03 10:31 AM
Hi Abhay,
Check this code.
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.
Modify your program in this way.
As per the method you have done, where are you passing the FM_NAME given in the data declaration.
Just recheck your program code.
Hope this resolves your query.
<b>Reward all the helpful answers.</b>
Regards
2007 May 03 10:32 AM
Hi Abhay,
Check ur smartform code.The code written in the main program is correct.U need to check ur smartform code.Probably u haven't taken a workarea for the internal table <b>itab</b> in the smartform.U hav to drap n drop tht workarea from the attribute list at the bottom most left corner of the window n place it where u want tht text to be displayed.
<b>plz reward points if helpful or if it solves ur query.</b>
Thanks
Chinmay
2007 May 03 10:33 AM
Hi,
Don't copy and paste the function module name directly in the program.Try to use the function module ssf_function_module_name to get the name of the function module dynamically in program.
Check this link for example.
2007 May 03 10:37 AM
Hi Abhay,
Please check in your smartform that the value that you want to print are getting populated in you smartform or not ... for it place a break-point in you smartform and see the values of the fields and internal table .. also do check that your are placing correct value in the smatform while you are dropping the values....
I think the problem with your information is that you are not dropping the fieldname you want to print from the correct internal tabel or work area... if you are printing this value inside the main window ..do check that have you filled in loop statement in the main window....
Regards,
Jayant
Please award if helpful
2007 May 03 10:38 AM
Hi abhay,
Declare Function module i think it willsolve ur problem. use the function module
call function 'SSF_FUNCTION_MODULE_NAME'
Regards,
Pavan
2007 May 03 10:39 AM
Hi,
You ve just declared the internal table. You need to fetch the data from the database table. Use select statements.
Check the following code :
REPORT zsjsform1.
TABLES : zsample1.
DATA : itab1 LIKE TABLE OF zsample1 WITH HEADER LINE.
DATA : wa TYPE STANDARD TABLE OF zsample1 WITH HEADER LINE.
DATA :FM_NAME TYPE rs38l_fnam.
SELECT-OPTIONS s_zctry FOR zsample1-zctry.
SELECT mandt zctry FROM zsample1
INTO CORRESPONDING FIELDS OF TABLE itab1
WHERE zctry IN s_zctry.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSJSMFORM2'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = FM_NAME
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.
*
CALL FUNCTION '/1BCDWB/SF00000240'
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
global = itab1
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.
Thanks & Regards,
Subashini.j