Looping for write_form

Hi,
I am working on smart forms. I have used some queries queries in my print program to populate my data in internal table say iafvc.
While using write_form, I am using following loop:
(Note that I am using 'Append' for function parameter in
exporting part of iafvc)
LOOP AT iafvc.
   CALL FUNCTION 'WRITE_FORM'
EXPORTING
   ELEMENT                        = 'OP-BAR'
   FUNCTION                       = 'APPEND'
   TYPE                           = 'BODY'
   WINDOW                         = 'BAR2'
EXCEPTIONS
   OTHERS                         = 10.
ENDLOOP.
In the layout under text element I have written like where A1 is some paragraph format I have defined.
/E OP-BAR
A1 &IAFVC-VORNR&
When I try to print only last value of internal table gets printed as many times as the number of values present in internal table.
For example say iafvc has two values 010 andd 020 then
instead of printing
010
020
its gets printed like
020
020
Can someone help me out ?
I will surely award relevant points.
Tushar.

It should be this easy....
LOOP AT iafvc.
CALL FUNCTION 'WRITE_FORM'
   EXPORTING
       ELEMENT = 'OP-BAR'
   EXCEPTIONS
       OTHERS = 10.
ENDLOOP.
Get rid of this stuff....
FUNCTION = 'APPEND'
TYPE = 'BODY'
WINDOW = 'BAR2'
Regards,
Rich Heilman

