Change the sy-tabix dynamically

Hi ,
could any one please let me know , is there any way that
i can change  the sy-tabix value dynamically , while passing an ITAB
into a Work area.  actually i have inserted a record into an ITAB , while
Looping the same  into a WA with an index witch already executed by the same loop.next  time i want to execute (Loop to the Wa) the Newly added Record .
LOOP AT itab.
idx = sy-tabix + 1. ...
(do something) ...
INSERT itab INDEX idx. ...
ENDLOOP.
In this way , the next record to be read is the one
inserted recently...
Thx in Advance
Dilum Alawatte

Hello Dilum
Even if you itab has a single record your loop will run indefinitely until the program dumps due to a memory problem.
Assuming that you want to process all initial records in your itab (i.e. start with 10 records -> end with 20 records) the solution is quite simple:
*& Report  ZUS_SDN_INFINITE_LOOP
REPORT  zus_sdn_infinite_loop.
TYPES: BEGIN OF ty_s_itab.
TYPES: counter  TYPE i.
TYPES: END OF ty_s_itab.
DATA: gt_itab   TYPE STANDARD TABLE OF ty_s_itab,
      gs_line   TYPE ty_s_itab,
      gd_idx    TYPE i,
      gd_max    TYPE i.
START-OF-SELECTION.
  gs_line-counter = 1.
  APPEND gs_line TO gt_itab.
  LOOP AT gt_itab INTO gs_line.
    gd_idx = syst-tabix + 1.
    gs_line-counter = gd_idx.
    WRITE: / gs_line-counter.
    INSERT gs_line INTO gt_itab INDEX gd_idx.
    IF ( gd_idx >= 10 ).  " avoid indefinite loop
      EXIT.
    ENDIF.
  ENDLOOP.
  " NOTE: gt_itab contains 10 records
  SKIP.
  WRITE: / syst-uline.
  SKIP.
  DESCRIBE TABLE gt_itab.
  gd_max = syst-tfill.
  LOOP AT gt_itab INTO gs_line FROM 1 TO gd_max.
    gd_idx = syst-tabix + gd_max.
    gs_line-counter = gd_idx.
    WRITE: / gs_line-counter.
    INSERT gs_line INTO gt_itab INDEX gd_idx.
**    IF ( gd_idx >= 10 ).
**      EXIT.
**    ENDIF.
  ENDLOOP.
END-OF-SELECTION.
Regards
  Uwe

