Want to display multiple rows of internal table on sap script

hi friends,
              i have created element in window.and in report i have called all functions as open_form,start_form,write_form,end_form,close_form.
enclosing  write_form function in 'loop at itab' and 'endloop',,,,gives error start_form missing even it is written before loop at sattement...
and if start_form is also included in loop  at and endloop statement then it shows per record per page......
please suggest .....how to make all records on same page 1 after another rather than of different pages

Hi
See the sample script program and code accordingly
*& Report  ZTEST12121
*& SAPScripts Example 1
REPORT  ztest12121.
*DATABASE TABLES
TABLES: ekko,ekpo,lfa1.
*INTERNAL TABLES AND STRUCTURES
DATA i_ekko LIKE ekko.
DATA i_ekpo LIKE ekpo OCCURS 0 WITH HEADER LINE.
DATA i_lfa1 LIKE lfa1.
*PARAMETERS
PARAMETERS: p_ebeln LIKE ekko-ebeln.
*VARIABLES
DATA MAT TYPE STRING VALUE 'MAT NO'.
DATA iTe TYPE STRING VALUE 'ITEM NO'.
DATA QTY TYPE STRING VALUE 'QTY'.
DATA UOM TYPE STRING VALUE 'UOM'.
DATA NET TYPE STRING VALUE 'NET PRICE'.
Data var type integer value 0.
*DATABASE SELECTS
*Header data
SELECT SINGLE * FROM ekko INTO i_ekko WHERE ekko~ebeln = p_ebeln.
IF sy-subrc = 0.
*Item Data
  SELECT * FROM ekpo INTO  TABLE i_ekpo WHERE ekpo~ebeln = p_ebeln.
  IF sy-subrc NE 0.
    WRITE 'PURCHASE DOCUMENT ITEM DATA ERROR'.
  ELSE.
*Vendor Details
    SELECT SINGLE * FROM lfa1 INTO i_lfa1 WHERE lfa1~lifnr = i_ekko-lifnr.
    IF sy-subrc NE 0.
      WRITE 'VENDOR DOCUMENT ITEM DATA ERROR'.
    ENDIF.
  ENDIF.
ELSE.
  WRITE 'THIS PURCHASE DOCUMENT NUMBER DOESNOT EXISTS'.
ENDIF.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
  APPLICATION                       = 'TX'
  ARCHIVE_INDEX                     =
  ARCHIVE_PARAMS                    =
  DEVICE                            = 'PRINTER'
  DIALOG                            = 'X'
    form                              = 'ZSCRIPT_1'
    language                          = sy-langu
  OPTIONS                           =
  MAIL_SENDER                       =
  MAIL_RECIPIENT                    =
  MAIL_APPL_OBJECT                  =
  RAW_DATA_INTERFACE                = '*'
  SPONUMIV                          =
IMPORTING
  LANGUAGE                          =
  NEW_ARCHIVE_PARAMS                =
  RESULT                            =
EXCEPTIONS
  CANCELED                          = 1
  DEVICE                            = 2
  FORM                              = 3
  OPTIONS                           = 4
  UNCLOSED                          = 5
  MAIL_OPTIONS                      = 6
  ARCHIVE_ERROR                     = 7
  INVALID_FAX_NUMBER                = 8
  MORE_PARAMS_NEEDED_IN_BATCH       = 9
  SPOOL_ERROR                       = 10
  CODEPAGE                          = 11
  OTHERS                            = 12
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
   ELEMENT                        = 'OFFICEAD'
   FUNCTION                       = 'SET'
   TYPE                           = 'BODY'
   WINDOW                         = 'OFFICEAD'
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
   ELEMENT                        = 'PODET'
   FUNCTION                       = 'SET'
   TYPE                           = 'BODY'
   WINDOW                         = 'PODET'
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
   ELEMENT                        = 'TOP'
   FUNCTION                       = 'SET'
   TYPE                           = 'TOP'
   WINDOW                         = 'MAIN'
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT I_EKPO.
var = i_ekpo-netpr * i_ekpo-menge.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
   ELEMENT                        = 'BODY'
   FUNCTION                       = 'SET'
   TYPE                           = 'BODY'
   WINDOW                         = 'MAIN'
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
  RESULT                         =
  RDI_RESULT                     =