Similar Messages

  • Code for looping the write_form

    Hi
    can anyone give me the code that  u have developed inthe past for looping the write_form F.M. please...

    Hi,
    TABLES :
      scarr,
      spfli,
      sflight.
    *PARAMETERS :
    *  p_carrid LIKE sflight-carrid,
    *  p_connid LIKE sflight-connid.
    DATA :
    BEGIN OF fs_sflight,
       carrid LIKE sflight-carrid,
       connid LIKE sflight-connid,
       fldate LIKE sflight-fldate,
       price  LIKE sflight-price,
       currency LIKE sflight-currency,
       seatsmax LIKE sflight-seatsmax,
       seatsocc LIKE sflight-seatsocc,
    END OF fs_sflight.
    DATA :
      t_scarr LIKE
    STANDARD TABLE
           OF scarr.
    DATA :
       t_spfli LIKE
      STANDARD TABLE
            OF spfli.
    DATA :
      t_sflight LIKE
       STANDARD TABLE
             OF fs_sflight.
    DATA :
      fs_options TYPE itcpo.
    START-OF-SELECTION.
      PERFORM selection.
      PERFORM open_form.
      LOOP AT t_sflight INTO fs_sflight.
        AT NEW connid.
          PERFORM start_form.
          READ TABLE t_spfli INTO spfli WITH KEY carrid = fs_sflight-carrid
                                                 connid = fs_sflight-connid.
          READ TABLE t_scarr INTO scarr WITH KEY carrid = fs_sflight-carrid.
        ENDAT.
        PERFORM write_form.
        AT END OF carrid.
          PERFORM end_form.
        ENDAT.
      ENDLOOP.
      PERFORM close_form.
    *&      Form  selection
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM selection .
      SELECT *
        FROM scarr
        INTO TABLE t_scarr.
    *          WHERE carrid = p_carrid.
      SELECT *
        FROM spfli
        INTO TABLE t_spfli.
    *          WHERE carrid = p_carrid
    *            AND connid = p_connid.
      SELECT carrid
             connid
             fldate
             price
             currency
             seatsmax
             seatsocc
        FROM sflight
        INTO TABLE t_sflight.
    *   WHERE carrid = p_carrid
    *     and connid = p_connid.
    ENDFORM.                    " selection
    *&      Form  open_form
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM open_form .
      fs_options-tdcopies = 2.
      fs_options-tddest = 'LP01'.
      fs_options-tdpreview = 'X'.
      fs_options-tdnoprint = 'X'.
      CALL FUNCTION 'OPEN_FORM'
       EXPORTING
    *   APPLICATION                       = 'TX'
    *   ARCHIVE_INDEX                     =
    *   ARCHIVE_PARAMS                    =
    *   DEVICE                            = 'PRINTER'
       dialog                            = ' '
    *     form                              = 'FORM1'
    *   LANGUAGE                          = SY-LANGU
       options                           =  fs_options
    *   MAIL_SENDER                       =
    *   MAIL_RECIPIENT                    =
    *   MAIL_APPL_OBJECT                  =
    *   RAW_DATA_INTERFACE                = '*'
    * IMPORTING
    *   LANGUAGE                          =
    *   NEW_ARCHIVE_PARAMS                =
    *   RESULT                            =
       EXCEPTIONS
         canceled                          = 1
         device                            = 2
         form                              = 3
         options                           = 4
         unclosed                          = 5
         mail_options                      = 6
         archive_error                     = 7
         invalid_fax_number                = 8
         more_params_needed_in_batch       = 9
         spool_error                       = 10
         codepage                          = 11
         OTHERS                            = 12
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " open_form
    *&      Form  write_form
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM write_form .
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         element                        = 'FLIGHTINFO'
    *   FUNCTION                       = 'SET'
    *   TYPE                           = 'BODY'
    *   WINDOW                         = 'MAIN'
    * IMPORTING
    *   PENDING_LINES                  =
       EXCEPTIONS
         element                        = 1
         function                       = 2
         type                           = 3
         unopened                       = 4
         unstarted                      = 5
         window                         = 6
         bad_pageformat_for_print       = 7
         spool_error                    = 8
         codepage                       = 9
         OTHERS                         = 10
      IF sy-subrc <> 0.
        WRITE 'Write_Error'.
      ENDIF.
    ENDFORM.                    " write_form
    *&      Form  close_form
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM close_form .
      CALL FUNCTION 'CLOSE_FORM'
    * IMPORTING
    *   RESULT                         =
    *   RDI_RESULT                     =
    * TABLES
    *   OTFDATA                        =
    * EXCEPTIONS
    *   UNOPENED                       = 1
    *   BAD_PAGEFORMAT_FOR_PRINT       = 2
    *   SEND_ERROR                     = 3
    *   SPOOL_ERROR                    = 4
    *   CODEPAGE                       = 5
    *   OTHERS                         = 6
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " close_form
    *&      Form  start_form
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM start_form .
      CALL FUNCTION 'START_FORM'
       EXPORTING
    *   ARCHIVE_INDEX          =
         form                   = 'FORM1'
    *   LANGUAGE               = ' '
    *   STARTPAGE              = ' '
    *   PROGRAM                = ' '
    *   MAIL_APPL_OBJECT       =
    * IMPORTING
    *   LANGUAGE               =
       EXCEPTIONS
         form                   = 1
         format                 = 2
         unended                = 3
         unopened               = 4
         unused                 = 5
         spool_error            = 6
         codepage               = 7
         OTHERS                 = 8
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " start_form
    *&      Form  end_form
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM end_form .
      CALL FUNCTION 'END_FORM'
    * IMPORTING
    *   RESULT                         =
       EXCEPTIONS
         unopened                       = 1
         bad_pageformat_for_print       = 2
         spool_error                    = 3
         codepage                       = 4
         OTHERS                         = 5
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " end_form
    Regards,
    Swapna.
    Edited by: NagaSwapna Thota on Jul 4, 2008 9:14 AM

  • Apple loops for garageband pack doesn't show the folder content (loops, files...)  in ableton live suite 8 library browser, but I can see all the loops in the folder from finder. how can i fix this? help please.

    apple loops for garageband pack doesn't show the folder content (loops, files...)  in ableton live suite 8 library browser, but I can see all the loops in the folder from finder. how can i fix this? help please.

    Thanks Barney, I tried that but all that comes up in Spotlight are the log files that show the file paths! I don't know how Steam works. Are all the files held by Steam on their server perhaps?

  • Loops for ipad

    Can you get apple loops for garage band on ipad, I have used the loops on mac and like them, I just want to use them on my ipad.
    Thamks :-)

    On the App Store. But never mind I found them. All I needed to do was press reset in the loops folder to bring them all up. Thanks.

  • Unable to download Additional Loops For Garageband Ctrl R Does Not Work

    I am unable to download the additonal loops for Garageband on my iMac Purchased New Spring 2013.
    I have done the following with no success:
    Uninstalled Garage Band.
    Reinstalled Garage Band from App Store.
    Reindexed Loops
    Clicked on missing loop and choose Update Now
    Clicked on missing loop and choose Update Later
    Used Ctrl+R in App store (nothing available). (Yes, I logged in with AppleID)
    Deleted Apple Loops Folder
    Deleted Apple Loops index Folder
    Re-indexed loops in Garageband
    My Library... Apple Loops folder is empty, but the pre-installed loops for Garageband are there.
    I have also tried the terminal command: sudo softwareupdate --list
    There are NO updates available.
    Anyone have any addittional suggestions for installing the missing loops from Garageband?

    What exactly happens, when you try to download the missing loops - when you click on a missing loop and choose "Update now"?
    My Library... Apple Loops folder is empty, but the pre-installed loops for Garageband are there.
    Are you looking in the library in your Home Folder 
    "~/Library/Audio/Apple Loops/"  , or in the System library  "/Library/Audio/Apple Loops/"  ?
    The loops should be installed in the System Library  
    "/Library/Audio/Apple Loops/".
    How did you set up your new mac? Did you migrate from an older mac using Setup Assistant or Migration Assistant? Did you migrate an earlier GarageBand installation?

  • I have GarageBand for iPad 2 and noticed that there are far fewer loops for iPad than for apple laptops. Is there a library available of apple loops? I haven't been able to find any if there are. Any help would be greatly appreciated.

    I have GarageBand for iPad 2 and noticed that there are far fewer loops for iPad than for apple laptops. Is there a library available of apple loops? I haven't been able to find any if there are. Any help would be greatly appreciated.

    Update: An Apple rep called me today to update the status of my return. I was told that the replacements for the BLACK iPad 2's was still another 3 weeks out (at least) so they offered me a brand new WHITE 16GB iPad 2. I could have that or continue waiting. I opted to go ahead and accept the offer of a new white one. Worst case scenario if I don't like the white one I have buddy that just bought a 16GB black one that he would be willing to swap it.

  • How to use old "Apple Loops for Soundtrack" with Garageband

    Since Soundtrack (was part of FinalCut Express HD) doesn't work anymore (since some ProKit framework update) and was not part of the FinalCut Express 4 upgrade I used Garageband for sound creation and editing. But I missed some good loops from the old Soundtrack.
    The Apple Loops for Soundtrack were still sitting on my harddisk but Garageband didn't recognize them in the Loop-Browser. Looking at the structure I found the Search Index files (/Library/Audio/Apple Loop Index/). I have two there, one for Garageband and another for iLife Sound Effects. Both are interpreted by Garageband. But no third for the old Soundtrack Loops. So I had a look at the Sound Loops installer DVD from FinalCut HD and there I found a similar structur and copied the Index file to the location of the two indexes mentioned above. I left the Loops for Soundtrack where they are (also could edit the index file for new locations, but that's a 7.5MB text file) and now Garageband knows their location and also lists the loops at the right categories inside the Loop-Browser.
    Maybe that helps someone, even if I didn't find a topic about it here.

    Ah.. ok, then never mind. Just didn't find any information about how to use the old soundtrack loops with garageband and so I did some thinking on my own. And if it works that easy, the better it is

  • Can we place Analog in Read(AI-RE​AD) Vi inside the while loop for high sample rate like 22ks/s?

    I am using E-series Card for data acquisition.My requirement is to sample the channel, and check the 10 samples for certain condition.both at a time.What should be done can we place the AI-READ vi inside for or while loop for this purpose?

    Hello,
    Yes, you can include the AI Read.vi inside the while loop, you would just need to specify the number of scans to read for every iteration of the loop. Then, after AI Read.vi has read the data, you can do what ever kind of manipulation of the data you would like, before the next iteration of the loop. The one thing to watch out for is what ever manipulation of the data you do, be sure that it doesn't take to long whereas the buffer holding the data starts to back up. That can be checked by looking at the scan backlog output of the AI Read.vi, which will tell you how many scans have been acquired but haven't been read into your program.
    Hope this helps!
    Regards,
    Steven B.
    Applications Engineering, NI

  • The product that I purchased is not working!!!! I need help and I've been stuck in your "Contact us loop" for the last few days and I'm getting frustrated. How do I contact you for HELP!

    The product that I purchased is not working!!!! I need help and I've been stuck in your "Contact us loop" for the last few days and I'm getting frustrated. How do I contact you for HELP!

    Probably the best place to start is the right forum for your product. This is the forum for Distiller Server, a long dead product used by big companies, and probably not what you have. If you can't find the right forum, please let us know the FULL name of what you paid for (please check your invoice, as Adobe have many similar products), and we can perhaps direct you. Good luck!

  • How to use a loop for a object

    Hi, All
    I have a procedure that needs a collection to pass in. The pass_in collection has multiple records with multiple fields, so I guess I need a loop for each record.
    How to assign each record of multiple fields to each corresponding local variables?
    Thanks In advance
    T_Object is a table object
    T_ProfileInfo is a collection
    procedure P_Updateprofile(UserId in number, NewProfileInfo in T_ProfileInfo) as
    V_B_ID number;
    V_A_ID number;
    V_Profile      T_ProfileInfo;     
    begin
         V_Profile := NewProfileInfo;
         --use the loop for each records
    FORALL i IN V_Profile.FIRST..V_Profile.LAST
    -- assign each value to the local variables
    -- I got error here. ideally I want to assign each record to the local variables
         select B_ID, A_ID
         into V_B_ID, V_A_ID
         from table(V_Profile(i));
         -- insert the record into the table
         INSERT INTO PROFILE
         VALUES (UserId, V_B_ID, V_A_ID);
         commit;
    end;

    You don't say which version of the database you are using. Oracle extended the collections functionality in 9.2....
    Cheers, APC
    SQL> CREATE OR REPLACE PACKAGE t1_utl AS
      2      TYPE rt_t1 IS TABLE OF t1%ROWTYPE;
      3      FUNCTION gen_t1 (p1 IN NUMBER) RETURN rt_t1;
      4      PROCEDURE pop_t1 (t1rows IN rt_t1);
      5  END t1_utl;
      6  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY t1_utl AS
      2      FUNCTION gen_t1 (p1 IN NUMBER) RETURN rt_t1
      3      IS 
      4          CURSOR cur (pn NUMBER) IS
      5              SELECT a12.NEXTVAL, col1, col2, rownum AS rn, substr(col3,30), sysdate
      6              FROM t2
      7              WHERE rownum <= pn;
      8          return_value rt_t1;
      9      BEGIN
    10          OPEN cur(p1);
    11          LOOP
    12              FETCH cur BULK COLLECT INTO return_value LIMIT 100;
    13              EXIT WHEN cur%NOTFOUND;
    14          END LOOP;
    15          RETURN return_value;
    16      END gen_t1;
    17      PROCEDURE pop_t1 (t1rows IN rt_t1) IS
    18      BEGIN
    19          FORALL indx IN t1rows.FIRST .. t1rows.LAST
    20              INSERT INTO t1
    21                VALUES t1rows (indx);
    22      END pop_t1;
    23  END t1_utl;
    24  /
    Package body created.
    SQL> SELECT * FROM t1
      2  /
    no rows selected
    SQL> DECLARE
      2      x t1_utl.rt_t1;
      3  BEGIN
      4      x := t1_utl.gen_t1(2);
      5      t1_utl.pop_t1(x);
      6  END;
      7  /
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM t1
      2  /
          COL1       COL2       COL3       COL4 COLA
    COLD
            56     165765      87979          1
    11-AUG-04
            57       3128    8217220          2
    11-AUG-04
    SQL>

  • Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    I just went through this and it appears that my Focusrite Saffire was the culprit. I connected all the outputs on the focusrite according to the way the jacsk on the back were labeled and then set up the multichannel speaker setup to match. Then I went into STP, created a pink noise clip and panned it around, the LFE, center and rears were not in the right place.
    I reconnected the hardware to match the 5.1 pan pot in STP then changed the multichannel speaker setup to match. Everything appears to be correct now but I would have loved to have been able to just assigned the output busses to correct outputs in the saffire.
    Next step is to pan that pink noise around with my SPL meter to calibrate the room.

  • For Each Loop for XML Task

    Hello Everyone,
    Please assist with a step by step guide on how to setup a For Each Loop for XML Task
    I'm trying to convert XML to XSLT
    I have tried more than 10 times and i just do not know what i am doing wrong - no error, my package just runs for a few seconds but nothing happens
    Thanks in advance
    Dee

    I managed to get my XML to XSLT to work but now when i run my package to import the data into SQL table,
    it stops after a few records, i get the following error: 
    [XML Source [1]] Error: The component "XML Source" (1) was unable to process the XML data. The element "Errors" cannot contain a child element. Content model is text only.
    Please assist
    Check this:
    http://social.msdn.microsoft.com/Forums/en-US/80726e0c-9e85-43ca-87bc-7cf90fd7fb31/xml-source-data-flow-throws-cannot-contain-a-child-element-content-model-is-text-only-error?forum=sqlintegrationservices
    Chaos isn’t a pit. Chaos is a ladder. Many who try to climb it fail and never get to try again. The fall breaks them. And some are given a chance to climb, but they refuse. They cling to the realm, or the gods, or love. Illusions. Only the ladder is real.
    The climb is all there is.

  • My iphone 5 is stuck in recovery mode loop for 3 days, can i recover my data before restoring the phone?

    My iphone 5 is stuck in recovery mode loop for 3 days, how can i fix this? I have attempted to reboot by pressing the home and power key at the same time. I have also tried to put in DFU mode and then plugin to my Mac and computer is not recognizing device in itunes.

    i have icloud setup - but my computer broke so i could not plugin to backup to iTunes

  • How to stop while loop for particular time

                    public void test()
                   new Thread(new Runnable()
                        public void run()
                             //Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
                             System.out.println("test");
                             //System.out.println("test ..."+i);
                             try
                                  Thread.sleep(3000);
                             catch (InterruptedException e)
                   }).start();
            public void startTest()
                    while(i < marquee_Str1.length)
                   marLbl1.setValue(marquee_Str1); //set value to textbox for perticular id
                   marLbl2.setValue(marquee_Str2[i]);
                   marLbl3.setValue(marquee_Str3[i]);
                   test(); // call thread function
                   i++;
    in this code while loop don't stop
    plz help me to stop while loop for certain period by using thread or other technique                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Yes.. the original problem would be your test() method put the sleep in an entirely separate thread of execution. So the thread is created then the method just keeps waiting. The while loop should directly call Thread.sleep... which you have apparently figured out!

  • Is there any way to use a For Each Loop for each property of an User Defined Type?

    Is there any way to use a For Each Loop for each property of an User Defined Type? That would be very handy!
    Jorge Barbi Martins ([email protected])

    Alas, no, not in VBA.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