Similar Messages

  • How to change the JCA JNDI dynamically using FTP Adapter

    We have 5 FTP Servers, each having a directory to poll. We have created 5 CCI instances for these FTP Adapters in the FTPAdapter deployment. We created a BPEL process and using FTP Adapter to connect to above mentioned servers.
    Question: Customer's requirement is to use a single BPEL process to poll all these FTP Servers at a specified date and time. How can we connect dynamically to each FTP server at specified time.
    (OR)
    Is there any way to change the JCAJNDI dynamically in a FTP Adapter configuration ?
    I have seen that FTP Adapter POLL doesnt take any JCA JNDI/hostname/un/pwd/date/time dynamically.
    Regards
    Pavan

    Hi Pavan,
    It's possible to change the JNDI dynamically but only when you use put operation where you can control the JNDI name at the time of invoking the FTP Adapter as described in below link.
    Dynamic JNDI in FTP Adapter | jca.jndi property not picked by Adapter
    However, can you consider using BPEL process with SyncRead (and read files through all the JNDIs in a loop) and scheduling this BPEL process to a desired frequency?
    Regards,
    Neeraj Sehgal

  • How can we change the name of dynamic events selector label in Event Structure

    When retriving references to Control that are contained in a cluster. The default name that
    appear in the Event Structure is: : Mouse down.
    I have found a workaround to correct the problem. But I would apreciate a more convinient way to do this.
    This is the workaround I found to change the names in the Event Structure
    I cast the References using a Reference constant and I change the label of
    that constant.
    See the VI for more detail. It is well commented.
    Is there any way to change the name of a dynamic event without doing the
    cast trick?
    Attachments:
    DynEventStructureName.vi ‏44 KB

    I agree!
    I can't top this approach.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Problem, change the language with dynamic text

    I am looking for a way to change simply the language of my flash animation
    I work with flash cs4
    of course I got Mylocale.as:
    import mx.lang.Locale;
    class MyLocale extends mx.lang.Locale {
    static function start():Void {  
    var langCode:String = xmlLang;
    currentXMLMapIndex = 0;
    xmlDoc.load(xmlMap[langCode][0]);
    static function setXMLLang(langCode:String):Void {
    xmlLang = langCode;
    and different xml files in the same folder than my swf file
    in string , I ticked : "replace  strings automatically during the execution"
      with a default language (I am wondering if the problem is not from there)
      if I tick: "replace strings manually using the scene language " or "replace strings via actionscript"
    my code does not work.
      then I kept: "replace strings automatically during the execution"
    in my flash animation I have several scenes (pages)
    p1, p2, p3, p4
    in p1
    I created a language bar
    then 2 layers inside
    Layer--action:
    langListener = new Object();
    langListener.change = function(eventObj) {
    var target = eventObj.target;
    var newLang = target.selectedItem.data;
    MyLocale.setXMLLang(newLang);
    MyLocale.start();
    lang_cb.addEventListener("change", langListener);
    // Force Japanese
    lang_cb.selectedIndex = 1;
    lang_cb.dispatchEvent({type:"change"});
    Layer--language ex Fr:
    // Forces combobox to have the correct value
    on (release) {
    var component = _parent.lang_cb;
    for (var i=0; i< component.length; i++) {
    var item = component.getItemAt(i);
    if (item.data == "fr") {
    component.setSelectedIndex(i);
    component.dispatchEvent({type:"change"});
    break;
    ex Ja :
    // Forces combobox to have the correct value
    on (release) {
    var component = _parent.lang_cb;
    for (var i=0; i< component.length; i++) {
    var item = component.getItemAt(i);
    if (item.data == "ja") {
    component.setSelectedIndex(i);
    component.dispatchEvent({type:"change"});
    break;
    When I change the language in p1 , the language is also modified in p2, p3 and p4
    however , after a navigation in p2, p3 and p4 , once I come back in p1 , the default language is back automatically although I did not touch the language bar!!
    I don't know how to solve the problem
    to my mind , the script reset itself each time I come back on p1
    is there a way to keep the saved settings even when I am back on p1 until I modify manually again the language bar
    thanks a lot

    I am looking for a way to change simply the language of my flash animation
    I work with flash cs4
    of course I got Mylocale.as:
    import mx.lang.Locale;
    class MyLocale extends mx.lang.Locale {
    static function start():Void {  
    var langCode:String = xmlLang;
    currentXMLMapIndex = 0;
    xmlDoc.load(xmlMap[langCode][0]);
    static function setXMLLang(langCode:String):Void {
    xmlLang = langCode;
    and different xml files in the same folder than my swf file
    in string , I ticked : "replace  strings automatically during the execution"
      with a default language (I am wondering if the problem is not from there)
      if I tick: "replace strings manually using the scene language " or "replace strings via actionscript"
    my code does not work.
      then I kept: "replace strings automatically during the execution"
    in my flash animation I have several scenes (pages)
    p1, p2, p3, p4
    in p1
    I created a language bar
    then 2 layers inside
    Layer--action:
    langListener = new Object();
    langListener.change = function(eventObj) {
    var target = eventObj.target;
    var newLang = target.selectedItem.data;
    MyLocale.setXMLLang(newLang);
    MyLocale.start();
    lang_cb.addEventListener("change", langListener);
    // Force Japanese
    lang_cb.selectedIndex = 1;
    lang_cb.dispatchEvent({type:"change"});
    Layer--language ex Fr:
    // Forces combobox to have the correct value
    on (release) {
    var component = _parent.lang_cb;
    for (var i=0; i< component.length; i++) {
    var item = component.getItemAt(i);
    if (item.data == "fr") {
    component.setSelectedIndex(i);
    component.dispatchEvent({type:"change"});
    break;
    ex Ja :
    // Forces combobox to have the correct value
    on (release) {
    var component = _parent.lang_cb;
    for (var i=0; i< component.length; i++) {
    var item = component.getItemAt(i);
    if (item.data == "ja") {
    component.setSelectedIndex(i);
    component.dispatchEvent({type:"change"});
    break;
    When I change the language in p1 , the language is also modified in p2, p3 and p4
    however , after a navigation in p2, p3 and p4 , once I come back in p1 , the default language is back automatically although I did not touch the language bar!!
    I don't know how to solve the problem
    to my mind , the script reset itself each time I come back on p1
    is there a way to keep the saved settings even when I am back on p1 until I modify manually again the language bar
    thanks a lot

  • I am deperately trying to change the background color dynamically ?

    Hello everybody,
    i am actually working on a portfolio website. I want the
    background color change each time we click on a button on the
    navigation bar. My problem is that when you click on a button it
    changes the background from the start
    (white background), not from the previous one clicked.
    i am trying to make the effect on this site
    www.mecompany.com.
    can someone please help me, i am in despair.
    thanks

    Hi ZAXSCD,
    You can change the background color of a PDF document by following the steps mentioned below:
    - Open PDF document in Adobe Acrobat X;
    - Click on Tools --> Pages --> Under 'Edit Page Design' select Background and then 'Add Background';
    - In Add Background window, under Source --> From color, select the color of your choice and click OK'.
    You can also refer to the screenshots mentioned below:

  • Changing the Category Lables dynamically

    Hello,
    I am new to Xcelsius and i am trying to create an Xcelsius report that can change category labels (X-Axis) dynamically. For example, For Region1, the categories could be Mens Clothing, Womens Clothing and Childrens Clothing. For Region 2, the categories could be Mens Clothing, Mens Shoes, Womens Clothing and Childrens Clothing. Can the chart be generated using Xcelsius
    Any help regarding this will be greatly appreciated,
    Thanks,
    KP

    Thank you all for your answers. I am afraid i might need a little bit more of a hand holding.
    I am using a listbox to select the series i want to display. In the listbox, there is a destination cell for values. However I dont see any destination cells for Category labels.
    I could assign the a5 thru a10 as the Category label and I will keep this empty. When I select Region 1, the value in cell a5 should be 'Men's Categories' while when i select Region2, it should be 'Women's Categories'. I am not sure how to update this range dynamically. You mentioned something about VLookup but if you could give more detailed explanation, that would be really great.
    Thanks and sorry for the inconvenience.
    KP

  • Dynamically changing the prompt on ksh

    Hi ,
    I couldn't find a better forum to post this query, that's why I put it under Installation.
    How do you make sure that the ksh prompt displays the current directory as well? I tried various combinations...even the examples say that PS1="[! $PWD]" should work, but that doesn't seem to work on ksh. Can anything be done to ensure that the prompt changes whenever I change the working directory?
    Thanks in advance,
    Amrith.

    Hi,
    I have no idea about changing the text element dynamically.
    But you can refresh the screen by the following sample coding.
    You can accomplish this with a RFC enabled Function module.
    1. Create a function module. The only functionality will be to wait for 10 secs.
    2. Create a subroutine which will set a user-command.
    3. and at user-command call the function module.
    Below is the code, I found on the web. It is quite simple..
    DATA: ZNUM LIKE SY-TABIX.
    : GET TIME.
    : WRITE: /01 'Update Number:', ZNUM, SY-UZEIT.
    : CALL FUNCTION 'Z_WAIT_30_SECS'
    : STARTING NEW TASK 'IF'
    : PERFORMING START_REFRESH ON END OF TASK.
    : AT USER-COMMAND.
    : IF SY-UCOMM = 'REFR'.
    : SY-LSIND = SY-LSIND - 1.
    : ADD 1 TO ZNUM.
    : GET TIME.
    : WRITE: /01 'Update Number:', ZNUM, SY-UZEIT.
    : CALL FUNCTION 'Z_WAIT_30_SECS'
    : STARTING NEW TASK 'IF'
    : PERFORMING START_REFRESH ON END OF TASK.
    : ENDIF.
    : */ Program Subroutines
    : FORM START_REFRESH USING TASKNAME.
    : SET USER-COMMAND 'REFR'.
    : ENDFORM. "
    : FUNCTION Z_WAIT_30_SECS.
    : ""Local interface:
    : DATA: ZTIME LIKE SY-UZEIT.
    : GET TIME.
    : ZTIME = SY-UZEIT + 30.
    : DO.
    : GET TIME.
    : IF SY-UZEIT >= ZTIME.
    : EXIT.
    : ENDIF.
    : ENDDO.
    : ENDFUNCTION.
    Hope this helps.
    Regards,
    J.Jayanthi

  • Dynamically change the cell editor in the table control

    Hi..
         I have 3 columns in a table . of which in one column we need to change the cell editor dynamically at runtime.
    i.e for example i have  columns as carrid, connid and fldate.
    For the first 2 rows the cell editor for the carrid  clomn shud be a dropdown and from there on in the next rows for the same  carrid column it shud be a input field.
    Can experts plz help me how to achieve this as this is very high priority issue....
    Regards,
    Madhu...

    This is actaully fairly simple to do.  You will need to add a cellVariant to your table column. You can then dataBind a context attribute to the selectedCellVariant property of the column to control which cellVariant will be used. This allows you to control row-by-row which cell editor you want to output.
    http://help.sap.com/saphelp_nw70/helpdata/EN/bd/5d9041d3c72e7be10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/EN/56/5e9041d3c72e7be10000000a1550b0/frameset.htm
    Also here is an example that I did the other day that uses Cell Variants within ALV.  This process is actually a little more complicated because you have to go through the ALV APIs.  To do this in a normal table is actually easier because you can create the cellVariant in the layout designer.
    Re: Freely-programmed value help for a single ALV cell

  • How to change the iterator collection for a table dynamically?

    Hi all,
    I am required to change the table iterator dynamically based on the some logic. Is this possible?
    Attempted this by trying to set "value" using a bean -
    value=#{backingBeanScope.chkBean.getCollectionModel}
    This bean method returns either of the below based on condition =
    #{bindings.MyVO1.collectionModel}
    #{bindings.MyVO2.collectionModel}
    Am I doing something wrong?
    Thanks,
    Srini

    have multiple VO instances and the pagedef
    iterator Binds="#{pageFlowScope.OrderBean.pageIterList.pageIterId}"
    in the bean:
    public Map getPageIterList() {
    return itrMap;
    another method in the bean:
    itrMap = new HashMap();
    put value(vo instance) for pageIterId in this map and call this method in the TF.

  • How to change the select options selection text dynamically in webdynpro abap ?

    I am using standard interface WDR_SELECT_OPTIONS.... i want to change the Selection text dynamically in my select options.I.E. if the select option is for VBELN field than i want to change its description SALES ORDER Number through Code to some other text.
    If anyone can please help me in this.

    Hi,
    You can achieve your requirement as below
    Get the range table of your selection field as below
              data lt_range_table type ref to data.
              wd_this->m_handler->GET_RANGE_TABLE_OF_SEL_FIELD(
                        exporting
                        i_id = 'VBELN'
                        receiving
                        rt_range_table = lt_range_table ).
    Update the selection field with new description - 'Your New Text'
              wd_this->m_handler->UPD_SELECTION_FIELD(
                        exporting
                             I_ID = 'VBELN'
                             I_DESCRIPTION = 'Your New text'
                             I_IS_AUTO_DESCRIPTION = abap_false
                             IT_RESULT = lt_range_table ).
    You can also pass the other parameters as per your requirement
    Hope this helps you.
    Regards,
    Rama

  • How to change the column header name dynamically based on sysdate

    Post Author: senthi_gokul
    CA Forum: WebIntelligence Reporting
    Dear All,
            i have designed some reports. i would like to change the column header dynamically based on sysdate. up to 24 months. can u help me, which add month function using the universe. i dont know if-then-else function is having the universe tool or not?

    Post Author: prasingh
    CA Forum: WebIntelligence Reporting
    Are you saying you are not able to create an object by value (select: statement) as sysdate and put it onto the headers of your report? You can use the add_months() function on the object to add the numbers of months you wish.
    Please let me knnow for more.. You can get in touch with me on [email protected] for quick reply. 

  • Change the design in iCal ?

    Hi,
    does anyone know how i can change the outer appearance of the new iCal?
    It is really annoying, when you don't see the entries in full text or wrapped.
    The text of the entries just ends and there isn't even a mouse-over function.
    If you want to read, you have to choose "information".... :-(
    Also i don't like the brown top bar....
    maybe i am not alone with this issue...??

    Hi Jenny ,
    Well there should a way to change the Corporate branding dynamically
    This is how we need to proceed ,
    Step 1 ) Prepare all different logo 's that you want to print and place them in path i mentioned above
    Step 2 ) Using profile potion we can change the Corporate branding image .
    (pls refer this : http://oraclemaniac.com/2012/02/22/change-the-default-oracle-logo-on-oracle-apps-login-page)
    Step 3 ) From controller class we can dynamically change the value of profile option .
    (pls refer this : Changing a profile value at the controller level )
    For you 2nd question :
    you can set Destination URI OA.jsp?page=/oracle/apps/per/selfservice/absence/webui/AbsenceHomePagePG&retainAM=Y
    Regards ,
    Keerthi

  • How to hide or change the design in oaf

    1. we want to hide the oracle default logo and display the department logo based on the payroll attached to the employee.
    2. how can we give a link on a custom oaf page this link must direct the end user to absence sshr screen...how can we do it?
    your contribution to this is highly appreciated!''
    many thanx to go through my post...hope som1 will respond to my thread.

    Hi Jenny ,
    Well there should a way to change the Corporate branding dynamically
    This is how we need to proceed ,
    Step 1 ) Prepare all different logo 's that you want to print and place them in path i mentioned above
    Step 2 ) Using profile potion we can change the Corporate branding image .
    (pls refer this : http://oraclemaniac.com/2012/02/22/change-the-default-oracle-logo-on-oracle-apps-login-page)
    Step 3 ) From controller class we can dynamically change the value of profile option .
    (pls refer this : Changing a profile value at the controller level )
    For you 2nd question :
    you can set Destination URI OA.jsp?page=/oracle/apps/per/selfservice/absence/webui/AbsenceHomePagePG&retainAM=Y
    Regards ,
    Keerthi

  • How to change a item type dynamically?

    Is it possible to change a item type dynamically?
    For example.
    I've got a page with 2 items. The first is a select list and the second is a date picker. The select list contains two values, 1 and 2.
    If value 1 is selected the second item needs to remain a date picker. If value 2 is selected the second item needs to become a Text Field (disabled saves state).
    Anyone got an idea?
    Thx. Frank.

    Frank,
    It's not possible to change the item type dynamically as you describe it below. However, to achieve a similar effect you could do the following:
    1) Make the Select List a Select List With Submit.
    2) Have a Date Picker AND a Text Field on the page.
    3) Make the display of the Date Picker item conditional on the relevant value having been chosen from the Select List.
    4) Make the display of the Text Item conditional on the other value having been chosen from the Select List.
    Andy
    http://atulley.wordpress.com/

  • How to change the font size in sap scripts?

    hi friends,
        i had a query regarding to SAPSCRIPT.
      how to change the font size of a text in sap script form in which it should change it  dynamically.
    is it possible to change the font size dynamically in scripts.
    one more query regarding to this only.
    i need to get the hard copy of a script .
    what is the transaction code to get the hard copy?

    Hi venkata,
    You can specify the font size either in the Character format or pharagraph format.
    You better decide it according to your requirement.  If you want to apply the same font size for the entire form create the Paragraph format and give the paragraph format in the default paragraph format.
    If you want to apply that to limited text, then create character format.
    The process of creating it is just after going inside paragraph format click EDIT-> Create Element and give the font size.
    This applies for character format also.
    Reward points if useful.
    Thanks,
    karthik

Maybe you are looking for

  • Wifi store help

    I purchased the Police remastered album and it said it would download a digtial booklet when I synced my Iphone. Problem is it never did. Am I missing something?

  • Should I Export Multiple Clips or Make One Giant One?

    I have just started to use FCE 4, and love it. However, I am running into the same problem as many other people, but can't seem to find the answer to MY question... I am editing a HD movie imported via FCE from my Canon HG10. I use the Magic Bullet L

  • Non stock material

    Dear All I want to create material codes under non stock material type. I have the following doubt for to create material code. Kindly clarify me 1. While creating PO for this material i want to capture automatic account.Not to enter account assignme

  • Compiz PKGBUILDs (compiz repo added!)

    compiz & compiz-git repo New packages added: compiz 0.3.6 & friends. Add this to to /etc/pacman.conf [compiz] Server = http://www.naderehvandi.net/arch/compiz/ News January 28th compiz:     * Added a bunch of patches from gandalfn's ubuntu packages.

  • HT5858 How do I remove an app from ipad that doesn't wiggle?

    I updated Facebook on my ipad air...afterwards, I had 2 Facebook icons on my homepage, one of which didn't allow me to remove it. Don't know what I did, but now there is a "social" icon that I can't remove...help!!