Only first line in a internal tabel should appear in output

Hi,
I have a requirement.
I loop at an internal table and that tabl (list_selected_records) records.
  Loop at list_of_selected_nodes into wa_selected_nodes.
    node = wa_selected_nodes-node_id.
    node_level = wa_selected_nodes-node_level.
    read table ex_list_of_texts
                       into wa_list_of_texts
                       with key node_id = node
                       binary search.
    IF sy-subrc eq 0.
      node_text = wa_list_of_texts-text.
    ENDIF.
      node_level = node_level - 1.
Selecting Text for Node selected (Business Scenario)
READ TABLE list_of_all_nodes into wa_all_nodes WITH KEY NODE_LEVEL = node_level
                     BINARY SEARCH.
if sy-subrc = 0.
SELECT SINGLE TEXT FROM TTREET into texts WHERE ID    EQ wa_all_nodes-tree_id
                            AND   SPRAS EQ 'EN  '.
IF NOT TEXTS IS INITIAL.
  wa_final-texts = texts.
append wa_final to it_final.
CLEAR WA_FINAL.
endif.
endif.
  endloop.
This is my code.
Now from the select single stmt i fetch a text and add it to be internal table . Once i fetch a one record the loop should be ended and a new iteration for for a second guid should start.
Once one record , first record is fetched for texts, only that shd appear in alv output but not other. but the loop should contnue for other fields. Please help
Thanks in Advance.
SS

Hi Swarna,
Use control event AT-NEW inside the loop. This event will triger only once for every new node_id.
Loop at list_of_selected_nodes into wa_selected_nodes.
AT-NEW node_id.
node = wa_selected_nodes-node_id.
node_level = wa_selected_nodes-node_level.
read table ex_list_of_texts
into wa_list_of_texts
with key node_id = node
binary search.
IF sy-subrc eq 0.
node_text = wa_list_of_texts-text.
ENDIF.
node_level = node_level - 1.
Selecting Text for Node selected (Business Scenario)
READ TABLE list_of_all_nodes into wa_all_nodes WITH KEY NODE_LEVEL = node_level
BINARY SEARCH.
if sy-subrc = 0.
SELECT SINGLE TEXT FROM TTREET into texts WHERE ID EQ wa_all_nodes-tree_id
AND SPRAS EQ 'EN '.
IF NOT TEXTS IS INITIAL.
wa_final-texts = texts.
append wa_final to it_final.
CLEAR WA_FINAL.
endif.
endif.
ENDAT.
endloop.
Thanks & Regards,
Parameswaran.K

