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

Need help on this issue.

Former Member
0 Likes
795

Hi Experts & Dear Matt,

Sorry for posting a request/thread (repost) like this.

but my situation is worst now, I am trying in different ways but have no solution yet.

It a minor problem where i dont know to correct, so getting problem(Pressure, Extra time used) from my higher authorities.

So please help me out by this situation.

My problem : I already posted a Thread, and I am reposting here again sorry for doing like this..

My thread :

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.

-Dunlop

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
745

Hi Dunlop,

I Gor ur Problem.Don't call Smartform in loop.

design ur Label in MAIN window.

put loop of ur final table to main window.and create control command to jump into new page.

Thanks

Sai

5 REPLIES 5
Read only

Former Member
0 Likes
745

Hi Dunlop,

Why not call your smartforms OUTSIDE the loop?

And make sure that your smartform NEXT page set the page itself, so it can be recursive.

Regards,

Lim...

Read only

0 Likes
745

Hi Ruslim,

This is my code...

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

Read only

Former Member
0 Likes
746

Hi Dunlop,

I Gor ur Problem.Don't call Smartform in loop.

design ur Label in MAIN window.

put loop of ur final table to main window.and create control command to jump into new page.

Thanks

Sai

Read only

0 Likes
745

Hi Sai,

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

Read only

0 Likes
745

Hi,

MULTIPLE POSTINGS

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