Problem in Sy-tabix value

Hi Experts,
I have a scenario like this
Itab1
A      | B | C
1050 | 10  | 88
1051 | 20  | 99
itab2
A      | D
1050 | 1
1050 | 2
1050 | 3
1051 | 4
1051 | 5
now I want to combine these values in itab3
my reslut should be
A     |  B  | C | D
1050  10   88  1
1050  10   88  2
1050  10   88  3
1051  20   99  4
1051  20   99  5
i did code like this
    LOOP AT i_tab1 INTO w_tab1.
      CLEAR w_tab3.
    w_tab3-A = itab1-A.
    w_tab3-B = itab1-B.
     w_tab3-C = itab1-C.
    APPEND w_tab3 TO i_tab3.
      loop at i_tab2 INTO w_tab2 where A = w_tab2-A.
      IF sy-tabix EQ 1.
         w_tab3-D = w_tab2-D.
         MODIFY i_tab3 INDEX sy-tabix FROM w_tab3 TRANSPORTING D.
      else.
         w_tab3-A = itab1-A.
        w_tab3-B = itab1-B.
        w_tab3-C = itab1-C.
      w_tab3-D = itab2-D.
        APPEND w_tab3 TO i_tab3
       ENDIF.
       CLEAR w_vttp.
       CLEAR w_vttk_tknum.
     endloop.
   ENDLOOP.
ENDIF.
Probelm:
When I am pocessing 2 record of itab1, the value of sy-tabix for in internal table i_tab2 is not resetting, it's picking the old value.
Can you please tell me how i can reset the sy-tabix of inner loop for the second pass of outer loop.
Thnaks
Krishan
Edited by: Krishan Kumar on Aug 2, 2008 2:40 PM

You can try it like this:
data:
  count type i value 1,
  w_line type i.
describe table i_tab1 lines w_line.
do w_line time.
read  i_tab1 into  w_tab1 index count.
  loop at tab2 into w_tab2 where A = itab1-A.
   w_tab3-A = itab1-A.
   w_tab3-B = itab1-B.
   w_tab3-C = itab1-C.
   w_tab3-D = itab2-D.
  APPEND w_tab3 TO i_tab3
  endloop.
count = count + 1.
enddo.
With luck,
Pritam.

