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

Similar Messages

  • Problem in Summing the value in one internal table. Its very urgent.

    Hi Experts,
    I have 10 fields in one internal table and based on the 8th field changing, I have to sum the 3rd field.
    I am unable to use AT END OF <FIELD8>, because any of the fields from 1 to 7 are changing, then this control break statement triggering.
    Could any body tell me, how I have to do this.
    Thanks,
    bsv.

    Hi,
    I think it could be as simple as below.
    DATA: l_field8 TYPE bla bla.
    READ TABLE itab
         INTO wa_itab
         INDEX 1.
    l_field8 = wa_itab-field8.
    LOOP AT itab INTO wa_itab.
         IF l_field8 NE wa_itab-field8.
              "Do the sum here
         ENDIF.
    ENDLOOP.
    Regards,
    Teddy
    Edited by: Teddy Kurniawan on Jan 25, 2008 8:38 AM

  • Sap script: Printing the values got from work area in a row

    Hi ,
    I need to print the values which I m getting from a work area like
    A1     A2
    A3     A4
    and so on
    but I m getting it as
    A1
    A2
    A3
    A4.
    Any solutions to this will be highly appreciated.
    Regards,
    Vivek

    Dear vivek,
    how is your work are structure - is it only with single field ?
    In your script after the each value give an extended line comman "=" which will take first and second values for print and after the second value give "line feed" or "carriage return"  command.
    Hope this solves your problem
    Thanks
    venugopal
    Reward accordingly

  • Problem in Printing the values in SAP Script

    Hi,
    I have to print the material, description, quantity and value in the invoice.. the problem i face is.. the variables which is of size 40 characters. only prints the data and gets trimmed because of which the data displayed in the invoice not in order.
    can any one tell me how to find the length of the variable or is there any way to protect the variable from getting trimmed.
    Advance Thanks..
    Guhapriyan S

    Hi again,
    1. what problem are u facing ?
      (there is no sapscript symbol / system symbol
       for finding out the length )
      (In abap u can use strlen)
    2.  data and gets trimmed
       what is the meaning of it ?
    3. do u mean to say that  !
      ABCDEF                     123 45
      GEF                        123 45
      is getting pritned like
      ABCDEF 123 45  ?
      GEF  123 45
    4. If so , then use TABS
    5. This happens because SPACE
       is different in different varlues of
       ABCDEF and GEF !
    regards,
    amit m.
    Message was edited by: Amit Mittal

  • In Scripts how to print the values in currence format

    Dear abap guru's,
    I am working on Purchase Order Script, copy from the standard script, after that wrote a one perform , in that added one new field to script, but value is printed like this formate : 1000.00, but i want to print 1,000.00 like this currence format. let me know the any solution
    thanks to all
    raj.

    Hi ,
    When you are populating the value in perform instead of assigning the value (using = ) pass it using WRITE TO.
    Like :  WRITE lw_total TO output-value.
    Declare lw_total as currency field.
    Regards,
    Rajitha.

  • Problem in moving the data into final internal table

    Hello all,
    I am stuck in apeculair situation.
    I have a internal table having header record and a internal table having its line items.
    Header record ::    90006103  A   20080110   ALBERTA    3456
    Detail   record ::    90006103  D2  2219CR1710441
                               90006103  D2  2219M11710443
                               90006103  D2  2219M21710442
                               90006103  A    20080115   ALBERTA    3456
                               90006103  D2  2219CR1710441
                               90006103  D2  2219M11710443
                               90006103  D2  2219M21710442
    I collected the header record in one internal table and another internal table having all the line items.But the problem is when i am moving the values to the final inernal table i am getting the same payment date
    20080110 (Date field in first record of header internal table) for all the line items .
    But my requirement is that date should be 20080110 for the first 3 line items of first header record and similarly date should be 20080115 for all the line items of the next header record.
    Kindly suggest.
    Regards,
    Arun

    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

  • To pass the value to final internal table

    hi all,
    in the report i have a select query has below
    SELECT SINGLE belnr
              INTO (l_belnr)
              FROM bkpf
              WHERE bukrs = ls_bseg-bukrs
               AND gjahr = ls_bseg-gjahr.
    i have an internal table gt_values , in this almost i have 1500 entries.
    with field  has BELNR.
    now i need to check l_belnr exists in GT_VALUES-BELNR OR NOT.
    IF EXISTS i need to pass the belnr to GV_BELNR.
    do we need to use LOOP and ENDLOOP or we have any other option.
    PLEASE help me how to proceed in writing code for this.

    Use read table statement.
    Read table GT_VALUES with key belnr = l_belnr.
    if sy-subrc = 0.
    move l_belnr to GV_BELNR.
    endif.

  • Problem in move the data to final internal table.

    hi,
    iam having 3 internal table.
    1. g_t_vbrk  (having data for vbrk table)
    2. g_t_vbak (having data for vbak table)
    3. g_t_likp   (having data for likp table.)
    actually i have written the loop like below .
    LOOP AT g_t_vbrk.
        READ TABLE g_t_vbfa WITH KEY vbeln = g_t_vbrk-vbeln.
        IF sy-subrc = 0.
          MOVE : g_t_vbrk-vbeln TO g_t_output_raw_header_data-vbeln,
                 g_t_vbrk-taxk1 TO g_t_output_raw_header_data-taxk1,
                 g_t_vbrk-taxk4 TO g_t_output_raw_header_data-taxk4,
                 g_t_vbrk-fkart TO g_t_output_raw_header_data-fkart,
                 g_t_vbrk-inco1 TO g_t_output_raw_header_data-inco1,
                 g_t_vbrk-inco2 TO g_t_output_raw_header_data-inco2,
                 g_t_vbrk-zterm TO g_t_output_raw_header_data-zterm,
                 g_t_vbrk-kunag TO g_t_output_raw_header_data-kunag.
          READ TABLE g_t_vbak WITH KEY vbeln = g_t_vbfa-vbelv.
          IF sy-subrc = 0.
            MOVE : g_t_vbak-vkorg TO g_t_output_raw_header_data-vkorg,
                   g_t_vbak-auart TO g_t_output_raw_header_data-auart,
                   g_t_vbak-spart TO g_t_output_raw_header_data-spart,
                   g_t_vbak-vtweg TO g_t_output_raw_header_data-vtweg.
          ENDIF.
          APPEND  g_t_output_raw_header_data.
    endloop.
    my question is i want to move likp table lfdat field to that final internal table with same loop.
    i want to write move statement with same loop.
    pls help with coding wise.
    thanks
    santhosh

    Hi
    In the loop.
    SELECT VBELN FROM VBFA
                  INTO V_VBELN
                  WHERE VBELV = G_I_VBRK-VBELN
                   AND VBTYP_N = 'M'
                   AND VBTYP_V = 'J'.
    Now READ from your LIKP internal table.
    READ TABLE G_I_LIKP WITH KEY VBELN = V_VBELN.
    Write your MOVE statements here.
    Regards
    Surya.

  • Get the records number from internal table with conditon.

    Internal table itab got more than 1000 records,now i need to get the number of records with condition that itab-field1 = 'XXXX'.
    actully, i got an inefficient logic to count the number in a loop statement. is there better way to implement it?

    Hi,
    One alternative solution, which may be useful for other parts of your program, is to have an aditional itab1 with a single column/field (field1), which acts like a index or shadow table, and which is filled simultaneously with itab. Then you can use DESCRIBE TABLE itab1 LINES lv_lines.
    Atb

  • Mapping data from internal table to SAPSCRIPT Box.

    Hi Gurus,
    I have to create a sapscript where in I should get data from standard tables and display the data in box (table format) in sapscript. I know how to get a field (perform in zprogram) into sapscript form zprogram. I dont know how I can get data (internal table) from my zprogram into sapscript and display in a box.
    Your help is highly appreciated.

    Hi David,
        consider the below example say if your zprogram having the internal table table loop and you want to print the contents line by line or in a box,
    LOOP AT tj_1irg23d.
    header line
            CALL FUNCTION 'WRITE_FORM'
              EXPORTING
                element = 'ITEM_HEADER1'
              EXCEPTIONS
                OTHERS  = 1.
    endloop.
    then in your sap script main window or where ever you want to print just straight away give your internal table fileds as follows(just for example)
    I2           ,,&J_1IRG23D-ZEILE(Z)&,,&J_1IRG23D-MATNR&,,&J_1IRG23D-CHAPID&,,
    =           &J_1IRG23D-MENGE(Z)&,,&J_1IRG23D-MEINS&,,0.0,,
    then it will bring the values of your internal table in the form.

  • How to download values in an internal table into an excel file

    is there any fn module to download the values in an internal table into an excel file..

    hi
    the function module "GUI_DOWNLOAD"  downloads the data from
    an internal table into a file (can be xl, dat ,doc etc) .
    Plz follow the usage below ;
    Parameters : pa_pfile LIKE rlgrap-filename OBLIGATORY.
    Data : lv_filename TYPE STRING.
    lv_filename = pa_pfile.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
       BIN_FILESIZE                  =
         FILENAME                      = lv_filename
         FILETYPE                      = 'ASC'
       APPEND                        = ' '
        WRITE_FIELD_SEPARATOR         = 'X'
       HEADER                        = '00'
       TRUNC_TRAILING_BLANKS         = ' '
       WRITE_LF                      = 'X'
       COL_SELECT                    = ' '
       COL_SELECT_MASK               = ' '
       DAT_MODE                      = ' '
       CONFIRM_OVERWRITE             = ' '
       NO_AUTH_CHECK                 = ' '
    IMPORTING
       FILELENGTH                    =
       TABLES
         DATA_TAB                      = tb_download         " table data to b downlaoded
      EXCEPTIONS
        FILE_WRITE_ERROR              = 1
        NO_BATCH                      = 2
        GUI_REFUSE_FILETRANSFER       = 3
        INVALID_TYPE                  = 4
        NO_AUTHORITY                  = 5
        UNKNOWN_ERROR                 = 6
        HEADER_NOT_ALLOWED            = 7
        SEPARATOR_NOT_ALLOWED         = 8
        FILESIZE_NOT_ALLOWED          = 9
        HEADER_TOO_LONG               = 10
        DP_ERROR_CREATE               = 11
        DP_ERROR_SEND                 = 12
        DP_ERROR_WRITE                = 13
        UNKNOWN_DP_ERROR              = 14
        ACCESS_DENIED                 = 15
        DP_OUT_OF_MEMORY              = 16
        DISK_FULL                     = 17
        DP_TIMEOUT                    = 18
        FILE_NOT_FOUND                = 19
        DATAPROVIDER_EXCEPTION        = 20
        CONTROL_FLUSH_ERROR           = 21
        OTHERS                        = 22
    IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards
    Pankaj

  • How to check a field value within an Internal table

    Hi Friends,
    My requirement is:
    I have a line item of PO records, in that each line item of Plant field should not diffe with other line items. If it differs or say the records have different plant values line items, then I have to throw an error message.
    Below example for better understanding.
    lineitem Plant
    010       ABC
    020       ABC
    030       XYZ
    040       LKG
    So, my report will throw an error like "All line items must be identical'.
    How to do proceed it.Please advise.
    Thanks & Regards
    Sankar.

    Hi Sankar
    first you need to fetch all the values in one internal table from your PO.
    After that create an internal table with only plant field and move all the plan values in this table.
    let assume ITAB is a table with all the values. and ITAB1 with plant only.
    wa_itab is the work area for ITAB and wa_itab1 is WA for ITAB1.
    ITAB has all the values and ITAB1 has all the values only for plant.
    delete adjacent duplicate from itab1 compairing plant.
    loop at itab1 into wa_itab1. " this will fetch all the plant values in workarea.
    read table itab into wa_itab where wa_itab-plant = wa_itab1-plant.  " this will fetch only the values matching to the table itab1
    if su-subrc <> 0.       
    message 'plants are not similar' TYPE 'E'.
    elseif sy-subrc = 0.
    write your code*.
    endif.
    endloop.
    hope this will help you.
    Thanks
    Lalit Gupta

  • Read contents of changing fields from internal table

    Hi Folks,
    Please help me in my query below:
    Consider there is a Z-table with two fields TABNAM and FIELD having values KNA1 and NAME1 respectively.
    In my report I have fetched entries for customers from KNA1. Now based on the field from Z-table I want to populate a variable suppose V_FREE_VAR with the value from KNA1 table.
    Here V_FREE_VAR is of CHAR200 so that it accomodate all types of values from KNA1.
    The value of Z-table FIELD can change daily i.e next day the value may be PSTLZ.
    So how can I read the particular field from internal table as the field to be read is dynamic.
    Note: using case is not feasible.
    Thanks in advance.
    Regards,
    Shardul

    @Hartmut P
    As Rob said i want to get the value of the field from internal table. the code is something like this.
    I_KNA1 contains records for customers.
    Suppose values of Z-table are in internal table I_TEMP_TABLE.
    Entries in I_TEMP_TABLE are as follows
    TABNAME      FIELDNAME
    KNA1                 NAME1
    The value of FIELNAME in Z-table can be changed
    Loop at I_TEMP_TABLE into WA_TEMP_TABLE.
    Read I_KNA1 into WA_KNA1 with key KUNNR = '0001002234'.
    IF SY-SUBRC EQ 0.
       CASE WA_TEMP_TABLE-FIELDNAME.
            WHEN 'NAME1'.
                 V_VAR = WA_KNA1-NAME1.
             WHEN 'PSTLZ'
                  V_VAR = WA_KNA1-PSTLZ.
    ENDIF.
    But using case is not appropriate as KNA1 contains 176 fields.

  • To get recent timestamp records from internal table

    hi all,
      i have one requirment
      i'm storing error messages in one table  while creating a sales order basing on timestamp
      which is of this format yyyy-mm-dd hh:mm:ss (random Number) 
      if i want to see the error messages left i'm getting all the error messages displayed
      for example i have created a sales order
    i got 10 errors displayed
    i have rectified 5 errors ... if i again display error messages the 10 errors + the 5 errors is getting displayed
    i want to display the 5 error messages only not the previous messages from internal table
    basing on timestamp current one has to displayed remaining has to deleted from internal table.

    I thought we used Sales Order Incompletion process for this....  but, if you're recreating the errors list every time you save with a create or change transaction then, at save, delete all rows in your error table for this document.   Then get your errors and update your db table from your current errors table.   From this viewpoint, the timestamp is not relevant.

  • Problem in printing the JTable values

    Dear Friends,
    I have to print the JTable values (on paper using print dialogue box).
    I'm using jtableObj.print to print the table values. But jtableObj.print takes more time to print the table values because it prints the values as a image(approximately 5 mins to print 10 pages).
    My code is ,
    boolean complete = tableObj.print(mode, header, footer, showPrintDialog, null, interactive,
                                  null);Could anyone please tell me how to reduce the time?
    Thanks in advance

    Hi again,
    1. what problem are u facing ?
      (there is no sapscript symbol / system symbol
       for finding out the length )
      (In abap u can use strlen)
    2.  data and gets trimmed
       what is the meaning of it ?
    3. do u mean to say that  !
      ABCDEF                     123 45
      GEF                        123 45
      is getting pritned like
      ABCDEF 123 45  ?
      GEF  123 45
    4. If so , then use TABS
    5. This happens because SPACE
       is different in different varlues of
       ABCDEF and GEF !
    regards,
    amit m.
    Message was edited by: Amit Mittal