Maybe you are looking for

  • ICloud doesn't sync

    Hello guys! I bought a brand new iMac with OS X 10.8.4 recently and set up my iCloud with my Apple ID. I use my Calendar, Mail, Notes, Reminders and Contacts frequently but have found that none of the info from my desktop apps can be found in my iClo

  • Difference between the way of login with ip address and SAProuter when checkin original file

    Hi, experts We found out: ① Login with ip address, check in a file with file name less than 22 Chinese character, OK. ② Login with ip address, check in a file with file name more than 22 Chinese character, error message 26253 appeares: Error while ch

  • Trying to understand RAW decoding of D700 in-camera processing

    I use Aperture 2 along with my Nikon D700 to manage and make minor edits to my pix (I know Phototshop well but use it sparingly). Though I believe I understand the benefits and theoretical underpinnings of RAW, until lately I've shot mostly JPEGs jus

  • How do i resolve error 3014 on my iphone in laymand terms?

    How do i resolve error 3014 on my iphone in laymand terms?

  • Bind menu bar to a menu model

    Hello, I'm trying to bind my menu bar (af:menubar) to a menu model. I created the menu model from my main unbounded task flow (adfc-config.xml) : right click -> "Create ADF Menu Model..." giving me root_menu.xml. My menu bar is currently defined in a