SAP Script: How do you print internal table values in a VAR window?

Hi
  I want to have a window like MAIN window where I can print data like line items and the no of lines are only 3..I have added one window type VAR. I have schedule line data in one internal table in which I am calling WRITE_FORM func.mod for the newly created window..But the last schedule line only getting printed...when I debug the script looping in internal table is happening correctly and going to window also happening but in the output its showing last schedule line...What could be the problem and how to over come this?
    Thanks in advance.
Regards
Vali.

Hi Md,
1. type MAIN window CAN GROW (vertically)
   But VAR window Cannot.
2. If our window is type VAR or FIXED
   no matter how much we loop
   it will show only the last record.
   because it cannot grow.
  (every loop pass overwrites the contents in the layout)
3. So if we use loop to print anything,
   THE WINDOW MUST BE OF TYPE "MAIN" ONLY.
Hope the above helps.
Regards,
Amit M.

Similar Messages

  • Internal table values in a popup window

    Hi All,
    i'm new to WD..
    i have a dynamic internal table(only one field) in my WDA. i want to show all the values as POPUP on the screen after user press the button. please let me know how can i procced for this? also after selecting the rows from Popup table, i want the fields selected to be placed into another internal table.
    please let me know how can i do this..
    Thanks in advance
    Shekhar

    Hi Shekhar,
    Have you actually populated your internal table I_TAB with any data? Am asking so coz I dont find anything related to that in here. You have just obtained your context node's reference & have written a bind_table to that. Have you actually filled this internal table by using WDDOINIT method or a supply function?
    Regards,
    Uday
    Am sorry I had earlier given you a link to invalid tutorial. Plz find the correct link for the task I had explained earlier in [here|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm].
    Below is the code that I have in my push button.I read the KUNNR value entered by the user & fetch the corresponding sales order information & bind it to my context node. I then map this context node to the view embedded within my popup view.
    METHOD onactiondisplay_popup .
      DATA: lv_node  TYPE REF TO if_wd_context_node,
            lv_kunnr TYPE ig_componentcontroller=>element_kna1-kunnr,
            lt_vbak  TYPE ig_componentcontroller=>elements_vbak.
    *   get message manager
      DATA lo_api_controller     TYPE REF TO if_wd_controller.
      DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
      lo_api_controller ?= wd_this->wd_get_api( ).
      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.
      lv_node = wd_context->get_child_node( name = 'KNA1' ).
      CALL METHOD lv_node->get_attribute
        EXPORTING
          name  = 'KUNNR'
        IMPORTING
          value = lv_kunnr.
      SELECT * FROM vbak INTO TABLE lt_vbak WHERE kunnr = lv_kunnr.
      IF sy-subrc NE 0.
    *   report message
        CALL METHOD lo_message_manager->report_error_message
          EXPORTING
            message_text = 'No sales orders exist for this customer!'.
      ELSE.
        lv_node = wd_context->get_child_node( name = 'VBAK' ).
        lv_node->bind_table( new_items = lt_vbak ).
        DATA lo_window_manager TYPE REF TO if_wd_window_manager.
        DATA lo_api_component  TYPE REF TO if_wd_component.
        DATA lo_window         TYPE REF TO if_wd_window.
        lo_api_component  = wd_comp_controller->wd_get_api( ).
        lo_window_manager = lo_api_component->get_window_manager( ).
        lo_window         = lo_window_manager->create_window(
                            window_name            = 'POPUP_WINDOW'
                            title                  = 'Working with modal windows in webdynpro!'
                            close_in_any_case      = abap_true ).
        lv_node = wd_context->get_child_node( name = 'WINDOW_REFERENCE' ).
        lo_window->open( ).
      ENDIF.
    ENDMETHOD.                    "onactiondisplay_popup

  • How to Refresh "Internal table values" in User EXIT.

    Dear All,
    My requirement is to place some checks in exit ZXQQMU20 in different tabs from the TCODE IW21 . IW22 etc.
    Now after placeing the checks towards the different tabs while doing "NOCO" from IW21 the conditions are fullfilled but
    when i go ahead to modify the created  "NOCO " from the TCODE IW22 by deleting the created values and saving in IW22 , the conditions written in the exit are still satisfied eventhough i have deleted the values in IW22.
    The reason for this is that the tables which are there in the exit ZXQQMU20 T_VIQMFE , T_VIQMUR , T_VIQMMA
    still contains the old values which were there at the time of creation of "NOCO"  in IW21 .
    How to refresh my " internal tables values" used in such that even at the time of modification of the NOCO through IW22 my table values should pick the current screen values and not the values which were there at the time of creation.
    Please help.
    The code i have written in the exit is as below:-
    ********************* Changed vide ******START
    *****IW21  IW22 also added in filter criteria of notification *************
    ******The purpose of this modification is that in the execution of IW21 or IW22 or IW24 or IW25 we have to give a check that if the
    ******notification type is M2 than inside the Transaction screen , if the Breakdown duration comes less than 15 min than there are
    ******no issues but if the breakdown duration is more than 15 min than the mandatory fields needs to be entered in the analysis tab.
    **    The user has to fill up either following mandatory fields in Analysis Data tab.
    **    A. Object Parts & Damages sub tab
    **    Code Group - Object Parts (OTGRP, VIQMFE)
    **                          AND
    **    Code Group - Problem / Damage (FEGRP, VIQMFE)
    **    Or
    **    Notification Item Short Text (FETXT, VIQMFE)
    **   B. Cause sub tab
    **    Code Group # Causes (URGRP, VIQMUR)
    **    Or
    **    Cause Text (URTXT, VIQMUR)
    **   C. Action Taken sub tab
    **    Code Group # Activities (MNGRP, VIQMMA)
    **    Or
    **    Activity Text (MATXT, VIQMMA)
    **            Then, allow user to complete notification (NOCO).
    CLEAR : L_VAR , L_COMP_TIME.
    IF ( SY-TCODE EQ 'IW21' OR SY-TCODE EQ 'IW22' OR SY-TCODE EQ 'IW24' OR
          SY-TCODE EQ 'IW25' ).
       IF ( E_VIQMEL-IWERK = '061' ) OR ( E_VIQMEL-IWERK = '062' ).
         IF E_VIQMEL-QMART = 'M2'.
           L_VAR = E_VIQMEL-AUSZT.
           L_COMP_TIME = L_VAR / 60.
           IF L_COMP_TIME < 15.
             EXIT.
           ELSEIF L_COMP_TIME > 15..
    *         IF ( T_VIQMFE-OTGRP IS INITIAL AND T_VIQMFE-FEGRP IS INITIAL )  OR  ( T_VIQMFE-FETXT IS INITIAL ) .
    *           MESSAGE 'Please fill the mandatory analysis data in Object Parts' TYPE 'E'.
    *         ENDIF.
             IF T_VIQMFE-OTGRP EQ '' OR T_VIQMFE-FEGRP EQ ''.
               IF T_VIQMFE-FETXT EQ ''.
                 MESSAGE 'Please fill the mandatory analysis data in Object Parts' TYPE 'E'.
               ENDIF.
             ENDIF.
             CLEAR L_TAG.
             IF T_VIQMUR[] IS INITIAL.
               MESSAGE 'Please fill the mandatory analysis data in Cause tab' TYPE 'E'.
             ELSE.
               LOOP AT T_VIQMUR.
                 IF  T_VIQMUR-URGRP IS INITIAL .
                   IF T_VIQMUR-URTXT IS INITIAL.
                     L_TAG = 'X'.
                   ENDIF.
                 ENDIF.
               ENDLOOP.
               IF L_TAG = 'X'.
                 MESSAGE 'Please fill the mandatory analysis data in Cause tab' TYPE 'E'.
               ENDIF.
             ENDIF.
             CLEAR L_TAG.
             IF T_VIQMMA[] IS INITIAL.
               MESSAGE 'Please fill the mandatory analysis data in Action' TYPE 'E'.
             ELSE.
               LOOP AT T_VIQMMA.
                 IF  T_VIQMMA-MNGRP IS INITIAL .
                   IF T_VIQMMA-MATXT IS INITIAL.
                     L_TAG = 'X'.
                   ENDIF.
                 ENDIF.
               ENDLOOP.
               IF L_TAG = 'X'.
                 MESSAGE 'Please fill the mandatory analysis data in Action' TYPE 'E'.
               ENDIF.
             ENDIF.
           ENDIF.
         ENDIF.
       ENDIF.
    ENDIF.
    <Added code tags>
    Thank you so much in advance..
    -Sudhish
    Please use the code tags when you're posting any code snippet
    Edited by: Suhas Saha on Jul 13, 2011 12:39 PM

    Hi, I was thinking just like XVBAP and YVBAP values in the USEREXIT_SAVE_DOCUMENT.
    Plz check u have x /y versions or tables like _old/ _new suffixes and then move the value accordingly.
    otherwise there may be inconsistency.
    Edited by: Prasenjit S. Bist on Jul 13, 2011 3:03 PM

  • Sap script '' how to create table frame in sap script"""

    i have some problem in sap script''  how to create table frame in sap script"""

    Hi,
    you can use BOX command..
    Syntax
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    Effect: draws a box of the specified size at the specified position.
    Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT and FRAME both a measurement and a unit of measurement must be specified. The INTENSITY parameter should be specified as a percentage between 0 and 100.
    1. XPOS, YPOS: Upper left corner of the box, relative to the values of the POSITION command.
    Default: Values specified in the POSITION command.
    The following calculation is performed internally to determine the absolute output position of a box on the page:
    X(abs) = XORIGIN + XPOS
    Y(abs) = YORIGIN + YPOS
    2. WIDTH: Width of the box. Default: WIDTH value of the SIZE command.
    3. HEIGHT: Height of the box. Default: HEIGHT value of the SIZE command.
    4. FRAME: Thickness of frame.
    Default: 0 (no frame).
    5. INTENSITY: Grayscale of box contents as % .
    Default: 100 (full black)
    Measurements: Decimal numbers must be specified as literal values (like ABAP numeric constants) by being enclosed in inverted commas. The period should be used as the decimal point character. See also the examples listed below.
    Units of measurement: The following units of measurement may be used:
    • TW (twip)
    • PT (point)
    • IN (inch)
    • MM (millimeter)
    • CM (centimeter)
    • LN (line)
    • CH (character).
    The following conversion factors apply:
    • 1 TW = 1/20 PT
    • 1 PT = 1/72 IN
    • 1 IN = 2.54 CM
    • 1 CM = 10 MM
    • 1 CH = height of a character relative to the CPI specification in the layout set header
    • 1 LN = height of a line relative to the LPI specification in the layout set header
    /: BOX FRAME 10 TW
    Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
    /: BOX INTENSITY 10
    Fills the window background with shadowing having a gray scale of 10 %.
    /: BOX HEIGHT 0 TW FRAME 10 TW
    Draws a horizontal line across the complete top edge of the window.
    /: BOX WIDTH 0 TW FRAME 10 TW
    Draws a vertical line along the complete height of the left hand edge of the window.
    /: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
    /: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
    check the fallowing link also
    http://help.sap.com/saphelp_40b/helpdata/en/d1/803293454211d189710000e8322d00/content.htm
    Mark the points if u find it useful...
    Regards,
    Omkar.

  • How Do You Print What OS X Renders and What You See Like the Lines on a Table on OpenOffice?

    Hi. How do you print what you OS X's graphics is rendering (what you see is what you get). I'm trying to print a calling card on OpenOffice Apache, latest but it would not print the guidelines (the lines when you use table, columns and rows) and it would only print the letters.
    Thank you in advance.
    God bless.

    If the lines are printing but they are too faint to see them easily, then there could be a rendering setting that could improve the line density.
    But if the lines are not at all visible then maybe the application is set not to print them. So check the Preferences or the printing options for OpenOffice? There might be a setting about the printing of gridlines.
    FYI - MS Excel has the gridlines disabled for printing but they can be enabled via the Excel print dialog.

  • In SAP Script how to hard code my Company address in footer window

    Hi All ,
    In SAP Script how to hard code my Company address in footer window .
    Ex : in YB_F140_ACC_STAT this script i want to keep my company address, i want to hard coad , i dont want to use any field from table.
    Please give me step by step.
    Thanks
    Sridhar

    Hi,
    You can make use of standard text...
    create a standard text in SO10 with your company address
    and in the footer window of your script.. use include text and provide the name of the standard text you created in SO10.
    In the text editor... goto insert > text> standard
    You get popup give the name of the text name id and language
    regards
    padma

  • In SAP Scripts How to write the fields 90  Degrees to regular format

    Hi ,
    I am working with SAP Scripts . Sometimes you may want to print text vertically.
    I have got a requiremnt in which there we have to write some data which is to be written 90 degres to regular output.
    please let me know if there is any printer setting for that .
    Regards.
    Rohit.

    Dear friend,
    For printing the text verticaly you need to made a
    print controle at printer level.
    select a command and in that you have to go in tab general
    attribute.
    and in front of :Include Printer Control: give the z print controle.
    in my company basis people had made one print controle
    ZR090.
    YOU have to use this command two times between
    the text .
    first command will move the printer at 90 degree and then
    write the text and second will move back to horizental.
    I dont know how this ZR090 can be made.
    rest wht i have written is very true and currently working.
    hope this will solve your problem.
    rewards are expected.
    Thanks and Regards
    vivek kumar srivastava

  • In sap scripts how to display the driver program

    Hi,
        I Want to know the sap scripts How to display the output to driver program

    Hi,
    Go to NACE Transaction.
    Select application for ex: if sales V1.
    Click on output types.
    Select the output type for ex : BA00
    Double click on Processing routines.
    There you can find the Driver Program name and Script/smart form name.
    Reward if useful.
    Thanks,
    Raju

  • How to declare a internal table in start routine i.e. transformations

    Hi Gurus,
    How to define an internal table in a start rotuine?
    any help greatly appreciated.
    Best Regards,
    Reddy.

    Hi,
    types: begin of str,
    field1 type c,
    field2 type c,
    end of str.
    data : itab type table of str with header line.
    the above code should be inserted where it says insert code below this. this will be like a global decleration. this table will be available for all the routines that you write in the transformation.
    All the best !!
    Regards
    Aparna

  • How to print the table values in fastest way?

    Dear Friends,
    I'm having table in my application and i need to print the table values. For that I used print() method to print the table values.
    boolean complete = tableObj.print(mode, header, footer, showPrintDialog, null, interactive,
                                  null);But, the time taken for displaying print dialouge box so late and printing operation is done very slowly.
    Could anyone please tell me is there any better way and fastest way to print the table values?
    Thanks in advance

    Hi,
    In the Module pool you will have fields. For those fields you have created the name also. Assign those name to work area and from there to internal table.
    And for your requirement viceversa you need to done.
    With Regards,
    Sumodh.P

  • Problem in printing internal table data in Sapscript!

    Hi All,
    Am trying to print internal table data into main window of sapscript.
    This is what I have written.
    loop at it_final INTO wa_final.
                  CALL FUNCTION 'WRITE_FORM'
                   EXPORTING
                     window   = 'MAIN'
                     ELEMENT  = '670'
                     TYPE     = 'BODY'
                     FUNCTION = 'APPEND'
                   EXCEPTIONS
                     window  = 1
                     element = 2.
                 IF sy-subrc <> 0.
                 ENDIF.
    ENDLOOP.
    IN Sapscript :
    /E   670
    IT     &wa_final-vbeln&,,&wa_final-vbelv&,,&wa_final-payment&
    =      &wa_final-rundate&,,&wa_final-waers&,,&wa_final-creditcard&
    =      &wa_final-augru&,,&wa_final-dmbtr&
    Pls let me know if am missing anything.
    Thanks & Regards
    Himayat

    Check if your Programm is called at the Sapscript level.
    Are you calling the programm from the Sapscript using the PERFORM command? or are these Programm and Sapscript set in customizing?
    Using SE16 check the Message Type and see if Sapscript and the programm are connected at all.

  • How much data can internal tables store?

    ABAPers,
    The function module that I am writing gets used by many of our customers. This module needs to store data temporily for further processing. Depending on individual customer's needs, the storage could be as little as 10000 records or it could run into millions of records.
    While doing my research, I cam across this quote:
    If you expect the size of your list to be greater than
    the amount of memory you want your program to use, then
    use field-groups (actually, if you use internal tables,
    and the number of records exceeds the number of records
    in your OCCURS statement, the system just writes those
    extra records to the paging space. So is there really any
    difference between just using an internal table with an
    OCCURS 0 statement-- which would write the entire table
    to paging space-- and using field-groups? According to
    Gareth M. de Bruyn and Robert Lyfareff in Introduction to
    ABAP/4 Programming for SAP, field-groups are stored more
    efficiently, and have better performance. They recommend
    field-groups for lists of 100,000 or more records).
    Questions:
    1. Is it true that internal tables can store any amount of records, irrespective of the amount of physical memory?
    2. For "OCCURS 0", are all the records ALWAYS stored in the paging space? Or, does the ABAP engine does virtual paging much like an operating system?
    Thank you in advance for your help.
    Pradeep

    Two good questions.......  here are two NOT so good answers.
    1)  The number of records that you are allow in your internal table(s) is limited to a cap for your session.  This is is a system setting.  When you reach the cap, program will end.
    2) You should not be using OCCURS extension anyway, always use TYPE TABLE OF.
    Regards,
    Rich Heilman

  • How to import the internal table into subroutine as parameter

    how to import the internal table into subroutine as parameter, and its structure can be recognized inside the subroutine

    Hi Yong,
    try this:
    parameters: p_tabnm like dd03l-tabname.
    field-symbols: <fs_tabname> type standard table.
    data: itab_ref type ref to data.
    create data itab_ref type standard table of (p_tabnm)
                         with default key.
    assign itab_ref->* to <fs_tabname>.
    select * from (p_tabnm) into table <fs_tabname>.
    perform subroutine tables <fs_tabname>
                       using p_tabnm.
    *&      Form  subroutine
          text
         -->P_<FS_TABNAME>  text
         -->P_P_TABNM  text
    form subroutine  tables   p_tabname type standard table
                     using    p_tabnm.
    Here p_tabname already has the structure of the table you gave as input
    parameter
    endform.                    " subroutine

  • How to pass an internal table to a SmartForm?

    Hi there!
    I have a program that calls a SmartForm.
    I have a internal table wich I want to print.
    This internal table is based on a custom structure with NO standard includes (e.g., with custom fields).
    How do I declare this internal table in the transaction SMARTFORMS?
    Best Regards,
    Luís.

    Refer below thread..
    How to pass an internal table to smartform.
    hope it will solve ur problem
    Thanks & Regards
    ilesh 24x7

  • How to use dynamic internal table with FOR ALL ENTRIES

    Hello SDNers,
    I am having a dynamic internal table & want to use FOR ALL ENTRIES(FAE) using this dyn. table.
    This works fine for me:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE ztable
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE (lv_dynwhere). "lv_dynwhere -> dynamic where clause
          ENDIF.
    SAP documentation says:
    "The logical expression sql_cond of the WHERE condition can be comprised of several logical expressions using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one comparison with a column of the internal table itab that can be specified statically or dynamically. "
    How do we specify the column of the internal table dynamically ? Can we do something like this:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE key_field1 = (dynamic token for column1 of <lt_tmp>)
                           key_field2 = (dynamic token for column2 of <lt_tmp>)
          ENDIF.
          ENDIF.
    Let me know if i am not clear about my requirement.
    BR,
    Suhas

    Hello Thomas,
    What i meant was something like this:
    WHERE key_field1 = ('<LT_TMP-COL1>') AND
          key_field2 = ('<LT_TMP-COL2>')
    I am confused by what SAP means with "dynamic representation of internal table columns" in FAE ?
    @Rob: I was referring to SAPNW 7.0 documentation & the phrase (release 6.40 & higher) is missing. Anyways fyi i am on ECC5.0 ABAP release 6.40.
    @Subhankar: This is what Marcin had proposed in For all entries and dynamic table.
    Thanks,
    Suhas
    Edited by: Suhas Saha on Apr 6, 2010 11:53 AM

Maybe you are looking for