Similar Messages

  • Sy-tabix value has changed...

    Hi Gurus,
    I  am using a code like dis...this is not the actual code m using instad m sendin u a sample program so that u can understand the problem
    There is a selecvtion for Customer.
    sort itab by kunnr.
    loop at itab.
    on change of itab-kunnr.
    wkunnr = itab-kunnr.
      read table zitab with key kunnr = itab-kunnr.
    endon.
    if itab-kunnr = wkunnr.
    wdmbtr = wdmbtr + itab-dmbtr.
    endif.
    at end of kunnr.
    ftab-kunnr = wkunnr.
    ftab-dmbtr = wdmbtr.
    append ftab.
    endat.
    endloop.
    Now my problem is that  AT END OF Kunnr is working fine for the first customer or say for single customer but when there are multiple customers  AT END OF kunnr is triggring for each entry.......
    In debug MOdei can see that as soon as read table  syntax is used the tabix value is changed....
    So Can anyone suggest what is the solution....
    Regards,
    Raman

    This is the Declaration
    DATA:  BEGIN OF ITAB OCCURS 0,
                      KUNNR      LIKE BSID-KUNNR,
                      BELNR      LIKE BSID-BELNR,
                      BUKRS      LIKE BSID-BUKRS,
                      GJAHR      LIKE BSID-GJAHR,
                      BUZEI      LIKE BSID-BUZEI,
                      SHKZG      LIKE BSID-SHKZG,
                      VALUT      LIKE BSID-ZFBDT,
                      SGTXT(70)  TYPE  C,
                      ZFBDT      LIKE BSID-ZFBDT,
                      ZBD1T       TYPE BSID-ZBD1T,
           ZBD2T       TYPE BSID-ZBD2T,
           ZBD3T       TYPE BSID-ZBD3T,
           REBZG       TYPE BSID-REBZG,
           NETDT       TYPE BSID-BUDAT,
                      ZUONR      LIKE BSID-ZUONR,
                       BLART      LIKE BSID-BLART,
                      DMBTR      LIKE BSID-DMBTR,
                      SPART       TYPE VBRK-SPART,
                      DAY    TYPE RFPOSX-VERZN,
                      FLAG TYPE C,
                      CITY        TYPE KNA1-ORT01,
           NAME1       TYPE LFA1-NAME1,
                     CR_DR1(4)  TYPE C,
                      PSWSL      LIKE BSID-PSWSL,
                      ZTERM      LIKE BSID-ZTERM,
                      VBELN      LIKE BSID-VBELN,
                      UMSKZ      LIKE BSID-UMSKZ,
                      KLIMK      LIKE KNKK-KLIMK,
                      VTEXT      LIKE TVZBT-VTEXT,
                      ADV        LIKE BSID-DMBTR,
                      REBZT       TYPE BSID-REBZT,
                      XBLNR      LIKE BSID-XBLNR,
                      VTEXT1(70) TYPE  C,
                       FKLIMK    LIKE KNKK-KLIMK,
                      ABC(4)     TYPE C,
                    AGRO(4)        TYPE C,
                      BIO(4)        TYPE C,
                      SKFOR      LIKE KNKK-SKFOR,
                      SSOBL      LIKE KNKK-SSOBL,
                      CTLPC      LIKE KNKK-CTLPC,
                      OEIKW      LIKE S066-OEIKW,
                      OLIKW      LIKE S067-OLIKW,
                      OFAKW      LIKE S067-OFAKW,
                     NAME1      LIKE LFA1-NAME1,
                      BUDAT      LIKE BKPF-BUDAT,
                      D_DMBTR    LIKE BSID-DMBTR,
                      S_DMBTR    LIKE BSID-DMBTR,
                      VORGN      LIKE BSEG-VORGN,
                      WERKS      LIKE BSEG-WERKS,
                      NAMESO     LIKE KNA1-NAME1,
                      NAMEAM     LIKE KNA1-NAME1,
                      NAMERM     LIKE KNA1-NAME1,
                       NAMEDR     LIKE KNA1-NAME1,
       END OF ITAB.

  • SY-TABIX value of a loop in other loop in other loop.

    Hello Gurus,
    I have a problem i want to modify some columns in final internal table and it is possible by using Transporting and Index but when i see SY-TABIX value it is not really giving particular loop iteration value. Because my present loop is in another loop and it is in another loop. Please gurus help me out
    or
    How to Insert particular filed columns  and how to use where clause in insert..
    Thanks.

    Hi !
    Here are things you could do:
    1. You can use nested loops with the WHERE statement on the inner loop. But this can be slow.
         This will look like this
                   loop at i_tab1 into wa1
                   loop at i_tab2 into wa2 where cond1 = wa1-cond1....
                     (   move wa2-field3 to wa1-field3.....)
                        modify i_tab1.
                   endloop.
                   endloop.
    2. You can use the parallel cursor technique as suggested above.
         This technique speeds up processing of data significantly. Here it is:
         data lv_tabix type i.
              sort i_tab1 by field1 ascending.
              sort i_tab2 by field1 ascending.
              loop at i_tab1 into wa1
              read table i_tab2 transporting no fields with key cond1 = wa1-cond1 binary search.
              lv_tabix = sy-tabix.
                   loop at i_tab2 into wa2 from lv_tabix.
                        if wa2-cond1 <> wa1-cond1.
                                   exit.       
                         endif.
                   ( move wa2-field3 to wa1-field3.....)
                        modify i_tab1.
                    endloop.
              endloop.
    Please let me know if you want more explanation

  • Decrease sy-tabix value in Loop

    Hi Experts,
    I need to know that is it possible that we can decrease or change value of SY-TABIX.
    EXAMPLE:
    I am using a;
    loop at itab.  --> at this stage sy-tabix is 1.
    for instance current value of sy-tabix is changed to 4 and now I want to make it 3.
    in this case I want to read the 3 value in loop again.
    So is it possible that I can change my SY-TABIX value from 4 to 3 and read that 3rd record in the loop?
    endloop.
    can anyone let me know.
    thanks in advance.
    Regards,
    Yahya

    Hi
    this is not possible directly to change the values of system variables
    but the other way is there
    what you can do is to move the valuw of sy-tabix in a variable and then loop through the table to that value,
    like:
    lv_tabix like sy-tabix.
    loop at itab into wa where sy-tabix = lv_tabix.
    after loop statement.
    lv-tabix = sy-tabix.
    you code............
    before enloop .
    lv_tabix = sy-tabix - 1.
    endloop.
    I am not sure about the above code but you can try something like above.
    Thanks
    Lalit

  • Outputting sy-tabix value in serial number.

    Dear expert,
    I have all the data stored in the internal table. I need to output it in the same serial number as it is in internal table along with the serial number (sy-tabix value) against this internal table data in report output display.
    Thanks in advance.

    Hi,
    Loop at itab.
    Itab-serialnum = sy-tabix.
    Modify Itab.
    endlloop.
    Naxt call alv display by passing the serial num filed catalog.
    Prabhudas

  • Problem in getting parameter value from selection screen in web dynpro abap

    Hi,
    I am facing problem in getting parameter value from selection screen.
    Please find my code below:
    DATA LT_PAR_ITEM TYPE IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM.
    FIELD-SYMBOLS:<FS_PAR_ITEM> LIKE LINE OF LT_PAR_ITEM,
                                 <FS_OBJ_USAGE>    TYPE REF TO data.
      WD_THIS->M_HANDLER->GET_PARAMETER_FIELDS( IMPORTING ET_FIELDS = LT_PAR_ITEM ).
      LOOP AT LT_PAR_ITEM ASSIGNING <FS_PAR_ITEM>.
        CASE <FS_PAR_ITEM>-M_ID.
          WHEN `OBJ_USAGE`.
             ASSIGN <FS_PAR_ITEM>-M_VALUE->* TO <FS_OBJ_USAGE>.      
    [ Here, sy-subrc is 4,  <FS_OBJ_USAGE> is not assigning.]
        ENDCASE.
      ENDLOOP. 
    So, can any one solve this problem.
    Thanks in advance,
    Radhika

    Hi Radhika,
    Try using GET_RANGE_TABLE_OF_SEL_FIELD...
    Please Refer below code..
       DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA: RT_CARRID TYPE REF TO DATA.
      DATA: ISFLIGHT TYPE TABLE OF SFLIGHT.
      DATA: WSFLIGHT TYPE SFLIGHT.
      FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.
    Retrieve the data from the select option
      RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
    Assign it to a field symbol
      ASSIGN RT_CARRID->* TO <FS_CARRID>.
      CLEAR ISFLIGHT. REFRESH ISFLIGHT.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE ISFLIGHT FROM SFLIGHT
                           WHERE CARRID IN <FS_CARRID>.
      NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( NAME = `FLIGHTS` ).
      NODE_FLIGHTS->BIND_ELEMENTS( ISFLIGHT ).
    Thanks,
    Regards,
    Kiran

  • I am facing a problem in passing multiple values as out parameters from fo

    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.

    user9041629 wrote:
    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.Probably not a bad thing that this isn't working for you.
    This is a horrible way to return the contents of a table.
    Are you doing this for educational purpose, or ... what is your goal here? If you just want to return a result set to a client you'd want to look in to using a REF CURSOR and not a bunch of arrays combined with horribly procedural (slow) code.

  • Problem with Selection screen values of an authorization variable

    hi Gurus,
    I have an authorization variable for Division in my queries....Now whenever a user tries to run the query...a list of divisions is available to him....All divisions for which he/she has proper roles assigned.
    Now the problem is that these values are not restricted to the ones relevant to that query (namely the multi provider)
    Eg. for a Flowers Query (divisions relevant to Flowers only) all the divisions (including the ones for Vegetables, Crops etc.) are also visible only because these roles are also assigned to the same user. This needs to be avoided.
    In a nutshell....
    Is their any way by which i can restrict the number of values popping up for an authorization variable in the selection screen, to only those values which are relevant to the info-provider on which the queries are based ???

    hi Deepu,
    I did go through that SAP note. I just have one concern regarding that. The check at the Info provider level is clear enough and i already have that in place. Now there are 2 more checks required a) at the info object level and b) at the BEX designer level.
    Are all three checks required???
    and also how do you  place the check at the BEX level??? i could not quite figure that one out...
    Any inputs would be welcome.
    Thanks,
    Nikhil

  • Problem when defaulting a value to the field

    Hi CRM Experts,
    I am new to CRM, i am facing a problem when defaulting a value to the field in the Tcode 'SOLMAN_WORKCENTER' (Solution Manager Server).
    when i am defaulting it is displaying fine in the view( Redefined the getter method there i passed the value), i set a break point in the getter method when i am executing the getter method i am unable to get the defaulted value in the importing parameter value, but i am getting the value here when i used to type manually in the filed, i cant understand why it is behaving like that? please can any body help in this regard...
    Thanks in advance
    Hari..

    There are other ways to get the string-value of an enum (format into string with a %s formatter for instance).
    But I have no idea what you are seeing.
    However I would not use the enum to string technique chose you have, just add the enum to the 'file' VI as an input.
    And the =0 comparison you have is useless, add the enum to the case structure as the selector.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Problem to fetch aquisition value

    hi,
    i am facing the problem to fetch aquisition value.
    my smart form working fine if equipment is not goes for AUC settlement but when it goes for settlement then i m not getting the aquisition value for deptt.
    since after settlement equipment assign with a new asset number. so i m not getting the exect field to get the aquistion value.
    b4 that i m using aqistion value for deptt is kansw from anlc table but it fails under settlement.
    i got one field AIBN1 in ANLA for new asset number under settlement but not sure about the amount that where it will b.
    since in our dev system data is not there so i m not sure that where i will get the aquision value, i hav track one field in ANLA (URWRT) or field will be same KANSW for new asset number in ANLC..
    please help me if u can?
    thanks in advance and marks will be sure for each helpfull answer*
    regards
    vijay

    Hi Vijay,
    Yes the field is right. It will store the original asset number.
    Regards,
    Atish

  • Script- problem in printing the values in from internal table

    Hi all,
    I have a requiremnt that i for a particular document no there are number of invoices are there. i.e for a single document no there are 20 invoices in that. i shoudl display the invoice number , invoice date, invoice amount , number of days of intrest , start date of interest, end date of interest and intrest amount.
    The problem is i should take the invoice number, invoice date, number of days  from TABLE <b>BSEG</b> and  inovice amount and start date, end date from table<b> INTITIT</b>.  for a particular document number there are diffent invoce numbers in both the table.
    i can display everthing but the prob is with invoice amount. it is repating only one values is displying in the ouput. The invoice number in INTITIT Is not changing. I have to write the syntax for that .Please help me The value in Bseg is chaing as per given syntax shown below.
    data:   begin of hbseg occurs 10.
            include structure hsortp.
            include structure bseg.
    data:   end of hbseg.
    data: begin of hsortp,
            sortp1 like sortp1,
            sortp2 like sortp2,
            sortp3 like sortp3,
            sortp4 like sortp4,
            sortp5 like sortp5,
            EKVBD  LIKE KNB1-EKVBD,
          end   of hsortp.
    loop at hbseg.
            WHERE BUKRS = SAVE_BUKRS.
              save_bukrs  = hbseg-bukrs.
              if  ( hbseg-kunnr = save_kunnr
              and   not save_kunnr is initial )
              or  ( hbseg-lifnr = save_lifnr
              and   not save_lifnr is initial ).
               clear bseg.
                move-corresponding hbseg to bseg.
                 *bseg = bseg.
                if bkpf-waers ne *bkpf-waers.
                  perform curr_document_convert_bseg
                              using
                                 bkpf-budat
                                 *bkpf-waers
                                 *bkpf-hwaer
                                 bkpf-waers
                              changing
                                 bseg.
                  if not bseg-pycur is initial.
                    alw_waers = bseg-pycur.
                    perform currency_get_subsequent
                                using
                                   save_repid
                                   bkpf-budat
                                   bkpf-bukrs
                                changing
                                   alw_waers.
                    if alw_waers ne bseg-pycur.
                      bseg-pycur = alw_waers.
                      perform convert_foreign_to_foreign_cur
                                  using
                                     bkpf-budat
                                     *bkpf-waers
                                     *bkpf-hwaer
                                     bseg-pycur
                                  changing
                                     bseg-pyamt.
                    endif.
                  endif.
                endif.
                perform fill_waehrungsfelder_bseg.
                perform fill_waehrungsfelder_bseg_2.
                if bseg-sgtxt(1) ne '*'.
                  bseg-sgtxt = space.
                else.
                  bseg-sgtxt = bseg-sgtxt+1.
                endif.
                clear save_bschl.
                clear save_umskz.
                clear tbslt.
                save_bschl = bseg-bschl.
                save_umskz = bseg-umskz.
                perform read_tbslt.
    ADDING VARIBLE V_GSALDF BY SUNIL 5.11.07******
               v_gsaldf = rf140-gsaldf + rf140-wrshb.
               rf140-gsaldf = v_gsaldf.
               clear v_gsaldf.
    SUNIL *********************
                 *rf140-gsaldf = *rf140-gsaldf + *rf140-wrshb.
                if  xmultk is initial
                and xactiv is initial
                and linecnt = '1'
                and not      xumsst is initial
                and not save_xumstn is initial.
                  if bkpf-bstat = 'V'.
                    perform read_vbset.
                  else.
                    perform read_bset.
                  endif.
                  describe table hbset lines linecnt.
                  if linecnt = '1'.
                    loop at hbset.
                      move-corresponding hbset to bset.
                       *bset = bset.
                      if bkpf-waers ne *bkpf-waers.
                        perform curr_document_convert_bset
                                    using
                                       bkpf-budat
                                       *bkpf-waers
                                       *bkpf-hwaer
                                       bkpf-waers
                                    changing
                                       bset.
                      endif.
                      clear rf140-msatz.
                      clear rf140-vtext.
                      save_ktosl = bset-ktosl.
                      perform read_t687t.
                      rf140-msatz = bset-kbetr / 10.
                       *rf140-msatz = rf140-msatz.
                      rf140-vtext = save_vtext.
                       *rf140-vtext = rf140-vtext.
                      if bset-shkzg = 'H'.
                        rf140-mwshb = bset-fwste.
                         *rf140-mwshb = *bset-fwste.
                        rf140-mdshb = bset-hwste.
                         *rf140-mdshb = *bset-hwste.
                      else.
                        rf140-mwshb = 0 - bset-fwste.
                         *rf140-mwshb = 0 - *bset-fwste.
                        rf140-mdshb = 0 - bset-hwste.
                         *rf140-mdshb = 0 - *bset-hwste.
                      endif.
                      exit.
                    endloop.
                    rf140-wrshb = rf140-wrshb - rf140-mwshb.
                     *rf140-wrshb = *rf140-wrshb - *rf140-mwshb.
                    rf140-dmshb = rf140-dmshb - rf140-mdshb.
                     *rf140-dmshb = *rf140-dmshb - *rf140-mdshb.
                  endif.
                endif.
    *****************Begin of Change by Karthikeyan J********************
                i_count = i_count + 1.
                clear rf140-element.
                clear: it_bseg, i_wrbtr,i_totday,i_tempday,i_day,i_bday.
    comparing with fields belnr AND SELECT * FROM INTITIT added by sunil 3.11.07*********
                select single * from bseg into
                corresponding fields of it_bseg where belnr = bseg-rebzg  anD GJAHR = BSEG-GJAHR.
                select single * from intitit into corresponding fields of  it_intitit where gjahr = bseg-gjahr and belnr_to = bseg-belnr and buzei = '2' OR BELNR = INTITIT-BELNR .
    added by Jayshree on 09/01/2007
                MOVE ' ' TO it_kna1-name1.
                SELECT SINGLE name1
                INTO CORRESPONDING FIELDS OF it_kna1
                FROM ( vbpa AS a INNER JOIN kna1 AS b ON akunnr = bkunnr )
                WHERE a~vbeln = it_bseg-vbeln
                  AND a~parvw = 'zd'.
                SELECT SINGLE fkdat
                INTO CORRESPONDING FIELDS OF it_kna1
                FROM vbrk
                WHERE vbrk~vbeln = it_bseg-vbeln.
    added by Jayshree on 01/02/2007
              CONCATENATE  it_kna1-fkdat6(2) it_kna1-fkdat4(2) it_kna1-fkdat+2(2)
                INTO vfkdat SEPARATED BY '.'.
              CONCATENATE  it_bseg-augdt6(2) it_bseg-augdt4(2) it_bseg-augdt+2(2)
                INTO vaugdt SEPARATED BY '.'.
                i_wrbtr = i_wrbtr + it_bseg-wrbtr.
    added as on 29.06.2007 by jayshree again transport  on 21.07.2007
                tot_wrbtr = tot_wrbtr + i_wrbtr.
                i_totday = it_bseg-zbd1t + it_bseg-zbd2t + it_bseg-zbd3t.
                CALL FUNCTION 'fima_date_create'
                  EXPORTING
                    i_date                        = it_bseg-zfbdt
                 I_FLG_END_OF_MONTH            = ' '
                 I_YEARS                       = 0
                 I_MONTHS                      = 0
                   i_days                        = i_totday
                 I_CALENDAR_DAYS               = 0
                 I_SET_LAST_DAY_OF_MONTH       = ' '
                 IMPORTING
                   e_date                        = i_bday
                 E_FLG_END_OF_MONTH            =
                 E_DAYS_OF_I_DATE              =
    added by JAYSHREE 01.02.2007
                CONCATENATE  i_bday6(2) i_bday4(2) i_bday+2(2)
                INTO vbday SEPARATED BY '.'.
                i_day = it_bseg-augdt - i_bday.
            CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
              EXPORTING
                date1                         = it_bseg-zfbdt
                date2                         = it_bseg-augdt
               OUTPUT_FORMAT                 = '01'
             IMPORTING
               YEARS                         =
               MONTHS                        =
               DAYS                          = i_day
             EXCEPTIONS
               INVALID_DATES_SPECIFIED       = 1
               OTHERS                        = 2
            IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    *added by sunil 5.11.07 ***********
    *read table it_intitit with key BELNR_TO = BSEG-BELNR  .
    *LOOP AT IT_INTITIT.
                rf140-element = '521'.
                CALL FUNCTION 'write_form'
                  EXPORTING
                    window  = 'main'
                    element = '521'
                  EXCEPTIONS
                    window  = 1
                    element = 2.
                IF sy-subrc = 1.
                  window = 'main'.
                  PERFORM message_window.
                ENDIF.
                IF sy-subrc = 2.
                  window = 'main'.
                  ereignis = '521'.
                  PERFORM message_element.
                ENDIF.
                IF save_xumstn IS INITIAL.
    *-------Umsatzsteuer -
                  IF xactiv IS INITIAL.
                    save_waers = rf140-waers.
                    PERFORM tax_data.
                    CLEAR taxlines.
                    DESCRIBE TABLE atax LINES taxlines.
                    IF NOT taxlines IS INITIAL.
                      LOOP AT atax.
                        CLEAR ereignis.
                        CLEAR rf140-msatz.
                        CLEAR rf140-vtext.
                        rf140-msatz = atax-msatz.
                         *rf140-msatz = atax-msatz.
                        rf140-vtext = atax-vtext.
                         *rf140-vtext = atax-vtext.
    *******begin of change by karthikeyan on 10.03.06*********************
                        IF sy-tabix = '1'.
                          ereignis = '522'.
                          v_stax = rf140-msatz * rf140-gsaldf / 100.
                        ELSE.
                          ereignis = '523'.
                          v_ecs = rf140-msatz * v_stax / 100.
                          v_total = rf140-gsaldf + v_stax + v_ecs.
                        ENDIF.
                        CALL FUNCTION 'hr_in_chg_inr_wrds'
                          EXPORTING
                            amt_in_num               = v_total
                          IMPORTING
                            amt_in_words             = v_spell
                        EXCEPTIONS
                          DATA_TYPE_MISMATCH       = 1
                          OTHERS                   = 2
                        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                        ENDIF.
    ***************************end of change******************************
                        CLEAR rf140-element.
                        rf140-element = ereignis.
                        IF NOT ereignis IS INITIAL.
                          CALL FUNCTION 'write_form'
                            EXPORTING
                              window  = 'main'
                              element = ereignis
                            EXCEPTIONS
                              window  = 1
                              element = 2.
                          IF sy-subrc = 1.
                            window = 'main'.
                            PERFORM message_window.
                          ENDIF.
                          IF sy-subrc = 2.
                            window = 'main'.
                            PERFORM message_element.
                          ENDIF.
                        ENDIF.
                      ENDLOOP.
                    ENDIF.
                  ENDIF.
                ENDIF.
               ENDLOOP.
              ENDIF.
            ENDLOOP.
    '521' is the element name in the main  window where i should display the values. before select qurey the values are coming in the bseg but not in table INTITIT.  Belnr is the document no with ref to that
    there are number  of invoices nos. so in both the tables it is selecting single value and displaying but in bseg the invoice number is getting refreshed and new number is coming in that place i.e in field bseg-rebzg but in INTITIT  in belnr only it is taking single value it is not getting refreshed.
       move-corresponding hbseg to bseg.
                 *bseg = bseg.
                if bkpf-waers ne *bkpf-waers.
    this is the syntax whr the values in bseg are getting refresh and new invoice number is selecting.
    How to write the syntax for INTITIT? As per invoice number it is giving new values.
    The invoice number in Bseg is different campare to in table INTITIT. in output is shoud show the fields as follows
    it_besg-rebzg(invoice number of besg) it_besg-zuonr(invoice date) INTITIT-INT_BASAMT(base amount) i_day (no of days ) INTITIT-INT_BEGIN (INTREST START DATE) INTITIT-INT_end(INTREST END DATE)  rf140-wrshb(INTREST AMOUNT).
    THE VALUE OF IT_BESG-REBZG IS CHANGING  BUT THE VALUE IN INTITIT-BELNR ( INVOICE NUMBER) IS NOT CHANGING THAT IS WHY IT IS SHOWING
    ONLY SINGLE RECORD.
    for both the table documet no is same. in besg-belnr is the document no. in intitit-BELNR_TO is the document no.
    here in bseg-rebzg is chaning but in INTITIT-BELNR IS  not changing.
    If i take loop at INTITIT. ALL the values are repating so i am unable to take loop. so i want to write
    a syntax such that intitit-belnr should be refreshed and also for every loop it shoud take new invoice no.
    Please help me out it is very urgent.
    <b>USEFUL ANSWERS WILL BE REWARDED.</b>
    regards,
    Sunil kumar.

    assumption: some mistake in ur posting that, How belnr and date r same for both header records, so i guess, either one is different.
    try with AT NEW - ENDAT.
    AT NEW belnr.
    here use looping, READing of ur itabs.---> so, u need to build couple of itabs to move forth and back.
    ENDAT.
    pls. note that, when u use this AT NEW all the CHAR fileds of itab wuld show as STARS **.....so, this is the necessity behind building new itabs.
    thanq
    Edited by: SAP ABAPer on Dec 30, 2008 6:24 PM

  • Problem with SY-TABIX?

    Hi all,
    I am using one FM in my application, at one place i am reading table using sy-tabix. But it is showing 0 even table contains values.
    In some other place in this code tabix is working. perticular in that place it is not working.
    And i check this by executing se37 there it is working fine...
    Here the code..
      SELECT   vbeln  vkorg  vtweg  kunnr spart  FROM vbak INTO  TABLE it_vbak
                     where vbeln  in  s_vbeln.
    IF it_vbak[] IS NOT INITIAL.
        SELECT  kunnr   "Customer Number 1
                adrnr   "Address
          FROM kna1 INTO CORRESPONDING FIELDS OF TABLE it_kna1
          FOR ALL ENTRIES IN it_vbak
          WHERE kunnr = it_vbak-kunnr.
    //Here sy-tabix always showing 0.    
    READ TABLE it_kna1 INTO wa_kna1 INDEX sy-tabix.
        IF sy-subrc = 0.
          gv_kunnr = wa_kna1-kunnr.
        ENDIF.
    In some other place it is working...
          SELECT  lifnr     "ACCOUNT NUMBER OF VENDOR OR CREDITOR
                  adrnr     "ADDRESS
            FROM lfa1
            INTO CORRESPONDING FIELDS OF TABLE it_lfa1
            FOR ALL ENTRIES IN it_knvp
            WHERE lifnr = it_knvp-lifnr.
        ENDIF.
        READ TABLE it_lfa1 INTO wa_lfa1 INDEX sy-tabix.   // Here it is working.  
    IF sy-subrc = 0.
          gv_lifnr = wa_lfa1-lifnr.
        ENDIF.
    Can anyone give me any suggetions.. i think code is correct, any fault is there...
    Tahnks,
    Venkat.

    Venkat,
    There are two selects, 1 from KNa1 and other from LFA1 and a read statement after each select.
    For your first select, your sy-tabix will always be 0. Sy-tabix will be filled with Loop or read. Now when execution reaches your second statement of read, the sy-tabix is already filled by the first read.
    So, two things: 1. Always use debugging, 2. please explore yourself first on these issues. You can use sy-dbcnt which fills with the total number of records returned.
    Regards,
    Santosh

  • Having problem to get the value from radio button

    i am doing my double module project for my degree course and i am also a newbie in JSP. Hope there is someone can help me to solve this problem. Now, i set the value of a radio button to "don't smoke", "smoke lightly", and "smoke heavily". Then i use request.getParameter ("smoking behavior") to get the value selected by the user, but the result is only "don't" or "smoke", which the character after spacing will be not be retrieved. I dun know how to solve it, so can any expert here help me to solve this problem? Thanks for helping.

    Why do you have to use whitespace. If your radio button group is name smokingBehavior - no whitespace, wouldn't it just make sence to have values of don't, lightly and heavily. This would solve the problem easily. If your teacher is being a pain in the a&!, and requires you to use whitespace for your naming variables I guess you could insert %20 between the two words and unescape the value on the server side. This seems like a lot of unnecessary work and a silly solution - good luck!

  • .MSG files. Problem with getting requested values from crawled properites

    Hi
    I have a lot of msg files on my file server. I use SharePoint Enterprise Serach engine to crawl all these MSGs.
    I would like to get extra managed properties out of these files. I am most interested in getting Mail:5(text) / Mail:12(Date and Time) / Mail:53(Date and Time) from MAIL category in Managed Properties.
    This thread is very similar to one already posted by SpinnerUp:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/82d69df0-5cb2-4e51-a485-34209e111f4b/problem-with-crawling-msg-files-doesnt-seem-to-return-requested-values-from-crawled-property
    Please be aware that I do not use Public Folders. These MSGs are exproted from Outlook and are stored on File Server not Exchange.
    I tried to link Crawled Properties to new property however I cannot get any results back.
    Thank you for you help.
    Regards, Marcin (Please mark as helpful or answered if it helps)

    Thank you for your replay.
    However I am not keen to write custom connector at this stage.
    Is it possible to simply get "Subject", "Sent", "Received" info from msg file and then map it to managed properties.
    Does SharePoint create any crawled properties which contain information about let's say "Subject" which then can be used to create managed properties?
    I tried playing with "MAIL" properties however I cannot get them to work. I guess this is because the file is a msg file rather than mail which is stored in Exchange Public Folder.
    Regards, Marcin (Please mark as helpful or answered if it helps)

  • Oracle report problem-Passing a column value from a query block to another

    Hi I am facing a problem in oracle reports.
    I have 3 query blocks say Q1,Q2 and Q3.
    From Q1 I get a tblkey coulmn and for each value of tblkey I need to pass it on to Q2 which gives me a status and now finally Q3 will take tblkey and status to give me final output.
    Can somebody please tell me how I can do it?
    Thanks,
    Avin

    Depending on your report requirement, you may do a join of Q1, Q2, and Q3; or keep all Qs and for Q3 use subqueries ...
    Select ... from ... where tblkey, status in (
    select tblkey, status from ... where tblkey in (
    select tblkey from .... where .... ) )
    Good luck.
    DC

Maybe you are looking for