Change Page in Sapscript form

Hi,
I have a custom report with a sapscript form that contains a list of records from KNA1 table. I would like to have a different page for every different KNA1-KUNNR (change page at new kunnr). Is this possible and how?
Thanks

Hi,
Kindly follow the below steps::
1.declare first field in ur internal table as 'KUNNR'.
2.once u get the required data into ur internal table to print, SORT the internal table with KUNNR.
3.LOOP the internal table to print and use CONTROL BREAK event (AT END OF KUNNR) to trigger new page for every new KUNNR.
4.In Control Break event (AT END OF KUNNR) call the Function Module 'CONTROL_FORM', which will trigger a new page in the output.
eg:
call function 'OPEN_FORM'      --> to Open the Form
LOOP AT itab.
     call function 'WRITE_FORM'
       exporting
          element = 'ITEM_DET'.
    AT END OF KUNNR.
       CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
               COMMAND = 'NEW-PAGE'.
    ENDAT.
endloop.
Hope it helps!!
Rgds,
Pavan

Similar Messages

  • Changing Page Upon Successful Form Validation

    I am trying to create a sort-of registration process and am having some difficulty.  I'll try to explain this as clearly as I can (forgive me, I'm a little new to all this):
    I have a form where I am using Spry validation widgets.  I'd like the submit button to validate those entries and keep the user on the page if any field doesn't pass, but take them to another page if the form checks out ok.  I can't figure out how to do this.  I've tried using behaviors to make the submit button also be a link but what ends up happening is that the link works whether the form passes validation or not.
    Is there any simple way to accomplish this with Dreamweaver's tools?  Any help is appreciated.

    That is not entirely true. Using SpryValidation you automatically stop the form from being processes (that is if the browser is JS enabled). If the form validates upon submission, then the action will take place. If the action is to go to another page then it will do so.
    The following is a very simple example
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <form action="action.php" method="post">
    <input name="frmSubmit" type="submit">
    <span id="sprytextfield1">
    <label for="text1"></label>
    <input type="text" name="text1" id="text1">
    <span class="textfieldRequiredMsg">A value is required.</span></span>
    </form>
    <script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    </script>
    </body>
    </html>
    Gramps

  • Call a function module from within a sapscript form

    not being an ABAPer i have the task of changing the Invoice SAPScript form.
    i have made the necessary changes - just about... but they have asked that i include the VAT Number on the Invoice....
    not too bad apart from different company codes have different vat numbers...
    not knowing a better way to retrieve data from table V_001_B - i am using the print program -RFKORD50, is there a better way of getting the VAT Number by company code? I figured if i could call the FM to return the value, all well and good.., they do not want the print program changed if possible so was looking at alternate methods....
    or am i trying to reinvent the wheel here?

    thank you both!  helpful answers! :o)
    anyway! 
    i have written the program which is called from the SAPScript:
        /:       PERFORM GET_VATNUMBER IN PROGRAM ZFI_F140_OPERATIONS
        /:       USING &BKPF-BUKRS&
        /:       CHANGING &VATNUMBER&
        CE       VAT Registration No : &VATNUMBER&
        REPORT zfi_f140_operations.
        FORM get_vatnumber TABLES in_par  STRUCTURE itcsy
                                  out_par STRUCTURE itcsy.
          DATA: lv_co_code TYPE bukrs,
                lv_vat_no  TYPE stceg.
          READ TABLE in_par WITH KEY name = 'BKPF-BUKRS'.
          MOVE in_par-value TO lv_co_code.
          SELECT SINGLE stceg FROM t001
            INTO lv_vat_no WHERE bukrs = lv_co_code.
          out_par-name = 'VATNUMBER'.
          WRITE lv_vat_no TO out_par-value.
          CONDENSE out_par-value.
          MODIFY out_par INDEX 1.
        ENDFORM.              
    it is not working and i cannot work out why... 
    i have not been ABAPing for very long but have had a go.... 
    any thoughts as to what i have done wrong?
    or point me where i should be looking?  thank you!

  • Getting total pages incorect in SAPSCRIPT FORM with SAPSCRIPT-FORMPAGES

    Hi,
    In scriptform I have total 3 pages, one is envelope_page, second is page_first, and third page_next. I want total no pages excluding envelop page, I have given HOLD for envelop page, START for first page, and INC for next page. Now when I run, I have only one page as output in my script(excluding envelop) so when am printing &PAGE& of &SAPSCRIPT-FORMPAGES& on first page, its giving me 1 of 2 instead I WANT 1 of 1, I even tried subtracting 1 from &SAPSCRIPT-FORMPAGES&, even by perform, but its not working.
    Its very urgent.
    Basically if anyone can even tell me how to do
    'total pages - 1' , that will also help.
    Please advice.
    Thanks for your help in advance.

    Hi Sanjay,
       In your case where you want to increment the value of the total number of pages always use <b>&SAPSCRIPT-JOBPAGES&</b> and for the individual page <b>&PAGE&</b>.
    Since you have to increment the value of the total number of pages, pass the value to a variable increment the variable and then display that variable.
    :   PERFORM CHECK_PAGE IN PROGRAM Z_SCRIPT
    :   USING &SAPSCRIPT-JOBPAGES&               
    :   CHANGING &WS_PAGE&                           
    :   ENDPERFORM                                
    FORM check_page TABLES p_page STRUCTURE itcsy
                           p_page1 STRUCTURE itcsy.
      READ TABLE p_page INDEX 1.
      IF sy-subrc = 0 .
        p_page1-value = p_page-value + 1.
        MODIFY p_page1 INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    "check_page
    Now your total number of pages would have been increased by 1 and display this variable in the script. But one point is <b>dont declare</b> the variable <b>WS_PAGE</b> in the driver program. If you declare the value will be reset. It will work believe me it works.
    Reward if helpful.
    Regards,
    Tushar

  • ORA-06502 on "Help Text" region when changing pages on a tabular form

    Hello everybody,
    We are developing an application on Apex 4.1.0.00.32. This application have some pages with tabular forms and these pages uses a page zero as template. In this page zero, we have added two sidebar regions: a list region to navigate on the application and a help text to describe how to use our application.
    The problem occurs when the tabular split the records into pages (since it has more records that it can show on a single page). When the user clicks to change to another page, Apex raises an ORA-06502: PL/SQL: numeric or value error as described below:
    Erro ao renderizar a região "Ajuda". ORA-06502: PL/SQL: erro: erro de conversão de caractere em número numérico ou de valor
    Informações Técnicas (visível somente para desenvolvedores)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -6502
    ora_sqlerrm: ORA-06502: PL/SQL: erro: erro de conversão de caractere em número numérico ou de valor
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 2
    component.name: Ajuda
    error_backtrace:
    ORA-06512: em "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 3654
    ORA-06512: em "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 4204
    Obs: Our database is in Brazilian Portuguese, so I guess it will be hard for some people to understand the first two lines! :)
    We have tried to change the pagination style of the tabular form and change the region model of the help text but the problem still happens.
    Does anyone an ideia about what this may be?
    Thanks in advance!

    I am getting the exact same message, to the line number, also in APEX 4.1.0.0.32.
    Occurs when changing pages in a classic report, Standard region template, select list pagination, when selecting a different pagination set.
    In English:
    Error during rendering of region "Matched Participants Help & Hints".
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -6502
    ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 2
    component.name: <strong>Matched Participants</strong> Help & Hints
    error_backtrace:
    ORA-06512: at "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 3654
    ORA-06512: at "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 4204
    There are no conditions on the region, and no date string within the Help text. Some HTML <strong> tags, that's it.
    The Help region renders fine the first time.
    The Debug info does not help any:
    3.798360.00062Computation point: After Box Body4
    0
    3.798990.00081Processes - point: AFTER_BOX_BODY4
    0
    3.799790.00068Region: <strong>Matched Participants</strong> Help & Hints4
    0
    3.800470.00213Region rendered dynamically because request was not null4
    0
    3.802590.00096Add error onto error stack4
    0
    3.803550.00084...Error data:4
    0
    3.804400.00084......message: Error during rendering of region "<strong>Matched Participants</strong> Help & Hints".4
    0
    3.805240.00084......additional_info: ORA-06502: PL/SQL: numeric or value error: character to number conversion error4
    0
    3.806080.00081......display_location: ON_ERROR_PAGE4
    0
    3.806890.00081......is_internal_error: true4
    0
    3.807700.00084......apex_error_code: APEX.REGION.UNHANDLED_ERROR4
    0
    3.808540.00082......ora_sqlcode: -65024
    0
    3.809350.00234......ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character to number conversion error4
    0
    3.811700.00082......error_backtrace: ORA-06512: at "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 3654 ORA-06512: at "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 4204 4
    0
    3.812510.00081......component.type: APEX_APPLICATION_PAGE_REGIONS4
    0
    3.813310.00110......component.id: 24
    0
    3.814420.00099......component.name: <strong>Matched Participants</strong> Help & Hints4
    0
    3.815400.00076...Show Error on Error Page4
    0
    3.816160.00344......Performing rollback4
    0
    3.819610.00225Processes - point: AFTER_ERROR_HEADER4
    0
    3.821850.00268Processes - point: BEFORE_ERROR_FOOTER4
    0
    3.82453-End Page Rendering
    Any thoughts on where to poke around for this one?
    Thanks - Karen

  • When I open "Pages" all the forms are in spanish. ( I am english speaking) I travel a lot and wonder if the program picked up on me being in Spain or something similar. How do I change it to english?

    When I open "Pages" all the forms are in spanish. ( I am english speaking) I travel a lot and wonder if the program picked up on me being in Spain or something similar. How do I change it to english?

    See
    http://en.wikipedia.org/wiki/Lorem_ipsum
    If that is what you are seeing, you just select it and type in your own text.

  • How to change the Development Class of the SAPSCRIPT FORM

    Hi All,
          I have transported the old form which needs to be deleted in Test System. Is that possible to create a TR for deletion and send it to Test enivronment?..
         Also is it possible to change the development class for a form?
         Please help me on this. Urgent!...
    Regards,
    Ramkumar.

    Yes, it is possible to change the development class for forms..
    Use SE03, transport organiser tools
    goto node OBJECT DIRECTORY ENTRY
    select node "Change object directory entries"
    Execute
    goto the next text box after data element, type FORM, give your SAPSCRIPT form name and tick the check box execute... now rightclick on your form and chenge development class..
    Now coming to your second question is is not possible to delete a FORM that it is already transported to QA and Production, only way to do this is by doing client copy.. basis will do it for you..
    Close the thread once your question is answered.
    Regards,
    SaiRam

  • Two SAPScript forms on a single page

    Hello
    Is there a way (in SAPScript) to have two forms (sapscript forms defined in SE71) printed in a single page ?
    What I would like to achieve is to have several sapscript forms defined in the system and to be able to combine them in a single page dynamicallly - I mean: the printing program would decide which of them should be output.
    I have one sapscript form which I want to output always - it contains some header and main window with some items. Apart from this form I need to print some additional information on the same page.
    This additional information may be formated in a few different ways - depending on the case. I need to include this info at the top of the page - formatted in one of possible ways mentioned. The rest of the page is always the same (some header and main window with items).
    I know I could just use windows definitions in a single sapsript form and let the printing program decide which of those windows to print. But my problem is: I would like to have different sizes of the information printed at the top of the pages - when I define a window I must declare height which will be occupied on the page - I'd like to have different height values for different cases.
    Is there a way to achieve that ?
    thanks in advance
    regards

    Hi,
    It is not possible.
    But instead of creating sapscript, why dont you create different standard text and call in same sap-script based on condition.
    You can create standard text in tcode so10. Its similar to editor in sap-script.
    Reward if useful

  • Print on the last page of a Sapscript form

    Hi,
    Is it possible (and how) to print something (a filed of an internal table) only to the last page of a sapscript form?
    Thanks

    Hi
    if you want to print something at the end of a page....
    You can write it as this...
    in the main window...
    in the data element write it...
    /E END_DATA
    /: IF &PAGE&  EQ  &SAPSCRIPT-FORMPAGES&.
    &W_VALUE&.
    /: ENDIF.
    SAPSCRIPT-FORMPAGES variable is a system variable which stores the total pages.
    PAGE variable stores the current variable accordingly it will check for last page and print it.
    Now call it in the driver program .
    Regards.

  • Change in SAPScript form not reflect in old orders

    Hi Expert,
       I have modified the layout of a sales order SAPScript form. For newly created one, I can get the new sales order printed with new layout. But for those who already exists, even though I go to the sales order, Extra -> Output -> Header to delete the original output, and manually add the output type again, the printout are always shown with old layout. I just wonder how can I have my old sales order printed with the new layout, thanks!

    Kumar,
    Remove and add the query into the workbook again, save the work, close and reopen. You should get it working again.
    Workbook also saves the format details and does not work well sometimes. So every time you do any format changes to the query, it is advisable to remove and add back the query into the workbook.
    Hope it helps
    _RJA

  • How can we change page format from A6 to A4 in smart forms

    Hi,
    Currently smart form is printing output in A6 page.Now my customer wants in A4 page.How can we change the page format from A6 to A4.Now the output should print in A4 page instead of A6 page.
    I checked the page format in form attribtes it is DINA4.Do in need to change the page format here.
    Is there any settings for this.Plase advice.I appriciate your guidence in this regard.Thanks in advance

    Hi Vijay,
       As the form is formated to A4, now the one A4 sheet and take a print out as well take a print with A6 sheet check the difference.  If the data is not printed in right way then u need to do alignment.
    If it's printing in the same as it used to be, then check the settings in SPAD. 
    Br,
    Laxmi.Suryadevara

  • TX F110 change sapscript form

    Hi.
    I have development a Z sapscript form, it´s a copy from F110_PRENUM_CHCK. How I can to do for change it to my new sapcript form, for TX F110?.
    Thanks in advance.
    Regards.

    Hello,
    1. Goto trxn FBZP.
    2. Click on "Pymt Methods in Company Codes".
    3. Select the company code & payment method for which you want to configure the Form. (Generally it will be C)
    4. Double click on the entry, expand the "Form Data" section. Here you will be able to add the Z-Form name.
    Please contact a functional guy in case of any doubts.
    BR,
    Suhas

  • SAPScript form coding changed automatically during transport

    Hi,
    I have developped  a SAPScript form in dev. and worked well.
    After I had transport it to testing environnment to test it there, I found out that my SAPScript coding
    was modified: some new lines code have been added replacing the original code while others have been just deleted.
    When I checked the attribute of the SAPScript, I notice that these modifications have been added automatically by user DDIC!
    I really do not understand how this could be.
    Any idea is welcome.
    Thanks,
    Charas

    Hi Charas,
    Note that SAPScripts are client specific, so make sure you import your script to each and every QA client. Inform your basis that the transport is not a cross client object. So, he will import to all the QA client.
    Or check with your Basis, to which QA client the transport has been imported to, go to SCC1 transcation code and copy it over to required QA client.
    I guess, above information will help you to close the thread.
    Regards,
    SaiRam

  • How to count Total Number of Pages in SAPSCRIPT

    Hi,
    Iam unable to print total number of pages in the First Page of SAPSCRIPT.Iam writing the Logic in the Varibale window.
    Please kindly help me.
    In First Page , The preview is
    Page 1 of 1-
    In Second Page , Teh Preview is
    Page 2 of 2
    The Logic is ....
    1. Variable window of Script
    PERFORM CHECK_PAGE IN PROGRAM ZZZF_SAPSCRIPT_EXITS
    USING &SAPSCRIPT-FORMPAGES&
    CHANGING &WS_PAGE&
    ENDPERFORM
    Page &PAGE(C)& of &WS_PAGE&
    2. Program
    FORM check_page TABLES p_pagein STRUCTURE itcsy
                            p_pageout STRUCTURE itcsy.
      DATA : p_i TYPE sypagno.
       READ TABLE p_pagein INDEX 1.
       IF sy-subrc = 0 .
         p_i = p_pagein-value.
         p_i = p_i - 1 .
    READ TABLE p_pageout INDEX 1.
    CLEAR p_pageout-value.
    *p_pageout-value = p_i+0(3).
    WRITE P_I TO p_pageout-value.
    condense p_pageout-value no-gaps.
         MODIFY p_pageout INDEX sy-tabix.
       ENDIF.
    ENDFORM. "check_page
    Please help me ASAP.
    Regards,
    Deepthi.

    Try this
    'On The Form'
    IF &NEXTPAGE& EQ 0
    DEFINE &DECRE& := '2'
    PERFORM SET_TEXT_SYMBOL IN PROGRAM YSS20200
    USING &SAPSCRIPT-FORMPAGES&
    USING &DECRE&
    ENDPERFORM
    ENDIF
    'In The Program'
    DATA : BEGIN OF script_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA END OF script_table.
    Used to modify total pages so they print correctly
    FORM set_text_symbol TABLES input_table LIKE script_table[]
    output_table LIKE script_table[].
    DATA: pageno TYPE i,
    intCnt type i,
    chrPg(2) type c.
    READ TABLE input_table INDEX 1.
    MOVE input_table-VALUE TO pageno.
    READ TABLE input_table INDEX 2.
    MOVE input_table-VALUE TO intCnt.
    subtract intcnt from pageno.
    write pageno to chrpg.
    CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
    EXPORTING
    NAME = 'FORMPAGES'
    VALUE = chrpg
    VALUE_LENGTH = 0
    REPLACE_SYMBOLS = ' '
    ENDFORM.

  • Printing Street4 Street5 in SAPScript form BA00

    Hello All,
    I am trying to print additional lines of street address (i.e. Street4 and Street5) in the sales order confirmation SAPScript form (BA00) output. I see that the structure VBDKA is being used to display the Ship-to-party address details. However, it does not have the additional street fields in it.
    How can I print these additional street lines?
    Any help will be greatly appreciated.
    Thanks,
    Rugmani

    In the INFO1 page of the SAPScript form I inserted the following code:
    /:   IF &VBDKA-LAND1_WE& NE &SPACE&.               
    /*   * Ship-To Address (not identical to Sold-To)  
    /:   ADDRESS DELIVERY PARAGRAPH AS                 
    /:     ADDRESSNUMBER &VBDKA-ADRNR&                               
    /:   ENDADDRESS         
    /:   ELSE.               
    /*   * Output Partner (Sold-To)                                               
    /:   ADDRESS PARAGRAPH AS                                                     
    /:     TITLE    &VBDKA-ANRED&                                                 
    /:     NAME     &VBDKA-NAME1&, &VBDKA-NAME2&, &VBDKA-NAME3&, &VBDKA-NAME4&    
    /:     STREET   &VBDKA-STRAS&                                                 
    /:     POBOX    &VBDKA-PFACH&  CODE &VBDKA-PSTL2&                             
    /:     CITY     &VBDKA-ORT01&, &VBDKA-ORT02&                                  
    /:     POSTCODE &VBDKA-PSTLZ&                                                 
    /:     COUNTRY  &VBDKA-LAND1&                                                 
    /:     REGION   &VBDKA-REGIO&                                                 
    /:     FROMCOUNTRY &VBDKA-SLAND&                                              
    /:   ENDADDRESS                                                               
    /:   ENDIF.                                                                   
    However, I do not see the additional street lines filled in the form output.
    Is there something wrong with my code? I think VBDKA structure does not accomodate the additional street lines. Is there any other structure that I can use? Do I have to change anything in the print program?
    Thanks,
    Rugmani

Maybe you are looking for

  • Cannot see control options in the player

    I have downloaded a free trail version of macromedia flash 6 on windows machine .whenever i try to open flash movie(.swf) from the player , the movie is played but i cannot see the control buttons with the movie .

  • End_of_list     in  REUSE_ALV_GRID_DISPLAY

    Hello all, I want to display some 2 lines of informations after all the records in the ALV grid display. For the same I have defined END_OF_LIST event and inside the FORM  <end_of_list> write: / '.........test1..............'. write: / '.........test

  • Blackberry app world & unknown symbols

    When trying to use my Blackberry app world on my Blackberry curve it is continuously telling me to accept terms and conditions but that is it, I can';t go Any further. Any suggestions ?. also ............ There are two symbols on my home screen and I

  • Disconnected ever few minutes for last week

    My dsl has been unusable for the last week.  every few minutes I am disconnected.  Sometimes it reconnects, other time I have to unplug the router and modem to reset.  I have had Verzon dsl for several years with mixed results but this is insane.  I

  • Singleton class in WebLogic Cluster

    Hi, We have an application set-up in a weblogic cluster. We have a singleton class in the application. Since we have two managed servers in the cluster the singleton has two instances, one in each server. So the basic purpose of use of singleton is l