Skip to Content
avatar image
Former Member

Smart Form Problem (Form Interface)

Moved to correct forum

Hi Experts,

I have a problem in SMARTforms,

First my requirement is Label Printing,(3 per page) I/p selection is MATNR & PLANT & LGORT.

OUTPUT is full Classification details wth two Logo's on each label(total 6 logos per page)

I managed to get all the data into Final table(materials) and I am passing 3 materials at a time to FORM.

through loop & endloop. in between Loop I am calling my smart form,

My ITAB Structire is

MATNR1, LGORT1,MATNR2, LGORT2,MATNR3, LGORT3,

MATNR1, LGORT1,MATNR2, LGORT2,MATNR3, LGORT3,

MATNR1, LGORT1,MATNR2, LGORT2,MATNR3, LGORT3,

MATNR1, LGORT1,MATNR2, LGORT2,MATNR3, LGORT3,

MATNR1, LGORT1,MATNR2, LGORT2,MATNR3, LGORT3,

My problem is If user inputs upto 3 matnrs. its working fine.

when he enters more than 3 lets say 7.

first its showing print settings screen, when i select print preview, It shows the output fine(1,2,3Materials.)

but only One page. When I click on back, again its showing print settings, if I click print preview,

It shows the next 3 materials(4,5,6Materials), and when I click back again print settings finally 1 materials(7th).

My requirement is when I click on print preview, It should show 3 pages at a time instead of the above.

Thanks in Advance,

Dunlop.

