Skip to Content
author's profile photo Former Member
Former Member

smart form..

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)....................

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jan 08, 2007 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 09: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.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 09:25 AM

    TNX U..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.