End Routine ABAP to read from Internal table and do calculation.

Hi All...
I have completed some coding in a start routine to extract some fields from a DSO containing Master Data (Stock Age) into an internal table (the internal table has been defined in the global declarations area) which will then be read in the end routine.
(the internal table will be read) at loadtime in the end routine and used in a calculation as described below.
I.E
GLOBAL DATA DECLARATION
Data: ITAB1 TYPE TABLE OF /BIC/DSOTAB
(DSOTAB has 3 fields PLANT, STYLE, 1STDATE (1STDATE IS A DATE FIELD)
The start routine has the following code:
IF ITAB1 IS INITIAL.
SELECT /BIC/PLANT /BIC/STYLE /BIC/1STDATE
                FROM /BIC/DSOTAB
                INTO CORRESPONDING FIELDS OF TABLE ITAB1.
This is working fine when run under simulation i.e ITAB1 is filled no problem.
I then need to do a calculation in the end routine.
1. First I have to find the record in the internal table using the key of PLANT AND STYLE from the RESULT_PACKAGE.
The code i am using now is as follows....
    READ TABLE ITAB1 TRANSPORTING NO FIELDS WITH KEY
    /BIC/PLANT = <result_fields>-/BIC/PLANT /BIC/STYLE =
    <result_fields>-/BIC/STYLE.
Once this record has been read I then have to perform the following calculation using the following additional fields
<result_fields>-/BIC/DYS1ST is a NUMC field in the <result_fields> that will be be filled by the result of the calculation described below.
<result_fields>-CALDAY is a date field which is already populated in the <result-fields> which is used in the calculation below.
The Calculation required is a difference in days between two dates
DYS1ST = CALDAY - 1STRED.
The code i am using is
If sy-subrc = 0.
     <result_fields>-/BIC/DYS1ST = <result_fields>-CALDAY -
     i_t_1stred_dso-/BIC/1STRED.
So the whole section of code inside the LOOP at RESULT PACKAGE looks like this in the end routine
       READ TABLE ITAB1 TRANSPORTING NO FIELDS WITH KEY
    /BIC/PLANT = <result_fields>-/BIC/PLANT /BIC/STYLE =
    <result_fields>-/BIC/STYLE.
IF sy-subrc = 0.
     <result_fields>-/BIC/DYS1ST = <result_fields>-CALDAY -
     i_t_1stred_dso-/BIC/1STRED.
Im getting the error
"ITAB1 " is a table without a header line and therefore has no component called "/BIC/1STRED
Please can someone advise as to what I need to do to get this fixed please.
Thanks in advance
Stevo:)

