PLz help i have one dought? IN ORACLE PL/SQL

1.write a block that accepts name and display it 5 times in output screen ?
(this my question i typed like in this SQL>screen but i'm getting out put ony once can u short out in this problem )
1 declare
2 name varchar2(15) :='&name';
3 n number(2) :=1;
4 begin
5 while n <=5
6 loop
7 dbms_output.put_line(name);
8 n :=n+1;
9 end loop;
10* end;
Enter value for name: dfhdfhfd
old 2: name varchar2(15) :='&name';
new 2: name varchar2(15) :='dfhdfhfd';
PL/SQL procedure successfully completed.
[CAN U TEL TEL ME HOW DO IT AND SEND ME THE CORRECT CODING THAT WOULD BE HELP FOR ME .I HAVE LAB WITH MY COURSE]
Regards
D.Muthu
Message was edited by:
user628154

Hi
You need to set serveroutput on.You will only get output once you would set it.You mentioned,you are getting one output.You didnt print it here.Where it is?
Three general thngs.
1)Please don't use caps while posting.I hope you know it,in internet chats,forums,it is considered as shouting.
2)Please read Pl/Sql guide from docs.These things are covered in details there.You can read it here.
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
3)Always mention your database and o/s version while posting.
Aman....

Similar Messages

  • After updating to iOS 6 my battery life of iPad 2 has reduced drastically..plz help..have tried all the standard solutions suggested in forums but doesn't help

    After updating to iOS 6 my battery life of iPad 2 has reduced drastically..plz help..have tried all the standard solutions suggested in forums but doesn't help

    The quickest way (and really the only way) to charge your iPad is with the included 10W or 12W USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    How to Save and Prolong the battery life of your new ipad
    https://discussions.apple.com/thread/4480944?tstart=0
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    iPhone, iPod, Using the iPad Charger
    http://support.apple.com/kb/HT4327
    Install and use Battery Doctor HD
    http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • Finder on my mac book pro is not showing the sidebar plz help .i have a mac book pro running on os x lion 10.7.5

    finder on my mac book pro is not showing the sidebar plz help .i have a mac book pro running on os x lion 10.7.5

    In Finder, Click View, then Show Sidebar - or ALT+CMD+S

  • I forgot my i cloud id plz help i have i phone5 a1428

    i forgot my i cloud id plz help i have i phone5 a1428

    Go here:
    https://iforgot.apple.com/appleid

  • Plz help i have trouble

    Hello i have a trouble in my nokia N97
    my problem is that i have only 2 mega free in my C memory and i dont have any pics or messages or any thing on it and when i make memory detail for C what i found is SIS AOOKICATIONS is 32 MB and Other friles 38 MB
    can u plz describe for me what is sis and other files and how can i only fromat C and why not all apllications downloaded on mass memory even i make the option in ovi store  plz plz help
    THANKS
    Moderator's note: Email address removed. It is not wise to publish your personal information on a public forum.

    @amro_1230
    Remember to backup essential data first but you can reset device to "Out of box" state by three keys depressed power on as for N97 described here:http://mynokiablog.com/2009/07/18/how-to-hard-reset-your-nokia-n97/
    Happy to have helped forum with a Support Ratio = 42.5

  • G580 Smart Fan Noise PLZ Help me Any One...PLZZZZZZZZZZZZZZzz

    PLZ help me. My lenovo g580 When power on ..Just hearing Noise . Its Smart fan Noise. Plz Help Me Bro...........

    hi Arif664
    Welcome to Lenovo Community Forums!
    You may want to try a software Called speed fan, This gives control to your Fan and also shows Temperature readings.
     Other Lenovo Motherboard have Restrictions for controlling the Fan. But give it a shot If it detected your fan then you're all set. adjust the Fan to your desired speed and fine tune it with the Temp that you're getting
    If the Fan really get too Loud, beyond normal, I would still suggest to call Lenovo Technical Support for Assistance.
    Best Regards
    Solid Cruver.
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • I am unable to verify my account info plz help I have 100$ but can't purchase any app

    I am unable to verify my apple I'd account information and can no more purchase apps.plz help

    Is it giving you a message saying your Apple ID has been disabled? If so, you need to use Apple Express Lane

  • Plz help me some one

    I have purchased my BlackBerry z10 six months back. 2nd day my mobile started giving trouble. Even i replaced my mobile. But still im facing same problems. I cant able to charge my mobile more than 80%. If my mobile battery reached 30% automatically it gets switch off. Again i cant able to.switch on it. Only after plugging the charger mobile is switching on. Now im started facing a new problem if i switch off wifi my mobile getting switch off.. i gave my mobile to your service centre for more than 3 times just they r updating software and giving back.. but the problems are not solved. Plz kindly help me.

    Duplicate:
    http://supportforums.blackberry.com/t5/BlackBerry-Z10/blackberry-Z10-problem/m-p/3031121#nobanner
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Plz help Me any one i am getting errors in Servlets

    My OS is Windows 2000.I am using J2SDK1.4.0_02(in c:\J2SDK1.4.02_02\) and in order to run the SERVLETS I recently installed the J2SDKEE1.3.1 (in c:\J2SDKEE1.3.1). I updated the class path to c:\ J2SDKEE1.3.1\bin and c:\ J2SDKEE1.3.1\lib\jsdk.jar .Now I wrote a simple servlet program SimpleServlet.java and saved it in c:\MyPrograms.
    Now when I compiled this program at prompt as follows
    C:\MyPrograms\>javac SimpleServlet.java
    I am getting the following errors
    1)Package javax.servlet doesn�t exist
    2)Package jaavx.servlet.http doesn�t exist
    Can somebody please tell me where I went wrong. My guess is that the problem is with installing J2SDK. Somebody please let me out this problem.
    Thanx!

    Okay, you installed the Enterprise java sdk. I have never seen this jar before: "J2SDKEE1.3.1\lib\jsdk.jar". There should be the j2ee.jar in the same folder, this is what contains the Servlet API.
    Next, when compiling your servlet include the classpath in your javac statement:
    javac -classpath %CLASSPATH% SimpleServlet.javaWhen installing the J2EE SDK, you should have set up your J2EE_HOME and J2EE_LIBS env entries. Rather than just add the jar to your class path, use the J2EE_LIBS ref when compiling instead:
    set J2EE_HOME=C:\J2SDKEE1.3.1
    set J2EE_LIBS=%J2EE_HOME%\lib
    javac -classpath %J2EE_LIBS%\j2ee.jar SimpleServlet.javaRather than call "set" each time add them to your System properties.
    Cheers,
    Anthony

  • Plz help i have capturing problem.......

    I'm using SONY HDVCAM(HDD)
    Capturing with SONY HVR DR60 keeps asking me to render for audio alone...is there any ways which will not ask me for audio render....

    .dv is a 'dv stream', much like what iMovie captures. You should be using an FCP (.mov) compatible codec, like DV-NTSC for MiniDV.
    What are the full specs on the originally shot media?

  • Please help convert MSSQL Stored Procedure to Oracle PL/SQL

    Hi there to all,
    this be my first post to these forums. I have already posted this question on a microsoft msdn forum, until someone advised that I ask my question here - dunno why I didnt think of that! ?:|
    Im working with an Oracle 10g Database from an ASP.NET 2.0 application, and want to know if it Oracle supports OPENXML (rhetorical question I fear!). The reason I ask is because I want to create an Oracle Stored Procedure that will accept an XML string as an input parameter, prepare it, select from it, and then insert it into an Oracle table.
    I have done this successfully in SQL server using the following as an example:
    CREATE PROCEDURE [dbo].[Employee_INSERT]
    bq. @INSERTRECORD XML
    AS
    BEGIN
    bq. DECLARE @XDOC INT; \\ EXEC sp_xml_preparedocument @XDOC OUTPUT, @INSERTRECORD; \\ INSERT INTO [dbo].[REC_Employees] (
    bq. bq. [EMPTITLE], \\ [EMPFNAME], \\ [EMPLNAME], \\ [EMPDEPTID], \\ [EMPBEGINDATE], \\ [EMPACTIVE], \\ [EMPDATEADDED]
    bq. )
    bq. SELECT
    bq. bq. [EMPTITLE] = Title, \\ [EMPFNAME] = Firstname, \\ [EMPLNAME] = LastName, \\ [EMPDEPTID] = DepartmentID, \\ [EMPBEGINDATE] = StartDate, \\ [EMPACTIVE] = IsActive, \\ [EMPDATEADDED] = GETUTCDATE()
    bq. FROM
    bq. bq. OPENXML(@XDOC, '/EMPREC/Table', 2) \\ WITH (
    bq. bq. Title VARCHAR(10), \\ FirstName VARCHAR(50), \\ LastName VARCHAR(50), \\ DepartmentID INT, \\ StartDate DATETIME, \\ IsActive BIT
    bq. bq. );
    bq. EXEC sp_xml_removedocument @XDOC;
    END
    I would sincerely appreciate any help in this regard!
    PS - Please excuse the formatting!
    Much Thanks!
    regards
    shalan

    Assuming your table is named DESTINATION
    Name                                      Null?    Type
    TITLE                                              VARCHAR2(10)
    FIRSTNAME                                          VARCHAR2(50)
    LASTNAME                                           VARCHAR2(50)
    DEPARTMENT                                         NUMBER
    STARTDATE                                          DATE
    ISACTIVE                                           NUMBERYou can use a procedure like:
    create or replace
    procedure test (p_xml in xmltype)
    is
    begin
      insert into destination
      select title
           , firstname
           , lastname
           , department
           , to_date (startdate, 'yyyy-dd-mm hh24:mi:ss') startdate
           , isactive
        from (xmltable ('/EMPREC/Table' passing p_xml
                       columns title varchar2(5) path 'Title'
                             , firstname varchar2(10) path 'FirstName'
                             , lastname varchar2(10) path 'LastName'
                             , department number path 'Department'
                             , startdate varchar2(20) path 'StartDate'
                             , isactive number path 'IsActive'
                      ) temp
    end test;to create records in the table
    Removed a unnecessary SELECT FROM DUAL...
    Edited by: Alex Nuijten on Jan 19, 2009 2:24 PM

  • HI Please help me for one for scenario in PL/SQL

    Dear Folks,
    Could you please give a solution for below mentioned scenario,
    In First case If the two alias active and flag value N no need to delete
    Second case
    CASE      Sec. Alias 1 Active     Sec. Alias 2 Active     ACTION
    1     N     N     None
    2     Y     N     Delete Sec. Alias 2
    3     N     Y     Delete Sec. Alias 1
    4     Y     Y     None - Warning
    Thanks
    Priyesh

    Welcome to the forum.
    Please be as specific as you can, post a small testcase along with your datebase version.
    It is all explained here:
    {message:id=9360002}

  • I have macbook 5.2 and i am using Mac OS 10.5.8 . which one is good for me to upgrade and how to do that..plz help me

    i have macbook 5.2 and i am using Mac OS 10.5.8 . which one is good for me to upgrade and how to do that..plz help me

    You have a 13" Early or Mid 2009 MacBook. Either one can run OS X Mavericks with enough RAM, 2 GB minimum. But first you will need to update to OS X Snow Leopard 10.6.8 so that you have the Mac App Store installed on your MacBook
    Buy this from apple;
    http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard
    Then download and update with this update combo;
    OS X Snow Leopard 10.6.8 v1.1 update combo
    http://support.apple.com/kb/DL1399
    After this you will have the Mac App Store on your MacBook and you should be able to download and install OS X Mavericks for free!
    Your MacBook must meet these minimum tech specs to run Mavericks;
    http://support.apple.com/kb/HT5842

  • PLZ HELP ME PROBLEM :- JSP Pages is slow

    HI, i am using oracle 10g application server to deploy my jsp pages.
    When i am running the jsp page ie. default.jsp which consist of three combo box which are dependent on each other.
    Database :- oracle 10g.
    Logic : I am retrieving all the data from the database in to a nested structure and using that nested structure to fill up in the combo box,
    Problem : when i m refreshing or opening the page , it takes a lot of time to open. well the data are also not so much huge that it take some time. ]
    Plz help me

    Why have you declared your own interface Tag?
    The server knows nothing about your custom classes.
    You should be implementing the javax.servlet.jsp.tagext.Tag Interface.
    Actually the easier way is for your tag to extend SimpleTag, which implements the basic interface for you, leaving you to override the bit you want to.
    Check out the API: http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/package-summary.html

  • ALV issue plz help

    Hi experts
    plz help
    i have createed an alv using slis method
    in the output there must come a header
    in this header i ill have to show som details
    like on the left side of the header i want to show the details of the user and on the right side i want to show he data of vendor .
    i am able to get the data in the left side but i am not able to show the data of vendor on the right side
    the data of vendor is by default coming on left side only just below the details of user but i want to show those details on the right side of the header .
    plz tell me how to do it .
    thanx in advance.

    Hi Anit,
    I am attaching here the whole Code. It is somewhat big code so go through it thoroughly.If you still face problem reply this thread otherwise <b>REWARD POINT</b>.
    REPORT test
           MESSAGE-ID zzrefn01
           NO STANDARD PAGE HEADING
         *** Portrait: 93x80
           LINE-SIZE 150
           LINE-COUNT 80.
         *** Landscape: 132x65
         LINE-SIZE 132
         LINE-COUNT 65.
       INCLUDES                                                        **
    INCLUDE zbc_i00.                         "Customer Standard Include
    INCLUDE <icon>.                          "For Button on the ALV Tool Bar
    INCLUDE yyef_check_isp_top.
    INCLUDE yyef_check_isp_f01.
    INCLUDE yyef_check_isp_o01.
    INCLUDE yyef_check_isp_i01.
          CLASS zcl_event_handler IMPLEMENTATION
    CLASS zcl_event_handler IMPLEMENTATION.
    Top-of-page event
      METHOD top_of_page.
        PERFORM event_top_of_page
                USING z_dyndoc_id.
      ENDMETHOD.   "METHOD top_of_page
    Change Status Button
      METHOD handle_toolbar.
        IF NOT pa_prodr IS INITIAL.
          DATA: lz_toolbar  TYPE stb_button.
          CLEAR lz_toolbar.
          MOVE    'CHANGE_STATUS'  TO lz_toolbar-function.
          MOVE    text-001         TO lz_toolbar-text.
          APPEND  lz_toolbar       TO e_object->mt_toolbar.
        ENDIF.          "IF NOT pa_prodr IS INITIAL
      ENDMETHOD.   "METHOD handle_toolbar
    Handle User Command
      METHOD handle_user_command.
        CASE e_ucomm.
          WHEN 'CHANGE_STATUS'.
            LOOP AT    it_output
                 INTO  wa_output.
              IF wa_output-chk_box EQ kc_x.
                z_flag = 1.
                EXIT.
              ENDIF.          "IF wa_output-chk_box EQ kc_x
            ENDLOOP.      "LOOP AT it_output INTO  wa_output
            IF z_flag EQ 1.
              PERFORM display_selected_data.
            ELSE.
              MESSAGE i001(zzrefn01)
                      WITH text-023.
            ENDIF.       "IF z_flag EQ 1
        ENDCASE.      "CASE e_ucomm
      ENDMETHOD.   "METHOD handle_user_command
    ENDCLASS.   "zcl_event_handler IMPLEMENTATION
       Processing of selection screen                                  **
        First time initialization                                        *
        Get Default variant                                              *
    INITIALIZATION.
      z_repid = sy-repid.
      PERFORM variant_init.
      zx_variant = z_variant.
      CALL FUNCTION 'LVC_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save        = kc_u
        CHANGING
          cs_variant    = zx_variant
        EXCEPTIONS
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          OTHERS        = 4.
      IF sy-subrc EQ 0.
        pa_vari = zx_variant-variant.
      ELSE.
        MESSAGE i001(zzrefn01)
                WITH text-021.
      ENDIF.   "IF sy-subrc EQ 0
    *** First time initialization in online mode except calls with variant
    *** (is not processed on return from prog to selection screen)
    pa_xyz = ....
    so_xyz.....
    SET PF-STATUS 'STAT1000'.
    *** An example for select options restrictions is available
    *** in TT1/YYKA_EXPORT_START_HOST (remove comment)
        Selection screen PBO                                             *
        Comment........                                                  *
    AT SELECTION-SCREEN OUTPUT.
    *** Init selection screen, also on variants
    *** (only for online reports)
      IF NOT zn_init_seldynp IS INITIAL
      AND sy-batch IS INITIAL   "Not on batch calls (e.g. AutoSys)
      AND sy-slset IS INITIAL.  "Not on calls with variant
        IF NOT pa_prodr IS INITIAL.
          CLEAR: pa_prodr.
          MESSAGE w999(zbcc).  "Flag prod.run reseted
        ENDIF.
       CLEAR: pa_start.
      ENDIF.
      CLEAR: zn_init_seldynp.
    *** Process dynpro fields
      LOOP AT SCREEN.
      *** --> Read-Only fields
        IF screen-group1 EQ 'RDO'
        AND screen-input NE '0'
        AND screen-group3 NE 'VPU'.
          screen-input = '0'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
        Selection screen PAI                                             *
        Comment........                                                  *
    *AT SELECTION-SCREEN ON so_xyz.
    AT SELECTION-SCREEN.
      PERFORM pai_of_selection_screen.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_vari.
      PERFORM f4_for_variant.
    PERFORM btci_at_sel_screen.  "Call BTCI checks (optional)
       Program                                                         **
        Main routine                                                     *
    START-OF-SELECTION.
      PERFORM fetch_data.
      PERFORM build_data.
      PERFORM prepare_field_catalog
              CHANGING it_fieldcat.
      CALL SCREEN 100.
        End routine                                                      *
    END-OF-SELECTION.
       Interactive Reporting                                           **
        Comment........                                                  *
    AT LINE-SELECTION.
    *** Good example in TT1/YIIHART (remove comment)
        Comment........                                                  *
    AT USER-COMMAND.
      PERFORM handle_user_command.
        Comment........                                                  *
      AT PFN.
    iNCLUDE YYEF_CHECK_ISP_F01
    *&  Include           YYEF_CHECK_ISP_F01                               *
    *&      Form  pai_of_selection_screen
             Check Variant Exist or not
    FORM pai_of_selection_screen .
      IF NOT pa_vari IS INITIAL.
        MOVE z_variant TO zx_variant.
        MOVE pa_vari   TO zx_variant-variant.
        CALL FUNCTION 'LVC_VARIANT_EXISTENCE_CHECK'
          EXPORTING
            i_save        = kc_u
          CHANGING
            cs_variant    = zx_variant
          EXCEPTIONS
            wrong_input   = 1
            not_found     = 2
            program_error = 3
            OTHERS        = 4.
        IF sy-subrc EQ 2.
          MESSAGE i001(zzrefn01)
                  WITH text-024.
        ENDIF.   "IF sy-subrc EQ 2
        z_variant = zx_variant.
      ELSE.
        PERFORM variant_init.
      ENDIF.   "IF NOT pa_vari IS INITIAL
    ENDFORM.  "pai_of_selection_screen
    *&      Form  variant_init
          Initialization of Variant
    FORM variant_init .
      CLEAR z_variant.
      z_variant-report = z_repid.
    ENDFORM.                    " variant_init
    *&      Form  f4_for_variant
          F4 Help for Layout
    FORM f4_for_variant .
      CALL FUNCTION 'LVC_VARIANT_F4'
        EXPORTING
          is_variant    = z_variant
          i_save        = kc_u
        IMPORTING
          e_exit        = z_exit
          es_variant    = zx_variant
        EXCEPTIONS
          not_found     = 1
          program_error = 2
          OTHERS        = 3.
      IF sy-subrc EQ 1.
        MESSAGE i001(zzrefn01)
                WITH text-022.
      ELSE.
        IF z_exit = space.
          pa_vari = zx_variant-variant.
        ENDIF.     "IF z_exit = space
      ENDIF.     "IF sy-subrc EQ 1
    ENDFORM.   "f4_for_variant
    *&      Form  fetch_data
          Fetch data from DB tables.
    FORM fetch_data .
      SELECT *
             FROM yyeft1200
             INTO TABLE it_yyeft1200
             WHERE id_rech  IN so_idrec
             AND   fnumkred IN so_fnumk
             AND   status   IN so_stat
             AND   erdat    IN so_erdat
             ORDER BY PRIMARY KEY.
      IF sy-subrc EQ 0.
        SELECT *
               FROM yyeft1201
               INTO TABLE it_yyeft1201
               FOR ALL ENTRIES IN it_yyeft1200
               WHERE id_rech   EQ it_yyeft1200-id_rech
               AND   artnr_bp  IN so_artnr
               ORDER BY PRIMARY KEY.
        IF sy-subrc EQ 0.
          SELECT *
                 FROM  yyeft1008
                 INTO TABLE it_yyeft1008
                 FOR ALL ENTRIES IN it_yyeft1201
                 WHERE bp_refnr EQ it_yyeft1201-bprefnr.
          IF sy-subrc EQ 0.
            SORT it_yyeft1008[] BY bp_refnr.
          ENDIF.  "IF sy-subrc EQ 0.
        ENDIF.  "IF sy-subrc EQ 0.
      ELSE.
        zn_cancel = kc_x.
      ENDIF.  "IF sy-subrc EQ 0.
    ENDFORM.                    " fetch_data
    *&      Form  build_data
          Gather the data from all the internal tables into one.
    FORM build_data .
      LOOP AT it_yyeft1200
           INTO wa_yyeft1200.
        CLEAR wa_output.
        wa_output-id_rech    = wa_yyeft1200-id_rech.
        wa_output-fnumkred   = wa_yyeft1200-fnumkred.
        wa_output-status     = wa_yyeft1200-status.
        wa_output-erdat      = wa_yyeft1200-erdat.
        wa_output-bukrs      = wa_yyeft1200-bukrs.
        wa_output-belnr      = wa_yyeft1200-belnr.
        wa_output-gjahr      = wa_yyeft1200-gjahr.
        IF  wa_yyeft1200-status  GE kc_status10
        AND wa_yyeft1200-belnr   IS INITIAL.
          wa_output-com_delfnd  = 'FI Doc NOT found'(t03).
        ENDIF.
        IF  wa_yyeft1200-status    LT kc_status10
        AND NOT wa_yyeft1200-belnr IS INITIAL
        AND wa_output-com_delfnd   IS INITIAL
        AND NOT pa_det             IS INITIAL.
          wa_output-com_delfnd = 'FI Doc should be empty'(t01).
        ENDIF.
        LOOP AT it_yyeft1201
            INTO wa_yyeft1201
            WHERE id_rech EQ wa_yyeft1200-id_rech.
          wa_output-bprefnr    = wa_yyeft1201-bprefnr.
          wa_output-lfdat      = wa_yyeft1201-lfdat.
          wa_output-artnr_bp   = wa_yyeft1201-artnr_bp.
          READ TABLE it_yyeft1008
               WITH KEY bp_refnr = wa_yyeft1201-bprefnr
               BINARY SEARCH
               TRANSPORTING NO FIELDS.
          IF sy-subrc EQ 0.
            LOOP AT it_yyeft1008
                 INTO wa_yyeft1008
                 FROM sy-tabix.
              IF wa_yyeft1008-bp_refnr NE wa_yyeft1201-bprefnr.
                EXIT.
              ENDIF.
              wa_output-id_anlief  = wa_yyeft1008-id_anlief.
              IF NOT pa_det               IS INITIAL
              OR NOT wa_output-com_delfnd IS INITIAL.
                APPEND wa_output TO it_output.
              ENDIF.
            ENDLOOP.  "LOOP AT it_yyeft1008
          ELSE.
            CLEAR wa_output-id_anlief.
            wa_output-com_delfnd = 'Deliv. NOT found'(t06).
            APPEND wa_output TO it_output.
          ENDIF.
        ENDLOOP.  "LOOP AT it_yyeft1201
        IF sy-subrc NE 0.
          wa_output-com_delfnd = 'No Detail records in YYEFT1201'(e01).
          APPEND wa_output TO it_output.
        ENDIF.  "IF sy-subrc NE 0.
      ENDLOOP.  "LOOP AT it_yyeft1200
    Checkbox Editable for Production Run
      IF pa_prodr IS INITIAL.
        LOOP AT   it_output
             INTO wa_output.
          zs_style-fieldname = 'CHK_BOX'.
          zs_style-style     = cl_gui_alv_grid=>mc_style_disabled.
          INSERT zs_style INTO TABLE wa_output-celltab.
          MODIFY it_output FROM wa_output
                 TRANSPORTING celltab.
        ENDLOOP.      "LOOP AT it_output INTO wa_output.
      ENDIF.      "IF pa_prodr IS INITIAL
      LOOP AT   it_output
           INTO wa_output.
        IF  wa_output-status GE kc_status10
        AND wa_output-belnr  IS INITIAL
        AND NOT pa_prodr     IS INITIAL.
          zs_style-fieldname = 'CHK_BOX'.
          zs_style-style     = cl_gui_alv_grid=>mc_style_enabled.
          INSERT zs_style INTO TABLE wa_output-celltab.
          MODIFY it_output FROM wa_output
                 TRANSPORTING celltab.
        ENDIF.      "IF wa_output-status GE kc_status10
      ENDLOOP.    "LOOP AT it_output INTO wa_output
    ENDFORM.   "build_data
    *&      Form  prepare_field_catalog
          Field Catalog Preparation
         <--PIT_FIELDCAT     Field catalog
    FORM prepare_field_catalog
         CHANGING pit_fieldcat TYPE lvc_t_fcat.
      DATA: ls_fcat TYPE lvc_s_fcat.
      IF it_output1 IS INITIAL.
      Check Box
        CLEAR ls_fcat.
        ls_fcat-fieldname  = 'CHK_BOX'.
        ls_fcat-datatype   = 'CHAR'.
        ls_fcat-intlen     = '1'.
        ls_fcat-edit       = kc_x.
        ls_fcat-coltext    = text-014.
        ls_fcat-checkbox   = kc_x.
        ls_fcat-outputlen  = '5'.
        APPEND ls_fcat TO pit_fieldcat.
      ENDIF.      "IF it_output1 IS INITIAL
    ID RECH
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'ID_RECH'.
      ls_fcat-outputlen  = '10'.
      ls_fcat-coltext    = text-002.
      APPEND ls_fcat TO pit_fieldcat.
    BP Reference
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'BPREFNR'.
      ls_fcat-outputlen  = '15'.
      ls_fcat-coltext    = text-003.
      APPEND ls_fcat TO pit_fieldcat.
    Delivery date
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'LFDAT'.
      ls_fcat-outputlen  = '10'.
      ls_fcat-coltext    = text-004.
      APPEND ls_fcat TO pit_fieldcat.
    Article
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'ARTNR_BP'.
      ls_fcat-outputlen  = '18'.
      ls_fcat-coltext    = text-005.
      APPEND ls_fcat TO pit_fieldcat.
    Account Payable invoice
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'FNUMKRED'.
      ls_fcat-outputlen  = '16'.
      ls_fcat-coltext    = text-006.
      APPEND ls_fcat TO pit_fieldcat.
    Status
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'STATUS'.
      ls_fcat-outputlen  = '2'.
      ls_fcat-coltext    = text-007.
      APPEND ls_fcat TO pit_fieldcat.
    Create date
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'ERDAT'.
      ls_fcat-outputlen  = '10'.
      ls_fcat-coltext    = text-008.
      APPEND ls_fcat TO pit_fieldcat.
    Comment
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'COM_DELFND'.
      ls_fcat-outputlen  = '25'.
      ls_fcat-coltext    = text-009.
      APPEND ls_fcat TO pit_fieldcat.
    Delivery ID
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'ID_ANLIEF'.
      ls_fcat-outputlen  = '10'.
      ls_fcat-coltext    = text-010.
      APPEND ls_fcat TO pit_fieldcat.
    Company Code
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'BUKRS'.
      ls_fcat-outputlen  = '4'.
      ls_fcat-coltext    = text-011.
      APPEND ls_fcat TO pit_fieldcat.
    Accounting Document Number
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'BELNR'.
      ls_fcat-outputlen  = '10'.
      ls_fcat-coltext    = text-012.
      APPEND ls_fcat TO pit_fieldcat.
    Financial Year
      CLEAR ls_fcat.
      ls_fcat-fieldname  = 'GJAHR'.
      ls_fcat-outputlen  = '4'.
      ls_fcat-coltext    = text-013.
      APPEND ls_fcat TO pit_fieldcat.
    ENDFORM.                    " prepare_field_catalog
    *&      Form  EVENT_TOP_OF_PAGE
          TOP-OF-PAGE Preparation
         -->z_dyndoc_id  Text of TOP-OF-PAGE
    FORM event_top_of_page
         USING   z_dyndoc_id TYPE REF TO cl_dd_document.
      DATA : lz_text(255) TYPE c.
    System ID
      CLEAR :     lz_text.
      CONCATENATE text-015
                  sy-sysid
                  INTO lz_text
                  SEPARATED BY space.
      PERFORM     add_text
                  USING lz_text.
      CALL METHOD z_dyndoc_id->new_line.
    Title
      CLEAR :     lz_text.
      CONCATENATE text-016
                  sy-title
                  INTO lz_text
                  SEPARATED BY space.
      PERFORM     add_text
                  USING lz_text.
      CALL METHOD z_dyndoc_id->new_line.
    Date
      CLEAR :     lz_text.
      WRITE       sy-datum TO lz_text.
      CONCATENATE text-017
                  lz_text
                  INTO lz_text
                  SEPARATED BY space.
      PERFORM     add_text
                  USING lz_text.
      CALL METHOD z_dyndoc_id->new_line.
    User ID
      CLEAR :     lz_text.
      CONCATENATE text-018
                  sy-uname
                  INTO lz_text
                  SEPARATED BY space.
      PERFORM     add_text
                  USING lz_text.
      CALL METHOD z_dyndoc_id->new_line.
    Time
      CLEAR :     lz_text.
      WRITE       sy-uzeit TO lz_text.
      CONCATENATE text-019
                  lz_text
                  INTO lz_text
                  SEPARATED BY space.
      PERFORM     add_text
                  USING lz_text.
      CALL METHOD z_dyndoc_id->new_line.
    Program Name
      CLEAR :     lz_text.
      WRITE       sy-repid TO lz_text.
      CONCATENATE text-020
                  lz_text
                  INTO lz_text
                  SEPARATED BY space.
      PERFORM     add_text
                  USING lz_text.
      CALL METHOD z_dyndoc_id->new_line.
    Populating data to TOP-OF-PAGE
      PERFORM top-of-page.
    ENDFORM.                    " EVENT_TOP_OF_PAGE
    *&      Form  ADD_TEXT
          Add Text To TOP-OF-PAGE
    FORM add_text
         USING p_text TYPE sdydo_text_element.
      CALL METHOD z_dyndoc_id->add_text
        EXPORTING
          text = p_text.
    ENDFORM.                    " ADD_TEXT
    *&      Form  TOP-OF-PAGE
          TOP-OF-PAGE
    FORM top-of-page.
      CALL METHOD z_dyndoc_id->display_document
        EXPORTING
          reuse_control      = kc_x
          parent             = z_parent_top
        EXCEPTIONS
          html_display_error = 1.
      IF sy-subrc NE 0.
        MESSAGE i001(zzrefn01)
                WITH text-036 ' '.
      ENDIF.      "IF sy-subrc NE 0
    ENDFORM.   "TOP-OF-PAGE
    *&      Form  handle_user_command
          Handle the user command
    FORM handle_user_command .
      DATA lzi_lin TYPE i.
      REFRESH ra_id_rech[].
      CLEAR ra_id_rech.
      ra_id_rech-sign   = kc_include.
      ra_id_rech-option = kc_equal.
      CASE sy-ucomm.
        WHEN kc_ucomm-upd.
          DESCRIBE LIST NUMBER OF LINES lzi_lin.
          DO lzi_lin TIMES.
            CLEAR wa_output.
            READ LINE sy-index
                 FIELD VALUE wa_output-chk_box
                             wa_output-id_rech.
            IF sy-subrc NE 0.
              EXIT.
            ELSE.
              IF wa_output-chk_box EQ kc_x.
                ra_id_rech-low    = wa_output-id_rech.
                APPEND ra_id_rech.
              ENDIF.
            ENDIF.
          ENDDO.
          IF NOT ra_id_rech IS INITIAL.
            SORT ra_id_rech BY low.
            DELETE ADJACENT DUPLICATES FROM ra_id_rech
                   COMPARING low.
            IF NOT pa_prodr IS INITIAL.
              UPDATE yyeft1200
                     SET status = kc_status00
                     WHERE id_rech IN ra_id_rech.
              IF sy-subrc EQ 0.
                MESSAGE s900(zbcc)
                        WITH 'Status change successful'(m08)
                             space
                             space
                             space.
              ELSE.
                MESSAGE i900(zbcc)
                        WITH 'Status change failed'(m09)
                             space
                             space
                             space.
              ENDIF.  "IF sy-subrc EQ 0.
            ELSE.
              MESSAGE i900(zbcc)
                      WITH 'TEST RUN: NO databases will be changed'(m03)
                           space
                           space
                           space.
            ENDIF.  "IF NOT pa_prodr IS INITIAL.
          ELSE.
            MESSAGE i900(zbcc)
                    WITH 'Atleast one line should be selected'(m01)
                         'in order to update.'(m02)
                         space
                         space.
          ENDIF.  "IF NOT ra_id_rech IS INITIAL
        WHEN kc_ucomm-back
          OR kc_ucomm-exit
          OR kc_ucomm-cancel.
          LEAVE TO SCREEN 0.
        WHEN OTHERS.
      ENDCASE.  "CASE sy-ucomm
    ENDFORM.                    " handle_user_command
    *&      Form  display_selected_data
          Display Selected Data
    FORM display_selected_data.
      LOOP AT it_output
              INTO wa_output
              WHERE chk_box EQ kc_x.
        MOVE-CORRESPONDING wa_output TO wa_output1.
        APPEND wa_output1 TO it_output1.
      ENDLOOP.   "LOOP AT it_output
    call dialog screen and display new alv control
      IF NOT it_output1[] IS INITIAL.
        CALL SCREEN 101 STARTING AT 10 5.
      ENDIF.    "IF NOT it_output1[] IS INITIAL
    ENDFORM.   " change_status
    iNCLUDE YYEF_CHECK_ISP_I01
    *&  Include           YYEF_CHECK_ISP_I01                               *
    *&      Module  USER_COMMAND_0100  INPUT
          Handle user command for screen 0100
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN kc_ucomm-back.
          LEAVE TO SCREEN 0.
        WHEN kc_ucomm-exit.
          LEAVE TO SCREEN 0.
      ENDCASE.                 "CASE sy-ucomm.
    ENDMODULE.              "USER_COMMAND_0100  INPUT
    *&      Module  USER_COMMAND_0101  INPUT
          Handle User Command for screen 0101
    MODULE user_command_0101 INPUT.
      CASE sy-ucomm.
        WHEN kc_ucomm-back.
          LEAVE TO SCREEN 0.
      ENDCASE.      "CASE sy-ucomm
    ENDMODULE.    " USER_COMMAND_0101  INPUT
    Include YYEF_CHECK_ISP_O01
    *&  Include           YYEF_CHECK_ISP_O01                               *
    *&      Module  PBO  OUTPUT
          OO ALV Display
    MODULE pbo OUTPUT.
      CREATE OBJECT z_container
             EXPORTING container_name = kc_container.
    Create TOP-Document
      CREATE OBJECT z_dyndoc_id
             EXPORTING style = kc_alv.
    Create Splitter for custom_container
      CREATE OBJECT z_splitter
             EXPORTING parent  = z_container
                       rows    = 2
                       columns = 1.
    For TOP-OF-PAGE
      CALL METHOD z_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = z_parent_top.
    For ALV Display
      CALL METHOD z_splitter->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = z_parent_grid.
    Set height for g_parent_html
      CALL METHOD z_splitter->set_row_height
        EXPORTING
          id     = 1
          height = 20.
      CREATE OBJECT z_grid
             EXPORTING i_parent = z_parent_grid.
    Set Handler for TOP-OF-PAGE
      CREATE OBJECT z_handler.
      SET HANDLER z_handler->top_of_page FOR z_grid.
      z_repid = sy-repid.
      z_variant-report = z_repid.
    Display ALV
      zs_layout-stylefname = kc_style.
      CALL METHOD z_grid->set_table_for_first_display
        EXPORTING
          is_layout       = zs_layout
          i_save          = kc_u
          is_variant      = z_variant
        CHANGING
          it_outtab       = it_output[]
          it_fieldcatalog = it_fieldcat.
    Processing TOP-OF-PAGE Event
      CALL METHOD z_grid->list_processing_events
        EXPORTING
          i_event_name = kc_top
          i_dyndoc_id  = z_dyndoc_id.
    Set handler for ALV Tool Bar
      SET HANDLER z_handler->handle_toolbar      FOR z_grid.
      SET HANDLER z_handler->handle_user_command FOR z_grid.
      CALL METHOD z_grid->set_toolbar_interactive.
    ENDMODULE.                 " PBO  OUTPUT
    *&      Module  STATUS_0100  OUTPUT
          Set the GUI status
    MODULE status_0100 OUTPUT.
      SET PF-STATUS kc_status.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  STATUS_0101  OUTPUT
          Display selected records on screen 0101
    MODULE status_0101 OUTPUT.
      SET TITLEBAR kc_title.
      CREATE OBJECT z_container1
             EXPORTING container_name = kc_container1.
      CREATE OBJECT z_grid1
             EXPORTING i_parent = z_container1.
      PERFORM prepare_field_catalog
              CHANGING it_fieldcat1.
    Display ALV
      CALL METHOD z_grid1->set_table_for_first_display
        EXPORTING
          is_layout       = zs_layout
        CHANGING
          it_outtab       = it_output1[]
          it_fieldcatalog = it_fieldcat1.
    ENDMODULE.                 " STATUS_0101  OUTPUT
    INCLUDE YYEF_CHECK_ISP_TOP
    *&  Include           YYEF_CHECK_ISP_TOP                               *
       DATA DEFINITIONS                                                **
        Class declarations                                               *
    *class zcl_xyz definition deferred.
    CLASS :cl_gui_alv_grid DEFINITION LOAD,
           cl_gui_custom_container DEFINITION LOAD.
        Tables (old SAP style, please avoid and use workareas instead)   *
    TABLES: yyeft1200,
            yyeft1201.
    *tables: xyz.
        Controls                                                         *
    *controls: ctrl_xyz.
        Types                                                            *
    TYPES: BEGIN OF ty_output,
             chk_box(1) TYPE c,
             celltab    TYPE lvc_t_styl,
             id_rech    TYPE yyeft1200-id_rech,
             bprefnr    TYPE yyeft1201-bprefnr,
             lfdat      TYPE yyeft1201-lfdat,
             artnr_bp   TYPE yyeft1201-artnr_bp,
             fnumkred   TYPE yyeft1200-fnumkred,
             status     TYPE yyeft1200-status,
             erdat      TYPE yyeft1200-erdat,
             com_delfnd TYPE char25,
             id_anlief  TYPE yyeft1008-id_anlief,
             bukrs      TYPE yyeft1200-bukrs,
             belnr      TYPE yyeft1200-belnr,
             gjahr      TYPE yyeft1200-gjahr,
           END OF ty_output.
    TYPES: BEGIN OF ty_output1,
             celltab    TYPE lvc_t_styl,
             id_rech    TYPE yyeft1200-id_rech,
             bprefnr    TYPE yyeft1201-bprefnr,
             lfdat      TYPE yyeft1201-lfdat,
             artnr_bp   TYPE yyeft1201-artnr_bp,
             fnumkred   TYPE yyeft1200-fnumkred,
             status     TYPE yyeft1200-status,
             erdat      TYPE yyeft1200-erdat,
             com_delfnd TYPE char25,
             id_anlief  TYPE yyeft1008-id_anlief,
             bukrs      TYPE yyeft1200-bukrs,
             belnr      TYPE yyeft1200-belnr,
             gjahr      TYPE yyeft1200-gjahr,
           END OF ty_output1.
    TYPES: BEGIN OF ty_status,
             id_rech TYPE yyeft1200-id_rech,
           END OF ty_status.
    *TYPES-POOLS: xyz.
    *TYPES: ty_xyz.
        Internal tables                                                  *
    *DATA: it_xyz.
    DATA: it_yyeft1200 TYPE STANDARD TABLE OF yyeft1200,
          it_yyeft1201 TYPE SORTED   TABLE OF yyeft1201
                       WITH UNIQUE KEY id_rech posnr,
          it_yyeft1008 TYPE STANDARD TABLE OF yyeft1008,
          it_output    TYPE STANDARD TABLE OF ty_output,
          it_output1   TYPE STANDARD TABLE OF ty_output1,
          it_fieldcat  TYPE lvc_t_fcat,
          it_fieldcat1 TYPE lvc_t_fcat.
        Workareas                                                        *
    *DATA: wa_xyz.
    DATA: wa_yyeft1200 TYPE yyeft1200,
          wa_yyeft1201 TYPE yyeft1201,
          wa_yyeft1008 TYPE yyeft1008,
          wa_output    TYPE ty_output,
          wa_output1    TYPE ty_output1.
    *****OO ALV DATA DECLARATION
    DATA:  zs_style           TYPE        lvc_s_styl,
           zs_layout          TYPE        lvc_s_layo,
           z_container        TYPE REF TO cl_gui_custom_container,
           z_container1       TYPE REF TO cl_gui_custom_container,
           z_grid             TYPE REF TO cl_gui_alv_grid,
           z_grid1            TYPE REF TO cl_gui_alv_grid,
           z_dyndoc_id        TYPE REF TO cl_dd_document,
           z_splitter         TYPE REF TO cl_gui_splitter_container,
           z_parent_grid      TYPE REF TO cl_gui_container,
           z_parent_top       TYPE REF TO cl_gui_container.
        Constants                                                        *
    *constants: kc_xyz         value ...     "character
    *constants: kn_xyz         value ...     "numeric
    *constants: ki_xyz         value ...     "integer
    *constants: kp_xyz         value ...     "packed
    *constants: kx_xyz         value ...     "hex
    CONSTANTS: kc_status00   TYPE yyeft1200-status VALUE '00',
               kc_status10   TYPE yyeft1200-status VALUE '10',
               kc_x          TYPE char01           VALUE 'X',
               kc_include    TYPE char01           VALUE 'I',
               kc_equal(2)   TYPE c                VALUE 'EQ',
               kc_status(11) TYPE c                VALUE 'ZGUI_STATUS',
               kc_container  TYPE char10           VALUE 'ZCONTAINER',
               kc_container1 TYPE char11           VALUE 'ZCONTAINER1',
               kc_u          TYPE char01           VALUE 'U',
               kc_top        TYPE char30           VALUE 'TOP_OF_PAGE',
               kc_alv        TYPE char50           VALUE 'ALV_GRID',
               kc_style      TYPE char07           VALUE 'CELLTAB',
               kc_title      TYPE char07           VALUE 'ZTITLE'.
    CONSTANTS: BEGIN OF kc_ucomm,
                 upd     TYPE sy-ucomm VALUE  'UPD',
                 back    TYPE sy-ucomm VALUE  'BACK',
                 exit    TYPE sy-ucomm VALUE  'EXIT',
                 cancel  TYPE sy-ucomm VALUE  'CANCEL',
               END OF kc_ucomm.
        Sentence counters                                                *
    *data: cnt_xyz type i value 0.
        Calculation variables (Rechenfelder)                             *
    *data: r_xyz.
        Switches                                                         *
    *data: sw_xyz(1) type n value 0.
        Misc variables                                                   *
    *DATA: z_xyz.
    *** Initialization of parameters at call of/return to
    *** selection dynpro (for Online-only-reports)
    DATA: zn_init_seldynp(1) TYPE n
                                  VALUE 1.

Maybe you are looking for