cancel
Showing results for 
Search instead for 
Did you mean: 

Logo printing in Smartform

Former Member
0 Kudos

Hi Experts,

I need to develop a smartform that will be generating multiple number of letters of 6 pages for different vendors.

Each letter will be having a company logo only in the first page.

I've developed 2 pages: First Page and Next Page.

Each page is having following windows:

1. Logo (secondary)

2. Main

3. Footer (secondary)

If I check the condition 'Only on first page' in the Logo window, then the logo is getting printed on the first page of the first letter, rest of the pages are not having any logo.

And if I uncheck that, the logo is getting printed on every pages of every letter.

Please suggest me how to go about that.

Best regards,

Anirban.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi anirban,

If i understtod it correctly you need to print letter of 6 pages for one vendor with logo on first page.

You have done everything perfect .

I've developed 2 pages: First Page and Next Page.

Each page is having following windows:

1. Logo (secondary)

2. Main

3. Footer (secondary)

If I check the condition 'Only on first page' in the Logo window,

just call smartform for individual vendor through print program

Lets say you have 10 vendors in itab.

loop at itab.

call smartform

endloop.

You can set output parameter so that you can get all output in one spool request.

hope this will help.

Thanks.

Dhiraj.

Former Member
0 Kudos

Hi Dhiraj,

Thanks for your prompt response.

Please let me know how to set output parameters so that I may get all outputs in one spool request.

Also, please let me know how to print this spool request.

Points given.

Thanks,

Anirban.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

some modifications i have made...

DATA: v_output TYPE ssfcompop,

it_r TYPE TABLE OF zcustomer_co.

v_output-tdnewid = 'X'.

    • addition by dhiraj*

*v_output-TDDEST = output device*

*v_output-TDNOPREV = 'X'.*

IF it_resi IS NOT INITIAL.

  • To get the fucntion module name generated for the smartform

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = c_resimonthform

IMPORTING

fm_name = v_fmname

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc = 0.

  • Call the above generated function module

LOOP AT it_resi INTO wa_resi.

refresh: it_r.

APPEND wa_resi TO it_r.

CALL FUNCTION v_fmname

EXPORTING

output_options = v_output

i_month = p_perio

i_year = p_gjahr

TABLES

it_cust = it_r

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

ENDLOOP.

ENDIF.

dhiraj.

Former Member
0 Kudos

Hi Anirban

refee to structure OUTPUT_OPTIONS (SSFCOMPOP) in interface of your smartform

OUTPUT_OPTIONS-TDNEWID = ' '.

this will make one spool for all print.

You can print this spool using T code SP01.

hope yhis will help.

Thanks,

Dhiraj.

Former Member
0 Kudos

Hi Dhiraj,

Thanks again.

Please see the code and rectify me where wrong.

DATA: v_output TYPE ssfcompop,
        it_r TYPE TABLE OF zcustomer_co.
  v_output-tdnewid = 'X'.

  IF it_resi IS NOT INITIAL.
* To get the fucntion module name generated for the smartform
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = c_resimonthform
      IMPORTING
        fm_name            = v_fmname
      EXCEPTIONS
        no_form            = 1
        no_function_module = 2
        OTHERS             = 3.
    IF sy-subrc = 0.
* Call the above generated function module

      LOOP AT it_resi INTO wa_resi.
        refresh: it_r.

        APPEND wa_resi TO it_r.

        CALL FUNCTION v_fmname
          EXPORTING
            output_options   = v_output
            i_month          = p_perio
            i_year           = p_gjahr
          TABLES
            it_cust          = it_r
          EXCEPTIONS
            formatting_error = 1
            internal_error   = 2
            send_error       = 3
            user_canceled    = 4
            OTHERS           = 5.
      ENDLOOP.
  ENDIF.

No spool request has been generated.

I've checked with SP01.

Please suggest.

Thanks,

Anirban.