SapScript, How do I read the current line number?

I have sections of text - each in it's own element with an 'include' of the standard text.
These sections are variable in size.
All elements are in the MAIN window.
I do not want a paragraph to split over two pages.
How do I read the current line number within the sapscript before the section prints so I can issue a new-page command at the beginning of the paragraph?
Thanks!

Yes, that does work for paragraphs.
If I have multiple elements to print from within a loop where "at first, at each and at last" each call the Sapscript funtcion write_form - how can I keep the whole section together.  protect/endprotect will keep each element together but not the group of elements.
There must be a way to find the current line number.

Similar Messages

  • How to find dynamically the current line number in the source file

    Is there a mechanism like __LINE__ and __FILE__ macro in C to get dynamically
    the current line number and file name of a source file?

    Don't know - but others have asked too. Have you searched the forum? For example:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=210496

  • How can we get the selected line number from JTextArea ?

    how can we get the selected line number from JTextArea ? and want to insert line/string given line number into JTextArea??? is it possible ?

    Praitheesh wrote:
    how can we get the selected line number from JTextArea ?
    textArea.getLineOfOffset(textArea.getCaretPosition());
    and want to insert line/string given line number into JTextArea??? is it possible ?
    int lineToInsertAt = 5; // Whatever you want.
    int offs = textArea.getLineStartOffset(lineToInsertAt);
    textArea.insert("Text to insert", offs);

  • How to only read the last line in the text file by using BufferedReader ?

    Dear all,
    Hello, I am new to Java. Do anybody know how to read the last line (this is the last record) in the text file.The method I am now using is reading from the first line until I reach the last line in the text file. Thank you!!
    BufferedReader br = new BufferedReader(new FileReader("c:\\sdk1.4.1\\bin\\dbExport.txt"));
    DataInputStream in = new DataInputStream(new FileInputStream("c:\\sdk1.4.1\\bin\\dbExport.txt"));
    String input;
    String firstinput;
    String secondinput;
    int count=90;
    int year=1955;
    while ((input = br.readLine()) != null) {
    firstinput = input.substring(0, 10);
    secondinput = input.substring(10);
    String insertStore1 = ("INSERT INTO AUTHORS " +
    "VALUES ('" + count + "', '" + firstinput + "', '" + secondinput + "', 1955)");
    System.out.println(insertStore1);
    int result = stmt.executeUpdate(insertStore1);

    I suppose you could use a java.io.RandomAccessFile.

  • Read the Current BP number before saving

    HI Experts,
    From the Identification tab iam creating the BP by entering all the mandatory fields and then i click on END button instead of "Save" so on this END button event i want to read the current BP which is not yet saved in the database.
    Iam writting the logic of END button in the IF_CRM_IC_PREPARE_FOR_CALLBACK~EXECUTE method of the Main View set(IUICMD/MainVS).
    data: zv_core    TYPE REF TO cl_crm_bol_core,
             zv_entity TYPE REF TO cl_crm_bol_entity_manager,
             zv_core = cl_crm_bol_core=>get_instance( ).
             CALL METHOD zv_core->get_entity_manager
               RECEIVING
                   rv_result = zv_entity.
    In Debug mode when i check the ZV_ENTITY in that there is one Private Attribute ENTITY_TAB of type Sorted Table where i can see 3 entries with OBJECT_NAME as "BuilHeader","BuilContactPerson", "BuilStandardAddress" when i check the Entity reference of ""BuilHeader" iam getting the current BP number. But how to read this entity iam not getting this.???
    I tried the below way..
    LOOP AT zv_entity->entity_tab ASSIGNING <itab>.
    ENDLOOP.
    But it says that "Access to private attribute "ENTITY_TAB" is not allowed."..
    Regards.

    Hi Hemant,
    As you are implementing your method in overview set , try to access the view controller where the BP ID is created by rereading the entity.
    DATA: lv_viewname TYPE string,
            lr_viewctrl TYPE REF TO cl_bsp_wd_view_controller.
      lv_viewname = me->get_viewarea_content( '<View Area of your view>' ).                            
      IF lv_viewname IS NOT INITIAL.
        lr_viewctrl = me->get_subcontroller_by_viewname( lv_viewname ).
        IF lr_viewctrl IS BOUND.
          TRY.
              CALL METHOD lr_viewctrl->('<method_name>')   .
               CATCH cx_sy_dyn_call_error.
              RETURN.
          ENDTRY.
        ENDIF.
      ENDIF.
    Regards,
    Nithish
    Edited by: nithish P on Feb 7, 2012 2:32 PM

  • How can we read the current URL in Forms9i

    Hi,
    It will be greatful, if anyone give me the solution to get the current URL in Oracle forms 9i
    Regards,
    Walter Nicholas T

    Walter,
    it depends on what you need it for. The Forms URL cannot be accessed directly from Forms without using a Java Bean in it, but consists of
    <protocoll><server><port>forms90/f90servlet?config=<application>
    If you want to call resources on the same server, then you could do a web.show_document() call to /<virtual path>/<file>, whic would then look for the resource on the server that downloaded Forms
    To get the information about the config parameter, create a user parameter in Forms, say "conf" and add teh following to teh formsweb.cfg file
    [myApp]
    otherparams=conf=%config%
    In Forms the config information is accessible via
    varStr := :parameter.conf;
    To get the whole URL string, I am afraid you need to write a Java Bean in Forms (not sure of webutil already implements this, maybe worth checking)
    Frank

  • How to you reference the current page number and total pages in a script?

    I'm trying write a small script to make field invisible when the current page equals the total number of pages, but with no luck.
    Can anyone advise how to do this?
    I've tried various ways to reference my fields, this being the most basic:
    if(pageNumber == totalPages) {
    continuedBase.presence = "invisible";
    // pageNumber has a run time property as "Current Page Number"
    // totalPages has a run time property as "Number of Pages"
    // continuedBase is a text field within the same subform as pageNumber and totalPages
    Thanks for any help offered.
    Russell

    If you are asking how to get the current page and total pages you acn use these commands:
    current page ----- xfa.layout.page(this)
    total pages ------ xfa.layout.pageCount()
    so your code woudl look like this:
    app.alert("The curent page is: " + xfa.layout.page(this));
    app.aler("The total number of pages is: " + xfa.layout.pageCount());
    if(xfa.layout.page(this) == xfa.layout.pageCount()) {
    continuedBase.presence = "invisible";

  • How do I read the current digital output?

    Im using LV 7.1 to control a stepper motor (direction only) using user defined set points that are measured by a linear encoder.
    Basically I want to make it bounce between two set points by switching the motor direction. I can do the outer bounds fine, but to tell LV which direction it should go in between I want to just have it look at the digital output that I am sending to the motor and just continue to send that same signal. I know that it is on port 7 line 0 of my card, I just haven't figured out yet how to grab that information. Any ideas?
    Thanks.

    What boards are you using for this?

  • How i can see the Current Order documents

    Hi Gurus,
    can any body  tell me how can i see the current order number documents? in T.Code - KONK  i see that the number range status shows current order document number. but i cannt trace where it to see the document?
    also i check the Order Actual Line Item & Plan Line Item at the time message arrise that Order doesnot exit.
    but in KONK - the current number range status shows the order document number.
    pls help me to overcome the problem.
    Point will be rewarded
    Than'x
    Dhananjay

    Hi,
    you are mistaking KONK with KANK. KONK ist the number range for internal order master data (i.e. order numbers). Please check this via AUFK. Line items have nothing to do with KONK.
    Regards
    Karl

  • How do you read the camera position in the 3d picture control?

    Hello,
    There is a method to setup the camera position, but how do you read the current camera position?  e.g. the user uses the mouse, ctrl, and shift, to change the camera position.  How do you read this new camera position?  There don't seem to be any properties to do this.
    I've read this thread:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=214629&requireLogin=False
    but the question was never answered....
    From the comments in that thread, even if you had the proper documentation for the "Model Matrix" property, you couldn't get the information necessary to calculation the camera position.

    Lorielle,
    Thanks for the VI.
    Could you point me towards a more detailed description of the "Modelview Matrix" property?  I've attached a screenshot from the online help.  It is not very helpful.
    Attachments:
    Modelview Matrix.jpg ‏71 KB
    Modelview Matrix1.jpg ‏71 KB

  • Current line number in smartform

    Hi All,
              I need to know is there anyway that i can know the current line number in smartforms.
    My requirement is:
       I have 1 header item and its 3 line items, if there is no space in main area to display all the header and its line items , then it sould be printed in next page,
    Eg:                          PAGE 1
    HD       Line
    A           01
                 02
                 03
    B           01
                 02
                 03                       PAGE 2.
              if this is the case then whole B 01-03 should be printed in next page.

    Hi,
    Please search SDN for Page Protection in Smartform Table
    You will get lot of info.
    Regards,
    Vishal
    Edited by: Vishal Jadhav on Nov 5, 2008 12:36 PM

  • Get the current line no.(similar to sy-linno in report) in  Sapscript form

    Hi everyone,
    In ABAP reporting, you can use sy-linno to determine the current line no.
    But if in sapscript form,
    does any system field to get the currect line no. or y-origin. ?
    Just say the program is now runing and have written several lines in a window of the form.
    AS         This is the first line
    AS         This is the second line
    AS         This is the third line
    how to get the current line = 3 or  yorigin '+3'  LN?
    Thanks for reply in advance.

    Hi,
    you can also chk the sy-linno directly in your script.
    Regards
    Subramanian

  • How to read a current line in table control in dialoug program ?

    How to read a current line in table control in dialoug program ?
    this code required to provide F4 help.

    Hi,
    You can use the variable <tablecontrol>-Currentline as Ebus says but there is a problem with this.Suppose there are 10 records in the table control with only 5 records visible then when u press a page down and press F4 the first record in page 2,  <tablecontrol>-Currentline will have value of 1 instead of 6.So you will need to write a small logic for that.
    index = ( <tablecontrol>-topline - <tablecontrol>-currentline ) + 1.
    read internal table itab at index.
    Hope this helps.
    Regards,
    Vivek

  • How to read current line number in function module sourrce code?

    Hi All,
    How to read current line number in function module sourrce code?
    regards,
    Anuj

    If you have new editor you would be able to see the line number. 
    Or in the Dump screen - there is a button called Debugger - click that you would be able to see the code where dump has occured..  you would be able to find the line number from there.
    To get the new editor with line number , you need to change the settingsin SE38.
    Regards
    Vivek

  • How to find the current line in the table control in module pool ?

    How to find the current line in the table control in module pool ?
    This is an urgent requirement? please do help me.

    refer to this example
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
    lines TYPE i.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
          TABLES demo_conn.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    DESCRIBE TABLE itab LINES lines.
    flights-lines = lines.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX<b> flights-current_line.</b>
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
          ENDIF.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols
                                  WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
    ENDLOOP.
          ENDIF.
    ENDCASE.
    ENDMODULE.

Maybe you are looking for

  • 'expression is of wrong type' - but which and where..?

    hello. Hopefully this will be clear as day to someone.. Please could someone tell me why I'm getting the following error message.. [061010_042222995][][EXCEPTION] SQLException encounter while executing data trigger.... java.sql.SQLException: ORA-0655

  • Moving Titles from one project to another

    I want to combine several iMovie projects into one, in order to create a single DVD via iDVD. The projects are fairly simple - no music, just video, dissolves, and some text. When I select all, and then copy and paste from one project to another, the

  • Connecting Canon MG5350 to MacBook with WLAN

    Hello! I just bought a Canon MG5350 and I tried to connect it with my MacBook which runs in iOS 10.6.8, using the wireless network. During the last step of the instalation, I am getting the message: no printer is dectetable. I checked the WLAN settin

  • How to create monitor entries from an update routine?

    Hi, Does anyone try to create monitor entries in ABAP routine in update rules? I have How-to guide "How to... Create monitor entries from an update routine". I applied code from it. RETURNCODE = 1. MONITOR-MSGID = 'RSM'. MONITOR-MSGTY = 'W'. *** I al

  • Add a date to a jpeg

    I have a bunch of pictures (jpeg) that I scanned from slides a number of years ago. Is there a way to date them so they will show in my iPhoto library by somewhat proper chronological order? If I import them as they are and rearrange them on the comp