ABAP proxy code using internal table

Hi XI guru's,
Good Afternoon,
My Scenario is ABAP Proxy to file using ztable.
i am getting data from Sap R/3 data base as Ztable. using this Ztable i have to write ABAP Proxy code. I generated ABAP Proxy and mentioned all below.Please send me ABAP Proxy code using this details. This is very urgent. Please help me.
ABAP proxy class:   zco_mioa_tata
structure              :   zmt_tata
structure                :   zdt_tata
structure                :   zdt_tata_employee
Table                :   zdt_tata_employee_tab
Ztable                :   zcnu_proxy_table
outbound structure:
mt_tata
    employee
thanks and regards
sai

Sai,
I guess this will help you.
1. Proxies can be a server proxy or client proxy. In our scenarios we require proxies to send or upload the data from/into SAP system.
2. One more thing proxies can be used if your WAS ≥ 6.2.
3. Use Tcode SPROXY into R/3 system for proxy use.
4. To send the data from R/3 system we use OUTBOUND PROXY. In Outbound proxy you will simply write an abap code to fetch the data from R/3 tables and then send it to XI. Below is the sample code to send the data from R/3 to XI.
REPORT zblog_abap_proxy.
DATA prxy TYPE REF TO zblogco_proxy_interface_ob.
CREATE OBJECT prxy.
DATA it TYPE zblogemp_profile_msg.
TRY.
it-emp_profile_msg-emp_name = 'Sarvesh'.
it-emp_profile_msg-empno = '01212'.
it-emp_profile_msg-DEPARTMENT_NAME = 'NetWeaver'.
CALL METHOD prxy->execute_asynchronous
EXPORTING
output = it.
commit work.
CATCH cx_ai_system_fault .
DATA fault TYPE REF TO cx_ai_system_fault .
CREATE OBJECT fault.
WRITE :/ fault->errortext.
ENDTRY.
Receiver adapter configurations should be done in the integration directory and the necessary sender/receiver binding should be appropriately configured. We need not do any sender adapter configurations as we are using proxies.
5. To receive data into R/3 system we use INBOUND PROXY. In this case data is picked up by XI and send it to R/3 system via XI adapter into proxy class. Inside the inbound proxy we careate an internal table to take the data from XI and then simply by using the ABAP code we update the data inot R/3 table. BAPI can also be used inside the proxy to update the data into r/3.
I hope this will clear few doubts in proxy.
Just go through these links:
http://help.sap.com/saphelp_nw04/helpdata/en/14/555f3c482a7331e10000000a114084/frameset.htm
ABAP Server Proxies By Siva Maranani
/people/siva.maranani/blog/2005/04/03/abap-server-proxies
/people/sravya.talanki2/blog/2006/07/28/smarter-approach-for-coding-abap-proxies
/people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
/people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
File to R/3 via ABAP Proxy with good example
/people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy
http://help.sap.com/saphelp_nw2004s/helpdata/en/48/d5a1fe5f317a4e8e35801ed2c88246/frameset.htm
Generating java proxies..
/people/prasad.ulagappan2/blog/2005/06/27/asynchronous-inbound-java-proxy
/people/rashmi.ramalingam2/blog/2005/06/25/an-illustration-of-java-server-proxy
Synchronous Proxies:
Outbound Synchronous Proxy
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/abap%2bproxy%2boutbound%2bprogram%2b-%2bpurchase%2border%2bsend
Inbound Synchronous Proxy
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/abap%2bproxy%2binbound%2bprogram%2b-%2bsales%2border%2bcreation
Regards,
Sarvesh

