Using submit to put to internal table

Dear experts,
I am willing to run transaction MB51 within my se38 program using Submit.Its corresponding program name is
RM07DOCS.
Further i want to declare an internal table ,structure of which should be same as the output.I want to capture the output to this internal table.How can i achieve this ?

Hi Aditya,
In RM07DOCS program, you have to find exit/enhancement point to EXPORT  the output to memory.
And in your zprogram, after submit RM07DOCS program you add code to IMPORT from memory to your itab.
Hope it's give you an idea.
Thanks,
Victor.

Similar Messages

  • Using where condition with dynamic internal table

    Hi Friends.
    How to use where condition with dynamic internal table ?
    Regards,
    Amit Raut

    Hai Amit
    REPORT  ZDYNAMIC_SELECT                         .
    TABLES: VBAK.
    DATA: CONDITION TYPE STRING.
    DATA: BEGIN OF ITAB OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    END OF ITAB.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
    CONCATENATE 'VBELN' 'IN' 'S_VBELN.'
    INTO CONDITION SEPARATED BY SPACE.
    SELECT VBELN POSNR FROM VBAP INTO TABLE ITAB
    WHERE (CONDITION).
    LOOP AT ITAB.
    WRITE 'hello'.
    ENDLOOP.
    Thanks & Regards
    Sreenivasulu P

  • SORT INTERNAL TABLE USING NON KEY OF THE INTERNAL TABLE

    HI,
    i have one query for the cdpos table of abap.
    What i am looking is i want the latest CHANENR of the cdpos for that
    objectid  and tabname and fname in my internal table.
    what i thought of doing was to sort my internal table with objectid changnr tabname fname in descending order
    and than use delete adjacent duplicates command
    BUt that is not sorting based on all field , its sorting on changnr only
    please let me know what can i do

    no, that is not what i am looking at,
    I am saying say i have internal table cdpos
    OBJECTCLAS      OBJECTID    CHANGENR   TABNAME                        FNAME
    RECN_RECN      |0100TEST1   0000384409|    VICN01                        |RECNEND
    RECN_RECN       0100TEST1   0000383462    VICN01                          RECNLIFNR 
    RECN_RECN       0100TEST1    0000360190   VICN01                         RECNEND
    RECN_RECN        0100TEST1   0000340630    VICN01                         RECNEND
    this is my debug output after sorting on objectid changenr tabname fname in descending
    i wanted line 2nd to be at last so when i use delete adjacent command i can get 2 line item i.e 1st and 2nd line ...

  • Is it important to use INITIAL SIZE 0 in internal table

    Hi Friends,
    I want to know, is it important to use INITIAL SIZE 0 in the time of internal table deceleration.
    TYPES:       BEGIN OF L_TYP_TAB_VBELN,
                         VBELN    LIKE VBAK-VBELN,         
                  END   OF L_TYP_TAB_VBELN.
    DATA:  L_TAB_VBELN  TYPE STANDARD TABLE OF L_TYP_TAB_VBELN.
                                                                                    OR
    DATA:  L_TAB_VBELN TYPE STANDARD TABLE OF L_TYP_TAB_VBELN INITIAL SIZE 0.
    In these two internal tables which one is good as a code and performance?
    Please explain also.
    Regards
    Amit

    Hi Amit,
    After the optional addition INITIAL SIZE, you can specify a number of rows n as a numeric literal or numeric constant to adjust the size of the first block in the memory that is reserved by the system for an internal table of the table type. Without this addition, if the number 0 is entered, or the value of n exceeds a maximum value, the system automatically allocates an appropriate memory area. If this is no longer sufficient, the system creates an additional block twice the size of the first block as long as this size does not exceed 8 KB. Additional areas are created where necessary with a size of 12 KB. The maximum value is calculated as 8 KB divided by the memory required for a row. In the case of larger values, a block size of 12 KB is automatically selected.
    You are advised to specify the initial memory requirements only when the number of entries in the table has already been specified and the initial main memory requirement has an adequate value. This can be especially important for internal tables that are components of table types and only contain a few rows.
    Hope this helps
    Regds,

  • 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

  • Reading XML file from application server and  put into internal table-4.6C

    Dear All,
    Is there any way of reading XML file from application server to SAP? I am using 4.6C. Function module SCMS_STRING_TO_XSTRING function module is not available. Please suggest.
    Thanks and regards,
    Atanu

    Hi Atanu!
    Simply use the XSLT transformation 'ID'.
    FIELD-SYMBOLS <ls_result> TYPE ANY.
    CREATE DATA lref_data TYPE (your_structure).
    ASSIGN lref_data->* TO <ls_result>.
    CALL TRANSFORMATION id
                        SOURCE XML xmlstr
                        RESULT result = <ls_result>.
    "xmlstr" contains your XML file. Just read it into it via standard I/O operations. "<ls_result>" will contain your DDIC formatted content.
    Best regards
    Torsten

  • Passing values to an internal table and use it with the table painter

    Hi,
    I have seen this topic here before but the answers didn't help me. Maybe I,m doing something wrong.
    The problem is that I defined the following structure on the |Types| tab of the |Global Definitions| section:
    TYPES: BEGIN OF DETAILS,
           EBELP  TYPE EKPO-EBELP,
           BSMNG  TYPE EBAN-BSMNG,
           LFDAT  TYPE RM06P-LFDAT,
    END OF DETAILS.
    Then defined the following definition on the |Global Data| section:
    WA_DETAILS TYPE STANDARD TABLE OF DETAILS WITH HEADER LINE
    The problem is that when I try to assign a value to one of the fields in the program code like this:
    LOOP AT WA_EKPO.
         WA_DETAILS-EBELP = WA_EKPO-EBELP.
         WA_DETAILS-EMATN = WA_EKPO-EMATN.
         MODIFY WA_DETAILS.
    ENDLOOP.
    gives me the following error:
    "WA_DETAILS" is not an internal table -the "OCCURS n" specification is missing.
    Then if I add the "OCCURS 10" to the definition of the Global Data the error "OCCURS 10" is not expected.
    How can I define, assign values and use as a parameter an internal table defined with types for use it with the table painter?

    Hi,
    if it is one record in wa_details. you can directly write as follows..
    REPORT  ZCR_TEST1                               .
    TYPES: BEGIN OF details,
              ebelp TYPE ekpo-ebelp,
              bsmng TYPE eban-bsmng,
              lfdat TYPE rm06p-lfdat,
              ematn TYPE ekpo-ematn,
           END OF details.
    DATA: wa_details TYPE STANDARD TABLE OF details WITH HEADER LINE,
          wa_ekpo    TYPE STANDARD TABLE OF details WITH HEADER LINE.
    wa_details-ebelp = '1'.
    append wa_details.
    wa_ekpo-ebelp = '3'.
    append wa_ekpo.
    LOOP AT wa_ekpo.
      wa_ekpo-ebelp = wa_details-ebelp.
      wa_ekpo-ematn = wa_details-ematn.
      modify wa_ekpo.
    endloop.
    Normally it wont be one record, so u need to put <b>read statement with key</b> in LOOP and ENDLOOP.
    Regards,
    Sriram

  • Use secondary index in internal tables.

    what are the uses of secondary index in internal table?

    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb47446011d189700000e8322d00/content.htm
    Creating Secondary Indexes
    Proceed as follows to create a secondary index on a table:
    In the field maintenance screen for the table, choose Goto --> Indexes.
    1. If you went to the field maintenance screen of the table in display mode, only correct the index (and not the table).
    If indexes already exist on the table, a list of these indexes is displayed. Choose Create. A dialog box appears in which you must enter the three-place index identifier. If there are no indexes, go directly to the dialog box.
    2. Enter the index identifier and choose Continue.
    You will go to the maintenance screen for indexes.
    3. Enter an explanatory short text in the field Short text.
    Choose TabFields.
    4. A list of all the fields of the table is displayed.
    5. Select the fields which you want to copy to the index.
    6. Choose Copy.
    The selected fields are copied to the index.
    7. If the values in the index fields already uniquely identify each record of the table, select Unique index.
    A unique index is automatically created on the database during activation because a unique index also has a functional meaning (prevents double entries of the index fields).
    8. If it is not a unique index, leave Non-unique index selected. In this case you can use the corresponding radio buttons to define whether the index should be created automatically on the database for all database systems, for selected database systems or for no database system.
    9. If you chose For selected database systems, you must specify these systems.
    You have two possibilities here:
    List of inclusions: The index is only created automatically during activation for the database systems specified in the list. The index is not created on the database for the other database systems.
    List of exclusions: The index is not created automatically on the database during activation for the specified database systems. The index is automatically created on the database for the other database systems.
    Click on the arrow symbol behind the radio buttons. A dialog box appears in which you can define up to 4 database systems. Use the corresponding radio buttons to decide whether this list should be treated as a list of inclusions or exclusions.
    10. Activate the index with Index ® Activate. The activation log tells you about the flow of the activation. Call it with Utilities ® Act.log. If an error occurred when activating the secondary index, you will automatically go to this log.
    The secondary index is automatically created on the database during activation if the corresponding table has already been created there and index creation was not excluded for the database system.
    Reward points if useful.

  • Want to get the where-used hitlist to an internal table

    hi everyone,
            while using where-used list we will get a hit list result. I want to take that hit list data to an internal table with out using any local file.
    Is anybody there to help me.
    regards,
    vijaya.

    Hi Lakshmikona,
    I had wrongly interpreted your question, as suggested by Thomas you can use RS_EU_CROSSREF to get the Where used list data in the internal table.
    Refer this SAP standard report RSHDCF00 for you detailed perusal.
    Regards
    Abhii
    Edited by: Abhii on Sep 3, 2010 12:08 PM

  • Internal table in ABAP  memory

    HI experts,
    Is it possible to put the internal
    table in the memory in such a way that
    that I can access the content
    of it in my function calls?
    Thanks for your reply.
    best regards,
    rose

    Hai
    Program 1
    report  zImport_0001.
    data: itab type table of string with header line.
    field-symbols: <fs> type table.
    itab = 'This is the line 1'.  append itab.
    itab = 'This is the line 2'.  append itab.
    assign itab[] to <fs>.
    export <fs> to memory id 'ZSRITEST'.
    submit zsri_0002 and return.
    Program 2
    REPORT zImport_0002 .
    data: itab type table of string with header line.
    field-symbols: <fs> type table.
    data: wa type string.
    assign itab[] to <fs>.
    import <fs> from memory id 'ZSRITEST'.
    loop at <fs> into wa.
    write:/ wa.
    endloop.
    Thanks & regards
    Sreeni
    Message was edited by: Sreenivasulu Ponnadi

  • ECC 6.0 internal table dump

    Hi,
    I am passing a database table from selection screen(Eg T001) and build dynamic internal table and get the data from table and put into dynamic internal table.
    I am getting dump in below code.
    LOOP AT <dyn_table> INTO <dyn_wa>.
       wa_result-line = <dyn_wa>.
       APPEND wa_result TO i_result.
       CLEAR wa_result.
    ENDLOOP.
    Can anybody please execute the below progra and try to help me to put data into normal internal table i_result from dynamic internal table.
    Full points will be given to useful answer.
    Thanks in advance for your help.
    Thanks and Regards,
    Suresh.
    REPORT Z_dynamic_internal_table.
    TYPE-POOLS : abap.
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                  <dyn_wa>,
                  <dyn_field>.
    DATA: dy_table TYPE REF TO data,
         dy_line  TYPE REF TO data,
         xfc TYPE lvc_s_fcat,
         ifc TYPE lvc_t_fcat.
    TYPES: BEGIN OF t_result,
           line(1024) TYPE c,
          END OF t_result.
    DATA: i_result TYPE TABLE OF t_result,
         wa_result TYPE t_result.
    DATA: tablename(16) TYPE c.
    DATA: cond(80) TYPE c.
    PARAMETERS: tabnam(8) TYPE c.
    tablename = tabnam.
    PERFORM get_structure USING tablename.
    PERFORM create_dynamic_itab USING tablename.
    PERFORM get_data USING tablename cond.
    PERFORM write_out USING tablename.
    *&      Form  get_structure
          text
    FORM get_structure USING tablename.
    DATA : idetails TYPE abap_compdescr_tab,
            xdetails TYPE abap_compdescr.
    DATA : ref_table_des TYPE REF TO cl_abap_structdescr.
    ref_table_des ?=
         cl_abap_typedescr=>describe_by_name( tablename ).
    idetails[] = ref_table_des->components[].
    LOOP AT idetails INTO xdetails.
       CLEAR xfc.
       xfc-fieldname = xdetails-name .
       xfc-datatype = xdetails-type_kind.
       xfc-inttype = xdetails-type_kind.
       xfc-intlen = xdetails-length.
       xfc-decimals = xdetails-decimals.
       APPEND xfc TO ifc.
    ENDLOOP.
    ENDFORM.                    "get_structure
    *&      Form  create_dynamic_itab
          text
    FORM create_dynamic_itab USING tablename.
    *----Create dynamic internal table and assign to fs
    CALL METHOD cl_alv_table_create=>create_dynamic_table
       EXPORTING
         it_fieldcatalog = ifc
       IMPORTING
         ep_table        = dy_table.
    CREATE DATA dy_table TYPE STANDARD TABLE OF (tablename).
    ASSIGN dy_table->* TO <dyn_table>.
    *----Create dynamic work area and assign to fs
    CREATE DATA dy_line TYPE (tablename).
    ASSIGN dy_line->* TO <dyn_wa>.
    ENDFORM.                    "create_dynamic_itab
    *&      Form  get_data
          text
    FORM get_data USING tablename cond.
    *----Select data from table.           .
    SELECT * INTO CORRESPONDING FIELDS OF TABLE <dyn_table>
                FROM (tablename) WHERE (cond).
    ENDFORM.                    "get_data
    *&      Form  WRITE_OUT
          text
    -->  p1        text
    <--  p2        text
    FORM write_out USING tablename .
    LOOP AT <dyn_table> INTO <dyn_wa>.
       wa_result-line = <dyn_wa>.
       APPEND wa_result TO i_result.
       CLEAR wa_result.
    ENDLOOP.
    ENDFORM.                    " WRITE_OUT

    Hi,
           Check the below code, it may be useful.
    data:it_grnchk  TYPE TABLE OF ty_grnchk WITH NON-UNIQUE KEY mblnr_i bwart_i.
    FIELD-SYMBOLS: <l_table> TYPE  STANDARD TABLE,
                               <l_line>  TYPE ANY,<wa_grn>  TYPE ty_grnchk, <l_field> TYPE ANY,
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
       I_STYLE_TABLE             =
        it_fieldcatalog           = it_fcat
       I_LENGTH_IN_BYTE          =
      IMPORTING
        EP_TABLE                  = new_table
       E_STYLE_FNAME             =
    EXCEPTIONS
       GENERATE_SUBPOOL_DIR_FULL = 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.
    ASSIGN new_table->* TO <l_table>.
    CREATE DATA new_line LIKE LINE OF <l_table>.
    ASSIGN new_line->* TO <l_line>.
    ASSIGN new_line->* TO <t_line>.
    ***********assigning dynamic Internal table  vlaues to normal internal table
    LOOP AT <l_table> INTO <l_line>.
             ASSIGN COMPONENT sy-index OF STRUCTURE <l_line> TO <l_field>.
             MOVE-CORRESPONDING <l_field> TO <wa_grn>.
             APPEND <wa_grn> TO it_grnchk.
        ENDLOOP.
    IF useful.......................
    Regards,
    S.Senthil kumar

  • Internal table and work area

    Hi,
           can anybody explain the concepts of Internal table and work area.Thanks in advance.

    hai,
    This may help u.
    WORKAREA is a structure that can hold only one record at a time. It is a collection of fields. We use workarea as we cannot directly read from a table. In order to interact with a table we need workarea. When a Select Statement is executed on a table then the first record is read and put into the header of the table and from there put into the header or the workarea(of the same structure as that of the table)of the internal table and then transferred top the body of the internal table or directly displayed from the workarea.
    Each row in a table is a record and each column is a field.
    While adding or retrieving records to / from internal table we have to keep the record temporarily.
    The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    e.g.
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    Internal tables are used for storing records which are obtained as a result when we use select statement on database. internal tables are run time entities and doesn't occupy any memory. they are dynamic.
    internal tables are of types.
    1. internal tables with header line. [header and body]
    2. internal tables with out header line. [only body]
    Workarea is the concept which is mainly useful when working with internal tables with out header line.
    at any point of time we can access only one record through header of a internal table. every thing should be done [inserting,modifying, reading ] through header only.
    ex: data: itab like standard table of mara with header line.
    for internal tables with out header line we will create a work area [explicit header] as type of table for storing data into internal table.
    ex: data: itab like mara,
    wa like mara.
    more about internal table types:
    Standard table:
    The key access to a standard table uses a sequential search. The time required for an access is linearly dependent on the number of entries in the internal table.
    You should usually access a standard table with index operations.
    Sorted table:
    The table is always stored internally sorted by its key. Key access to a sorted table can therefore use a binary search. If the key is not unique, the entry with the lowest index is accessed. The time required for an access is logarithmically dependent on the number of entries in the internal table.
    Index accesses to sorted tables are also allowed. You should usually access a sorted table using its key.
    Hash table:
    The table is internally managed with a hash procedure. All the entries must have a unique key. The time required for a key access is constant, that is it does not depend on the number of entries in the internal table.
    You cannot access a hash table with an index. Accesses must use generic key operations (SORT, LOOP, etc.).
    Hashed tables
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index.
    The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always
    have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for
    processing large amounts of data.
    TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.
    TYPES: BEGIN OF LINE,
    COLUMN1 TYPE I,
    COLUMN2 TYPE I,
    COLUMN3 TYPE I,
    END OF LINE.
    DATA ITAB TYPE HASHED TABLE OF SPFLI
    WITH UNIQUE KEY CARRID CONNID.
    with regards,
    B.Sowjanya,
    reward points if helpful.

  • Adding amounts in an internal table

    I have created an internal table which has values BP number, Contract Account and amount paid. i would like to add the amounts paid per business partner and per contract account and only display the total amount paid per business partner and per contract account. may i have the code to make the addition of the amounts in an internal table.

    Hello,
    So what was meant is that for the same business partners and same Contract account numbers the amount should get added.....
    do the following...imagine that you have data in int_tab with 3 fields...Declare int_tab1 as the same internal table type
    Sort int_tab by BP Contract_AC.
    loop at int_tab into workarea.
    collect workarea to int_tab1.
    endloop.
    Collect statement compares the "BP" and "Contract A/C"
    and for the same BP and contractA/C number it adds and appends..if an entry exists in int_tab1 it adds the amount only
    eg:
    BP | CAno: | Amount
    A   |  23A      | 100
    A   |  23A      | 50
    A   |  24A      |  11
    B   |  23A      | 12
    after the collect statement..internal table contains
    A | 23A | 150
    A | 24A | 11
    B | 23A | 12
    but it will work only if int_tab contais 3 fields as mentioned..if more fields are there which are non-numeric it will compare that also...
    in addition to it also check if the contract Account number is getting added by putting a breakpoint in the code..if so... there are 2 options
    (1) Declare a new internal table and pass the field contract number as a character....and use collect on the new internal table..so the contract account number will not get added...
    or
    instead of collect statement use loops and other logic to suit your requirement
    Reward if helpful
    Regards
    Byju

  • Populate data from itab to dynamic internal table

    Hi All,
    I have internal table it_tab with below data
    "-----internal table it_tab data
    1 0000123 GBP DA S 6265.45
    2 0000123 GBP DA H 240.51
    3 0000123 GBP DA S 35.82
    4 0000123 GBP D1 H 281.85
    5 0000123 GBP D1 S 23.41
    6 0000123 GBP D1 S 34.23
    7 0000123 GBP RV H 97.02
    8 0000123 GBP RV S 52.90
    9 0000123 GBP RV S 148.31
    I have created dynamic internal table <t_dyn_table> using field-symbol based in dynamic fieldcatelog it_fldcat, using below code
    Create dynamic internal table and assign to Field Symbol
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = it_fldcat
        IMPORTING
          ep_table                  = it_dynamic_table
        EXCEPTIONS
          generate_subpool_dir_full = 1
          others                    = 2.
      IF sy-subrc eq 0.
        ASSIGN it_dynamic_table->* TO <t_dyn_table>.
    Create dynamic work area and assign to Field Symbol
        CREATE DATA it_newline LIKE LINE OF <t_dyn_table>.
        ASSIGN it_newline->* TO <wa_dyn>.
      ENDIF.
    Now I want to put the data from it_tab to <t_dyn_table> as shown below
    Customer ___DAS ___D1S___RVS___DAH___D1H___RVH___DAT____D1T____RVT
    0000123____6265.45__________________________________6265.45
    0000123________________________240.51_______________240.51
    0000123____35.82____________________________________35.82
    Please help me out, Thanks in Advance
    Thanks & Regards
    Sekhar
    Thanks in Advance
    Sekhar

    Hi Sekhar_tech,
    Hope this helps. I made the code in notepad may have any syntax errors but the idea of the code is.
      loop at it_tab into wa_tab.
        UNASSIGN  <wa_dyn>.
        ASSIGN it_newline->* TO <wa_dyn>.
        if <wa_dyn> is assigned.
          UNASSIGN <lf_field_Value>.        
          ASSIGN COMPONENT 'CUSTOMER' OF STRUCTURE
                           <wa_dyn> TO <lf_field_value>. 
          IF <lf_field_Value> IS ASSIGNED.
             <lf_field_value> = wa_tab-customer.
          ENDIF.    
          UNASSIGN <lf_field_Value>.        
          ASSIGN COMPONENT 'DAS' OF STRUCTURE
                           <wa_dyn> TO <lf_field_value>. 
          IF <lf_field_Value> IS ASSIGNED.
             <lf_field_value> = wa_tab-das.
          ENDIF.    
    #same logic to other fields...
    #The final step
          APPEND <wa_dyn> TO <t_dyn_table>.
        endif.
      endloop.
    Regards
    Bruno Xavier.

  • Upload XML file data into internal table

    Hi,
    I need help from you.
    I am uploading XML file from Application server.
    1.In application server under directory it may have several XML files and i need to upload all the XML files  when we gave only directory name. So, what is the function module for that logic . If possible code also.
    2.Once we get the files into some internal table we need to upload data from that files to internal table.
    So what is the logic for that , if possible code also.
    I am giving sample directory:    
    For example in this directory assume 3 xml files are there.
    I need to upload those files and data from that in to internal table.
    Thanks & Regards
    VSR

    Below code will give you an idea.
    TYPE-POOLS: ixml. "iXML Library Types
    *TABLES : rbkp.
    TYPE DECLERATIION
    TYPES: BEGIN OF type_tabpo,
    ebeln TYPE ekko-ebeln, "PO document number
    ebelp TYPE ekpo-ebelp, "PO line item
    END OF type_tabpo.
    TYPES: BEGIN OF type_ekbe,
    belnr TYPE rbkp-belnr, "Invoice document
    gjahr TYPE rbkp-gjahr, "fiscal year
    END OF type_ekbe.
    TYPES: BEGIN OF type_invoice,
    belnr TYPE rbkp-belnr, "PO document number
    gjahr TYPE rbkp-gjahr, "Fiscal Year
    rbstat TYPE rbkp-rbstat, "invoice status
    END OF type_invoice.
    TYPES: BEGIN OF t_xml_line, "Structure for holding XML data
    data(256) TYPE x,
    END OF t_xml_line.
    INTERNAL TABLE DECLERATIION
    DATA: gi_tabpo TYPE STANDARD TABLE OF type_tabpo,
    gi_ekbe TYPE STANDARD TABLE OF type_ekbe,
    gi_invoice TYPE STANDARD TABLE OF type_invoice,
    gi_bapiret2 TYPE STANDARD TABLE OF bapiret2.
    DATA: l_ixml TYPE REF TO if_ixml,
    l_streamfactory TYPE REF TO if_ixml_stream_factory.
    DATA: l_xml_table TYPE TABLE OF t_xml_line, " XML Table of the structure
    l_xml_line TYPE t_xml_line, " Record of structure t_xml_line
    l_xml_table_size TYPE i. " XML table size
    DATA: l_filename TYPE string.
    WORK AREA DECLARATION
    DATA: gw_tabpo TYPE type_tabpo,
    gw_ekbe TYPE type_ekbe,
    gw_invoice TYPE type_invoice,
    gw_bapiret2 TYPE bapiret2.
    BEGIN OF SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/tmp/'.
    Validation of XML file: Only DTD included in XML document is supported
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION SCREEN VALIDATION
    AT SELECTION-SCREEN.
    To validate p_file is not initial
    PERFORM sub_validate_file.
    PERFORM sub_validate_path.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Request for filename for xml file from the application server
    PERFORM sub_get_filename_appl USING p_file.
    START OF SELECTION SCREEN
    START-OF-SELECTION.
    PERFORM sub_fetch_po_details.
    PERFORM sub_get_invoice.
    PERFORM sub_rel_invoice.
    END OF SELECTION SCREEN
    END-OF-SELECTION.
    *& Form sub_validate_file
    To Validate the file
    FORM sub_validate_file .
    IF p_file IS INITIAL.
    MESSAGE e000. "specify the file path
    ENDIF.
    ENDFORM. " sub_validate_file
    *& Form sub_get_filename_appl
    form sub_get_filename_appl USING l_fname TYPE any.
    DATA: l_fname TYPE filename-fileintern. " File name
    *GET THE FILENAME FROM THE APPLICATION SERVER
    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    EXPORTING
    directory = l_fname
    filemask = '*'
    IMPORTING
    serverfile = l_fname
    EXCEPTIONS
    canceled_by_user = 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.
    ENDFORM. " sub_get_filename_appl
    *& Form sub_fetch_po_details
    To fetch the PO details from the application server
    Format of file is XML
    FORM sub_fetch_po_details .
    TYPE DECLERATIION
    l_ixml = cl_ixml=>create( ).
    Creating a stream factory
    l_streamfactory = l_ixml->create_stream_factory( ).
    PERFORM get_xml_table.
    LOOP AT gi_tabpo INTO gw_tabpo.
    WRITE:/ gw_tabpo.
    ENDLOOP.
    ENDFORM. " sub_fetch_po_details
    *& Form get_xml_table
    Read from the xml file
    FORM get_xml_table .
    Local variable declarations
    DATA: l_len TYPE i,
    l_len2 TYPE i,
    l_tab TYPE tsfixml,
    l_content TYPE string,
    l_str1 TYPE string,
    c_conv TYPE REF TO cl_abap_conv_in_ce,
    l_itab TYPE TABLE OF string.
    l_filename = p_file.
    code to upload data from application server
    OPEN DATASET l_filename FOR INPUT IN BINARY MODE.
    IF sy-subrc 0.
    WRITE:/ 'invalid file path'.
    ENDIF.
    DO.
    READ DATASET l_filename INTO l_xml_line.
    IF sy-subrc EQ 0.
    APPEND l_xml_line TO l_xml_table.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET l_filename.
    code to find the table size
    DESCRIBE TABLE l_xml_table.
    l_xml_table_size = ( sy-tleng ) * ( sy-tfill ).
    *code to convert hexadecimal to XML
    LOOP AT l_xml_table INTO l_xml_line.
    c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
    replacement
    = space ).
    c_conv->read( IMPORTING data = l_content len = l_len ).
    CONCATENATE l_str1 l_content INTO l_str1.
    ENDLOOP.
    l_str1 = l_str1+0(l_xml_table_size).
    SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
    LOOP AT l_itab INTO l_str1.
    REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
    l_str1 WITH space.
    ENDLOOP.
    CALL TRANSFORMATION ('ID') " code to put in internal table
    SOURCE XML l_str1
    RESULT tab = gi_tabpo[].
    ENDFORM. " get_xml_table

Maybe you are looking for

  • No data in the unused software report

    Hi, We have Software metering enabled and many of the software metering reports return data as we would expect, for example:  Computers that have run a specific metered software program Concurrent usage for all metered software programs However, no m

  • Payment Medium Workbench - Custom Format

    Hi , We are in the middle of a global implementation. In our project we would be using Payemnt medium workbench to generate the payment run files from transaction F110. The Bank we will be dealing would require a custom format of MT101 for modificati

  • Special characters are not shown in compare document report in Acrobat X

    Hi All, I have a pdf document which is having some special characters like üὄ. Now I have updated the document with few corrections and while compare document in Acrobat X special characters are not shown in the report. Can any one please look into t

  • Can't order more than 30 prints?

    I am trying to order prints using Aperture 3.0.3 under OSX 10.6.2. When I select up to 30 pictures I am able to "Order Prints" from the menu bar. As soon as I select more than 30 pictures the "Order Prints" menu item becomes grayed out. I haven't bee

  • Notification user groups customization

    Hi All: We are currently troubleshooting the notifications sent when a document change status. We have document which moves from status A to B. On the status A, we have a group of users UserGroupA and another group B we have which is called UserGroup