Hi,
You will have to do few changes in your code as below,
GLOBAL DATA DECLARATION
Data: ITAB1 TYPE standard TABLE OF /BIC/DSOTAB.
After that declare a workarea to read the values.
DATA: i_wa_itab1 type /bic/dsotab.
(DSOTAB has 3 fields PLANT, STYLE, 1STDATE (1STDATE IS A DATE FIELD)
The start routine has the following code:
IF ITAB1 IS INITIAL.
SELECT /BIC/PLANT /BIC/STYLE /BIC/1STDATE
FROM /BIC/DSOTAB
INTO CORRESPONDING FIELDS OF TABLE ITAB1.
This is working fine when run under simulation i.e ITAB1 is filled no problem.
I then need to do a calculation in the end routine.
1. First I have to find the record in the internal table using the key of PLANT AND STYLE from the RESULT_PACKAGE.
The code i am using now is as follows....
READ TABLE ITAB1 TRANSPORTING NO FIELDS WITH KEY
/BIC/PLANT = <result_fields>-/BIC/PLANT /BIC/STYLE =
<result_fields>-/BIC/STYLE.
Once this record has been read I then have to perform the following calculation using the following additional fields
<result_fields>-/BIC/DYS1ST is a NUMC field in the <result_fields> that will be be filled by the result of the calculation described below.
<result_fields>-CALDAY is a date field which is already populated in the <result-fields> which is used in the calculation below.
The Calculation required is a difference in days between two dates
DYS1ST = CALDAY - 1STRED.
The code i am using is
If sy-subrc = 0.
<result_fields>-/BIC/DYS1ST = <result_fields>-CALDAY -
i_t_1stred_dso-/BIC/1STRED.
So the whole section of code inside the LOOP at RESULT PACKAGE looks like this in the end routine
READ TABLE ITAB1 into i_wa_itab1 WITH KEY
/BIC/PLANT = <result_fields>-/BIC/PLANT /BIC/STYLE =
<result_fields>-/BIC/STYLE.
IF sy-subrc = 0.
<result_fields>-/BIC/DYS1ST = <result_fields>-CALDAY -
i_wa_itab1-/BIC/1STRED.
Once you do this changes, your code will work fine.
Regards,
Durgesh.

Similar Messages

  • Performance Issue When Read from Internal Table

    In my form, I have 6 windows which contain all the header information, which are kept in my gt_header internal table. Since all windows required data from the same internal table, reading the internal table at Initialization for once or, creating the LOOP at each window, which one will be a better choice in terms of performance?

    Hi,
    you cannot create 6 windows under loop.You can only have loop under a window only.
    So create a big window which covers whole area of 6 windows.Create templete under that and write only one loo with text in all those boxes of that templete.
    Regards,
    Rock.

  • Create XML file from internal table and vise a versa

    Hi Friends,
    I have requirement to create an XML string from internal table data and also read XML string data to internal table.
    Can anybody tell are there any Function Modules or methods existing for this?
    Thanks.
    Krishna Yerram.

    1. Write XSLT program. T.code XSLT . e.g. XSLT name "ZTRANS".
    2. Write ABAP program
    Which includes declaration of internal tables
    that you need "IT_DATA".
    Upload XML data to an internal table "IT_XML "
    use below statement to convert XML to internal table.
    Call transformation ZTRANS
    source XML IT_XML
    result IT_DATA.

  • How do I read from one table and write to another identical table?

    I am very new to Oracle. I am trying to do something that should be very simple.
    I am trying to read from one table in SQL and then write to another
    Identically formatted table. I keep getting various errors. Could someone please
    post some vey simple code that will work so that I can play around with it?
    Any help would be greatly appreciated.
    Thanks,
    Ron

    Thanks, but I must be missing something.
    I have two tables, SONGLIST and SETLIST.
    The second line by itself works just fine on either table.
    Here is the code I used following your seggestion, along with it's error message.
    Hope you can help. Thanks again...
    INSERT INTO SETLIST
    SELECT TITLE FROM SONGLIST WHERE ROTATION <> 'X'
    ORA-00947: not enough values

  • Using abap code data from internal table to XML file create

    Hi ALL,
    i am using methods
      L_VALUE = GS_DOCUMENT-U_MITARBEITER.
      L_RC = L_ELEMENT_FLIGHTS->SET_ATTRIBUTE( NAME = 'U_Mitarbeiter' VALUE = L_VALUE ).
      CLEAR: L_VALUE,
             L_RC.
      L_VALUE = GS_DOCUMENT-VORNAME .
      L_RC = L_ELEMENT_FLIGHTS->SET_ATTRIBUTE( NAME = 'Vorname' VALUE = L_VALUE ).
         ENDLOOP.
      LOOP AT GS_DOCUMENT-GI_TIMETABLE INTO GS_TIMETABLE.
        L_ELEMENT_AIRLINE  = L_DOCUMENT->CREATE_SIMPLE_ELEMENT(
            NAME = 'Timetable'
            PARENT = L_ELEMENT_FLIGHTS  ).
          Create attribute 'code' of node 'airline'
        L_VALUE = GS_TIMETABLE-BEGINNUHRZEIT.
        L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Beginnuhrzeit' VALUE = L_VALUE ).
        L_VALUE = GS_TIMETABLE-BEMERKUNGEN.
        L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Bemerkungen' VALUE = L_VALUE ).
        L_VALUE = GS_TIMETABLE-ENDEUHRZEIT  .
        L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Endeuhrzeit' VALUE = L_VALUE ).
        L_VALUE = GS_TIMETABLE-BUCHUNGSDATUM.
        L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Buchungsdatum' VALUE = L_VALUE ).
      ENDLOOP.
      Creating a stream factory
      L_STREAMFACTORY = L_IXML->CREATE_STREAM_FACTORY( ).
      Connect internal XML table to stream factory
      L_OSTREAM = L_STREAMFACTORY->CREATE_OSTREAM_ITABLE( TABLE = L_XML_TABLE ).
      Rendering the document
      L_RENDERER = L_IXML->CREATE_RENDERER( OSTREAM  = L_OSTREAM
                                            DOCUMENT = L_DOCUMENT ).
      L_RC = L_RENDERER->RENDER( ).
      Saving the XML document
      L_XML_SIZE = L_OSTREAM->GET_NUM_WRITTEN_RAW( ).
    i am geting the output,
    line1
    <?xml version="1.0"?><Head Document="002_TMA1_KW1_SAP.XML" Innenauftragsnummer="008004000800" Kalenderwoche="17" MonatJahr="04/2008" Name="" Personalnummer="91003139" Projektnummer="1400000700" Regionalstelle="B" U_Entleiher="1" U_Mitarbeiter="1" Vorname=
    line 2
    Ricky"><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="21.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="22.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrz
    line 3
    it="16:30" Buchungsdatum="23.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="24.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="25.04.2008"/></Head>
    but i want this type line by line
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Document Dokumentnummer="001_TMA7_KW2_MAN" Dokumenttyp="TN_HE" Innenauftragsnummer="8004750104" Kalenderwoche="15" MonatJahr="04/2008" Name="Banana" Personalnummer="166326" Projektnummer="1400000203" Regionalstelle="RV1" U_Entleiher="1" U_Mitarbeiter="1" Vorname="Sepp">
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="07.04.2008" Endeuhrzeit="16:00"/>
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="08.04.2008" Endeuhrzeit="16:00"/>
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="09.04.2008" Endeuhrzeit="16:30"/>
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="10.04.2008" Endeuhrzeit="16:30"/>
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="11.04.2008" Endeuhrzeit=""/>
    </Document>
    for line breaking, please give me solution
    Regards,
    Santha

    Hi,
    Please give me more inforamtion, how to use this
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    cl_abap_char_utilities=>newline
    Regards,
    Santha

  • Read from internal table.

    hi frnd's
    Values in the internal_table must be compared with the screen field value entered.
    Whether the where condition can be used in the read table syntax.

    Hi,
    if it is paramter then
    read table it_matnr with key matnr = p_matnr.
    if it is select option then
    loop at it_matnr where matnr in s_matnr.
    do some thing...
    exit.
    endloop.
    Regards
    vijay

  • Read from 2 tables, write only to one. Simple, but impossible??

    I've been messing about with various annotations for quite a while now, and I can't seem to figure out how to accomplish this seemingly simple task. I'm hoping somebody could explain to me the probably very obvious and simple mistake that I am making.
    I realize that question would otherwise point to problems in my database design and persistence strategy, but I can't seem to read from 2 tables, and write to only one. I have an entity bean that refers mainly to one table, but needs just one column of information from another table. It should not attempt to alter the secondary table, just join on it to get the one field it needs. So far, I've got the following:
    @Entity
    @Table(name = "ventureprofile")
    @SecondaryTable(name = "venture",
                    pkJoinColumns = @PrimaryKeyJoinColumn(name="ventureid"))
    @NamedQueries( {
            @NamedQuery(name = "Ventureprofile.findByVentureprofileid", query = "SELECT v FROM Ventureprofile v WHERE v.ventureprofileid = :ventureprofileid"),
            @NamedQuery(name = "Ventureprofile.findByVentureid", query = "SELECT v FROM Ventureprofile v WHERE v.ventureid = :ventureid"),
            @NamedQuery(name = "Ventureprofile.findByVenturesummary", query = "SELECT v FROM Ventureprofile v WHERE v.venturesummary = :venturesummary"),
            @NamedQuery(name = "Ventureprofile.findByLogoimagelocation", query = "SELECT v FROM Ventureprofile v WHERE v.logoimagelocation = :logoimagelocation"),
            @NamedQuery(name = "Ventureprofile.findByVisible", query = "SELECT v FROM Ventureprofile v WHERE v.visible = :visible ORDER BY v.venturename")
    public class Ventureprofile implements Serializable {
        @Id
        @GeneratedValue(strategy=GenerationType.AUTO, generator="Ventureprofile.ventureprofileid.seq")
        @SequenceGenerator(name="Ventureprofile.ventureprofileid.seq", sequenceName="ventureprofile_ventureprofileid_seq", allocationSize=1) 
        @Column(name = "ventureprofileid", nullable = false)
        private BigInteger ventureprofileid;      
        @Column(name = "ventureid", table="ventureprofile", nullable = false)
        private Long ventureid;
        @Column(name = "venturesummary")
        private String venturesummary;
        @Column(name = "logoimagelocation")
        private String logoimagelocation;
        @Column(name = "visible", nullable = false)
        private boolean visible;  
        @Column(table = "venture", name = "venturename", nullable=false, insertable=false, updatable=false)
        private String venturename;
    //... The extra column of data is "venturename", the tables are related by the column "ventureid". I contest, that since I have specified for read/write access no fields mapped to the 'venture' table (I specified with 'table=' any ambiguous columns), and described the table relationship via my @PrimaryKeyJoinColumn annotation, that toplink should not try to persist anything to the 'venture' table. However, I am getting the following exception:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: org.postgresql.util.PSQLException: ERROR: null value in column "venturename" violates not-null constraint
    Error Code: 0
    Call: INSERT INTO venture (ventureid) VALUES (?)
            bind => [220]
    Query: InsertObjectQuery(VCMarkWeb.db.entity.Ventureprofile[ventureprofileid=220])
            at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:311)
    ...It seems pretty clear that toplink is trying to insert an empty row into the secondary table, and barfing since it is inserting no values, including those constrained to be nonnull. Anyway...I hope it's clear what's going on here, and perhaps somebody knows the right way to do this. Thanks fot your help!

    Tom and Cornelius,
    Thank you both for your ideas. This what I think I will do:
    1) Drive up to OWC (fortunately they are only about 15 miles away from where I live) and get a bigger HD and some more RAM.
    2) Copy the OS9 applications on the existing HD to a thumb drive.
    3) Install the new hard drive and memory
    4) Install OSX TIger and 9.2.2
    5) Maybe do the 4.1.8 firmware update also, maybe.
    6) Look around for a Superdrive and if I can get one for a good price, I'll do it otherwise I'll just use USB thumb drives if I need to copy something off the PB.
    One thing that I was fighting with the other day was that when I had the yoyo power supply plugged in and attached when the PB was in the kitchen, the batteries would not charge although the yoyo was outputting +24 VDC.
    I move everything to the garage, where I originally fixed the yoyo power supply, plug it in out there and the batteries started charging!!! Scratching my head...then I check the voltage between the metal barrel (with the Vsensing resistor attached between the metal shell and the ground wire) of power supply plug and the +24 VDC wire and there is 22 to 23 VDC with the batteries being charged. In the kitchen when they were not being charged, it was about 1.0 VDC. So I rotate the plug a little bit and the batteries start charging. Rotate it more and the batteries don't charge. Something else to do when I have spare time.
    Anyway, thanks for the help and suggestions.
    John

  • Fill database table from internal table

    I made one table ZDISP_CHDOC_CC and want to fill that table from internal table.and i got runtime error. that duplicate entry
    and two entry are like 10 200000    likhp 10
                                        10 200000    likp   10
    DESCRIBE TABLE IT_CHDOC .
        LOOP AT IT_CHDOC.
        INSERT ZDISP_CHDOC_CC FROM  IT_CHDOC.
        endloop.
        IF SY-SUBRC = 0.
          COMMIT WORK.
        ELSE.
    and when i used following then only one entry is insreted.
    DESCRIBE TABLE IT_CHDOC .
        LOOP AT IT_CHDOC.
        INSERT ZDISP_CHDOC_CC FROM  IT_CHDOC.
        IF SY-SUBRC = 0.
          COMMIT WORK.
    endloop.
        ELSE.

    Hi,
    Replace your current code
    DESCRIBE TABLE IT_CHDOC .
    LOOP AT IT_CHDOC.
    INSERT ZDISP_CHDOC_CC FROM IT_CHDOC.
    endloop.
    IF SY-SUBRC = 0.
    COMMIT WORK.
    ELSE.
    WITH THE ONE GIVEN BELOW
    DESCRIBE TABLE IT_CHDOC .
    INSERT ZDISP_CHDOC_CC FROM TABLE IT_CHDOC ACCEPTING DUPLICATE KEYS.
    IF SY-SUBRC = 0.
    COMMIT WORK.
    ELSE.
    Regards,
    Siddarth

  • How to send data from internal table to the shared folder in ABAP

    Hi experts,
             My requirement is to transfer data from a file to shared folder. i just did reading data from a file to a internal table. Now i want to send this internal table data into a shared folder which is  "
    xxx\y\z....".
    I do not have any idea on how to send data from internal table to the shared folder path.
    can anybody please help me out how to do this?
    Thanks & Regards
    Sireesha.

    Where that folder is located, its on presentation server i.e. desktop or application server.
    If its on presentation server, use FM GUI_UPLOAD.
    If its on application server, then use DATASET functions. Have a look at below link.
    [File Handling in ABAP|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm]
    I hope it helps.
    Thanks,
    Vibha
    Please mark all the useful answers

  • Reading Data from Internal Table

    Hi,
    Can anyone please tell me how to read data from Internal Tables in the Event Handler without using the Select statement OnInitialization?
    Thanks,
    Gaurav

    Hi Siddhartha,
    Can you tell me the problem in my code. I tried to work on the way you suggested. Though I have not finished with the coding, I just wanted to know whether I am going in the direction or not.
    I have declared the the structure in Type Defination as
    TYPES: BEGIN OF TEST_STRUC,
             BEGDA TYPE BEGDA,
             ENDDA TYPE ENDDA,
           END OF TEST_STRUC.
    TYPES: TEST_TAB_TYPE TYPE TABLE OF TEST_STRUC.
    In the Event Handler, I have added the following code on OnInputProcessing:
    event handler for checking and processing user input and
    for defining navigation
    DATA TEST_INFO LIKE LINE OF TEST_TAB.
    DATA: MYTAB6 TYPE TABLE OF PA0006,
          MYTAB6_WA LIKE LINE OF MYTAB6.
    REFRESH TEST_TAB.
    CLEAR TEST_INFO.
    MYTAB6_WA-BEGDA = REQUEST->GET_FORM_FIELD( STARTDATE ).
    MYTAB6_WA-ENDDA = REQUEST->GET_FORM_FIELD( ENDDATE ).
    IF EVENT->NAME EQ 'button'
       AND EVENT->SERVER_EVENT EQ 'click'.
      LOOP AT MYTAB6 INTO MYTAB6_WA.
        TEST_INFO-BEGDA = MYTAB6_WA-BEGDA.
        TEST_INFO-ENDDA = MYTAB6_WA-ENDDA.
      ENDLOOP.
      APPEND TEST_INFO TO TEST_TAB.
      CLEAR TEST_INFO.
      NAVIGATION->SET_PARAMETER( NAME = 'test_tab'
      VALUE = 'begda' ).
      NAVIGATION->SET_PARAMETER( NAME = 'test_tab'
      VALUE = 'endda' ).
      NAVIGATION->GOTO_PAGE( 'MyBSP2.htm').
    ENDIF.
    P.S. MyBSP2.htm is my next page.
    Thanks,
    Gaurav

  • How to update whole external table(in ABAP dictionary) from internal table at once

    Hi,
    How can I update the content of the external table (in ABAP dictionary) from the content of internal table data at once. I created the internal tables with out the header line, with the work area. I tried UPDATE TARGET_EXTERNAL_TABLE FROM TABLE INTERNAL_TABLE. But it returns 4 for sy-subrc and did not work.
    Thank you
    Regards.
    CHINTHAKA

    Hi Feiyun Wu,
    Thank you very much. Your code worked. Is there any way to replace the whole content of the external table from internal table data ?
    Regards,
    Chinthaka

  • 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.

  • How to get a block of data from internal table based on a criteria

    Hi all,
              I have some records in the internal table t_int1. I want to retrieve some set records from that table and put them all in some other table, based on a single field which is not  a key. Can i use READ statement to achieve this.
    Could you please let me know any simple way of doin this.
    Regards,
    Vishnu

    I have some records in the internal table t_int1. I want to retrieve some set records from that table and put them all in some other table, based on a single field which is not a key. Can i use READ statement to achieve this.
    Could you please let me know any simple way of doin this.
    Answer :
    data:
    itab2 like standard table of  t_int1 with header line.
    Loop at t_int1.
    read table t_int1 with index 1.
    check ur condition----
    check each line and insert it ---work out the syntax for this
    IF t_int1-xyz = data1
    append  line of t_int1 to itab2. or try insert
    cnt = cnt + 1   -
    u will get no. of records added to next itab.
    else.
    cnt1 = cnt1 + 1 -
    u will get no. of records not added to next itab.
    endif.
    end loop.

  • Downloading data from internal table to xls file leading zeros are not disp

    Hai abap gurus,
    when i am downloading data from internal table to excle file. some field values in a column are with leading zeros and some others dont have leading zeros.but in the output it is showing without leading zeros. then how to get with exact values.
    Ex:
    <b>ECC Code.</b>
    045234
      88567
    098456 
    but output is giving like this:
    45234
    88567
    98456
    how to get the actual values.....
    plz help me in this matter.

    Dear Kiran,
    Those field in the internal table having Leading Zeroes, make those fields' datatype as character.
    Then use the function module to download the content of the internal table to the excel file.
    Regards,
    Abir
    Don't forget to Reward Points  *

  • How to choose in Delete Duplicates from internal table?

    Now I need to delete Duplicates from internal table,
    So at first I sort
    than I delete duplicate
    Sort itab1 BY Company_Code  Asset_No Capital_Date.
          DELETE ADJACENT DUPLICATES FROM itab1 COMPARING Company_Code  Asset_No  Capital_Date
    Company_Code
    Asset_No
    Capital_Date
    Remark
    BC35
    1515593
    20021225
    Helen
    BC35
    1515593
    20021225
    Common Asset
    BC35
    1515594
    20030109
    Judy
    BC35
    1515594
    20030109
    Common Asset
    But here comes my problem~If I want to delete the Common Asset in Remark Column,how I let it choose the right one to do it?

    Hi Jack
    Try the below coding..
    Report zsamp.
    types: begin of t_tab,
            comp_code(4) type c,
            ***_no(7) type n,
            cap_date type d,
            remark type string,
            end of t_tab.
    data: i_tab type TABLE OF t_tab,
           w_tab type t_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515593'.
    w_tab-cap_date = '20021225'.
    w_tab-remark = 'Helen'.
    append w_tab to i_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515593'.
    w_tab-cap_date = '20021225'.
    w_tab-remark = 'Common Asset'.
    append w_tab to i_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515594'.
    w_tab-cap_date = '20030109'.
    w_tab-remark = 'Judy'.
    append w_tab to i_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515594'.
    w_tab-cap_date = '20030109'.
    w_tab-remark = 'Common Asset'.
    append w_tab to i_tab.
    sort i_tab by remark.
    delete ADJACENT DUPLICATES FROM i_tab COMPARING remark.