Similar Messages

  • Module pool- only first line item data saved, rest disappears??

    Hi Experts,
    I have one module pool that was developed by other developer. It has header details input fields and items details input by table control.
    Now below scenarios occur:
    1) When I enter only one line item, and save it, the data is saved properly
    2) when I enter more than one item data and save it, it only saves first line item data.
    3).When I press ENTER button after every new line item data, it saves all the data properly.
    I tried to debug the report but could not find the exact problem statement as the code is written very badly without any comments.
    I am pasting the flow logic code below for the screen.
    So please help me figure out the problem and solution for it.
    +++++++++++++++++++++++++++++++++++
    PROCESS BEFORE OUTPUT.
    *&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'IT_MSEG'
       MODULE it_mseg_change_tc_attr.
    *&SPWIZARD: MODULE IT_MSEG_CHANGE_COL_ATTR.
       LOOP AT   it_gp
            INTO wa_gp
            WITH CONTROL it_mseg
            CURSOR it_mseg-current_line.
         MODULE it_mseg_get_lines.
    *&SPWIZARD:   MODULE IT_MSEG_CHANGE_FIELD_ATTR
       ENDLOOP.
    * MODULE STATUS_9001.
       MODULE deactive_screen.
    PROCESS AFTER INPUT.
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'IT_MSEG'
       LOOP AT it_gp.
         CHAIN.
           FIELD wa_gp-yposnr.
           FIELD wa_gp-matnr.
           FIELD wa_gp-maktx.
           FIELD wa_gp-meins MODULE check_uom ON INPUT..
    *      FIELD WA_GP-DOC_QTY.
    *      FIELD WA_GP-REC_QTY.
           FIELD wa_gp-gp_qty.
           FIELD wa_gp-chall_qty.
           FIELD wa_gp-netwr.
           FIELD wa_gp-remarks.
           FIELD wa_gp-exp_ret.
           MODULE it_mseg_modify ON CHAIN-REQUEST.
         ENDCHAIN.
         FIELD wa_gp-chk
           MODULE it_mseg_mark ON REQUEST.
       ENDLOOP.
       MODULE it_mseg_user_command.
    *&SPWIZARD: MODULE IT_MSEG_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE IT_MSEG_CHANGE_COL_ATTR.
       MODULE user_command_9001.
    +++++++++++++++++++++++++++++++++++
    Thanks,
    Vishal.

    Hi Aruna,
    Below is the code as you required.
    +++++++++++++++++++++++++++++
    MODULE user_command_9001 INPUT.
       ygp_header_mas-ret_type = v_gpt.
       CASE sy-ucomm.
         WHEN 'MBLNR'.
           PERFORM select_mblnr.
         WHEN 'DEL'.
           PERFORM select_delivery.
         WHEN 'INTI'.
           PERFORM grt_gi_details.
         WHEN 'GENT'.
           PERFORM get_ge_details.
         WHEN 'GP'.
           PERFORM get_returnable_gp.
         WHEN 'SAVE'.
           PERFORM gen_gp_number.
           PERFORM gen_data.
           PERFORM save_data.
         WHEN OTHERS.
           PERFORM get_ge_details_other.
           IF it_gp[] IS INITIAL.
             INSERT INITIAL LINE INTO it_gp INDEX 1.
           ENDIF.
       ENDCASE.
       IF v_entry = 07 .
         PERFORM serial_no1.
         PERFORM insert_row.
       ENDIF.
       IF sy-ucomm IS INITIAL.
         PERFORM calc_amt.
       ENDIF.
       CLEAR:sy-ucomm.
    ENDMODULE.                    "user_command_9001 INPUT
    +++++++++++++++++++++++++++++++
    MODULE it_mseg_user_command INPUT.
       ok_code = sy-ucomm.
       PERFORM user_ok_tc USING    'IT_MSEG'
                                   'IT_GP'
                                   'CHK'
                          CHANGING ok_code.
       sy-ucomm = ok_code.
    ENDMODULE.                    "IT_MSEG_USER_COMMAND INPUT
    ++++++++++++++++++++++++++++++++++
    MODULE it_mseg_modify INPUT.
       MODIFY it_gp
         FROM wa_gp
         INDEX it_mseg-current_line.
    ENDMODULE.                    "IT_MSEG_MODIFY INPUT    
    ====> Above module has some problem i think as while debugging it was not updating IT_GP as the current line number was not matching with IT_GP as it has only one line item and WA_GP was changing. Also WA_GP data was getting changed with LOOP with all line items data.
    ++++++++++++++++++++++++++++++++++++++++++++++
    MODULE it_mseg_mark INPUT.
       DATA: g_it_mseg_wa2 LIKE LINE OF it_gp.
       IF it_mseg-line_sel_mode = 1
       AND wa_gp-chk = 'X'.
         LOOP AT it_gp INTO g_it_mseg_wa2
           WHERE chk = 'X'.
           g_it_mseg_wa2-chk = ''.
           MODIFY it_gp
             FROM g_it_mseg_wa2
             TRANSPORTING chk.
         ENDLOOP.
       ENDIF.
       MODIFY it_gp
         FROM wa_gp
         INDEX it_mseg-current_line
         TRANSPORTING chk.
    ENDMODULE.                    "IT_MSEG_MARK INPUT
    +++++++++++++++++++++++++++++++++++++++++
    If I press ENTER after entering each line item, all records come in IT_GP but if not then only first line item comes. Also if I dont press ENTER after entering the first line item and and add one item (total 2) and then press ENTER then sometimes both the lines disappear.
    Thanks,
    Vishal

  • "read from measurement file" reads only first line of data

    Hello,
    I have a problem when trying to read a .lvm file through "Read from Measurements file" with the following block diagram
    Problem: it reads only the first line of data from what I can see in the probe window,.
    A part of the lvm file for reference.
    I haven't used Labview in a long long time, I'm trying to figure out what I am doing wrong.
    Thanks

    Sorry meant to attach the lvm. Here it is. (Actually I had to put it in .txt because the forum wont let me upload a lvm file)
    I unfortunately cannot share the full vi that record the data as I am not its owner/creator. I'll try to give as much info as I can with the relevant pictures attached, I hope it allows us to at least have an hint of where the problem might be.
    (this is in a while loop)
    In the stacked sequence, the other pannels are similar to the one shown here: value read fron a variable, converted to dynamic and a signal attribute is set. The "start recording" control operation is "switch when pressed".
    Here are the properties of the set signal attributes
    And here are the properties of the "write to measurement file"
    Attachments:
    NoTarget_full circle__Rx_-10-SAMPLE.txt ‏60 KB

  • PDF showing only first line of Table?

    Hi @,
    I am showing an input table to PDF using adobe Int Form and in the Adobe screen it is displaying only the first line of the table.
    I am using CE 7.1 SR5.
    Regards

    Hi,
    When the XML interface is generated for the context, for every node that has cardinality 0..n or 1..n, a node named DATA is generated in the XML.
    So if your Webdynpro context has foll structure...
    Node1 ... 1..1
      Node2 ... 0..n
        Attrib1
        Attrib2
    The corresponding XML would be
    Node1
      Node2
        DATA
          Attrib1
          Attrib2
    Regards,
    Reema.

  • Only first line printed in Smartform

    Hello,
    I have a form in Arabic langauge text, when I add a text to a window, only the first line of the text (which in the text editor I have more than 3 lines) is displayed. when I start SAP GUI in english I have all the text displayed and only only the first line.
    please help, thanks

    Can you pls tell me , How you are fetching that text?
    1. through Read_text FM?
    2. Through "Text Module" option from smart form screen?
    3. Using Include option in the text editor?
    Rds,
    Lokesh.

  • IPhoto: No pictures only broken-line/square boxes where pictures should be.  Scanning with the bar slide the pics appear for one or two seconds then are gone.

    Grandson Son sabataged my IPhotos!  Can't get pics to appear.  Only broken-line/square boxes where the pictures should be.  Scrolling with side bar brings up pics for 1 or 2 seconds then they are gone again.  HELP!  Please....
    Raefisch

    Restore from your back up is the most obvious way forward.
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to rebuild the thumbnails. It can take 3 or 4 goes for this to work

  • In cor2, components only first line item should be in editalbe mode and res

    Dear friends,
    My client requirement is , in cor2 ie change process order, in components, Except line item 1. rest of all the components needs to be in display( grey) mode.
    As far as my knowledge,  with the option of Screen Variant , we can make all the components items grey But not one line item in editable mode and rest of all in grey mode.
    Please suggest a way out.

    Hi,
    A suggestion:
    Use one of the below user-exits to meet your need.
    PPCO0008  Enhancement in the adding and changing of components
    PPCO0023  Checks Changes to Order Components
    So the logic could be, if changes are done to any component except the first one, then prevent saving of the order. Discuss with your abaper & it shoudl be possible.
    I doubt with a screen variant this can be possible.
    Regards,
    Vivek

  • Can I use automatically select only first line of a caption to include in List of Figures?

    Is there a setting in the TOC utility in ID CS6 that will allow me to use only the first sentence in a caption to include in a list of Figures?
    Example
    Willard's Wharf, Cocoa, Florida, 1887.   This was Cocoa's first  blah blah blah.  Photo by a dead guy.  courtesy of a nice old lady whose grandmother collected it.
    In the example above, the entire passage is currently formatted using a paragraph style sheet in Arno Pro Caption.  When I'm done, I would like to have that first phrase or sentence in bold, which I planned to do with a character style sheet.  The remainder will be in regular type. 
    Now that I understand more how the TOC utility works, I'm wondering, can I make a paragraph style for the title phrase, and a second paragraph style for the remaining text in the caption that follows  If so, how to I ensure that the second paragraph will follow on the same line where ever the first paragraph style ends?  Nested styles, maybe?  If nested styles are the way to go, comments on or pointers to the simplest strategy to make this work will be appreciated.
    Captions are not consistent.  Some have a name and date; others are a Title phrase or sentence, followed, sometimes, by up to several sentences.  Typically, however, there is only one sentence after the title. I also usually have a "Courtesy of . . ." statement acknowledging the source of the photo.
    I'm a newbie using id cs6, for the first time, to format a book.  I'm enjoying using the program, but a few details sometimes bring me to a stop.
    Thanks
    Roy

    Roy,
    In fact, you only need a char style to control that you correctly mark what you want in the LOF.
    See how I do:
    1/ I create the para style "Caption" [color: Red] and insert a grep style in it.
    2/ I create the char style "Char_Caption" [color: Blue]. It only needs to control what I want in the LOF.
    3/ What I have to do is insert a "N-Joiner" in the "Caption" text. See the grep code of the grep style defined in the "Caption" para style.
    4/ I generate the TOC, only with the "Caption" para style. I select the story where I insert the TOC and launch this simple regex.
    Done! 

  • Only first line

    Hi,
    I have this select sentence:
    SELECT
    /BIC/ID_BIEN
    /BIC/ZI_CLBI
    /BIC/ZIDATFPBE
    /BIC/ZIDATIPBE
    /BIC/ZIPORPBE
    FROM /BIC/AZIOBIPEb00 AS B INNER JOIN /BIC/AODSEPERB00 AS E
    ON B~/BIC/ID_EPER = E~/BIC/ID_EPER
    WHERE E~/BIC/ID_PERS = '50' and
    E~/BIC/COD_TEPE = 'BE'.
    Key for table /BIC/AZIOBIPEb00 is /BIC/ID_BIEN,/BIC/ID_EPER
    Key for table /BIC/AODSEPERB00 is /BIC/ID_EPER, /BIC/ID_PERS
    My problem is that when performing the selection, it gets all different /BIC/ID_BIEN related to the same /BIC/ID_EPER. I would like the selection to get ONLY ONE of the different available /BIC/ID_BIEN for a concrete /BIC/ID_EPER.
    How can I achieve that?
    Thanks and best regards,
    David.

    SELECT
    /BIC/ID_BIEN
    /BIC/ZI_CLBI
    /BIC/ZIDATFPBE
    /BIC/ZIDATIPBE
    /BIC/ZIPORPBE
    FROM /BIC/AZIOBIPEb00 AS B INNER JOIN
    ER JOIN /BIC/AODSEPERB00 AS E
    ON B~/BIC/ID_EPER = E~/BIC/ID_EPER
    WHERE E~/BIC/ID_PERS = '50' and
    E~/BIC/COD_TEPE = 'BE'.by the way, this does not sound like oracle syntax. Please do not post generic content here. It is very annoying, because we invest time to provide a solution, which is probably useless in your environment (row_number is oracle specific)
    Thank you

  • ALV Report -   Selection screen information should appear in Output screen

    Hi experts,
    I am working on ALV Reports.
    I want selection screen information to appear in ouputscreen when report executed.
    Those who know the sloution pls tell  me as soon as possible.
    regards,
    Imran

    Hi Imrangs ,
    Ur requirement is not clear -
    if u want ur selection screen and the output screen on the same screen, i.e if u fill ur selection options with input and press the button then ur ALV will display on the same screen. For this try to use Screen painter, it will get resolved.
    http://www.kodyaz.com/articles/sap-abap-tutorial-alv-grid-cl_gui_alv_grid-screen-painter.aspx
    chreers
    Regards
    Neha

  • Validation for first line item ( table )

    Dear Friends,
    i have table with multiple line items, i want to validate first line item only, if first line item is initial, it should throw an error message, could any one pls help me with an example
    Thanks
    Vijaya
    Col1
    Col2
    Col3

    Hi Vijaya,
    Method get_static_attributes_table of interface if_wd_context_node will return a table of context elements. You can then either read the first row of that table or loop through it to validate the table's data and issue messages as needed. For example...
    data lo_nd_ctx_node type ref to if_wd_context_node.
    data lt_attributes_table type wd_this->elements_ctx_node.
    lo_nd_ctx_node = wd_context->get_child_node( name = wd_this->wdctx_ctx_node ).
    lo_nd_ctx_node->get_static_attributes_table( importing table = lt_attributes_table ).
    If the row to be validated happens to be the table's lead selection, you can fetch attributes of the lead selection row directly, and again validate and issue messages as needed...
    data lo_nd_ctx_node type ref to if_wd_context_node.
    data lo_el_ctx_element type ref to if_wd_context_element.
    data ls_attributes type wd_this->element_ctx_node.
    lo_nd_ctx_node = wd_context->get_child_node( name = wd_this->wdctx_ctx_node ).
    lo_el_ctx_element = lo_nd_ctx_node->get_element( ).
    lo_el_ctx_element->get_static_attributes( importing static_attributes = ls_attributes ).
    Both of these code patterns to read context data are available through the Web Dynpro Code Wizard.
    Cheers,
    Amy

  • Print's first line then freezes

    Blue tooth connetion is fine on both printer and computer.  Computer recognizes printer.  Printer says "ready." When send a document to print, paper drops in properly, and printer makes printing noise. Display says "Now Printing," but nothing seems to be happening.  Eventurally an error message displays on laptop. Cancel printing (which requires disabling from labtop to get it to stop). When paper comes out, only first line of text printed. Called tech support. They asked me to print from notepad.  It prints from notepad (only tested on line of text).  It wll also print from Word doc if only one line of text.  WIth multiple lines of text or images from any program, it fails. I uninstalled, reinstalled, checked ink cartriges, checked paper, turned on-off, restarted, turned on devices in both orders (printer first, computer first)... all multiple times. Same result. The printer was able to print a webpage before (only printed one page since I've owned it). Now that I have installed the updated driver it does not work. 

    Hey , Welcome to the HP forums! I hope you enjoy your stay here. I see that you are experiencing some issues with printing from your Windows 8.1 machine to your Officejet 150. I can help with that. First, to make sure the printer itself is functional on the printer click on Setup and then Reports and then Print Status Report. If that prints then we know the printer itself is functional. Next, we'll test your print system. To do so:Turn the printer off.Go to your PC's Control Panel and then Printers and Devices.Right click on any picture of the printer you have.Click on Remove Device.Repeat for any other printers that are listed.Turn the printer on.Try printing.If this works then we know your print system is fine. From here we can try printing through Bluetooth. To do so:Return to Devices and Printers.Right click on the printer to remove it.Add the Bluetooth printer back.Try printing.Hopefully this will allow you to print. If you have any other questions please let me know. Likewise if it resolves your issues then please let others know by clicking on Accept as Solution below my post. I hope this helps and I hope you have a great evening!

  • Modify a line in an internal table

    Hi Friends,
    I have an internal table . I need to set a flag in the internal table and modify only that line of the internal table .Please advise .
    ex :
    Loop at itab.
    If sys-subrc <> 0 .
    itab-flag = 'X' .
    Modify  ?
    endloop.
    Thanks,
    Teresa

    data l_index type i.
    Loop at itab.
    l_index = sy-tabix
    If sys-subrc <> 0 .
    itab-flag = 'X' .
    Modify itab INDEX l_index
    endloop.
    Regards,
    Atish

  • Video CC problem in 5.5: only last line shows up

    Using Captivate 5.5.  My slide has imported slide video and I want to caption the narration contained in the video.  There is no other slide audio.
    I can enter the caption text in the Slide Notes rows as expected, and I check the Video CC box for each row.
    However, when I preview the slide, only the last row of text appears on-screen.  It appears right at the beginning of the slide and doesn't go away.
    Any ideas why the first line of the captions doesn't appear?
    Thanks!

    It could be that your eMac is covered under Apple's eMac Repair Extension Program for Video and Power Issues. You can read more about it here:
    http://www.apple.com/support/emac/repairextensionprogram/
    It could be a coincidence that you started having problems after installing Mac OS X 10.4.7. Let us know if your eMac falls within the serial number ranges on the repair site.

  • ALV:   how to display only subtotals lines in theoutput

    hi
    in the alv list output
    if we display subtotals based on 3 feilds out of 10
    we see subtotals (sum) based on the end of each field
    now i want to display only the lines which are displayed as subtotals in the output
    we have parameter
    totals_only(1) type c,        " show only totals
    in the structrure slis_layout_alv
    i have used it but i can see no change in the output

    hai
    data : GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
    ABAP List Viewer
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME = 'ITAB1'
    IS_LAYOUT =  GS_LAYOUT
    IT_FIELDCAT = GT_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
      IT_SORT = GT_SORT[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
      IT_EVENTS = GT_EVENTS[]
    IT_EVENT_EXIT =
      IS_PRINT = GS_PRINT
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = ITAB1
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ENDFORM.
    DATA SORTING AND SUBTOTAL
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    *GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    ENDFORM.
    regard
    nawa

Maybe you are looking for

  • Use Camcorder for iMovie and iChat?

    Hi, I want to find a way to be able to plug a video camera into my iBook to use with iMovie and iChat. I'm having a difficult finding a definitive solution in finding a webcam to use with my iBook. Does anyone know if a firewire camcorder will work w

  • 8.1.6 install - Oracle 8i for Linux

    I'm trying to install the Oracle 8i for Linux installation kit from the Osborne book. You can stop laughing now. Really, we're going to buy the full deal, but until that happens, we want to get a bit of a headstart. I'm using Hummingbird eXceed v6.2.

  • REQUEST within f?p =

    Hi, I've got a report which prints out a list of links on a page. Each link is a f?p url with values from the query and a request to branch it to a page which runs pl/sql processing when the requests are equal. Basically, the link looks like this: f?

  • How to read the date in Time management schema or in Payroll schema

    Dear all, My issue is before 16th in current month, the overtime/absence's wage type should be one and after 16th should be another.For example, before 16th,the overtime wage type is 5001 and the absence deduction wage type is 5002,and after the 16th

  • Can we register Essbase with Shared Services through command line?

    Hi, I have version 11.1.1.3 setup on my machine (AIX 5.x) and I am trying to externalize users through the EAS console but the operation is failing. System is pointing to the message panel for details but there is no info as such. I even checked in t