‎2007 Jan 08 8:57 AM
hi experts
i devepoled a form for a paricular document no.....in that if i give doc no and date i will get the items in that document no.......but i want in such a way that i will give range of document no's....all the recipts for that range should come one after the other...(on seperate papers)....................
‎2007 Jan 08 9:18 AM
Assuming that your driver program has a select-option for the range of documents.
Select * from <master table for the doucments>
into table itab
where document number in s_docno.
loop at itav.
P_docno = itab-docno. " p_docno is the parameter that you had earlier..
earlier logic for printing each document.
*
endloop.
Regards,
Ravi
‎2007 Jan 08 9:21 AM
Hi!
This can be solved like the following:
You have to write a report program, which collects all the required documents and the required data.
When you have all data, write a coding into your program like this. The coding is unfinished and untested, but maybe gives you a good idea.
* determine smartform function module for delivery note
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING FORMNAME = LF_FORMNAME "your smartform
* variant = ' '
* direct_call = ' '
IMPORTING FM_NAME = LF_FM_NAME "sap FM for smartform
EXCEPTIONS NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* error handling
CF_RETCODE = SY-SUBRC.
PERFORM PROTOCOL_UPDATE.
ENDIF.
ENDIF.
LOOP AT itab INTO wa_itab.
AT END OF doc_num.
IF CF_RETCODE = 0.
* call smartform delivery note
CALL FUNCTION LF_FM_NAME
EXPORTING
ARCHIVE_INDEX = TOA_DARA
ARCHIVE_PARAMETERS = ARC_PARAMS
CONTROL_PARAMETERS = LS_CONTROL_PARAM
* mail_appl_obj =
MAIL_RECIPIENT = LS_RECIPIENT
MAIL_SENDER = LS_SENDER
OUTPUT_OPTIONS = LS_COMPOSER_PARAM
USER_SETTINGS = ' '
IS_DLV_DELNOTE = LS_DLV_DELNOTE
IS_NAST = NAST
* importing document_output_info =
* job_output_info =
* job_output_options =
EXCEPTIONS FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
* error handling
CF_RETCODE = SY-SUBRC.
PERFORM PROTOCOL_UPDATE.
* get SmartForm protocoll and store it in the NAST protocoll
PERFORM ADD_SMFRM_PROT. "INS_HP_335958
ENDIF.
ENDIF.
ENDAT.
ENDLOOP.
‎2007 Jan 08 9:25 AM