TABLES
  OTFDATA                        =
EXCEPTIONS
  UNOPENED                       = 1
  BAD_PAGEFORMAT_FOR_PRINT       = 2
  SEND_ERROR                     = 3
  SPOOL_ERROR                    = 4
  CODEPAGE                       = 5
  OTHERS                         = 6
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • Internal table in sap script

    Hello All ,
    I  have got a internal table with tracking numbers and I want to print all the numbers in that internal table on sap script.
    Please advise.
    Thanks
    Moderator message:  please search for available information before asking.
    locked by: Thomas Zloch on Sep 13, 2010 1:09 PM

    Hi,
    You can create a sub-routine and pass all the table entries in variables and then you can print them.

  • Get Multiple Rows into internal Table using Webdynpro Alv Display ..

    Hi guys ,
    I need to find out the logic for getting all the selected rows into the internal table.
    When i display the ALV Output on webdypro screen .
    USer Selects multiple rows for further processing ..
    Ineed to get all the rows selected by user into an internal table .
    Please let me know how to achive this ...
    Thanks in advance for quick reply
    Regards
    Saurabh Goel

    Hi,
    You need to use the method GET_SELECTED of IF_WD_CONTEXT_NODE to get the rows selected. Also ccheck for the paramters of that method, this retruns the element set.
    This meets your requirement.
    Regards,
    Lekha.

  • Dynamically want to display a row of a table in BI Publisher

    Hi Gurus,
    Could any body help me regarding the following thing .
    I want to display a complete row of a table as a first record(on thenext page) if the particular Group having some data goes to next page .
    This Grouph is the inner group. I have tried in using following way but it didnot help me .
    I declare 2 variable as "present" and "prevoius and used <?xdoxslt:set_variable($_XDOCTX, 'count', <fo:page-number/>)?> to assigned value for both the variable . After that i have used <?:if $present != $rprevous?> Print the row else donot print.
    Please i need a urgent help for this and will appriciate to you guys.

    try BI publisher forum.
    --Prasanna                                                                                                                                                                                                                           

  • Displaying multiple  rows of  a table using smartforms

    hi,
    how to get multiple  rows on a  form from a  table using smartforms.I succeded in getting only the first row of the table on the main window of the page .In order to display more than one record on the page what i have to do.

    You have to use LOOPS / TEMPLATES to achieve this
    Here is a very good code sample for using Template,Table,Loop in smartforms with screen shot
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    Please do not post multiple threads. Kindly close them rewarding point for helpful answers,
    extracting multiple records
    to display multiple records in smart form
    Re: extracting multiple records
    Kindly reward point and close the duplicates.
    Regards
    Kathirvel

  • Inserting multiple rows in internal table in debugging

    Hi All,
    I need to insert multiple records from an excel sheet to an intenal table while debugging. I can see there is an option for "append row" in debugging but not for multiple rows. Can anybody help in this regard.
    Thanks,
    Ravi.

    Hi,
    I am using new debugger for ECC 6.0..but could not find that option..Can you please indicate where exactly this option lies in the debugger.

  • Convert multiple rows of internal table into one row of internal table

    Hi everyone,
    I have an internal table of structure
    Objid   - Sobid
    1         -     A
    1          -    B
    1           -   C
    1            -  D
    2        -      a
    2        -      b
    Now I have to show this in ALV format
    Objid - Sobid1- Sobid2 -Sobid3 -Sobid4 -Sobid5
    1      -   A   -      B   -       C  -     D       
    2       -  a     -     b
    Kindly help me it's urgent.
    bye

    Hi sandip,
    sorry i make a mistake. I have not seen that you will have it in ALV.
    Try this an use itab1-txt in your alv:
    DATA: BEGIN OF ITAB OCCURS 0,
      OBJID(1),
      DUMMY(1) VALUE '-',
      SOBID(1),
      END   OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0,
      txt(20),
      END   OF ITAB1.
    ITAB-OBJID = '1'. ITAB-SOBID = 'A'. APPEND ITAB.
    ITAB-OBJID = '1'. ITAB-SOBID = 'B'. APPEND ITAB.
    ITAB-OBJID = '1'. ITAB-SOBID = 'C'. APPEND ITAB.
    ITAB-OBJID = '1'. ITAB-SOBID = 'D'. APPEND ITAB.
    ITAB-OBJID = '2'. ITAB-SOBID = 'a'. APPEND ITAB.
    ITAB-OBJID = '2'. ITAB-SOBID = 'b'. APPEND ITAB.
    LOOP AT ITAB.
      AT NEW OBJID.
        if sy-tabix <> 1. append itab1. clear itab1. endif.
        itab1-txt = ITAB-OBJID.
      ENDAT.
      AT NEW SOBID.
        concatenate itab1-txt ITAB-DUMMY ITAB-SOBID into itab1-txt.
      ENDAT.
    ENDLOOP.
    append itab1.
    loop at itab1. write: / itab1-txt. endloop.
    Regards, Dieter

  • Display of multiple rows of long text in sap script

    Hello Abapers,
    Is it possible to have a loop inside a sapscript?
    Can you give me a sample code?
    I have tried it on my sapscript but it only shows the last row
    of my internal table.
    This is my source code :
    /: DEFINE &WF_EBELN& = &EKPO-EBELN&
    /: DEFINE &WF_EBELP& = &EKPO-EBELP&
    /: PERFORM GET_ITEM_TEXT IN PROGRAM ZMPU_PO_ORDER
    /: USING &WF_EBELN&
    /: USING &WF_EBELP&
    /: CHANGING &WF_TEXT&
    /: ENDPERFORM
    /:  LOOP AT &WF_TEXT&
    as   &WF_TEXT&
    /:  endloop
    in the zmpu_po_order, the WF_TEXT has 12 lines of data,
    but when sapscript is displayed it only has one line.
    I hope you can help me. Thanks in advance...

    Hi,
    It is not possible using loops in sap text editor .
    YOU CAN USE IN PROGRAM OF FORM.
    reward points

  • Want to display selected rows of table in another table

    Hello all,
    On jspx page their is quick query search component clcking on it popup gives result in table format
    user can select multiple rows for this I have provided checkbox column which transit variable in my view..
    now I want to display selected rows into another table
    how I can achieve this functionality...

    Hi,
    You can add the method in the AM, expose them as client interface. In the action listener of the button (of the popup where you are selecting the rows and clicking to continue), execute the method from AM.
    Sample,
    AM method
    public void filterMyTableRows(){
    this.getMyViewObject().setWhereClause("transient_attribute='Y'");  // Change according to your view object name and transient attribute name
    this.getMyViewObject().executeQuery();
    }In your actionListener, add something like
        public String commandButtonActionListener() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("filterMyTableRows");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            /* your rest of the code goes here..
            return null;
        }-Arun

  • Display specific row to display multiple time in jsf table 11.1.1.2.0 with

    HI ALL,
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I have to display the values in jsf frm table where i'm using DislayCertDetailVO . In dis VO i'm having a column no.of certificaties .taking dis column value when i navigate to other page jsf by selecting a specific row. here i have to display the selected row in multiple times based on the no.of.certificates column value.
    I want to display specific row to display multiple time to repeat same row in a table in jsf based on the value from bean or table in database.
    Edited by: user9010551 on Apr 28, 2010 6:14 AM
    Edited by: user9010551 on Apr 28, 2010 10:33 PM

    Hi, Trying it once more to give more clarity of my scenario.
    I have to navigate from 1 screen to the other by picking a given table record/row from the 1st screen. While displaying the record on the 2nd screen the catch is that, I have to display it as many times as the value in a cell of the selected record.
    eg.
    screen 1
    col1   col2     col3
    2 order1 item1
    [next]
    On clicking next it should look like
    screen2
    col1           col2            col3           col4
    order1 item1
    order1 item1
    where col3 and col4 will be editable by the user and col1 is the value depends how many times i have repeat the row/record
    Hope this give more clarity.

  • I'm using qurey panel with table.i want to display the rows as default

    Hi
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I'm using qurey panel with table , for first time when i run ,rows are not displayed as default .After i fire search button records / rows are displaying.Now i want to display the rows in table when i run for first time , mean i want to display rows by default.
    thanks in advance.

    Hi,
    if the queryPanel is based on a ViewCriteria in ADF BC then this autoExecute can be defined on the VC definition
    Frank

  • Update row in a table based on join on multiple rows in another table

    I am using SQL Server 2005. I have the following update query which is not working as desired.
    UPDATE DocPlant
    SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
    FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID 
    For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. But the above update query is considering only one row from
    PlantAction table even though there are multiple rows that match with DocID and PlantID.
    DocHistory column is of type NVARCHAR(MAX).
    How do I fix my query to achieve what I want ? Thanks for the help.

    UPDATE DocPlant
    SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
    FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID 
    We do not use the old Sybase UPDATE..FROM.. syntax. Google it and learn how it does not work. We do not use the old Sybase CONVERT() string function. You are still writing 1950's COBOL with string dates instead of temeproal data types. 
    You also did not post DDL, so we have to guess about everything. Does your boss make you work without DDL? How do you do it? 
    >> For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction [singular name?] table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. <<
    Why? What does this new data element mean? This is like dividing Thursday by Red and expecting a reasonable answer. Now, non-SQL programmers who are still writing COBOL will violate the tiered architecture rule about doing display formatting in the database.
    If you will follow forum rules, we can help you. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Displaying multiple rows in a form layout problem?

    HI,
    I displayed multiple rows using form layout,but form browse buttons displaying one row multiple times like if i click next it is displaying same rows in next page also ?
    how can I prevent this?
    very urgent
    Thanks in advance

    Set the table range size property to the number of rows you want to display.
    Then as a post-generation action, drag and drop the Next Set and Previous Set operations of your View Object usage as buttons onto your page.
    Then move the button code to a custom template, and uncheck group-level checkbox "Clear Page Definition before generation" to preserve the NextSet and PreviousSet action bindings.
    Steven Davelaar,
    JHeadstart Team.

  • Updating multiple rows in a table in ADF

    Hi
    How do we update multiple rows in a table.
    Onclicking a update button the changed rows must be updated.

    Hi Prince,
    currently I am selecting one row from the table and rendering a region at the top of the table and capturing the user entered data with the following code:
    ViewObjectVOImpl vo = getViewObjectVO1();
    Row CurrentRow = vo.getCurrentRow();
    //After this I perform the checks like user entered value is not null or check input as per business logic.
    if(CurrentRow.getAttribute("attributeName") ==null){
    //Add what message you want to display
    //Add other business logic.
    After making all the checks, i commit it.
    getOADBTransaction().commit();
    Now in my new page I am capturing the user input in the table itself like an excel sheet. Suppose there are ten rows in my advanced table on my page, and each row has one editable field. I have one save button at the bottom of the table.
    Now on clicking the save button I have to capture the user input, check whether there is any null value and if all the entered data is correct then only I should commit it.
    Can you please let me know how we can accomplish that.
    Regards
    Hawker

  • Select multiple rows from dual table

    Is it possible to select multiple rows from dual table using a single select statement.
    i.e., i want the out put to be
    column_name
    1
    2
    3
    4
    Edited by: vidya.ramachandra on Dec 14, 2009 8:24 AM

    Aside from the fact you're responding to an old thread...
    1002424 wrote:
    While using CONNECT BY, I see it always leave behind one row.
    Suppose I have a condition based on which I have to generate constant rows like
    SELECT 1 FROM DUAL WHERE ROWNUM < N;
    Here if N = 0, still it gives out single row.... you are obviously doing something wrong in your code elsewhere, because that SQL statement does not always return a single row...
    SQL> SELECT 1 FROM DUAL WHERE ROWNUM < 0;
    no rows selected
    SQL>

Maybe you are looking for