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

help related to smartforms

hi folks,

I have an issue that goes like this...

Using Smartforms I am running monthly AR statements, I have the ABAP print program in place for that,as of now I am running the statement for an individual customer based on the manual entry, but I have run the ABAP print program for a list of customers in a sequence as an automatic process with no manual entry.

Also, the first-page of the smartform is different to the NEXT-Page

How can i do this ? also, when it is processing every new customer it has to return to the first page and print the details.

I do need help in this regard?

Thanks in advance.

Santhosh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2005 at 04:31 PM

    You insert customer in an internal table, and loop it, than you call FM of your smartform for each table record (customer).

    LOOP AT T_CUSTOMERS.

    CALL FUNCTION <SMARTFORMS>

    .....

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 26, 2005 at 04:36 PM

    Hi Santosh,

    What I understood from your post is that you need to print every new customer different first page.

    Create your first page in the smartform and then copy it to another page(e.g. secondpage). Use the right mouse button for copy and paste. Now modify the second page according to your requirement. Change the next page of first page to 'Secondpage' and next page of secondpage will be secondpage.

    You need to have explicit page break whenever you find a new customer. Hope you are using the TABLE node for displaying the line items. But explicit page break (using COMMAND node) is not possible inside the TABLE node. The solution is using LOOP node. I think you are using an internal table for TABLE node. Copy the values in another internal table and take only unique customer number (use SORT and DELETE ADJUCENT DUPLICATES). Use this internal table in the LOOP node. The TABLE node will be inside the LOOP node.

    So the LOOP node will loop through the unique customer number internal table and the TABLE node will loop through the items for the selected customer.

    Hope this will help you. If you want to have different page numbers for each customer please go through this blog.

    /people/vinod.chandran/blog/2005/08/23/using-final-window-in-smartforms

    Another solution is to control this in the print program.

    Instead of command node for page break you have to call the smartform for each customer passing the AR items for the selected customer. You need the unique internal table in the program.

    Thanks

    Vinod

    Message was edited by: Vinod C

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Vinod Chandran

      To place smartform calling inside the loop (as we've suggested you) is right solution.

      If you want to open the smartform only one time you can get out open calling from smartform.

      You can do it using SSF_OPEN and SSF_CLOSE.

      For example:

      LOOP AT ITAB.

      AT FIRST.

      CALL FUNCTION 'SSF_OPEN'

      .......

      ENDAT.

      SSFCTRLOP-NO_OPEN = 'X'.

      SSFCTRLOP-NO_CLOSE = 'X'.

      CALL FUNCTION FM_SMARTFORM

      EXPORTING

      CONTROL_PARAMETERS = SSFCTRLOP

      .......

      ENDLOOP.

      IF SY-SUBRC = 0.

      CALL FUNCTION 'SSF_CLOSE'.

      ENDIF.

  • Posted on Aug 26, 2005 at 04:37 PM

    Declare your selection screen customer field as a select-option, no extension, no intervals. That way, when someone runs it online, they can enter only one customer and when you schedule a background job, you can leave it empty, thus selecting all customers based on the rest of the criteria. You may want to check that users do enter a customer number when running online, otherwise they will end up printing all, similar to an automated run.

    Once you get the customer list, you can do as explained in the previous response.

    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.