Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in Calling a smartform in a driver program(SE38)

Former Member
0 Likes
597

Hi,

I created a report in SE38 and i have a 5 CHECK Boxes. i called a smartformsin that program.

My problem is if i check the 5 check boxes the layout should show 5 copies.

if i check 3 check boxes the layout should show 3 copies. e.t.c.

Edited by: vijay krishna on Jul 12, 2008 9:47 AM

4 REPLIES 4
Read only

Former Member
0 Likes
565

If u check 5 check boxes then u have to pass 5 to field TDCOPIES of structure SSFCOMPOP and then need to pass this structure to parameter OUTPUT_OPTIONS for ur smartform FM.

For 3 check boxes u need to pass 3 to TDCOPIES.

Regards,

Joy.

Read only

Former Member
0 Likes
565

Vijay,

just use this similer code which i used for same purpose.

FORM set_print_param  CHANGING cs_control_param TYPE ssfctrlop.
  DATA:    ls_itcpo     TYPE itcpo,
           cf_retcode   TYPE sy-subrc,
           lf_repid     TYPE sy-repid,
           lf_device    TYPE tddevice.

  lf_repid = sy-repid.

  CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'"this must call for multiple copy
    EXPORTING
      pi_nast             = nast
*     PI_ADDR_KEY         = ' '
*     PI_COUNTRY          = ' '
      pi_repid            = lf_repid
*     PI_SCREEN           = ' '
   IMPORTING
      pe_returncode = cf_retcode
      pe_itcpo      = ls_itcpo
      pe_device     = lf_device.
*      pe_recipient  = cs_recipient
*      pe_sender     = cs_sender.
  IF cf_retcode = 0.
    cs_control_param-device      = lf_device.
    cs_control_param-no_dialog   = 'X'.
    cs_control_param-preview     = xscreen.
    cs_control_param-getotf      = ls_itcpo-tdgetotf.
    cs_control_param-langu       = nast-spras.
  ENDIF.

ENDFORM.                    " set_print_param
*&---------------------------------------------------------------------*
*&      Form  sub_fill_copy
*&---------------------------------------------------------------------*
* Fill the copy
*----------------------------------------------------------------------*
FORM sub_fill_copy .

  IF w_juri = 'KOLKATA'.
    t_copy-copy = 'ORIGINAL FOR BUYER'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'DUPLICATE FOR TRANSPORTER'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'TRIPLICATE FOR ASSESSE'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

  ELSEIF w_juri = 'BEHROR'.
    t_copy-copy = 'ORIGINAL FOR BUYER'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'DUPLICATE FOR TRANSPORTER'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'TRIPLICATE FOR ASSESSE'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

  ELSEIF w_juri = 'RUDRAPUR'.
    t_copy-copy = 'ORIGINAL FOR BUYER'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'DUPLICATE FOR TRANSPORTER'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'TRIPLICATE FOR ASSESSE'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.


  ELSEIF w_juri = 'MON'.
    t_copy-copy = 'ORIGINAL FOR BUYER'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'DUPLICATE FOR TRANSPORTER'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'TRIPLICATE FOR ASSESSE'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

    t_copy-copy = 'EXTRA COPY'.
    APPEND t_copy.
    CLEAR  t_copy.

  ENDIF.

ENDFORM.                    " sub_fill_copy

Amit.

Read only

0 Likes
565

Hi amit,

thanks for this code.

But i am using this code. i have 3 check boxes as vendor , gatepass , office copies

if i select this 3 check box i want the three copies of there repective copy heading like in first page Vendor copy , in 2nd copy gatepass copy e.t.c.

w_formname = 'Z_MM_REP_GATEPASS'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = w_formname

IMPORTING

fm_name = w_fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

call function w_fm_name

exporting

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS = tdcopies

  • USER_SETTINGS = 'X'

s_bukrs = v_bukrs

s_mblnr = p_mblnr

s_mjahr = p_mjahr

s_data = p_data

s_lifnr = v_lifnr

s_nrgp = r_nrgp

s_rgp = r_rgp

s_gp = r_gp

s_gpcc = r_gpcc

s_chal = r_chal

s_truck = p_truck

s_date = p_date

s_freight = p_freigh

coun = var

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

tables

s_itab = ITAB[]

  • 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.

Edited by: vijay krishna on Jul 12, 2008 1:17 PM

Edited by: vijay krishna on Jul 12, 2008 2:37 PM

Read only

Former Member
0 Likes
565

ok