Skip to Content
0
Former Member
Oct 19, 2006 at 06:01 PM

How to split Smart forms at Item level??

45 Views

Hi,

We have developed a smarform for printing customer statements.right Now it is working fine .

As we went live globaly there might be statements in differeent currencies.

My item table holds the currency field and i want split the statements with respective currencies..

How can we do this?

Present logic is like this in my driver program.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = P_FORM

IMPORTING

FM_NAME = FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LS_COMPOSER_PARAM-TDNEWID = 'X'.

LS_CONTROL_PARAM-PREVIEW = ''.

SORT T_HEADER BY NAME1 KUNNR.

LOOP AT T_HEADER INTO WA_HEADER.

REFRESH ITEM_ITAB.

LOOP AT T_ITEM WHERE KUNRG = WA_HEADER-KUNNR.

APPEND T_ITEM TO ITEM_ITAB.

ENDLOOP.

SORT ITEM_ITAB BY FKDAT.

CALL FUNCTION FM_NAME

EXPORTING

ARCHIVE_INDEX = TOA_DARA

ARCHIVE_INDEX_TAB = ARC_IND_TAB

ARCHIVE_PARAMETERS = ARC_PARAMS

CONTROL_PARAMETERS = LS_CONTROL_PARAM

MAIL_APPL_OBJ = LS_RECIPIENT

MAIL_RECIPIENT = LS_RECIPIENT

MAIL_SENDER = LS_SENDER

OUTPUT_OPTIONS = LS_COMPOSER_PARAM

USER_SETTINGS = SPACE

WA_ITAB = WA_HEADER

IMPORTING

DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO

JOB_OUTPUT_INFO = JOB_OUTPUT_INFO

JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS

TABLES

WA_DEP = ITEM_ITAB

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4.

IF SY-SUBRC <> 0.

WRITE: / 'ERROR in passing vars to the smartforms '.

ENDIF.

LS_COMPOSER_PARAM-TDNEWID = SPACE.

LS_CONTROL_PARAM-NO_DIALOG = 'X'.

LS_CONTROL_PARAM-PREVIEW = ''.