cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Form Problem (Form Interface)

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dunlop

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

Regards,

Sravanthi

Former Member
0 Kudos

Hi Srvanthi,

Here comes the major problem,

After passing the variable to smartform as mentioned, I am retriving the data again like this

now I need to show both the passing variable and the retived variables,

retrived data is always 20-30 records, (classification of materials)

so i am making a loop here, to print classification. so i am doing this three time for three logos..

Hope you understand my problem now clearly.

TABLES : KSML,AUSP, CABN.

DATA: BEGIN OF T_TEMP OCCURS 0,

CLASS LIKE KLAH-CLASS, "Class number

KLART LIKE KLAH-KLART, "Class type

CLINT LIKE KLAH-CLINT, "Internal class number

END OF T_TEMP.

DATA : IT_TEXT3 TYPE TABLE OF TY_TEXT,

WA_TEXT3 LIKE LINE OF IT_TEXT3.

DATA : CNT1(2), CNT(2) .

DATA : IT_FINAL TYPE TABLE OF TY_FINAL, WA_FINAL LIKE LINE OF IT_FINAL.

  • Get the classification details KSSK and KLAH.

SELECT SINGLE SCLASS SKLART L~CLINT INTO

(T_TEMP-CLASS, T_TEMP-KLART, T_TEMP-CLINT)

FROM KSSK AS L INNER JOIN KLAH AS S ON SCLINT EQ LCLINT

WHERE L~OBJEK EQ GV_MATNR.

CLEAR :IT_TEXT[],WA_TEXT.

  • retrieve characteristics info of a class

SELECT * FROM KSML WHERE CLINT = T_TEMP-CLINT

AND KLART = T_TEMP-KLART.

  • retrieve characteristics value info

SELECT * FROM AUSP WHERE OBJEK = GV_MATNR

AND ATINN = KSML-IMERK

AND KLART = KSML-KLART.

  • retrieve characteristics info

SELECT SINGLE * FROM CABN WHERE ATINN = AUSP-ATINN.

MOVE CABN-ATNAM TO WA_TEXT-ATNAM. "Characteristics desc.

MOVE AUSP-ATWRT TO WA_TEXT-ATWRT. "Characteristics Value

MOVE CABN-ATINN TO WA_TEXT-ATINN.

APPEND WA_TEXT TO IT_TEXT.

CLEAR: WA_TEXT.

ENDSELECT. "ausp

ENDSELECT.

DELETE IT_TEXT WHERE ATWRT IS INITIAL.

LOOP AT IT_TEXT INTO WA_TEXT.

SELECT SINGLE ATBEZ INTO WA_TEXT-ATBEZ FROM CABNT

WHERE ATINN = WA_TEXT-ATINN AND SPRAS = 'EN' . "SY-LANGU.

MODIFY IT_TEXT FROM WA_TEXT.

CLEAR WA_TEXT.

ENDLOOP.

LOOP AT IT_TEXT INTO WA_TEXT.

CNT1 = CNT1 + 1.

ENDLOOP.

IF IT_TEXT IS NOT INITIAL.

LOOP AT IT_TEXT INTO WA_TEXT.

CNT = SY-TABIX MOD 2.

IF CNT EQ 0.

MOVE WA_TEXT-ATWRT TO WA_TEXT3-ATWRT1.

MOVE WA_TEXT-ATBEZ TO WA_TEXT3-ATBEZ1.

APPEND WA_TEXT3 TO IT_TEXT3.

CLEAR : WA_TEXT3.

ELSE.

MOVE WA_TEXT-ATWRT TO WA_TEXT3-ATWRT.

MOVE WA_TEXT-ATBEZ TO WA_TEXT3-ATBEZ.

ENDIF.

ENDLOOP.

CNT = CNT1 MOD 2.

IF CNT NE 0.

APPEND WA_TEXT3 TO IT_TEXT3.

CLEAR : WA_TEXT3.

ENDIF.

CLEAR : IT_TEXT[].

IT_TEXT[] = IT_TEXT3[].

ENDIF.

-Dunlop

Former Member
0 Kudos

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

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Suneel,

My problem still exists.

lets say the user material range is 100 materials, then i will split into itab as three per row,

then i will get finally 34 records each row containing 3 materials & final row with one material.

I written a logic like this. and its working fine,

my point is for 34 records we need to see 34 pages in the print preview, but i can see only 1 page and

when i click on back, again print options screen appears instead of input screen and continues to page 2,

like this if i need to print 34 pages then 34 clicks are needed. hope you understood the problem

Can anyone ple tell me how to use the SSF_OPEN & SSF_CLOSE Fm's for my situation or is there any other solutions.

- Dunlop

Former Member
0 Kudos

check program SF_EXAMPLE_03, u ill understand how to use ssf_open & ssf_close.

Hope it helps!!

Regards,

Pavan

Former Member
0 Kudos

Hi Vishnu,

SF_EXAMPLE_03 is a smart form and where can i see SSF in the smart form, can you please tell me the Print program name,,,

or can you send me a sample code.

Thanks to all, and my problem not yet solved, and still open, please help me out,

-Dunlop

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi ,

use SSF_OPEN and SSF_CLOSE function modules

matt
Active Contributor
0 Kudos

Moved to correct forum