Similar Messages

  • Report using internal table events

    Hi,
    i have an internal table with  the fields 1. profitcenter 2. company code 3. gl account 4. amount
    for each profit center i need to seggregate accounts based on company code.
    the report should look like the one below.
    please suggest some code using internal table events at new , at end etc. as im not using alv. your help will be rewarded
    regards,
    ravi.
    -Profitcenter-companycodeglaccount-amount---
    -pfcenter1----
    glaccount1-1000---
    glaccount2-2000---
    4444-total--3000---
    glaccount1-4000---
    glaccount2-1000---
    3333-total--5000---
    -profitcentre1*total8000---
    profitcentre2.........

    Hi.
    TYPES: BEGIN OF G_I_DATA,
             PROFIT(4)   TYPE C,
             COMPANY(4)  TYPE C,
             ACCOUNT(10) TYPE C,
             AMOUNT      TYPE P,
           END OF G_I_DATA.
    DATA: G_IT_DATA TYPE TABLE OF G_I_DATA,
          G_WA_DATA TYPE G_I_DATA.
    DATA: G_SUM_COMPANY  TYPE P,
          G_SUM_PROFIT   TYPE P,
          G_AMOUNT       TYPE P.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 2000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 3000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 4000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 5000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 2000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 3000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 4000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 5000.
      APPEND G_WA_DATA TO G_IT_DATA.
      SORT G_IT_DATA BY PROFIT COMPANY ACCOUNT.
      WRITE: /6 'ProfitCenter', 20 'CompanyCode',
              34 'Glaccount', 48 'Amount'.
      WRITE: /6 SY-ULINE(50).
      LOOP AT G_IT_DATA INTO G_WA_DATA.
        AT NEW PROFIT.
          WRITE: /6 G_WA_DATA-PROFIT.
        ENDAT.
        G_AMOUNT = G_WA_DATA-AMOUNT.
        AT NEW ACCOUNT.
          WRITE: /34 G_WA_DATA-ACCOUNT,
                 48  G_AMOUNT.
        ENDAT.
        G_SUM_PROFIT = G_SUM_PROFIT + G_WA_DATA-AMOUNT.
        G_SUM_COMPANY = G_SUM_COMPANY + G_WA_DATA-AMOUNT.
        AT END OF COMPANY.
          WRITE: /20 G_WA_DATA-COMPANY,
                  34 'Totle',
                  48 G_SUM_COMPANY.
          CLEAR G_SUM_COMPANY.
          WRITE: /6 '*******'.
        ENDAT.
        AT END OF PROFIT.
          WRITE: /6 G_WA_DATA-PROFIT,
                  20 'Totle',
                  48 G_SUM_PROFIT.
          CLEAR G_SUM_PROFIT.
          WRITE: /6 '*************************************'.
        ENDAT.
      ENDLOOP.

  • Abap Logic for performance tuning not working when using Internal tables

    Hi,
    I wrote this piece of code that is working correctly that is select SUM of cost from DSO where Plant is the same for Sales Items.
    LOOP AT RESULT_PACKAGE INTO rp.
    SELECT SUM( /N/S_STRDCOST ) FROM /N/ADSP_DPIT00 INTO
    rp-/N/S_STRDCOST
    WHERE /N42/S_SALESITEM = rp-/N42/S_ITEMID AND /N42/S_PLPLANT EQ
    rp-/N42/S_SOURCE.
    MODIFY RESULT_PACKAGE FROM rp.
    Clear rp.
    ENDLOOP.
    Now I try to rewrite it for performance tunning using internal table  but I am getting 0 values. can't figure out whats the problem and been struggling fixing it.
    TYPES : begin of ty_DSO_TABLE,
             /N42/S_STRDCOST TYPE /N/ADSP_DSPC00-/N/S_STRDCOST,
             /N42/S_ITEMID TYPE /N/ADSP_DSPC00-/N/S_ITEMID,
           end of ty_DSO_TABLE.
    DATA: it_DSO_TABLE type hashed table of ty_DSO_TABLE with unique key
    /N/S_ITEMID,
         wa_DSO_TABLE type ty_DSO_TABLE.
    Field-symbols:  <rp> TYPE tys_TG_1.
    LOOP AT RESULT_PACKAGE assigning <rp>.
      clear wa_DSO_TABLE.
    Read table IT_DSO_TABLE into wa_DSO_TABLE with table key /N/S_ITEMID
      = <rp>-/N/S_ITEMID.
      if sy-subrc ne 0.
          select SUM( /N/S_STRDCOST )  into CORRESPONDING
          FIELDS OF wa_DSO_TABLE from
          /N/ADSP_DPIT00 WHERE /N/S_SALESITEM =  <rp>-/N/S_ITEMID AND
          /N/S_PLPLANT EQ <rp>-/N/S_SOURCE.
         if sy-subrc eq 0.
              <rp>-/N/S_STRDCOST = wa_DSO_TABLE-/N/S_STRDCOST.
         endif.
    endif.
    ENDLOOP.
    Any idea whats wrong with the code
    thanks

    Hi Vaidya,
    According to the code which you have written, there is no value in table IT_DSO_TABLE when you are trying to read the values.And after the read statement you have given a condition for sy-subrc. Hence the select statement is actually not even getting executed. *Also you have not assigned the final value back to the ResultPackage.*_
    So Kindly correct your code as follows:
    Data: wa_dso type ty_DSO_TABLE.
    LOOP AT RESULT_PACKAGE assigning <rp>.
    clear wa_DSO_TABLE.
    select SUM( /N/S_STRDCOST ) into CORRESPONDING
    FIELDS OF wa_DSO_TABLE from
    /N/ADSP_DPIT00 WHERE /N/S_SALESITEM = <rp>-/N/S_ITEMID AND
    /N/S_PLPLANT EQ <rp>-/N/S_SOURCE.
    if sy-subrc eq 0.
    <rp>-/N/S_STRDCOST = wa_DSO_TABLE-/N/S_STRDCOST.
    MODIFY RESULT_PACKAGE FROM <rp>.
    endif.
    ENDLOOP.
    Hope this helps you.
    Regards,
    Satyam

  • ABAP proxy code help needed

    Hi,
    In the ABAP inbound (server) proxy, I have written code like this.
    DATA: lt_material TYPE TABLE OF zxdt_material,
            ls_material TYPE zxdt_material,
            ls_input type zxmt_cam.
    ls_input = input.
    lt_material = ls_input-mt_cam-material.
    Here, material is a table type which should have 10 records of material. But it has only one records always eventhough I am passing 10 records in the input xml.
    What could be the reason?
    Any help is really appreciated since I am trying this for a long time now.
    Thanks
    Ricky

    Example code...
    here header has simple structure type (non repeating) so we directly assigning fields
    INPUT-ACCOUNTLIST-ACCOUNTDETAILINFO has proxy table structure(repeating structure) ,.... so we have used internal table for that..
    FUNCTION Z_00FI_ACCOUNTS_RECON_DAT.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(INPUT) TYPE  ZDT_ACCOUNT_RECON_INFO_TARGET4
    TABLES:ZT00FI_ACCDATA,                       "Accounts Data
           ZT00FI_ACCHEAD.
    DATA:
         LT_ACCOUNTLIST TYPE TABLE OF  ZDT_ACCOUNT_RECON_INFO_TARGET3,
         LT_ACCDATATAB TYPE TABLE OF ZT00FI_ACCDATA,
         LT_ACCHEADERTAB TYPE TABLE OF ZT00FI_ACCHEAD,
         LS_ACCOUNTLIST TYPE  ZDT_ACCOUNT_RECON_INFO_TARGET3,
         LS_ACCDATATAB TYPE ZT00FI_ACCDATA,
         LS_ACCHEADERTAB TYPE ZT00FI_ACCHEAD,
         LS_HEADER TYPE ZDT_ACCOUNT_RECON_INFO_TARGET.
        SELECT SINGLE * FROM ZT00FI_ACCHEAD
        WHERE BATCHID = INPUT-HEADER-BATCHID AND
              SUBBATCHID = INPUT-HEADER-SUBBATCHID.
    *IF SY-SUBRC NE 0.
    MOVE:
      INPUT-HEADER-SOURCEREF TO LS_ACCHEADERTAB-SOURCEREF,
      INPUT-HEADER-BATCHID TO LS_ACCHEADERTAB-BATCHID,
      INPUT-HEADER-SUBBATCHID TO LS_ACCHEADERTAB-SUBBATCHID,
      INPUT-EXTRACTIONINFO-DATAVERSION TO LS_ACCHEADERTAB-DATAVERSION,
      INPUT-EXTRACTIONINFO-SOURCESYSTEM TO LS_ACCHEADERTAB-SOURCESYSTEM,
      INPUT-EXTRACTIONINFO-COUNTRYCODE TO LS_ACCHEADERTAB-COUNTRYCODE,
      INPUT-EXTRACTIONINFO-NUMBEROFACCOUNTS TO LS_ACCHEADERTAB-NUMBEROFACCOUNTS,
      INPUT-EXTRACTIONINFO-STARTTIMESTAMP TO LS_ACCHEADERTAB-STARTIMESTAMP,
      INPUT-EXTRACTIONINFO-ENDTIMESTAMP TO LS_ACCHEADERTAB-ENDTIMESTAMP,
      INPUT-EXTRACTIONINFO-DELTAINDICATOR TO LS_ACCHEADERTAB-DELTAINDICATOR,
      INPUT-EXTRACTIONINFO-LASTBATCHINDICAT TO LS_ACCHEADERTAB-LASTBATCHINDICAT.
    MOVE 'N' TO LS_ACCHEADERTAB-PROCESSINDICATOR.
    APPEND LS_ACCHEADERTAB TO LT_ACCHEADERTAB.
    INSERT ZT00FI_ACCHEAD FROM TABLE LT_ACCHEADERTAB.
    MOVE INPUT-ACCOUNTLIST-ACCOUNTDETAILINFO TO LT_ACCOUNTLIST.
    LOOP AT LT_ACCOUNTLIST INTO LS_ACCOUNTLIST.
      MOVE:
      INPUT-HEADER-BATCHID TO LS_ACCDATATAB-BATCH_ID,
      INPUT-HEADER-SUBBATCHID TO LS_ACCDATATAB-SUBBATCH_ID.
      MOVE-CORRESPONDING LS_ACCOUNTLIST TO LS_ACCDATATAB.
      APPEND LS_ACCDATATAB TO LT_ACCDATATAB.
      CLEAR:LS_ACCOUNTLIST,
            LS_ACCDATATAB.
    ENDLOOP.
    INSERT ZT00FI_ACCDATA FROM TABLE LT_ACCDATATAB.
    COMMIT WORK.
    *ENDIF.
    ENDFUNCTION.

  • Using internal tables in BI 7 Start routines

    Hi All
    I tried searching for using internal tables in a start routine in BI 7 could not find the right pointers.
    This is what I am trying to do is the following:
    In a DSO ZSD_O01  I have a sales order and sales order item number and this DSO also contains the Contract number and the contract Item number.
    The DSO structure is as follows:
    /BIC/AZSD_O0100
    DOC_NUMBER
    ITEM
    CONTRACT
    CITEMNUM
    I want to read the data in this DSO into a internal table. But the key fields in this DSO is DOC_NUMBER and ITEM so I want to read this data into a internal table only for the first data package into the internal table. Thereafter I want to lookup into the internal table given the doc_number and ITEM to find the CONTRACT and CITEMNUM.
    Can any of you kindly show me how to :
    - Read data from a DSO into a internal table
    - Read the internal table for the first data package
    - How do I make the access in the internal table fast when my lookup in the internal table is not on the
      DSO key columns but on a different key column
    Appreciate your help
    Thanks
    Karen

    Hi Karen ,
    It will be helpful if you tell your requirement  as the approach you suggested is not looks convincing .May be their is some easy way and we can suggest you better approach
    -how to check for source_package = 1
    You need to hard code it .
    We decide package size at DTP level so you can declare a global variable .let say you have 50000 size of your  package then use global variable as counter and read only when record_count is <= 50000 .
    -how to declare the internal table so the values in it exists between different data packages
    Declare a global table and select data into it .A global table retain data across  the packages .
    - The key on which I need to lookup in the internal table is not the key fields as in the DSO
    Its ok .Let say you are doing lookup on A B and C field of DSO1 and the values may duplicate  in your source .then you just need to read the internal table having data from DSO2  with key field  A B C .
    Better if you set them as semantic keys at DTP level so that all  duplicate entries of A B  C will appear in same package .
    global Declarations
    In your start routine you will have this following code :
      TYPES:
          tyt_SC_1        TYPE STANDARD TABLE OF tys_SC_1
                            WITH NON-UNIQUE DEFAULT KEY.
    $$ begin of global - insert your declaration only below this line  -
    ...   insert your code here
    $$ end of global - insert your declaration only before this line   -
    One question
    Why you want to populate values for 1 source package only not for all ?This will be helpful to understand your requirement and may be we can fulfill it in some other manner .
    Regards,
    Jaya Tiwari

  • Is there any other option for using internal table in badi

    hi
    i know we cannot use internal table in badi
    but is der any other option
    plz write in d codez too
    with Regards
    Rohan Shetty
    Edited by: Rohan Shetty on May 6, 2008 2:14 PM

    of course you can use internal table in BAdi, do like this.
    data: itab type table of ....
    data: wa type ...
    Example:
    data: itab type (standard, sorted, hashed) table of mara.
    data: wa type mara.
    Or create your own type within the badi.
    types: begin of ty_xxx,
                fielda  type c,
                fieldb  type n,
                fieldc  type d.
    types: end   of ty_xxx
    data: itab type table of ty_xxx.
    data: wa type ty_xxx.
    Edited by: Micky Oestreich on May 6, 2008 2:16 PM

  • Submititng the program to another program  using internal table values

    Hi All,
    How to Submit from one program to another program using internal table values minimum 7 int tables without using the seletion screen
    thanks
    raj

    Hi All,
    Thank you very much for your inputs.
    i am facing another issue:
    For each 10,000 records it should trigger a job  (we are trying to call a program)  were the validation will be done only through the other program.
    please find the code mentioned below :
    TABLES : but000.
    DATA:  int_bp LIKE but000 OCCURS 0 WITH HEADER LINE.
    data released like BTCH0000-CHAR1.
    DATA: jobnumber LIKE tbtcjob-jobcount, " Job ID and
          jobname LIKE tbtcjob-jobname, " job name.
          startdate LIKE tbtcjob-sdlstrtdt, " Start-time
          starttime LIKE tbtcjob-sdlstrttm, " window specs.
          laststartdate LIKE tbtcjob-laststrtdt,
          laststarttime LIKE tbtcjob-laststrttm,
          job_released LIKE btch0000-char1. " JOB_CLOSE: Was job released?
    DATA : l1 TYPE i,
           b_size TYPE i,
           b_cursor TYPE cursor.
    INITIALIZATION.
      b_size = 5000.
    START-OF-SELECTION.
      OPEN CURSOR WITH HOLD b_cursor
         FOR
         SELECT *
         FROM but000
         WHERE bpkind = 'AA'.
      IF sy-subrc = 0.
        DO.
          FETCH NEXT CURSOR b_cursor INTO TABLE int_bp
                                               PACKAGE SIZE b_size.
    Note : here in this point  we are getting a dump for the second job trigger.
          IF sy-subrc = 0.
            CLEAR jobname.
            CONCATENATE sy-repid sy-datum sy-uzeit INTO jobname.
    export int_bp to memory id 'ABC'.
            CALL FUNCTION 'JOB_OPEN'
                 EXPORTING
                      jobname          = jobname
                 IMPORTING
                      jobcount         = jobnumber.
                EXCEPTIONS
                     cant_create_job  = 1
                     invalid_job_data = 2
                     jobname_missing  = 3
                     OTHERS           = 4
    CALL FUNCTION 'JOB_SUBMIT'
          EXPORTING
               authcknam = sy-uname
               jobname   = jobname
               jobcount  = jobnumber
               report    = 'YTEST_RRR'.
               variant   = lv_variant.
       SUBMIT ytest_rrr
          VIA JOB jobname NUMBER jobnumber
          AND RETURN.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
           event_periodic                    = 'X'
            jobcount                          = jobnumber
            jobname                           = jobname
            strtimmed                         = 'X'
          IMPORTING
            job_was_released                  = released
            else.
            EXIT.
          ENDIF.
        ENDDO.
    calling program :
    REPORT YTEST_RRR .
    data itab1 like but000 occurs 0 with header line.
    data l type i.
    import itab1 from memory id 'ABC' .
    describe table itab1 lines l.
    free memory id 'ABC'.
    write:/ 'total records are:', l.
    Please give your suggestion why its going for  dump in the second iteration.
    thanks in advance.

  • Best way to declare and use internal table

    Hi all,
    As per my knoledge there are various techeniques (Methods) to declare and use the internal tables.
    Please Suggest me the Best way to declaring and using internal table ( WITH EXAMPLE ).
    Please Give the reason as well how the particular method is good ?
    What are benefits of particular method ?
    Thanks in advance.
    Regards
    Raj

    Hello Raj Ahir,
    There are so many methods to declare an internal table.
    Mainly I would like to explain 2 of them mostly used.
    1. Using Work Area and
    2. With header line.
    This with header line concept is not suggestable, because, when we shift the code to oops concept.. it doesn't work... Because OOPS doesn't support the Headerline concept...
    But it all depends on the situation.
    If you are sure that your program doen't make use of the OOPs concept, you can use HEADER LINE concept. If it invols OOPs use WORK AREA concept.
    Now I'l explain these two methods with an example each...
    1. Using Work area.
    TABLES: sflight.
    DATA: it_sflight TYPE TABLE OF sflight.
    DATA: wa_sflight LIKE LINE OF it_sflight.
    SELECT *
      FROM sflight
      INTO it_sflight
      WHERE <condition>.
      LOOP AT it_sflight INTO wa_sflight.
        WRITE / wa_sflight.
      ENDLOOP.
      In this case we have to transfer data into work area wa_sflight.
    We can't access the data from the internal table direclty without work
    area.
    *<===============================================
    2. Using Header line.
      DATA: BEGIN OF it_sflight OCCURS 0,
              carrid LIKE sflight-carrid,
              connid LIKE sflight-connid,
              fldate LIKE sflight-fldate,
            END OF it_sflight.
      SELECT *
        FROM sflight
        INTO it_sflight
        WHERE <condition>.
        LOOP AT it_sflight INTO wa_sflight.
          WRITE / wa_sflight.
        ENDLOOP.
    In this case we can directly access the data from the internal table.
    Here the internal table name represents the header. for each and every
    interation the header line will get filled with new data. If you want to
    represnent the internal table body you can use it_sflight[].
    *<======================================================
    TYPES: BEGIN OF st_sflight,
             carrid LIKE sflight-carrid,
             connid LIKE sflight-connid,
             fldate LIKE sflight-fldate,
           END OF st_sflight.
    DATA: it_sflight TYPE TABLE OF st_sflight,
          wa_sflight LIKE LINE OF it_sflight.
    This is using with work area.
    DATA: it_sflight LIKE sflight OCCURS 0 WITH HEADER LINE.
    This is using header line.
    <b>REWARD THE POINTS IF IT IS HELPFUL.</b>
    Regards
    Sasidhar Reddy Matli.
    Message was edited by: Sasidhar Reddy Matli
            Sasidhar Reddy Matli

  • Population of sales orders using internal tables

    I am trying to execute a program, where my requirement is to populate all the
    sales orders number using internal tables concept
    I am not sure, whether I am missing portion of logic or logic is incorrect
    Followed is the source code of my program
    tables: vbak.
    data: ztab like standard table of vbak with header line.
    parameters: z_vbeln like vbak-vbeln.
    select * from vbak into ztab where vbtyp = 'c'.
    append ztab.
    endselect.
    write: 30 'sales order' , 50 'order type', 60 'date' , 75 'time'.
    loop at ztab.
    write: /30 ztab-vbeln, 50 ztab-vbtyp, 60 ztab-erdat, 75 ztab-erzet.
    endloop.
    Thanks In Advance!!

    Hi Eshwer,
    Try following code. Use into table concept. It performancewise better than select ...endselect.
    TABLES : vbak.
    DATA : ztab LIKE STANDARD TABLE OF vbak WITH HEADER LINE.
    PARAMETERS : z_vbeln LIKE vbak-vbeln.
    SELECT  *
        INTO TABLE  ztab
        FROM vbak
       WHERE vbtyp = 'c'.
    ***You can add parameter z_vbeln in where clause if required****
    IF sy-subrc EQ 0.
    write: 30 'sales order' , 50 'order type', 60 'date' , 75 'time'.
    LOOP AT ztab.
    write: /30 ztab-vbeln,
              50 ztab-vbtyp,
              60 ztab-erdat,
              75 ztab-erzet.
    ENDLOOP.
    Regards,
    Anil Salekar

  • Debugging ABAP Proxy code

    Hi,
    I have problem in ABAP Proxy. When i upload a XML and test the ABAP Proxy code it is working fine, but when i trigger the change from sender, its updating the wrong value in the database.
    I checked the incoming and the converted XML, everything is correct and there is no prob in the XI.
    Please tell me is there any way to debug the ABAP Proxy during the actual proccessing i,e. when the change is triggered from the sender.
    Thanks and Regards,
    Arunsri

    I've had the same problem before...everything seemed fine but the xml was not updating the desired values - you have 2 choices - 1. Enable the debugging, but if you have a high volume scenario, then it may cause some issues. Also, I am not sure if you plan to do this in production - as you know, debugging in production is a big No-No.
    Option 2 is to just take the stream and store it as a file in the OS. This is what we followed and we were able to figure out the issue with the xml. Make sure you write it in such a way that you can turn it off immediately. In our case, it worked fine for all suppliers but one and this one supplier was sending a double spaced character in between, which was causing the issue.
    Regards,
    Srini

  • Selecting records from DB table with out using internal tables

    hi,
    i need to retrieve values from a database table based on few fields and date as well. however, i need to check whether the date is less or equal to the current date and along with that i should get the appropriate record. how can i do that with out using internal table.
    field1-----date---
    11111----
    20070219
    11111--20070214 <---
    11111----
    20070205
    in the above scenario i should get the second record
    Regards,
    Kranthi.

    Try:
    REPORT ztest MESSAGE-ID 00.
    TABLES bkpf.
    SELECT * FROM bkpf
      UP TO 1 ROWS
      WHERE budat <= sy-datum
      ORDER BY budat DESCENDING.
    ENDSELECT.
    Rob

  • Compare the elements data of the 2 context nodes using internal table

    Hi,
    How can i compare the elements data of the 2 context nodes using internal table?
    Regards,
    Ronita

    hi ronita,
    just get the nodes data into internal tables and just compare them......
    node1->get_static_attributes_table(importing table = ITAB_node1)
    node2->get_static_attributes_table(importing table = ITAB_node2)
    now u have the data of ur 2 context nodes in 2 different internal tables ..
    just compare them like
    if  ITAB_node1[ ] = ITAB_node2[ ].
    write: / 'itab1 is equal to itab2'..
    endif.
    and u can use as many as comparision operators between these 2 tables to compare them....
    regards....
    srini,,,,

  • Using aggregation in ABAP code for internal table

    I have written following code to get cumulative amount on a date but i have to hit database for each record.
    Can't I use some function similar to SUM for doing the same thing on internal table??It would increase my performance.
    code is:
        SELECT SUM( DEB_CRE_LC ) FROM /BIC/AZFIAR_O500
         INTO LV_BALMONTH   WHERE   DEBITOR = LV_DEBITOR AND
        CALMONTH GE LV_STARTMONTH AND CALMONTH  LE LV_LASTCALMON.
    I want to put  ZFIAR data to internal table and read and do SUM thing..is it possible?? withotut usiong loop.
    regards,
    rakesh

    Hi Rajesh,
    types : begin of ty_tab,
                date type dats,
                DEB_CRE_LC   type .....     " delare type & is the filed need to summerized
                end of ty_tab,
    data: itab type standard table of ty_tab.
    SELECT date
                  SUM( DEB_CRE_LC )  as DEB_CRE_LC  FROM /BIC/AZFIAR_O500
                  INTO corresponding fields of itab
                  where CALMONTH GE LV_STARTMONTH AND CALMONTH LE LV_LASTCALMON
                  group by date.   " date is the field available in your ODS/transparent table
    simulate the above code in your program...
    Hope this will work..

  • Use Internal table in WebDynpro ABAP.

    Hi,
        I am using a internal table, for calling a FM, which require Internal table as its parameter. Since Internal table with header line is not supported in ABAP OO. How to attain this.
    Thanq For Ur time.
    Cheers,
    Sam

    Hi Sam,
    If we want to use an internal table for the FM as input then we can declare a table and use it.
    But when we want use it as a workarea we need to define a work area (another attribute) of a internal table saparatly and use it.
    Best regards,
    Suresh

  • Using Internal Table in ABAP OO.

    Hi,
         I am using a internal table, I am calling a FM, which require Internal table as its parameter. Since Internal table with header line is not supported in ABAP OO. How to attain this.
    Thanq For Ur time.
    Cheers,
    Sam

    Hi,
    Please look at my example below.
    TYPES: BEGIN OF t_vbak,
              vbeln TYPE vbak-vbeln,
              posnr TYPE vbap-posnr,
              erdat TYPE vbak-erdat,
              ernam TYPE vbak-ernam,
              auart TYPE vbak-auart,
              kunnr TYPE vbak-kunnr,
              vkgrp TYPE vbak-vkgrp,
             END OF t_vbak.
    DATA: gt_vbak     TYPE STANDARD TABLE OF t_vbak,
          gt_vbak_dum LIKE gt_vbak.
    *CLASS DEFINITIONS
    *       CLASS lcl_get_so DEFINITION
    CLASS lcl_get_so DEFINITION.
      PUBLIC SECTION.
        METHODS: get_sales_orders
                    EXPORTING
                       ex_vbak LIKE gt_vbak.
    ENDCLASS.                    "lcl_get_so DEFINITION
    *CLASS IMPLEMENTATIONS
    *       CLASS lcl_get_so IMPLEMENTATION
    CLASS lcl_get_so IMPLEMENTATION.
      METHOD get_sales_orders.
        SELECT vbak~vbeln vbap~posnr vbak~erdat
               vbak~ernam vbak~auart vbak~kunnr
               vbak~vkgrp
          FROM vbak
         INNER JOIN vbap
            ON vbak~vbeln = vbap~vbeln
          INTO TABLE gt_vbak
         WHERE vbak~erdat IN s_erdat
           AND vbak~ernam IN s_ernam
           AND vbak~auart IN s_auart
           AND vbak~vkgrp IN s_vkgrp
           AND vbak~kunnr = p_kunnr.
        IF NOT gt_vbak[] IS INITIAL.
          ex_vbak[] = gt_vbak[].
        ELSE.
          MESSAGE i000 WITH 'No data found for given criteria'.
          LEAVE TO SCREEN 0.
        ENDIF.
      ENDMETHOD.                    "get_sales_orders
    ENDCLASS.                    "lcl_get_so IMPLEMENTATION
    * START-OF-SELECTION                           *
    START-OF-SELECTION.
      DATA: o_get_so         TYPE REF TO lcl_get_so.
      CREATE OBJECT: o_get_so.
    *Get sales orders
        CALL METHOD o_get_so->get_sales_orders
          IMPORTING
            ex_vbak = gt_vbak_dum.
    Hope it helps...
    Please award points if it helps...

Maybe you are looking for