Edited by: Matt on Apr 16, 2009 9:57 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 17, 2009 at 03:45 AM

    Hi Dunlop

    Refer to my post in the below thread..for the sample code regarding your issue hope your issue resolves

    issue-with-print-single-record-on-page

    Regards,

    Sravanthi

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Check this sample code to generate a single spool request.

      DATA:

      P_INPUT TYPE SSFCOMPIN,

      P_CONTROL TYPE SSFCTRLOP.

      P_INPUT-DIALOG = 'X'.

      CALL FUNCTION 'SSFCOMP_OPEN'

      EXPORTING

      INPUT = P_INPUT

      EXCEPTIONS

      ERROR = 1.

      LOOP AT IT_FINAL INTO WA_FINAL.

      P_CONTROL-NO_OPEN = 'X'.

      P_CONTROL-NO_CLOSE = 'X'.

      CALL FUNCTION FNAME

      EXPORTING

      CONTROL_PARAMETERS = P_CONTROL

      GV_MATNR = WA_FINAL-MATNR.

      ENDLOOP.

      CALL FUNCTION 'SSFCOMP_CLOSE'.

      Thanks & regards,

      Dileep .C

  • avatar image
    Former Member
    Apr 16, 2009 at 08:08 AM

    Hi ,

    use SSF_OPEN and SSF_CLOSE function modules

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 16, 2009 at 08:19 AM

    Hi Dunlop,

    As you are calling SF in loop, so every time it calls print settings screen...

    In order to rectify this

    While calling SF in Exporting we need to paly with control_parameters , output_options.

    CALL FUNCTION fm_name

    EXPORTING

    control_parameters = wa_parameters

    output_options = wa_options

    Data: wa_parameters TYPE ssfctrlop,

    wa_options TYPE ssfcompop.

    Before you call SF you need pass values as below:

    wa_parameters-preview = 'X'. "Preview

    wa_options-tdnoprint = 'X'. "No printing from print preview

    Try once and check,

    Regards,

    Suneel G

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Suneel,

      I tried like you said but still same problem,

      i can avoid the user dailog in the second screen this is what i need, but I need to see all the pages at a time,

      currently if i need to see i need to press back button and because of no_dialog is can see secod page directly.

      to be more clear, instead of next page I am using standard back button(alos close & logoff same effect ), but i have to tal no of pages as 1 always, when i say back anain 1 only,

      i mean it always showing page 00001 of 00001. and for each back it showing secon page,

      I need 0001 of 0000X.(where X is the user input range of materials as explainied in the abpve post)

      DATA: WA_PARAMETERS TYPE SSFCTRLOP,

      WA_OPTIONS TYPE SSFCOMPOP.

      WA_PARAMETERS-PREVIEW = 'X'. "Preview

      " WA_OPTIONS-TDNOPRINT = 'X'. "No printing from print preview

      LOOP AT IT_FINAL INTO WA_FINAL.

      IF SY-TABIX EQ 1.

      WA_PARAMETERS-NO_DIALOG = SPACE.

      ELSE.

      WA_PARAMETERS-NO_DIALOG = 'X'.

      ENDIF.

      CALL FUNCTION FNAME

      EXPORTING

      CONTROL_PARAMETERS = WA_PARAMETERS

      OUTPUT_OPTIONS = WA_OPTIONS

      GV_MATNR = WA_FINAL-MATNR

      GV_LGORT = WA_FINAL-LGORT

      GV_CLASS = WA_FINAL-CLASS

      GV_KSCHL = WA_FINAL-KSCHL

      GV_MATNR1 = WA_FINAL-MATNR1

      GV_LGORT1 = WA_FINAL-LGORT1

      GV_CLASS1 = WA_FINAL-CLASS1

      GV_KSCHL1 = WA_FINAL-KSCHL1

      GV_MATNR2 = WA_FINAL-MATNR2

      GV_LGORT2 = WA_FINAL-LGORT2

      GV_CLASS2 = WA_FINAL-CLASS2

      GV_KSCHL2 = WA_FINAL-KSCHL2.

      ENDLOOP.

      Also tried in this way but no result.

      DATA:SSFCTRLOP TYPE SSFCTRLOP,

      SSFCTRLOP_OPEN TYPE SSFCTRLOP,

      SSFCRESOP TYPE SSFCRESOP,

      E_SSFCOMPOP TYPE SSFCOMPOP,

      FL_OPEN.

      LOOP AT IT_FINAL INTO WA_FINAL.

      IF NOT E_SSFCOMPOP IS INITIAL.

      • After first time dialog doesn't open

      SSFCTRLOP_OPEN-NO_DIALOG = 'X'.

      ENDIF.

      IF FL_OPEN = 'X'.

      CALL FUNCTION 'SSF_CLOSE'.

      ENDIF.

      CALL FUNCTION 'SSF_OPEN'

      EXPORTING

      USER_SETTINGS = SPACE

      OUTPUT_OPTIONS = E_SSFCOMPOP

      CONTROL_PARAMETERS = SSFCTRLOP_OPEN

      IMPORTING

      JOB_OUTPUT_OPTIONS = SSFCRESOP

      EXCEPTIONS

      FORMATTING_ERROR = 1

      INTERNAL_ERROR = 2

      SEND_ERROR = 3

      USER_CANCELED = 4

      OTHERS = 5.

      IF SY-SUBRC = 0.

      FL_OPEN = 'X'.

      • Only first time it opens dialog

      • CLEAR E_SSFCOMPOP-DIALOG.

      • SSFCTRLOP-NO_DIALOG = ' '.

      ELSE.

      • Get print parameter choosen in the first print and

      • transfer them for next call of fm SSF_OPEN

      MOVE-CORRESPONDING SSFCRESOP TO E_SSFCOMPOP.

      ENDIF.

      • Block open and close of smartform in FM

      SSFCTRLOP-NO_OPEN = 'X'.

      SSFCTRLOP-NO_CLOSE = 'X'.

      CALL FUNCTION FNAME

      EXPORTING

      CONTROL_PARAMETERS = SSFCTRLOP

      OUTPUT_OPTIONS = E_SSFCOMPOP

      GV_MATNR = WA_FINAL-MATNR

      GV_LGORT = WA_FINAL-LGORT

      GV_CLASS = WA_FINAL-CLASS

      GV_KSCHL = WA_FINAL-KSCHL

      GV_MATNR1 = WA_FINAL-MATNR1

      GV_LGORT1 = WA_FINAL-LGORT1

      GV_CLASS1 = WA_FINAL-CLASS1

      GV_KSCHL1 = WA_FINAL-KSCHL1

      GV_MATNR2 = WA_FINAL-MATNR2

      GV_LGORT2 = WA_FINAL-LGORT2

      GV_CLASS2 = WA_FINAL-CLASS2

      GV_KSCHL2 = WA_FINAL-KSCHL2.

      ENDLOOP.

      CALL FUNCTION 'SSF_CLOSE'.

      please Any body Help me out as i took extra mandays already.

      -Dunlop

  • Apr 16, 2009 at 07:57 AM

    Moved to correct forum

    Add comment
    10|10000 characters needed characters exceeded