Maybe you are looking for

  • Time Capsule is not seen by Windows Computer :(

    Hello everyone. I have a 500GB Time Capsule, I believe it is the first model that came out. I have a PC that currently has Windows 7 installed on it, and a MacBook Pro with the latest version of Snow Leopard. I have always been able to access the Tim

  • Impossible problem with iPod Photo

    Ok, so here's the kick: I joined this forum because I cannot find a solution to this problem whatsoever. I have an iPod Photo that has been sitting in a drawer for about 2 years. I just got a new car stereo and I wanted to fix my old iPod instead of

  • My bb doesn't connect to browser or app world pls help.

    i have a bb 9300 and my browser does not load, also app world doesn't work, it tells me i have to upgrade but since i cannoct connect to the browser i cant do it. i cannot connect my emails either although apps such as fb work.. whats the problem and

  • Replication CRM contact person to R3 as contact person

    Hi, I'm trying to replicate CRM contact person from CRM to R/3 via MW. First initial created from R/3 to CRM. In the daily business the agent will create a new contact person thru the Call center transaction in CRM. (web client) How I can be sure tha

  • Html links target another movieClip in same movie

    OK, here's what I am trying to do. I have figured out how to read in an html file and format it (somewhat) with CSS in flash. I need to have the links in the html open in a separate movieClip, etc. on the same page. Picture one column of html text wi