Smartforms - new page command at loop

Hi @ll,
I`ve created a loop over an internal table in which I have insert a command to go to next page. The command is being called correctly but I don`t get data on the next page. I would expext that the loop goes on with the next record. Currently have just one page - could that be the problem?
What I`m doing wrong?
Ragards,
Flo

Hi,
   In the internal table add one more field called flag and in the driver program populate the value of     flag = 'X'  at the end of every PERNR using Control break statements.
   In the loop and the command give the condition as  Flag = 'X'.
   So the Page break will be triggered when ever the PERNR value will be changed.
Hope this will help you.
Regards,
Venkat.

Similar Messages

  • New page command

    Hi experts,
    i have a requirement.
    after execute the report,it will display multiple personal number in abap hr as blocked list
    like
    in first block employee earning details
    in second block employee deduction block
    in third block employee tax details.
    but my requirement is
    when we down load the program,page break should come for every personal no.
    another employee should not start in middle of the page .
    i have used NEW PAGE command after loop statement to pront another employee in another page.
    but anorthe employee is not priting another page.he is priting on the same page.
    any one could solve this problem.
    Regards.
    Sudheer

    try within the loop
    AT NEW PERNR.
    new page
    END AT.

  • New Page command not working in SMARTFORM

    I have a text file in an internal table of type TSFTEXT.  I'm passing this internal table to my smartform.  The smart form has 1 page, 1 main windo and 1 text element.  The text has a text type of "Dynamic Text" and a fieldname = <<internal table of type TSFTEXT>>.  The start property = "New Paragraph".
    In the internal table (TSFTEXT), i have a few NEW-PAGE commands.  These seem to be ignored.  How can I force the smartform to create a new page.  Here is what the internal table looks like.
    / here is some text 1
    / here is some text 2
    / here is some text 3
    / here is some text 4
    / here is some text 5
    /:NEW-PAGE
    / here is some text 6
    / here is some text 7
    / here is some text 8
    / here is some text 9
    / here is some text 10
    Thank you,

    As far as I know, NEW_PAGE is not applicable in smartforms. That only applies to Sapscripts. As you stated in your requirement, to have a new-page in smartform, try to adjust the height of the main window. Once the records on the internal table reaches the total height, then it will automatically create a new page...

  • New Page COmmand in Smartforms

    Hi,
    My requirement is as follows,
    Whenever the item number changes it has to generate a new page with the header
    Whenever an item overflows it should come in a new page without the header details.
    So for this I have two pages in my smartform.
    Page1 - Header with item details
    Page2 - Only item details without the header
    I have given Page1's next page as Page2. And I have given a command whenever the item no changes it should go to Page1.
    But whats happening now is whenever a new page is generated only Page 2 is coming and not the Page 1.
    Any ideas??

    Hi ,
    u want like this right ...
    assume  that  table  data
    item                            item desc                              qty
    10                              10item descripotion                 23
                                        for material      
    20                               20item descripotion                 33
                                         for material      
    O/P Like  This u want
    *page1
    item                                    item desc                            qty
    10                                       10item descripotion            23
    page2  (dont want  want headers only remainning data of the line item)
                                              for material      
    For this simply u can put your header  in the main area of the table  (leave header as blank)
    Let me know if any concerns........
    Regards,
    Lokesh.

  • Dynamic New-Page Command in Smartform

    Dear Experts,
    I have a particular requirement of triggering New-Page after the end of Main window for displaying Terms & Conditions on the last page.
    For this purpose I have designed 3 pages :
    PAGE1 - Contains Main window, few Secondary windows and some Graphic windows.
                   (In PAGE1 -> General Attributes -> Next Page = PAGE2)
    PAGE2 - Is in continuation with PAGE1 except a few changes w.r.t. some Secondary windows.
                   (In PAGE2 -> General Attributes -> Next Page = PAGE2)
    PAGE3 - Contains a new Main window for displaying Terms & Conditions, few Secondary windows and
                   some Graphic windows.
                   (In PAGE3 -> General Attributes -> Next Page = PAGE3)
    After the end of Main window in PAGE1 or PAGE2 depending on the amount of data, I have used a Command logic for triggering New-Page (PAGE3). But it always triggers PAGE2 as new page and not PAGE3.

    Thanks Muthukumar.
    But in case if I set a next page of page 3 to the second page, then if my Page2 contains data spreading over more than one pages, it will display Page2 once and immediately display Page3 as next page.
    I will explain my requirement once again:
    1. If my PO details fits on Page1 itself than my next page should be Page3(Terms & Condition page).
    2. If my PO details is of more than one page, for that I have designed Page1 as first page and Page2
        for remaining pages. Once the PO details is over the next page should be Page3.

  • Smartforms new page

    Hi everybody.
    I have a problem with a SmartForm i'm developing.
    I need to print a table with several columns.
    Each row of the table is group by the first column.
    I want to change the page and begin to print my list in a new page when the value of the first column changes.
    I use the 46C version and I don't know if it coul be possible with it.
    Wait your response.
    Cheers. See You.

    Hi Lorena,
        Create a COMMAND element inside the loop element after you print the line.
    In that COMMAND element, put next page as another page (Create another page),
    In the condition tab of the command element, you can put a condition that if current loop pass's columns <> last loop pass's column value.
    You have to put a program lines element in the loop(At the beginning of the loop), which would calculate the current loop pass's column value)
    Regards,
    Ravi

  • New Page triggering in SMARTFORMS

    hi all
    According to my requirement if the subarea of the person changes it should trigger the new-page. I have written the new-page command in Event on sort begin. It is triggering when the subarea changes but the last record of previous subarea is repeating into the next page when there is only one record in the pervious page, with more records of the same personnel subarea in the pervious page.
    If the subarea is having only one record it is printing in a new page and the next subarea is also printing in the new page correctly.
    If the last page of a particular subarea is having more than 1 record, the next subarea is printing correctly in the next page.
    The problem is coming only when one record is printing in a page and there are some more records of the same subarea in the pervious page. The record is getting printed in the last page is repeating again in the next page with the changed subarea. 
    pls give me the solution.

    hydfyt

  • Regarding new-page

    Dear all,
    I have used new-page command in my report
    Every new material it will go to next-page..In my report foreground is working fine.
    If i execute in background new-page is not working.. it will come all material in the same page from spool request.
    ANY SOLUTION FOR SOLVE THE PROBLEM IN BACKGROUND
    Example CODING
    select-options : so_matnr for mara-matnr.
    select  matnr from mara into table it_mara where matnr in so_matnr.
    sort it_mara by matnr.
    loop at it_mara.
    new-page.
      write : /1 it_mara-matnr.
    endloop.
    Thaks.

    Hello Friend,
    To print a different pages in spool request you have to use NEW PAGE PRINT ON...
    Pleaes modify the code like below:
    DATA PARAMS LIKE PRI_PARAMS.
    DATA: DAYS(1)  TYPE N VALUE 2,
          COUNT(3) TYPE N VALUE 1,
          VALID    TYPE C.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING DESTINATION           = 'LT50'
                COPIES                = COUNT
                LIST_NAME             = 'TEST'
                LIST_TEXT             = 'Test NEW-PAGE PRINT ON'
                IMMEDIATELY           = 'X'
                RELEASE               = 'X'
                NEW_LIST_ID           = 'X'
                EXPIRATION            = DAYS
                LINE_SIZE             = 79
                LINE_COUNT            = 23
                LAYOUT                = 'X_PAPER'
                SAP_COVER_PAGE        = 'X'
                RECEIVER              = 'SAP*'
                DEPARTMENT            = 'System'
                NO_DIALOG             = ' '
      IMPORTING OUT_PARAMETERS        = PARAMS
                VALID                 = VALID.
    IF VALID <> SPACE.
      NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG.
      WRITE / 'First line'.
    ENDIF.

  • New Page Format implentation in Sap Scripts and Reports

    Hi,
       I want to print Report details and also some of the SAP Script details on the paper size of 350MM width and 310MM Height in the PORTRAIT format.
       So i created new page format with these dimensions.
       How i can use this for reports. So i can set these parameters while taking output from Report.
       Pls specify if any configuration required for this.
    Thanks in Advance,
    Regards,
    Pavan.

    In SAPscript, you set the Page Format for the document in the "Page Format" field of the "Basic Settings" page of the documents "Header" information. The popup list of this field will show all available formats in your system, so this is a ggod way to make sure your new format is set up properly.
    For reports, page format is set either with the LINE-SIZE addition to the REPORT and NEW-PAGE commands, or through the PARAMETERS addition to the NEW-PAGE command. When you use LINE-SIZE the print system picks the format for you, based on the available formats in the systems.
    I don't remember if there is an activation step for Page Formats, or if saving is all you have to do.

  • RE: new-page

    HI,
       Iam facing two problem in scripts. 
    1. Iam using new-page command in the main window editor.
       If i use one notification number then it has to show 1 page. But it is giving two pages. So how to rectify this.
    example: if i run for 200 pages
              it is giving 201 pages
    2. When ever i run the script it automatically should go to the sap mail box. How can i achieve this.
    rgds
    p.kp

    MOVE-CORRESPONDING NAST TO LVS_SNAST.
        MOVE SY-REPID           TO LVF_PROGRAM.
        CALL FUNCTION 'CONVERT_COMM_TYPE_DATA'
            EXPORTING
                 PI_COMM_TYPE              = LVS_COMM_TYPE
                 PI_COMM_VALUES            = LVS_COMM_VALUES
                 PI_SCREEN                 = US_SCREEN
    *           PI_NEWID                  =
                 PI_COUNTRY                = US_COUNTRY
                 PI_REPID                  = LVF_PROGRAM
                 PI_SNAST                  = LVS_SNAST
            IMPORTING
                 PE_ITCPO                  = LVS_ITCPO
                 PE_DEVICE                 = LVF_DEVICE
                 PE_MAIL_RECIPIENT         = LVS_RECIPIENT
                 PE_MAIL_SENDER            = LVS_SENDER
            EXCEPTIONS
                 COMM_TYPE_NOT_SUPPORTED   = 1
                 RECIPIENT_CREATION_FAILED = 2
                 SENDER_CREATION_FAILED    = 3
                 OTHERS                    = 4.
        IF SY-SUBRC <> 0.
          retcode = sy-subrc.
          exit.
        endif.
    * fill structure itcpo
        ITCPO = LVS_ITCPO.
        if v_nast = 'X'.
          lvs_itcpo-tdgetotf = 'X'.
          lvs_itcpo-tdnewid = ' '.
         <b> TNAPR-FONAM       = 'ZTESTFORM'.</b>
    *    LVF_DEVICE = 'OTF_MEM'.
        endif.
    * open form
        CALL FUNCTION 'OPEN_FORM'
             EXPORTING
    *           APPLICATION        = 'TX'
                  ARCHIVE_INDEX      = TOA_DARA
                  ARCHIVE_PARAMS     = ARC_PARAMS
    *            DEVICE             = LVF_DEVICE
                  DIALOG             = ' '
                  FORM               = TNAPR-FONAM
                  LANGUAGE           = NAST-SPRAS
                  OPTIONS            = LVS_ITCPO
                  MAIL_SENDER        = LVS_SENDER
                  MAIL_RECIPIENT     = LVS_RECIPIENT
    *           MAIL_APPL_OBJECT   = ' '
    *           RAW_DATA_INTERFACE = '*'
    *      IMPORTING
    *           LANGUAGE           =
    *           NEW_ARCHIVE_PARAMS =
    *           RESULT             =
             EXCEPTIONS
                  CANCELED           = 1
                  DEVICE             = 2
                  FORM               = 3
                  OPTIONS            = 4
                  UNCLOSED           = 5
                  MAIL_OPTIONS       = 6
                  ARCHIVE_ERROR      = 7
                  OTHERS             = 8.
        IF SY-SUBRC NE 0.
          retcode = sy-subrc .
        endif.
    try this we have used like this...
    Message was edited by: Vijay Babu Dudla

  • Triggerring new page in the script

    Hi
    can anybody tell me how to trigger a new page in the script on condition.
    my problem is i want to print material & its discription based on the MRP controller using scripts.
    if the MRP controller changes then it has to trigger a new page in the script.
    page 1.
    MRP controller 102
    material1  material1-discription.
    material2 material2-discritpion.
    new page shoud trigger here
    page 2
    MRP Controller 103
    material1  material1-discription.
    material2 material2-discritpion.
    Thanks in advance

    Hi,
    First Call That text Element Were U Used New-page Coomand.
    SAPscript automatically inserts a page break when the main window of a page (MAIN) is full. You can use the NEW-PAGE command to force a page break in the text at any point you want one. The text following this command then appears on a new page. The page break is always performed (it is an unconditional page break).
    The NEW-PAGE command completes the current page. This means that all the windows that are still on the page are printed immediately. If you use the NEW-PAGE command without parameters, the page defined in the current form as the next page will be taken next. If, however, your form contains a number of different pages, then you can specify any one of these as the next page to be used.
    Syntax:
    /: NEW-PAGE page_name
    /: NEW-PAGE
    The current page will be completed and the text in the following lines will be written to the page specified in the form.
    /: NEW-PAGE S1
    As above, except that the page S1 will be taken as the next page.
    If, in a NEW-PAGE command, you specify a page not contained in the form, the specification is ignored.
    Take care that there are no blank lines immediately before a NEW-PAGE command. If an implicit page break occurs within the blank lines, an unexpected blank page may be printed.
    2.it can be set in two way
    1 using SE71 ur Script transaction
    u can create new page by clicking page tab in Se71 and goto edit->create Element.. that will create a new page..
    2 Using ur SE38 itself by setting a flag variable = X u can create a new page..
    if page = ' X '.
    new-page.
    endif.
    reward if helpful
    Shiva Kumar

  • Script new page

    Hi i am creating new page in script and giving some text in that page window.
    but that page not all triggering here,
    all ready first and next pages are there in my script .. i created new page,, but not coming...
    could any body explain how to solve my problem..
    thanks,

    Hai,
    First   Call That  text Element  Were U Used New-page Coomand.
    SAPscript automatically inserts a page break when the main window of a page (MAIN) is full. You can use the NEW-PAGE command to force a page break in the text at any point you want one. The text following this command then appears on a new page. The page break is always performed (it is an unconditional page break).
    The NEW-PAGE command completes the current page. This means that all the windows that are still on the page are printed immediately. If you use the NEW-PAGE command without parameters, the page defined in the current form as the next page will be taken next. If, however, your form contains a number of different pages, then you can specify any one of these as the next page to be used.
    Syntax:
    /: NEW-PAGE [page_name]
    /: NEW-PAGE
    The current page will be completed and the text in the following lines will be written to the page specified in the form.
    /: NEW-PAGE S1
    As above, except that the page S1 will be taken as the next page.
    If, in a NEW-PAGE command, you specify a page not contained in the form, the specification is ignored.
    Take care that there are no blank lines immediately before a NEW-PAGE command. If an implicit page break occurs within the blank lines, an unexpected blank page may be printed.
    Regards.
    Eshwar.

  • Smartforms Dump at Command - New Page

    Hi Experts,
    I have to create a Smartforms Layout. I have to print the first page as Landscape and the rest of the pages as portrait.
    The first page will contain the summary. Other will contain different details related to the summary.
    I have created 3 pages.
    The first page in Layout. The next page here is first page.
    The second and third pages as portrait.
    On the first page after the summary table I have given a command. I have selected the checkbox, go to new page and specified the next page.
    If I give the other pages as Landscape and the main window with the same size as the window on the first page, I am able to print correctly. If I specify as portrait I get a dump.
    Any body can let me know how do I create different pages with different layout. Where am I going wrong
    Regards,
    Abu

    Short text
        Exception condition "ERROR" raised.
    What happened?
        The current ABAP/4 program encountered an unexpected
        situation.
    Error analysis
        A RAISE statement in the program "SAPLSTXBC" raised the exception
        condition "ERROR".
        Since the exception was not intercepted by a superior
        program, processing was terminated.
        Short description of exception condition:
        For detailed documentation of the exception condition, use
        Transaction SE37 (Function Library). You can take the called
        function module from the display of active calls.

  • Reg smartforms -  creating a new page for each customer number

    Dear friends,
    This is a sample program for smartform.
    Below is my coding ...
    TABLES : KNA1.
    SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR.
    TYPES : BEGIN OF ZFS_KNA1,
            KUNNR TYPE KNA1-KUNNR, 
            NAME1 TYPE KNA1-NAME1,
            ORT01 TYPE KNA1-ORT01,
             END OF ZFS_KNA1.
    DATA : ITAB TYPE STANDARD TABLE OF ZFS_KNA1 INITIAL SIZE 0,
           WA TYPE ZFS_KNA1.
    SELECT KUNNR NAME1 ORT01 PSTLZ LAND1 FROM KNA1 INTO TABLE ITAB WHERE KUNNR IN S_KUNNR.
    Now i am having one secondary window (cusotmer number) and main window(name and city).
    I am able display list of cm nos, names and city in one page.
    But i want to display name, city and number of customer in one single page.
    suppose 5 customer numbers are there.....then 5 seperate pages should be displayed.
    pls help me.
    Regards,
    S. Vinod

    Hi,
    In your loop node... you have sort criteria....
    give the fieldname of the customer number KUNNR and check the check box under the begin of sort event...
    An event node is created... under that event  node... create command node for triggering new page and dont forget to tick the checkbox for " not on first page" in the conditions tab....
    and under that you can create text elements to display the data
    regards
    padma

  • New-page for smartform

    Hello all,
    I am facing a problem using smartforms. I am printing a report where there is a loop running for a list of plants. For printing the information of each plant, I need to use a new page. Information of one plant may take several pages but for every new plant, I need to insert a page break.
    I am using a COMMAND with a checked next page option in my EVENT ON SORT BEGIN for the plant code.
    This does the trick, but if I use the command at the bottom, it inserts a blank page at the end of the report. If I use the command at the top of the event, it first shows a blank page and then the data from the 2nd page.
    Please sugest how can I fix this.
    Anmol

    Hi Friend,
            You can use following tips for generating smartforms for every new plant.I have generated sales order report using this steps.You can refer it.Tips are given below:
    1.Define the structure,workarea and internal table for sales order header and details and also define
    select-options for sales order.
    2.Also define the one STRUCTURE which has type as ssfctrlop.
    e.g. control type ssfctrlop.
         This variable we have to define because we are going to use this in
    SSF_OPEN function.This is used to avoid print preview while openning smartform
    for every sales order.
    3. Select data from vbak for sales header.
    4. Call function SSF_FUNCTION_MODULE_NAME.
    e.g.*CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = w_formname
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
       IMPORTING
         fm_name                  =  w_functionname
       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.
    5.Now here define the various features or field in control structure.
    This is controls for smartform.
    e.g.  control-no_dialog = 'X'.
         control-preview   = 'X'.
         control-no_open   = 'X'.
         control-no_close  = 'X'.
    6. Call function SSF_OPEN.
         Here you have to pass the control structure which you have define in declaration.
    e.g.
    CALL FUNCTION 'SSF_OPEN'
        EXPORTING
      ARCHIVE_PARAMETERS       =
      USER_SETTINGS            = 'X'
      MAIL_SENDER              =
      MAIL_RECIPIENT           =
      MAIL_APPL_OBJ            =
      OUTPUT_OPTIONS           =
          control_parameters       = control
    IMPORTING
      JOB_OUTPUT_OPTIONS       =
       EXCEPTIONS
         formatting_error         = 1
         internal_error           = 2
         send_error               = 3
         user_canceled            = 4
         OTHERS                   = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    7. Take loop at header internal table .
    8. Select data from vbak for sales details. Also select data from respective tables
    like makt,kna1 here.
    9.Then call function module which generated after executing smartform. And also pass the control structure
    in import parameter in this function module.
    e.g.  CALL FUNCTION '/1BCDWB/SF00000397'
        EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
        control_parameters         = control
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
          wa_vbak                    = wa_vbak
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        TABLES
          it_vbak                    = it_vbak
          it_vbap                    = it_vbap
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    10.After endloop call function SSF_CLOSE.
         If it will help you reward me points.
    Regards,
    Santosh.

Maybe you are looking for

  • PCUI - open New Window via Button (to call custom URL / HTML viewer)

    Hello group, I have followed the "Use CRM PCUI HTML viewer to call a custom URL" in order to create a custom URL to BW web template. However, instead of displaying the URL in a tab (this works fine), I want a Button in the Accounts view to open up a

  • Help! Intalled i tunes and need help with syncing

    I have successfully installed iTunes on my compaq cpu (windows xp) and have purchased a couple of audio books. However, when I plug in my Sony MP3 playing to my CPU via the USB cord. My MP3 player icon does not show up on my items tool bar so I am un

  • Controlling Multi-processor Solaris 8

    We have a Solaris 8 MP box. We want to be able to 'toggle" the use of one of the processors. That is, we want to PROGRAMATICALLY tell the OS to disable one processor and run as a single-processor machine. Then, later, tell it to enable that processor

  • Number of BDC in a package.

    Hi all. I want to find out number of BDC created, in a package. Regards Prajwal

  • I have mac book 2008 model 3,1  runing osx version 10.5

    i have mac book 2008 model 3,1 and for some reason it is letting me connect to an air port and wifi but its not letting me get online access from safari or itunes? every time i click the safari it tells me  "The application Safari quit unexpectedly"