Application Development 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: 

Spools created from Smartform - Issue with Sequence of Spools

Former Member
0 Kudos

Hi,

I have a Custom SmartForm called in a Custom Program creates Spool for each SmartForm. I have an internal table sorted before it calls the SmartForm. Between Loop & Endloop, each time it calls the SmartForm, it generates the Spool. Even though the Spools numbers created are in Sequence, the SmartForms are not in line with the SORT order in the Internal table i.e., The Internal table is SORTed for Material Number and I expect the SmartForms (Spools) to be generated for the same Order with that of Internal table. Do I have to include a Commit Statement for each and every call to the Smatform inside the Loop/Endloop?

I hope I have made my posting understandable. Please let me know if you have any solutions.

I Appreciate Your Help!

Thanks,

Kannan.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

It is hard to tell why system is not processing Smartform in given sequence. But you can link the spool with its genertor's number.

To link between your material number and generated spool you can one more field in the SPOOL table.

Like:

DATA: BEGIN OF IT_SPOOL OCCURS 0,
MATNR TYPE MATNR,
SPOOL TYPE I,
END  OF IT_SPOOL.

LOOP AT ITAB.
* CALL OF SMARTFORM
* GET THE SPOOL NUMBER FORM RETURN
  IT_SPOOL-MATNR = ITAB-MATNR
  IT_SPOOL-SPOOL = <SPOOL_NO>.
  APPEND IT_SPOOL.
  CLEAR  IT_SPOOL.
ENDLOOP.

Regards,

Naimesh Patel

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos

It is hard to tell why system is not processing Smartform in given sequence. But you can link the spool with its genertor's number.

To link between your material number and generated spool you can one more field in the SPOOL table.

Like:

DATA: BEGIN OF IT_SPOOL OCCURS 0,
MATNR TYPE MATNR,
SPOOL TYPE I,
END  OF IT_SPOOL.

LOOP AT ITAB.
* CALL OF SMARTFORM
* GET THE SPOOL NUMBER FORM RETURN
  IT_SPOOL-MATNR = ITAB-MATNR
  IT_SPOOL-SPOOL = <SPOOL_NO>.
  APPEND IT_SPOOL.
  CLEAR  IT_SPOOL.
ENDLOOP.

Regards,

Naimesh Patel

0 Kudos

BASIS have solved this. They made it Prefered Printer. It works.