on 11-06-2010 11:58 AM
Hi Expert's,
I am created one program with smort form,There having number of records, i selected one record and showing printpreview then come back in previous screen then selection another record and showing print preview.then it is showing preview record as well.I m clear the header of internal table but still is showing.
i am given following coding.
WHEN 'PRINT'.
PERFORM print_form.
FORM print_form .
DATA: v_fmname TYPE rs38l_fnam,
l_output_options TYPE ssfcompop,
l_output_info TYPE ssfcrescl,
l_control_parameters TYPE ssfctrlop.
PERFORM get_uname.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = c_formnam
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = v_fmname
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.
ELSE.
l_output_options-tddest = c_locl.
l_output_options-tdnewid = 'X'.
l_output_options-tdimmed = 'X'.
l_control_parameters-preview = c_l_conprmtr.
LOOP AT it_bkpf ASSIGNING <fs_bkpf>.
AT FIRST.
l_control_parameters-no_close = 'X'.
ENDAT.
AT LAST.
l_control_parameters-no_close = space.
ENDAT.
CALL FUNCTION v_fmname
EXPORTING
control_parameters = l_control_parameters
output_options = l_output_options
user_settings = ''
v_belnr = <fs_bkpf>-belnr
v_currency = <fs_bkpf>-waers
v_total = <fs_bkpf>-total
v_bukrs = <fs_bkpf>-bukrs
v_blart = <fs_bkpf>-blart
v_uname = <fs_bkpf>-uname
v_kursf = <fs_bkpf>-kursf
v_hwaer = <fs_bkpf>-hwaer
IMPORTING
job_output_info = l_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
clear :it_bkpf.
refresh it_bkpf.
LEAVE TO SCREEN 0.
ELSE.
*-- Check Print Status
IF l_output_info-outputdone EQ 'X'.
*-- Check status reprint and print
PERFORM update_print_table.
ENDIF.
ENDIF. " sy-subrc
l_control_parameters-no_open = 'X'.
ENDLOOP.
ENDIF.
ENDFORM. " PRINT_FORM
Please suggest me how to solve this problem with example.
Best regards.
Pravin
i solved this problem by myself.
I am creating new program and there i coding only smartform calling function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pravin,
Can you verify this once will the BOLD highlighted code will get executed...
WHEN 'PRINT'.
PERFORM print_form.
FORM print_form .
DATA: v_fmname TYPE rs38l_fnam,
l_output_options TYPE ssfcompop,
l_output_info TYPE ssfcrescl,
l_control_parameters TYPE ssfctrlop.
PERFORM get_uname.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = c_formnam
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = v_fmname
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.
ELSE.
l_output_options-tddest = c_locl.
l_output_options-tdnewid = 'X'.
l_output_options-tdimmed = 'X'.
l_control_parameters-preview = c_l_conprmtr.
LOOP AT it_bkpf ASSIGNING <fs_bkpf>.
AT FIRST.
l_control_parameters-no_close = 'X'.
ENDAT.
AT LAST.
l_control_parameters-no_close = space.
ENDAT.
CALL FUNCTION v_fmname
EXPORTING
control_parameters = l_control_parameters
output_options = l_output_options
user_settings = ''
v_belnr = <fs_bkpf>-belnr
v_currency = <fs_bkpf>-waers
v_total = <fs_bkpf>-total
v_bukrs = <fs_bkpf>-bukrs
v_blart = <fs_bkpf>-blart
v_uname = <fs_bkpf>-uname
v_kursf = <fs_bkpf>-kursf
v_hwaer = <fs_bkpf>-hwaer
IMPORTING
job_output_info = l_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc 0.
clear :it_bkpf.
refresh it_bkpf.
LEAVE TO SCREEN 0.
ELSE.
*-- Check Print Status
IF l_output_info-outputdone EQ 'X'.
*-- Check status reprint and print
PERFORM update_print_table.
ENDIF.
ENDIF. " sy-subrc
l_control_parameters-no_open = 'X'.
ENDLOOP.
ENDIF.
ENDFORM. " PRINT_FORM
I think that should be Before the LEAVE TO SCREEN 0. And also I suggest you to UNASSIGN THE FIELD SYMBOL before leaving the Screen.
Let me know if any.
Regards,
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But
Which is your problem? I can't understand it
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.