Simple technical q'n realted to internal tables

How to extract common data from 2 internal tables and place it onto 3rd internal tabel?
ex:
In internal table 'A' I have data a,b,c,d,e,f
and in 'B' I have a,b,c
Now I want to place this common data(a,b,c) into third table/
How is it possible?

hi,
check this.
itab1.
a b c d e f            => data
itab 2
a b c                  => data
put the date final internal table
1. loop at itab1.
read table itab2 with key keyfield2 = itab1-keyfield1
                                          field2 = itab1-field2
                                          field3 = itab1-field3.
if sy-surc = 0.
itab_final-key_field1 = itab1-keyfield1
itab_final-field1 = itab1-field1.
itab_final-field2 = itab1-field2.
itab_final-field3 = itab2-field3.
append itab_final.
clear itab_final.
endif.
endloop.
rgds
Anver

Similar Messages

  • USING SUM IN INTERNAL TABLE

    plz give me a simple example for using SUM in internal table and do some calculations in the same internal table.

    HI
    CHECK WITH THIS
    Syntax
    SUM.
    Effect
    The statement SUM can only be specified within a loop starting with LOOP, and is only considered within a AT- ENDAT control structure. Prerequisites for using the statement SUM include using the addition INTO in the LOOP statement, and that the specified work area wa is compatible with the row type of the internal table. In addition, SUM cannot be used when the row type of the internal table itab contains components that are tables.
    The statement SUM calculates the component total with the numeric data type (i, p, f) of all rows in the current control level and assigns these to the components of the work area wa. In the control levels FIRST, LAST, and outside of an AT-ENDAT control structure, the system calculates the sum of numeric components of all rows in the internal table.
    Example
    Control level processing for creating a list. At the end of line groups, the total of reserved places is calculated and issued.
    DATA: sflight_tab TYPE SORTED TABLE OF sflight
                      WITH UNIQUE KEY carrid connid fldate,
          sflight_wa  LIKE LINE OF sflight_tab.
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab.
    LOOP AT sflight_tab INTO sflight_wa.
      AT NEW connid.
        WRITE: / sflight_wa-carrid,
                 sflight_wa-connid.
        ULINE.
      ENDAT.
      WRITE: / sflight_wa-fldate,
               sflight_wa-seatsocc.
      AT END OF connid.
        SUM.
        ULINE.
        WRITE: / 'Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
        SKIP.
      ENDAT.
      AT END OF carrid.
        SUM.
        ULINE.
        WRITE: / 'Carrier Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
        NEW-PAGE.
      ENDAT.
      AT LAST.
        SUM.
        WRITE: / 'Overall Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
      ENDAT.
    ENDLOOP.
    Hope this solves ur problem....
    <b>do reward if useful....</b>
    regards
    dinesh

  • Internal Table Line Operations - Collect Statement

    Hello Gurus,
    I have an internal table with data in it. The fields of the internal table are
    Location - Matnr - Qty - Flag.
    Same material can be at different locations with different quantities. I need to get material and total quantity of the material in all the locations in a new internal table.
    If the table (it_tab) contains -
    Location - matnr - qty - flag
    1200        abc       10    S
    1201        abc       20    S
    1205        abc       30    S
    1207        abc       50    S
    1200        xyz       20    S
    1201        xyz       25    S
    1300        xyz       22    S
    From this table, I need to get the result int table (it_res) as below -
    Matnr - qty
    abc      110
    xyz       67
    110 = 102030+50
    67 = 252220
    My idea is we can use collect statement looping the it_tab table.
    Please help me how to do this.
    Regards,
    Balu

    Hi balu,
    1. Simple
    2. Create one another internal table STAB,
        with only two fields
       a) MATNR
       b) QTY
    3. Now,
    4.
    Loop at Itab.
    Move-corresponding itab to STAB.
    COLLECT STAB.
    Endloop.
    regards,
    amit m.

  • How to ADD rows to a dynamic internal table??

    My question is simple.
    I have a dynamic internal table and I need to ADD rows to if.
    I read this thread How to modify a dynamic internal table from dynamic work area but they are modifying existing data.
    My internal table is EMPTY and I need to ADD new rows, so I can't use LOOP ASSIGNING.
    How can I do that?
    Any help is welcome!
    Thanks!
    Bettina

    Hi,
      try something similar.
    FIELD-SYMBOLS: <fs> type any.
    FIELD-SYMBOLS: <f1> type any.
    ASSIGN INITIAL LINE TO lo_data ASSIGNING <fs>. " or <f_tab> - not sure w/o editor :-)
    assigning component 1 of structure <fs> to <f1>.
    <f1> = 'aaa'.
    I write it from memory so there can be some syntax errors but focus to command APPEND INITIAL LINE ...
    Regards,
      Karol

  • Simple Transformation ST, upload xml file to internal table

    Hi.
    I want to upload some parts of an xml file into an sap internal table, especially the part "trackingnumber" which can occur several times.
    the xml looks like this:
    <?xml version="1.0" encoding="windows-1252"?>
    <OpenShipments xmlns="x-schema:OpenShipments.xdr">
         <OpenShipment ProcessStatus="Processed">
              <ShipTo>
              </ShipTo>
              <ShipFrom>
              </ShipFrom>
              <ShipmentInformation>
              </ShipmentInformation>
              <Package>
              </Package>
              <InternationalDocumentation>
              </InternationalDocumentation>
              <Goods>
              </Goods>
              <ProcessMessage>
                   <TrackingNumbers>
                        <TrackingNumber>1Z1234563330702444</TrackingNumber>
                        <TrackingNumber>1Z1234566644402555</TrackingNumber>
                   </TrackingNumbers>
              </ProcessMessage>
         </OpenShipment>
    </OpenShipments>
    The ST looks like this:
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
    <tt:root name="ROOT"/>
    <tt:template>
    <OpenShipments xmlns="x-schema:OpenShipments.xdr">
    <OpenShipment>
    <ShipTo>
    <tt:skip/>
    </ShipTo>
    <ShipFrom>
    <tt:skip/>
    </ShipFrom>
    <ShipmentInformation>
    <tt:skip/>
    </ShipmentInformation>
    <tt:group>
    <tt:cond frq="*">
    <Package>
    <tt:skip/>
    </Package>
    </tt:cond>
    </tt:group>
    <InternationalDocumentation>
    <tt:skip/>
    </InternationalDocumentation>
    <tt:group>
    <tt:cond frq="*">
    <Goods>
    <tt:skip/>
    </Goods>
    </tt:cond>
    </tt:group>
    <ProcessMessage>
    <ShipmentRates>
    <tt:skip/>
    </ShipmentRates>
    <TrackingNumbers>
    <tt:group>
    <tt:cond frq="*">
    <TrackingNumber>
    <tt:loop ref="ROOT">
    <tt:value ref="ROOT" />
    </tt:loop>
    </TrackingNumber>
    </tt:cond>
    </tt:group>
    </TrackingNumbers>
    <ImportID>
    <tt:skip/>
    </ImportID>
    <Reference1>
    <tt:skip/>
    </Reference1>
    <Reference2>
    <tt:skip/>
    </Reference2>
    </ProcessMessage>
    </OpenShipment>
    </OpenShipments>
    </tt:template>
    </tt:transform>
    The ABAP Code looks like this:
    REPORT  z_xml_to_abap_test.
    TYPES: t_xmllin_src(4096) TYPE x,
           t_xmltab_src TYPE STANDARD TABLE OF t_xmllin_src.
    DATA: xmlstr_src TYPE xstring,
          xmltab_src TYPE t_xmltab_src,
          result1(254) TYPE c,
          BEGIN OF ROOT,
            TrackingNumber(254) type c,
          END OF ROOT.
    FIELD-SYMBOLS: <xmlline> LIKE LINE OF xmltab_src.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       filename                      = 'e:\20100601_132212.Out'
       filetype                      = 'BIN'
       has_field_separator           = ''
       header_length                 = 0
       read_by_line                  = 'X'
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
    TABLES
       data_tab                      = xmltab_src
    EXCEPTIONS
       file_open_error               = 1
       file_read_error               = 2
       no_batch                      = 3
       gui_refuse_filetransfer       = 4
       invalid_type                  = 5
       no_authority                  = 6
       unknown_error                 = 7
       bad_data_format               = 8
       header_not_allowed            = 9
       separator_not_allowed         = 10
       header_too_long               = 11
       unknown_dp_error              = 12
       access_denied                 = 13
       dp_out_of_memory              = 14
       disk_full                     = 15
       dp_timeout                    = 16
       OTHERS                        = 17.
    LOOP AT xmltab_src ASSIGNING <xmlline>.
      CONCATENATE xmlstr_src <xmlline> INTO xmlstr_src IN BYTE MODE.
    ENDLOOP.
    CALL TRANSFORMATION z_ups_xml_upload
      SOURCE XML xmlstr_src
      RESULT ROOT = ROOT.
    When i run the program i got the following error message:
    "The goal was to access variable "ROOT". However, this access was not possible.
    Anybody has an idea, why this happens, this is my first ST and have no clue at the moment why this happens?

    Hi.
    I want to upload some parts of an xml file into an sap internal table, especially the part "trackingnumber" which can occur several times.
    the xml looks like this:
    <?xml version="1.0" encoding="windows-1252"?>
    <OpenShipments xmlns="x-schema:OpenShipments.xdr">
         <OpenShipment ProcessStatus="Processed">
              <ShipTo>
              </ShipTo>
              <ShipFrom>
              </ShipFrom>
              <ShipmentInformation>
              </ShipmentInformation>
              <Package>
              </Package>
              <InternationalDocumentation>
              </InternationalDocumentation>
              <Goods>
              </Goods>
              <ProcessMessage>
                   <TrackingNumbers>
                        <TrackingNumber>1Z1234563330702444</TrackingNumber>
                        <TrackingNumber>1Z1234566644402555</TrackingNumber>
                   </TrackingNumbers>
              </ProcessMessage>
         </OpenShipment>
    </OpenShipments>
    The ST looks like this:
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
    <tt:root name="ROOT"/>
    <tt:template>
    <OpenShipments xmlns="x-schema:OpenShipments.xdr">
    <OpenShipment>
    <ShipTo>
    <tt:skip/>
    </ShipTo>
    <ShipFrom>
    <tt:skip/>
    </ShipFrom>
    <ShipmentInformation>
    <tt:skip/>
    </ShipmentInformation>
    <tt:group>
    <tt:cond frq="*">
    <Package>
    <tt:skip/>
    </Package>
    </tt:cond>
    </tt:group>
    <InternationalDocumentation>
    <tt:skip/>
    </InternationalDocumentation>
    <tt:group>
    <tt:cond frq="*">
    <Goods>
    <tt:skip/>
    </Goods>
    </tt:cond>
    </tt:group>
    <ProcessMessage>
    <ShipmentRates>
    <tt:skip/>
    </ShipmentRates>
    <TrackingNumbers>
    <tt:group>
    <tt:cond frq="*">
    <TrackingNumber>
    <tt:loop ref="ROOT">
    <tt:value ref="ROOT" />
    </tt:loop>
    </TrackingNumber>
    </tt:cond>
    </tt:group>
    </TrackingNumbers>
    <ImportID>
    <tt:skip/>
    </ImportID>
    <Reference1>
    <tt:skip/>
    </Reference1>
    <Reference2>
    <tt:skip/>
    </Reference2>
    </ProcessMessage>
    </OpenShipment>
    </OpenShipments>
    </tt:template>
    </tt:transform>
    The ABAP Code looks like this:
    REPORT  z_xml_to_abap_test.
    TYPES: t_xmllin_src(4096) TYPE x,
           t_xmltab_src TYPE STANDARD TABLE OF t_xmllin_src.
    DATA: xmlstr_src TYPE xstring,
          xmltab_src TYPE t_xmltab_src,
          result1(254) TYPE c,
          BEGIN OF ROOT,
            TrackingNumber(254) type c,
          END OF ROOT.
    FIELD-SYMBOLS: <xmlline> LIKE LINE OF xmltab_src.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       filename                      = 'e:\20100601_132212.Out'
       filetype                      = 'BIN'
       has_field_separator           = ''
       header_length                 = 0
       read_by_line                  = 'X'
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
    TABLES
       data_tab                      = xmltab_src
    EXCEPTIONS
       file_open_error               = 1
       file_read_error               = 2
       no_batch                      = 3
       gui_refuse_filetransfer       = 4
       invalid_type                  = 5
       no_authority                  = 6
       unknown_error                 = 7
       bad_data_format               = 8
       header_not_allowed            = 9
       separator_not_allowed         = 10
       header_too_long               = 11
       unknown_dp_error              = 12
       access_denied                 = 13
       dp_out_of_memory              = 14
       disk_full                     = 15
       dp_timeout                    = 16
       OTHERS                        = 17.
    LOOP AT xmltab_src ASSIGNING <xmlline>.
      CONCATENATE xmlstr_src <xmlline> INTO xmlstr_src IN BYTE MODE.
    ENDLOOP.
    CALL TRANSFORMATION z_ups_xml_upload
      SOURCE XML xmlstr_src
      RESULT ROOT = ROOT.
    When i run the program i got the following error message:
    "The goal was to access variable "ROOT". However, this access was not possible.
    Anybody has an idea, why this happens, this is my first ST and have no clue at the moment why this happens?

  • Simple Transformation - XML to Internal Table Error

    I have a webservice call that returns XML.  I need to transform a portion of the response to an internal table, but my simple transformation is not working with loop processing.  I have read through most posts regarding the topic but they're either too old or related to serialization.  There aren't any exceptions thrown, but I don't get any data in the internal table (PAPERWORK root).  Below are some code snippets.  Any ideas on the problem with the XSLT template?  Thanks.
    Sample XML:
    <?xml version="1.0" encoding="utf-8" ?>
    <PrintVersionDataSet>
    <Result>
    <ReturnCode>W</ReturnCode>
    <ReturnMessage>There are reports with later version(s)</ReturnMessage>
    </Result>
    <Paperwork>
    <ReportCode>CVR</ReportCode>
    <ReportName>Cover Sheet</ReportName>
    <Version>2</Version>
    <PrintedDateTime>2009-05-01T09:54:04.1-05:00</PrintedDateTime>
    </Paperwork>
    <Paperwork>
    <ReportCode>SPS</ReportCode>
    <ReportName>Sponsor Summary</ReportName>
    <Version>2</Version>
    <PrintedDateTime>2009-05-01T09:54:04.99-05:00</PrintedDateTime>
    </Paperwork>
    </PrintVersionDataSet>
    XSLT Code:
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="RESULT"/>
      <tt:root name="PAPERWORK"/>
      <tt:template>
        <PrintVersionDataSet>
          <Result tt:ref="RESULT">
            <ReturnCode>
              <tt:value ref="RETURNCODE"/>
            </ReturnCode>
            <ReturnMessage>
              <tt:value ref="RETURNMESSAGE"/>
            </ReturnMessage>
          </Result>
          <tt:deserialize>
            <tt:loop ref=".PAPERWORK">
              <Paperwork>
                <ReportCode>
                  <tt:value ref="REPORTCODE"/>
                </ReportCode>
                <ReportName>
                  <tt:value ref="REPORTNAME"/>
                </ReportName>
                <Version>
                  <tt:value ref="VERSION"/>
                </Version>
                <PrintedDateTime>
                  <tt:value ref="PRINTEDDATETIME"/>
                </PrintedDateTime>
              </Paperwork>
            </tt:loop>
          </tt:deserialize>
        </PrintVersionDataSet>
      </tt:template>
    </tt:transform>
    ABAP Call to Transform Data:
    TRY.
    CALL TRANSFORMATION Z_GA_PAPERWORK_VERS_WEBSVC
          SOURCE XML LS_RESPONSE-VERIFY_PRINT_VERSION_RESULT
          RESULT RESULT     = LS_RESULT
                 PAPERWORK  = LT_PAPERWORK.
        CATCH CX_ROOT INTO ROOT_EXCEPTION.
          CALL METHOD ROOT_EXCEPTION->IF_MESSAGE~GET_TEXT
            RECEIVING
              RESULT = LV_MESSAGE.
      ENDTRY.

    Upon further inspection and testing with a simple file and program, I can see that the XML structure isn't quite correct for the loop process.  There needs to be a single <PAPERWORK> node, instead of one for each table line in the file.  This should allow the loop to execute properly after a slight adjustment to the XSLT template.

  • Urgent...simple internal table problem

    Hi gurus
    i am filling a internal table like this
    loop at i_0001 into s_0001.
    clear out_final.
    out_final-pernr = s_0001-pernr.
    out_final-parea = s_0001-parea.
    loop at i_0021 into s_0021 where pernr = s_0001-pernr and subty ne '7'.
    perform rec1.
    endloop.
    loop at i_0106 into s_0106 where pernr = s_0001-pernr and subty ne '7'.
    perform rec2.
    append out_final to i_final.
    clear out_final.
    endloop.
    and my performs are
    FORM rec1.
    read table i_0021 into s_0021 with key pernr = s_0001-pernr.
    out_final-fname = s_0021-fname.
    out_final-lname = s_0021-lname.
    out_final-bdate = s_0021-bdate.
    ENDFORM.                    " rec1
    FORM rec2.
    read table i_0106 into s_0106 with key pernr = s_0001-pernr.
    out_final-ssn = s_0106-ssn.
    out_final-add1 = s_0106-add1.
    out_final-add2 = s_0106-add2.
    out_final-city = s_0106-city.
    out_final-state = s_0106-state.
    out_final-country = s_0106-country.
    out_final-zip = s_0106-zip.
    out_final-hphone = s_0106-hphone.
    ENDFORM.                    " rec2
    all my declerations and syntax are correct
    now i have 2 simple things to ask
    1. when i write data i get duplicate records ....is my loop , clear and append are in right place
    2. i wan to delimit this data for a condition where bdate is greater than 18. bdate is of type p0021-fgbdt which i have to format using some FM....how do i do that where do i have to add code for that.
    thanks in advance
    plz help
    regards

    Hi,
      Check the below code.
    loop at i_0001 into s_0001.
    clear out_final.
    out_final-pernr = s_0001-pernr.
    out_final-parea = s_0001-parea.
    <b>*****loop at i_0021 into s_0021 where pernr = s_0001-pernr and subty ne '7'.</b>
    perform rec1.
    <b>***endloop.
    ****loop at i_0106 into s_0106 where pernr = s_0001-pernr and subty ne '7'.</b>perform rec2.
    <b>if not out_final is initial.</b>
    append out_final to i_final.
    <b>endif.</b>
    clear out_final.
    endloop.
    and my performs are
    FORM rec1.
    read table i_0021 into s_0021 with key pernr = s_0001-pernr
                                                             <b>subty ne '7'.</b>
    <b>if sy-subrc = 0.</b>
    out_final-fname = s_0021-fname.
    out_final-lname = s_0021-lname.
    out_final-bdate = s_0021-bdate.
    <b>endif.</b>
    ENDFORM. " rec1
    FORM rec2.
    read table i_0106 into s_0106 with key pernr = s_0001-pernr
                                                             <b>subty ne '7'.</b>
    <b>if sy-subrc = 0.</b>
    out_final-ssn = s_0106-ssn.
    out_final-add1 = s_0106-add1.
    out_final-add2 = s_0106-add2.
    out_final-city = s_0106-city.
    out_final-state = s_0106-state.
    out_final-country = s_0106-country.
    out_final-zip = s_0106-zip.
    out_final-hphone = s_0106-hphone.
    <b>endif.</b>
    ENDFORM. " rec2
    <b></b><b></b>
    Hope this will solve ur duplication problem

  • Simple transformation error in converting XML to internal table

    Hi Team,
    I have an issue, its working in Dev, QA, and Prod in PI 7.0, once we upgrade it to PI 7.1 I'm getting the  below mention error,   
    Unknown Simple transformation error in converting XML to internal table
    Application error in mapping program ZF_INT006_FILE_TO_SAP_FILE, error code: , error text: Unknown Simple transformation error in converting XML to internal table An exception has occurred.
    Can any one suggest related notes are suggestion.
    appericate in advance for the solutions which you all provide me
    Thank you
    Venkat Anil

    Check the flag "use SAP XML toolkit" for the operation mapping and try, if that works then.
    Check the flag for all XSLT and Java mappings which is migrated from PI 7.0

  • Simple command to refresh data of all declared internal tables & variables!

    Hi All,
    I have declared many internal tables & variables in my program in declaration include.
    Is there any Simple command which can refresh data of all declared internal tables & variables!
    Instead of clearing & refreshing each i.table & variable i want to use single command to refresh data.
    Is this possible!
    Thanks in advance.
    Thanks,
    Deep.

    CLEAR: lv_field1,
                 lv_field2,
                 lt_itab1[],
                 lt_itab2[].
    ONE simple command (CLEAR), can initialize fields, workareas, field-symbols,.... and internal tables.

  • Maximum record length in internal table?

    Is there a maximum record length in an internal table?  Please note:  My question is NOT related to table space.  I'm referring only to the length of an individual record (A.K.A. row length).
    I am using a work area to insert data into an internal table.  Both the work area and internal table are defined by the same structure.
    The structure has a total length of 672 bytes.  For the sake of this discussion I'll point out that at the end of the structure, bytes 669, 670, 671, and 672 are four separate fields of 1 character each.
    When viewing the work area record in the debugger I'm seeing all the fields and all the values.  When viewing the internal table in the debugger after a record is inserted, the internal table ends with the field defined at Byte 670.  The internal table does not include the two fields defined at Bytes 671 and 672.
    Am I to assume from the above explanation that the length of a record ( A.K.A. row) in an internal table cannot exceed 670 bytes?
    Thank you.

    Manish,
    False alarm!  While, technically, you didn't answer my question, your request for code ended up helping me answer my own question.
    To provide you with some code I wrote a simple test program using the record layout referred to above, with a DO loop to put some records into the internal table, followed by a LOOP AT, with accompanying WRITE statements to display the contents of the internal table and demonstrate that the last two fields weren't being stored.
    However, when I ran the test program, the last two fields were being displayed.
    It was at that point, when stepping through the debugger that I noticed the scroll arrows above the last column of my internal table that allowed me to scroll to the right and see my final two fields.
    Apparently, because of the large number of fields in my internal table I had reached the default display length of the debugger.  While I was obviously aware of the scroll bar found at the bottom of the display, I had never worked with an internal table of that width in the past and hadn't even noticed the scroll arrows above the last column before.
    Thanks for taking the time to respond helping me get to the solution.

  • How to Pass internal table from a program to Samrt form

    Hi Pals
    I want to pass an internal table which I have declared in the program to Smartform..can you please help
    me asap.
    Regards
    Praveen

    Hai.
    check link.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
    check this.
    How to create a New smartfrom, it is having step by step procedure
    http://sap.niraj.tripod.com/id67.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Here is the procedure
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Smartform
    you can check this link here you can see the steps and you can do it the same by looking at it..
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SMARTFORMS STEPS.
    1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
    2. Create Table type(t_struct) of stracture in se11.
    3. In your program declare Internal table(Itab) type table of structure(struct).
    4. Define work area(wa) like line of internal table.
    5. Open Tcode Smartforms
    6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
    7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
    8. In form pages and window, create Page node by default Page1 is available.
    9. In page node you can create numbers of secondary window. But in form there is only one Main window.
    10. By right click on page you can create windows or Go to Edit, Node, Create.
    11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
    12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
    13. In table there are three areas Header, Main Area, Footer.
    14. Right click on the Main area create table line by default line type1 is there select it.
    15. Divide line into cells according to your need then for each cell create Text node.
    16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
    17. Save form and activate it.
    18. Then go to Environment, function module name, there you get the name of function module copy it.
    19. In your program call the function module that you have copied from your form.
    20. In your program in exporting parameter of function pass the internal table(itab).
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
    configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
    What Transaction to start SAP Smart Forms?
    Execute transaction SMARTFORMS to start SAP Smart Forms.
    Key Benefits of SAP Smart Forms:
    SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
    To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
    These actions do not include writing of coding lines or using a Script language.
    Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
    For Web publishing, the system provides a generated XML output of the processed form.
    Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
    SmartForms System Fields
    Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
    System fields of Smart Forms
    &SFSY-DATE&
    Displays the date. You determine the display format in the user master record.
    &SFSY-TIME&
    Displays the time of day in the form HH:MM:SS.
    &SFSY-PAGE&
    Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
    &SFSY-FORMPAGES&
    Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
    &SFSY-JOBPAGES&
    Contains the total page number of all forms in the currently processed print request.
    &SFSY-WINDOWNAME&
    Contains the name of the current window (string in the Window field)
    &SFSY-PAGENAME&
    Contains the name of the current page (string in the Page field)
    &SFSY-PAGEBREAK&
    Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
    &SFSY-MAINEND&
    Is set as soon as processing of the main window on the current page ends
    &SFSY-EXCEPTION&
    Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).
    Example Forms Available in Standard SAP R/3
    SF_EXAMPLE_01
    Simple example; invoice with table output of flight booking for one customer
    SF_EXAMPLE_02
    Similar to SF_EXAMPLE_01 but with subtotals
    SF_EXAMPLE_03
    Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
    check this:
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SMARTFORMS_tutorial.html
    check this linkls------>
    https://www.sdn.sap.com/irj/sdn/collaboration
    http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Insert Images in smartforms
    regards.
    sowjanya.b.

  • Std Internal Tables

    Hi, what are Standard Internal Tables and Standard reports, and can I have names of some 'Standard Internal Tables' and  'Standard Reports' plz ?
    Thnx.

    these are some of the standard reports\
    REKH0004
       SAP demo program that shows how to do  2d        3D, and 4D graphics.
    RGUGBR00 
    Substitution/Validation utility
    RHGEN00
         Regen PD and PA inconsistencies
    RHGRENZ0  
       Delimit IT1000 and related 1001s. Program                     will            delete any 1001 infotypes whose start date is after the delimit date.
    RHGRENZ1
    Extend the end date on delimited records. Very useful when you delimit a bunch of records incorrectly, and need to change the end date.
    RHGRENZ2
    Delimit IT1001 only.
    RKCTSEAR
    Search source code for up to two strings. Also see RSRSCAN1 and RPR_ABAP_SOURCE_SCAN.
    RPDTRA00
    List all HR transactions.
    RPR_ABAP_SOURCE_SCAN
    Search ABAP code for a string. Has many more options for selecting the ABAPs to search than RSRSCAN1 or RKCTSEAR.
    RPUAUD00
    HR Report to list all logged changes for an employee. Uses the PCL4 Audit Cluster.
    RPUAUDDL
    HR Report to delete audit data from the PCL4 Audit Cluster.
    RPUDELPN
    Delete all info for an employee number, including cluster data and infotypes
    RPUP1D00/10
    View/Delete data from PCL1 Cluster
    RPUP2D00/10
    View/Delete data from PCL2 Cluster
    RPUP3D00/10
    View/Delete data from PCL3 Cluster
    RPUP4D00/10
    View/Delete data from PCL4 Cluster
    RSABAPIV
    Mass print/display of ABAP/4 help text
    RSAVGL00
    Table adjustment across clients
    RSBDCBTC
    Submit a BDC job with an internal batch number and wait for the end of the batch input session.
    RSBDCDRU
    Prints the contents of a Batch Input session. No options for error transactions only.
    RSBDCOS0
    Execute UNIX commands. Looks similar to the old SAPMSOS0 program that disappeared in 3.0
    RSBDCSUB
    Release batch input sessions automatically
    RSBTCDEL
    Clean the old background job records
    RSSDOCTB
    R/3 Table Manual - prints a list of all fields in the selected tables with the field name and the field documentation.
    RSCLTCOP
    Copy tables across clients
    RSDBCREO
    Clean batch input session log
    RSINCL00
    Extended program list
    RSNASTED
    Process message control output for entries in the NAST table
    RSORAREL
    Get the Oracle Release
    RSPARAM
    Display all instance parameters
    RSPO0041
    Removing old spooling objects
    RSRSCAN1
    Search source code for a given string. Will also search includes. Also see RKCTSEAR and RPR_ABAP_SOURCE_SCAN.
    RSSNAPDL
    Clean the old ABAP error dumps
    RSTBSERV
    Compare a contents of a table between clients
    RSTXFCON
    Converts SAPScript page formats
    RSTXSCRP
    Save a SAPScript layout set to disk, and load it back into SAP.
    RSTXSCRP
    Transport SAPscript files across systems
    RSTXSCRP
    Upload and download SAPScript layout sets
    RSTXTPDF4
    Pass the spool number of a report's output to this program to have the output converted to PDF format.
    RSTXTRAN
    Add standard texts to a transport so they can be moved between systems.
    RSUSR003
    Check the passwords of users SAP* and DDIC in all clients
    RSUSR006
    List users last login
    RSWBO052
    Change development class of a sapscript (provided by Alan Cecchini)
    RSWBO060
    put objects into a request and transport it to any other system
    inernal tables
    INTERNAL TABLES IN ABAP:
    There are two ways of accessing the records in an internal table:
    By copying individual records into a work area. The work area must be compatible with the line type of the internal table.
    You can access the work area in any way, as long as the component you are trying to access is not itself an internal table. If one of the components is an internal table, you must use a further work area, whose line type is compatible with that of the nested table.
    When you change the internal table, the contents of the work area are either written back to the table or added as a new record.
    By assigning the individual data records to an appropriate field symbol. Once the system has read an entry, you can address its components directly via its address. There is no copying to and from the work area. This method is particularly appropriate for accessing large or complex tables.
    If you want to read more than one record, you must use a LOOP... ENDLOOP structure. You can then change or delete the line that has just been read, and the system applies the change to the table body. You can also change or delete lines using a logical condition.
    When you use the above statements with sorted tables, you must ensure that the sort sequence is maintained.
    Within a loop, the INSERT statement adds the data record before the current record in the table. If you want to insert a set of lines from an internal table into another index table, you should use the INSERT LINES OF variant instead.
    When you read single data records, you can use two further additions:
    In the COMPARING addition, the system compares the field contents of a data record with those in the work area for equality.
    In the TRANSPORTING addition, you can restrict the data transport to selected fields.
    Other statements for standard tables
    SORT [ASCENDING|DESCENDING]
    [BY [ASCENDING|DESCENDING] ..
    [ASCENDING|DESCENDING]][AS TEXT] [STABLE].
    These statements sort the table by the table key or the specified field sequence. If you do not use an addition, the system sorts ascending. If you use the AS TEXT addition, character fields are sorted in culture-specific sequence. The relative order of the data records with identical sort keys only remain constant if you use the STABLE addition.
    APPEND INTO SORTED BY .
    This statement appends the work area to the ranked list in descending order. The ranked list may not be longer than the specified INITIAL SIZE, and the work area must satisfy the sort order of the table.
    The statements listed here can be used freely with both standard and sorted tables.
    When you change a single line, you can specify the fields that you want to change using the TRANSPORTING addition. Within a loop, MODIFY changes the current data record.
    If you want to delete a set of lines from an index table, use the variant DELETE FROM... TO.. or WHERE... instead of a loop. You can program almost any logical expression after WHERE.
    The only restriction is that the first field in each comparison must be a component of the line structure (see the corresponding Open SQL statements). You can pass component names dynamically.
    If you want to delete the entire internal table , use the statement CLEAR .
    In the LOOP AT... ENDLOOP structure, the statements within the loop are applied to each data record in turn. The INTO addition copies entries one at a time into the work area.
    The system places the index of the current loop pass in the system field sy-tabix. When the loop has finished, sy-tabix has the same value that it had before the loop started.
    Inserting and deleting lines within a loop affects the following loop passes.
    Access to a hashed table is imple mented using a hash algorithm. Simplified, this means that the data records are distributed randomly but evenly over a particular memory area.. The addresses are stored in a special table called the hashing table .
    There is a hash function, which determines the address at which the pointer to a data record with a certain key can be found. The function is not injective, that is, there can be several data records stored at a single address. This is implemented internally as a chained list. Therefore, although the system still has to search sequentially within these areas, it only has to read a few data records (usually no more than three). The graphic illustrates the simplest case, that is, in which there is only one data record stored at each address.
    Using a hash technique means that the access time no longer depends on the total number of entries in the table. On the contrary, it is always very fast. Hash tables are therefore particularly useful for large tables with which you use predominantly read access.
    Data records are not inserted into the table in a sorted order. As with standard tables, you can sort hashed tables using the SORT statement:
    SORT [ASCENDING|DESCENDING]
    [BY [ASCENDING|DESCENDING] ..
    [ASCENDING|DESCENDING]][AS TEXT].
    Sorting the table can be useful if you later want to use a loop to access the table.
    You can use the statements listed here with tables of all three types. Apart from a few special cases, you can recognize the statements from the extra keyword TABLE. The technical implementation of the statements varies slightly according to the table type.
    As a rule, index access to an internal table is quickest. However, it sometimes makes more sense to access data using key values. A unique key is only possible with sorted and hashed tables. If you use the syntax displayed here, your program coding is independent of the table type (generic type specification, easier maintenance).
    With a standard table, inserting an entry has the same effect as appending. With sorted tables with a non-unique key, the entry is inserted before the first (if any) entry with the same key.
    To read individual data records using the first variant, all fields of that are key fields of must be filled. and can be identical. If you use the WITH TABLE KEY addition in the second variant, you must also specify the key fully. Otherwise, the system searches according to the sequence of fields that you have specified, using a binary search where possible. You can force the system to use a binary search with a standard table using the BINARY SEARCH addition.
    In this case, you must sort the table by the corresponding fields first. The system returns the first entry that meets the selection criteria.
    Similarly to when you read entries, when you change and delete entries using the key and a work area, you must specify all of the key fields.
    You can prevent fields from being transported into the work area during loop processing by using the TRANSPORTING NO FIELDS addition in the WHERE condition. (You can use this to count the number of a particular kind of entry.)
    Other statements for all table types
    DELETE ADJACENT DUPLICATES FROM
    [COMPARING .. | A L L F I E L }|ALL FIELDS}].
    The system deletes all adjacent entries with the same key field contents apart from the first entry. You can prevent the system from only comparing the key field using the COMPARING addition. If you sort the table by the required fields beforehand, you can be sure that only unique entries will remain in the table after the DELETE ADJACENT DUPLICATES statement.
    Searches all lines of the table for the string . If the search is successful, the system sets the fields sy-tabix and sy-fdpos.
    FREE .
    Unlike CLEAR, which only deletes the contents of the table, FREE releases the memory occupied by it as well.
    If you want to access your data using the index and do not need your table to be kept in sorted order or to have a unique key, that is, when the sequence of the entries is the most important thing, not sorting by key or having unique entries, you should use standard tables. (If you decide you need to sort the table or access it using the key or a binary search, you can always program these functions by hand.)
    This example is written to manage a waiting list.
    Typical functions are:
    Adding a single entry,
    Deleting individual entries according to certain criteria,
    Displaying and then deleting the first entry from the list,
    Displaying someone's position in the list.
    For simplicity, the example does not encapsulate the functions in procedures.
    The first thing we do in the example is to declare line and table type, from which we can then declare a work area and our internal table. We also require an elementary field for passing explicit index values.
    This example omits the user dialogs and data transport, assuming that you understand the principles involved. We really only want to concentrate on the table access:
    Adding new entries
    The data record for a waiting customer is only added to the table if it does not already exist in it. If the table had a unique key, you would not have had to have programmed this check yourself.
    Deleting single entries according to various criteria
    The criterion is the key field. However, other criteria would be possible - for example, deleting data records older than a certain insertion date reg_date.
    Displaying and deleting the first entry from the list
    Once a customer comes to the top of the waiting list, you can delete his or her entry. If the waiting list is empty, such an action has no effect. Consequently, you do not have to check whether there are entries in the list before attempting the deletion.
    Displaying the position of a customer in the waiting list
    As above, you do not need to place any data in the work area. We are only interested in the values of sy-subrc and sy-tabix. If the entry is not in the table, sy-tabix is set to zero.
    At this stage, let us return to the special case of the restricted ranked list:
    DATA {TYPE|LIKE} STANDARD TABLE OF ... INITIAL SIZE . ... APPEND INTO SORTED BY .
    When you choose to use a sorted table, it will normally be because you want to define a unique key.
    The mere fact that the table is kept in sorted order is not that significant, since you can sort any kind of internal table. However, with sorted tables (unlike hashed tables), new data records are inserted in the correct sort order. If you have a table with few entries but lots of accesses that change the contents, a sorted table may be more efficient than a hashed table in terms of runtime.
    The aim of the example here is to modify the contents of a database table. The most efficient way of doing this is to create a local copy of the table in the program, make the changes to the copy, and then write all of its data back to the database table. When you are dealing with large amounts of data, this method both saves runtime and reduces the load on the database server. Since the internal table represents a database table in this case, you should ensure that its records have unique keys.
    This is assured by the key definition. Automatic sorting can also bring further advantages.
    When you change a group of data records, only the fields price and currency are copied from the work area.
    This means that, with larger tables, the access time is reduced significantly in comparison with a binary search. In a loop, however, the hashed table has to search the entire table (full table scan). Since the table entries are stored unsorted, it would be better to use a sorted table if you needed to run a loop through a left-justified portion of the key.
    It can also be worth using a hashed table but sorting it. A typical use for hashed tables is to buffer detailed information that you need repeatedly and can identify using a unique key. You should bear in mind that you can also set up table buffering for a table in the ABAP Dictionary to cover exactly the same case. However, whether the tables are buffered on the application table depends on the size of the database table.
    Buffering in the program using hashed tables also allows you to restrict the dataset according to your own needs, or to buffer additional data as required.
    In this example, we want to allow the user to enter the name of a city, and the system to display its geographical coordinates.
    First, we fill our "buffer table" city_list with values from the database table sgeocity. Then, we read an entry from the hashed table, specifying the full key.
    The details are displayed as a simple list. At this point, it is worth repeating that you should only use this buffering technique if you want to keep large amounts of data locally in the program. You must ensure that you design your hashed table so that it is possible to specify the full key when you access it from your program.
    You can define internal tables either with (WITH HEADER LINE addition) or without header lines. An internal table with header line consists of a work area (header line) and the actual table body. You address both objects using the same name. The way in which the system interprets the name depends on the context. For example, the MOVE statement applies to the header line, but the SEARCH statement applies to the body of the table.
    To avoid confusion, you are recommended to use internal tables without header lines. This is particularly important when you use nested tables. However, internal tables with header line do offer a shorter syntax in several statements (APPEND, INSERT, MODIFY, COLLECT, DELETE, READ, LOOP).
    hope this is helpful
    do reward

  • Creating XML file from ABAP internal table data....

    Hello,
    I am fethcing data froma  custom table and I have to write data in XMl format. Following is the XML format in which I want data. Is there any function module iN SAP which will help me in writing data from internal table to XML file ?
    <batch>
      <invoice>
        <StatusCode>10</StatusCode>
        <paymentamount>122.00</paymentamount>
         <ReferenceNumber>70980934</ReferenceNumber>
      </invoice>
      <invoice>
         <StatusCode>90</StatusCode>
        <paymentamount>122.00</paymentamount>
         <ReferenceNumber>70980934</ReferenceNumber>
      </invoice>
      <control>
        <InvoiceCount>2</InvoiceCount>
      </control>
    </batch>
    Please help.
    Regards,
    Jainam.

    I suggest you look into "simple transformations". That's SAP's most recent technology for such purposes, as far as I know.
    http://help.sap.com/abapdocu_70/en/ABENABAP_ST.htm
    Thomas

  • Internal table in bdc

    I am new to the bdc .
    i have gone to SHDB and created a new recording  for the some T-code .
    After that i have created a prog (transfer from recording ) .
    i got some values in the file in my presenation server.
    i got default code generated .
    I have to declare the internal table of some time .
    may i know of which type should i declare my internal table ??
    My code ****************************************************************
    report ZRAJESH_BDC
           no standard page heading line-size 255.
    include bdcrecx1.
    start-of-selection.
    perform open_group.
    *******loop
    perform bdc_dynpro      using 'SAPMF02K' '0101'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-D0110'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  '12345'.
    perform bdc_field       using 'RF02K-D0110'
                                  'X'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-TELF2'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPDA'.
    perform bdc_field       using 'LFA1-ANRED'
                                  'Mr.'.
    perform bdc_field       using 'LFA1-NAME1'
                                  'RAJESH'.
    perform bdc_field       using 'LFA1-SORTL'
                                  'Q'.
    perform bdc_field       using 'LFA1-LAND1'
                                  'US'.
    perform bdc_field       using 'LFA1-SPRAS'
                                  'EN'.
    perform bdc_field       using 'LFA1-TELF2'
                                  '9033558227'.
    perform bdc_transaction using 'XK02'.
    perform close_group.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> NODATA.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.

    Hi,
    I have one simple  BDC Program  .
    Just you have to do recording by using SHDB Transaction Code.
    and Copy that program and do some modification by following my Program and upload data to that perticular transaction.
    before that u have to prepare data in Text file by using TAB Space .
    Below is the Code(I have used MM01 transaction)
    ******************************************************************************************8
    report ZBDCTEST no standard page heading line-size 255.
    ***DECLARING TABLES.
    TABLES : MARA.
    **DECLARING INTERNAL TABLE.
    DATA : BEGIN OF ITAB OCCURS 0,
           MATNR LIKE MARA-MATNR,
           MEINS LIKE MARA-MEINS,
           MATKL LIKE MARA-MATKL,
           Maktx like makt-maktx,
           SPART LIKE MARA-SPART,
           END OF ITAB.
    DATA BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
       CODEPAGE                      = 'IBM'
       FILENAME                      = 'C:\TEST.TXT'
       FILETYPE                      = 'DAT'
      HEADLEN                       = ' '
      LINE_EXIT                     = ' '
      TRUNCLEN                      = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      DAT_D_FORMAT                  = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = ITAB
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      FILE_OPEN_ERROR               = 2
      FILE_READ_ERROR               = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      OTHERS                        = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *include bdcrecx1.
    *start-of-selection.
    *perform open_group.
    LOOP AT ITAB.
      REFRESH BDCDATA.
      perform bdc_dynpro      using 'SAPLMGMM' '0060'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'RMMG1_REF-MATNR'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=AUSW'.
      perform bdc_field       using 'RMMG1-MATNR'
                                    ITAB-MATNR.
      perform bdc_field       using 'RMMG1-MBRSH'
                                    'M'.
      perform bdc_field       using 'RMMG1-MTART'
                                    'FOOD'.
      perform bdc_dynpro      using 'SAPLMGMM' '0070'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'MSICHTAUSW-DYTXT(02)'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=ENTR'.
      perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                    'X'.
      perform bdc_field       using 'MSICHTAUSW-KZSEL(02)'
                                    'X'.
      perform bdc_dynpro      using 'SAPLMGMM' '4000'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=SP02'.
      perform bdc_field       using 'MAKT-MAKTX'
                                    'T1003'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'MARA-MATKL'.
      perform bdc_field       using 'MARA-MEINS'
                                    'BOX'.
      perform bdc_field       using 'MARA-MATKL'
                                     ITAB-MATKL.
      perform bdc_field       using 'MARA-SPART'
                                    ITAB-SPART.
      perform bdc_field       using 'MARA-MTPOS_MARA'
                                    'NORM'.
      perform bdc_dynpro      using 'SAPLMGMM' '4004'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BU'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'MAKT-MAKTX'.
      perform bdc_field       using 'MAKT-MAKTX'
                                    'T1003'.
    *perform bdc_transaction using 'MM01'.
    *perform close_group.
      CALL TRANSACTION 'MM01' USING BDCDATA MODE 'A'. "A= all screens ,N= no screens
    ENDLOOP.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> SPACE.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.
    if you want further help let me know
    Regards,
    Jak

  • Internal table in routine of infocube

    Hi
    Plz can anybody let me know simple scenario for where we use the internal table in the routine IN BW SIDE. Let me say i have 3 characteristic like CID,PID AND SRID and keyfigures like qty , revenue and amount.
    Thanx & Regards,
    RaviCHandra
    Please search the forum before posting a thread.
    Edited by: Pravender on Jan 29, 2012 9:38 PM

    Standard Internal Tables
    Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition.
    This is the quickest way to access table entries.
    Hashed Internal Tables
    Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.
    This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and using internal tables that are similar to database tables.
    Regards
    KP

Maybe you are looking for

  • Various issues since Leopard upgrade

    I have just installed Leopard on a Dual 2.7 G5 with a 500GB Hitachi HDD and 5GB RAM and I have noticed one or two niggling little 'quirks' (I am lumping everything together here, rather than separating them in to more appropriate sections, so that I

  • ORABPEL-11017 Error while translating message to native format

    Hello I and trying to do a simple read and write file adapter. When I try and map the variables in the xls file it seems to work right but I run the BPEL and I get this output :( ORABPEL-11017 [2010/01/20 15:52:19] Faulted while invoking operation "W

  • Ipad will not accept new version of itunes

    ipad will not accept new version of itunes

  • Alternatives to Network Magic (Cisco or otherwise)

    Hi, After many years of using Network Magic without decent support, updates or continued development  I've decided to knock it on the head. Persistent stopping or the Pure Networks service on all my PC's has convinced me I need an alternative product

  • Sorting of data in adobe forms

    Hi, We have an adobe form designed which picks the data from the backend. In one specific case, a table comprising of different headers with different data, including date is being called. My pdf simply displays the data, the way it is stored in the