Maybe you are looking for

  • Use SkyDrive to upload collected files and post screen shot/picture. (Updated: 1/16/2012)

    To help community members troubleshoot issues efficiently, sometimes we need to collect related files (such as Event logs, Network traces, Setup log files, Screenshots, etc.) to perform a specific analysis.  We can simply use SkyDrive, which is a fre

  • XLS Transformations leeds to exception CX_XSLT_FORMAT_ERROR

    Hello, I am using the following transformation to transform a amazon product advertising response to an abap structure: <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">   <xsl:output encoding="UTF-8" indent="yes" method=

  • Visibility of paths

    Hello everyone, I'm using the Pen Tool to draw several paths; I need to draw each path with reference to the other, previously drawn, paths. This is where I encountered a problem with Photoshop CS3: whenever I create a new path, the old ones become i

  • SQL developer

    Can anybody help me out with setting a repository in SQL developer... for version controlling. What i want is to set a repository connection on a server with the repository folder in another server. Any answers that would be helpful ...

  • How to Enter Event Parameters in FM SAP_WAPI_CREATE_EVENT_EXTENDED

    Hi, I am trying to trigger theEvent 'START_RM_WEBREQ' for an ABAP Class 'CL_HREIC_RM_WORKFLOW' using the above mentioned FM. Usually this can be done using SWUE, however I am asked to do it create a custom program that would do the functionality for