Interfaces in ABAP

Can any one tell me how to handle interfaces in ABAP.
i would like to know what r all methodology  or technology we can use like RFC,IDOC,BAPI,ALE,BDC.
Thanks in advance

HI ,
<b>BATCH DATA COMMUNICATION</b>
About Data Transfer In R/3 System
When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.
In the process of replacing current applications and transferring application data, two situations might occur:
•     The first is when application data to be replaced is transferred at once, and only once.
•     The second situation is to transfer data periodically from external systems to SAP and vice versa.
•     There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.
The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called “batch input” or “batch data communication”.
1. SESSION METHOD
2. CALL TRANSACTION
3. DIRECT INPUT
Advantages offered by BATCH INPUT method:
1.     Can process large data volumes in batch.
2.     Can be planned and submitted in the background.
3.     No manual interaction is required when data is transferred.
4.     Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.
To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a “data transfer” program must map the data from the external system into the data structure required by the SAP batch input program.
The batch input program must build all of the input to execute the SAP transaction.
Two main steps are required:
•     To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.
•     To pass the table to SAP for processing.
Prerequisite for Data Transfer Program
Writing a Data Transfer Program involves following prerequisites:
Analyzing data from local file
Analyzing transaction
Analyzing transaction involves following steps:
•     The transaction code, if you do not already know it.
•     Which fields require input i.e., mandatory.
•     Which fields can you allow to default to standard values.
•     The names, types, and lengths of the fields that are used by a transaction.
•     Screen number and Name of module pool program behind a particular transaction.
To analyze a transaction::
•     Start the transaction by menu or by entering the transaction code in the command box.
(You can determine the transaction name by choosing System – Status.)
•     Step through the transaction, entering the data will be required for processing your batch input data.
•     On each screen, note the program name and screen (dynpro) number.
(dynpro = dyn + pro. Dyn = screen, pro = number)
•     Display these by choosing System – Status. The relevant fields are Program (dynpro) and Dynpro number.  If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.
The technical info pop-up shows not only the field information but also the program and screen.
•     For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.
Note the following information:
-     The field name for batch input, which you’ll find in its own box.
-     The length and data type of the field. You can display this information by double clicking on the Data Element field.
•     Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).
Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.
In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.
You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.
Once you have program name, screen number, field name (screen field name), you can start writing.
DATA TRANSFER program.
Declaring internal table
First Integral Table similar to structure like local file.
Declaring internal table like BDCDATA
The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.
The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.
This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:
•     Create a BDCDATA structure
•     Write the structure out to a session or process it with CALL TRANSACTION USING; and then
•     Create a BDCDATA structure for the next transaction that is to be processed.
Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.
The screen identifier record is followed by a separate BDCDATA record for each value,  to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:
•     Data that is entered into screen fields.
•     Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.
The BDCDATA structure contains the following fields:
•     PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.
•     DYNPRO: Screen Number. Set this field only in the first record for the screen.
•     DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to ‘  ‘ (blank) for all other records.)
•     FNAM: Field Name. The FNAM field is not case-sensitive.
•     FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.
Transferring data from local file to internal table
Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.
Population of BDCDATA
For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.
All these five initial steps are necessary for any type of BDC interface.
DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION.  The initial steps for both the methods are same.
First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.
<b>SESSION METHOD</b>
About Session method
In this method you transfer data from internal table to database table through sessions.
In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.
Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.
When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.
Unless session is processed, the data is not transferred to database table.
<b>BDC_OPEN_GROUP</b>
You create the session through program by BDC_OPEN_GROUP function.
Parameters to this function are:
•     User Name:     User name
•     Group:          Name of the session
•     Lock Date:          The date on which you want to process the session.
•     Keep:          This parameter is passed as ‘X’ when you want to retain session after
               processing it or ‘   ‘ to delete it after processing.
<b>BDC_INSERT</b>
This function creates the session & data is transferred to Session.
Parameters to this function are:
•     Tcode:          Transaction Name
•     Dynprotab:          BDC Data
<b>BDC_CLOSE_GROUP</b>
This function closes the BDC Group. No Parameters.
Some additional information for session processing
When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.
However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue.  Log is not removed for that session.
If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.
<b>CALL TRANSACTION</b>
About CALL TRANSACTION
A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program by
Call transaction     <tcode> using <BDCTAB>
     Mode <A/N/E>
     Update <S/A>
     Messages into <MSGTAB>.
Parameter – 1     is transaction code.
Parameter – 2     is name of BDCTAB table.
Parameter – 3     here you are specifying mode in which you execute transaction
          A is all screen mode.  All the screen of transaction are displayed.
          N is no screen mode. No screen is displayed when you execute the transaction.
     E is error screen. Only those screens are displayed wherein you have error record.
Parameter – 4     here you are specifying update type by which database table is updated.
     S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.
     A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place.  So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).
Parameter – 5     when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:
     1. Tcode:      Transaction code
     2. Dyname:      Batch point module name
     3. Dynumb:      Batch input Dyn number
     4. Msgtyp:      Batch input message type (A/E/W/I/S)
     5. Msgspra:     Batch input Lang, id of message
     6. Msgid:     Message id
     7. MsgvN:     Message variables (N = 1 - 4)
For each entry, which is updated in database, table message is available in BDCMSGCOLL. As BDCMSGCOLL is structure, you need to declare a internal table which can contain multiple records (unlike structure).
Steps for CALL TRANSACTION method
1.     Internal table for the data (structure similar to your local file)
2.     BDCTAB like BDCDATA
3.     UPLOAD or WS_UPLOAD function to upload the data from local file to itab. (Considering file is local file)
4.     Loop at itab.
Populate BDCTAB table.
Call transaction     <tcode> using <BDCTAB>
     Mode <A/N/E>
                       Update <S/A>.
Refresh BDCTAB.
Endloop.
(To populate BDCTAB, You need to transfer each and every field)
The major differences between Session method and Call transaction are as follows:
          SESSION METHOD               CALL TRANSACTION
1.          Data is not updated in database table unless Session is processed.               Immediate updation in database table.
2.          No sy-subrc is returned.               Sy-subrc is returned.
3.          Error log is created for error records.               Errors need to be handled explicitly
4.          Updation in database table is always synchronous               Updation in database table can be synchronous Or Asynchronous.
Error Handling in CALL TRANSACTION
When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:
Steps for the error handling in CALL TRANSACTION
1.     Internal table for the data (structure similar to your local file)
2.     BDCTAB like BDCDATA
3.     Internal table BDCMSG like BDCMSGCOLL
4.     Internal table similar to Ist internal table
     (Third and fourth steps are for error handling)
5.     UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)
6.     Loop at itab.
Populate BDCTAB table.
Call transaction <tr.code> using <Bdctab>
                          Mode <A/N/E>
                          Update <S/A>
                          Messages <BDCMSG>.
      Perform check.
      Refresh BDCTAB.
      Endloop.
7     Form check.
IF sy-subrc <> 0.  (Call transaction returns the sy-subrc if updating is not successful).
Call function Format_message.
(This function is called to store the message given by system and to display it along with record)
Append itab2.
Display the record and message.
Check these links to know more
<b>BAPI</b>
http://www.allsaplinks.com/bapi.html
<b>IDOC</b>
http://www.allsaplinks.com/idoc_sample.html
http://www.allsaplinks.com/
http://www.sap-img.com/
http://www.sappoint.com/abap.html
Regards,
Santosh

Similar Messages

  • Significance of Interfaces in ABAP Objects

    Hi Guys, here I have a query -
    Why do we use Interfaces in ABAP Objects?, and what is the significance of Interfaces in ABAP Objects?
    Please clarify the above with a suitable example.

    Moderator message - Welcome to SCN.
    But
    Moderator message - But this isn't a training forum. Please ask a specific question - post locked

  • Trigerring Outbound XI interfaces in ABAP

    Hi,
    I need to know about calling an outbound XI interface in ABAP. Can any body share some knowledge about this?
    Thanks,
    Kulwant

    Kulwant,
    >>>While i m trying to edit EXECUTE_ASYNCHRONOUS method of my class, it says "You Cannot Edit Proxy Objects". Is it the expected behaviour or some thing is wrong at my side
    Yes. It is the expected behaviour. You can not edit a client(outbound) proxy. You need to have a report which will call this method and pass the reqd data.
    P.S For server proxy, you can and need to edit the EXECUTE_ASYNCHRONOUS. Here you will write the code to retrive the data and process.
    >>>In SXMB_MONI, i can see Sender Message but will there be any response message too? Because i cannot find such message
    Since your interface is asynchronous, you will not have a respose msg.
    Regards,
    Jai Shankar.

  • What are the Interfaces in ABAP

    Hi all,
    What are the Interfaces in ABAP ?
    send me any material on the same

    Dear
    Interface are basically used to upload large amt of data in SAP .
    Intrfaces are Automation of BDCS..
    Search for BDC'S IN FORUM u will get lots of material on same
    Rgds
    Santo

  • Interfaces in abap programming

    Hi,
        Please tell me what is an interface in abap program and also let me know how many types are there with ex's.
    Thanks
    Ali

    hi ,
    check the below links too may be helpful for you
    http://help.sap.com/saphelp_nw04/helpdata/en/78/217da751ce11d189570000e829fbbd/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    /people/kevin.wilson2/blog/2006/11/13/ale-scenario-development-guide
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci1230385,00.html .
    for the geneal stuff on ale/idoc check the below links
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    check out this link :
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=interfacesinABAP&cat=sdn_all
    For ALE -- IDoc's
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs
    ALE/ IDOC/EDI
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    ALE/ IDOC/ XML
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://www.thespot4sap.com/Articles/SAP_XML_Business_Integration.asp
    http://help.sap.com/saphelp_srm30/helpdata/en/72/0fe1385bed2815e10000000a114084/content.htm
    IDOC Convertion
    /people/kevin.wilson2/blog/2005/12/07/changing-fields-in-an-idoc-segment
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/ale/configuration.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapdevelopment.co.uk/training
    http://www.sapgenie.com/ale/why_ale.htm
    http://www.sapdevelopment.co.uk/training
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    Regards,
    Ranjita

  • Interface Type "ABAP Dictionary-Based Interface" not generating Interac

    Hi All,
    I am getting problem in ABAP Adobe interactive forms in ECC6.
    I tried designing Adobe interactive form by 2 following ways:
    1) in SFP -->> Interface Type -->"ABAP Dictionary-Based Interface"
    2) in SFP -->> Interface Type -->"XML Schema-Based Interface"
    When I designed with 1st way I am not getting Interactive form, I get only read
    only form when executing ABAP webdynpro application.
    But same form giving interactive form when calling ABAP program.
    But when I designed with 2nd(XML) way I am getting Interactive form. In Webdynpro application.
    In both case i have kept view property as enabled.
    Please guide me, Is there any step which is mandatory for Adobe interactive forms when
    we use (SFP -->> Interface Type -->"ABAP Dictionary-Based Interface"), with ABAP webdynpro application.
    Thanks

    XML Schema-Based Interface

  • RRI (Report Report Interface) with ABAP Sender program

    I need to call a Report Writer report from a bespoke ABAP program. I can call transaction START_REPORT to do this, but I wondered if the Report-Report Interface can be used here.
    Has anyone ever programmed a direct call to the RRI interface in ABAP?

    Hi Robin
    I know the answer comes late but you might find my wiki posting helpful:
    https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP+Report-Report-Interface
    Regards,
    Marc
    SAP NetWeaver RIG

  • Difference between PI/XI interface and ABAP interface

    Hello Experts,
    We are in the process of identifying interfaces for our current client. I am looking for some documentation or any specific information that will help me to differentiate between SAP PI interface and ABAP Interface. Basically I want to know what are the advantages of PI interface over ABAP interface. What is better? and why?
    Any information would be of great help. Thanks.

    PI (versus point to point ABAP) advantages are:
    1)     Centralized control over data security
    2)     More effective (centralized) interface failure monitoring and resolution
    3)     Elimination of redundant development and maintenance costs

  • Interface between ABAP and Excel-report

    Hi anyone!
    I need to implement a BAdI (CRM_MKTTG_SEG_MEM_EX) for displaying an aggregated BW field in the CRM Segment Builder. However my programmer knows little about the interface between ABAP an Excel. He therefore struggles with the programming. Have anyone of you any suggestions for how he can call a field in a query. Has anyone used this BAdI for the same purpose?
    Thanks, Camilla

    Hello Camilla,
    i think you should ask your question in a generic form in the BW forum. Ask them for access to a Query via RFC.
    Regards
    Gregor

  • SLD Application Programming Interface for ABAP-Based Systems

    Hi Experts,
    Could you help me to configure the connection between SLD ABAP API and the SLD manually?
    Why we use SLD Application Programming Interface for ABAP-based systems (SLD ABAP API)?
    please help.
    Sushama

    You have to use transaction SLDAPICUST in the business system to define the SLD access data. This data consists of the host and port of the SLD as well as a user and password (PIAPPLUSER, for example). You can use the entries that you maintained on your Integration Server.
    The RFC destinations LCRSAPRFC and SAPSLDAPI are used for the SLD connection. They use the SLD access data maintained with transaction SLDAPICUST. The RFC destination LCRSAPRFC is used to read the exchange profile; SAPSLDAPI is used by the ABAP API.
    The RFC destinations are also used to retrieve the information about where to retrieve the information about where to find the Integration Builder required for the proxy generation. This information is located in the exchange profile.
    You have to create both RFC destinations in your business system. They use the same registered server program, which is defined as part of the RFC engine settings of the J2EE Engine on the Integration Server host. This means that all business systems can use the same server program for their RFC destinations LCRSAPRFC and SAPSLDAPI. This program ID is:
    &#9679;      SAPSLDAPI_UNICODE for Unicode business systems
    &#9679;      SAPSLDAPI_NONUNICODE
    This should help

  • Interface SAP/ABAP-Host - Non SAP/ABAP Host

    Hi experts,
    I need to define an interface technoloty between an ABAP-host and a Non-ABAP host.
    I know, that non-abap hosts are able to call RFC-Function Modules of the ABAP-host and that I can use this method to exchange data between the systems. This means, the non-abap host starts the action.
    But I don't know, how I can do it on the other way, so that the ABAP-host starts the action.
    So how can I call a function/program on the non-abap host out of SAP?
    Do I need to define this as an external program call in SM59?
    And if so, how does the syntax needs to be look-like, which I need to implement in ABAP.
    Is it an normal RFC-FM which has the destination of the SM59?
    Kind regards and thank you for every tip.

    Hi Christian,
                        SUP i.e Sybase is the interface which is used to connect non SAP to SAP system via RFC-FM. It does not require to do RFC settings through SM59.
    Regards,
    Shahezad

  • The use of interface in abap object

    hi,
    what is the use of interface in class? can have a simple example with explanation? i have read from help but not quite understand its purpose.
    thanks

    Hi El,
    Interfaces are pure abstract classes. The interface methods will have only definitions but no implementations.
    The classes which will implement interfaces has to provide the implementation to the methods.
    Interfaces will provide the common definition and the classes which implements these interfaces will provide them different implementation to the methods as per their requirements. This achieves Polymorphism of Object Orientation.
    REPORT zbc404_hf_events_3 .
    INTERFACE lif_employee.
      METHODS:
        add_employee
           IMPORTING im_no   TYPE i
                     im_name TYPE string
                     im_wage TYPE i.
    ENDINTERFACE.
    CLASS lcl_company_employees DEFINITION.
      PUBLIC SECTION.
        INTERFACES lif_employee.
        TYPES:
          BEGIN OF t_employee,
            no  TYPE i,
            name TYPE string,
            wage TYPE i,
         END OF t_employee.
        METHODS:
          constructor,
         add_employee      "Removed
            IMPORTING im_no   TYPE i
                      im_name TYPE string
                      im_wage TYPE i,
          display_employee_list,
          display_no_of_employees.
      PRIVATE SECTION.
        CLASS-DATA: i_employee_list TYPE TABLE OF t_employee,
                    no_of_employees TYPE i.
    ENDCLASS.
    CLASS lcl_company_employees IMPLEMENTATION.
      METHOD constructor.
        no_of_employees = no_of_employees + 1.
      ENDMETHOD.
      METHOD lif_employee~add_employee.
      Adds a new employee to the list of employees
        DATA: l_employee TYPE t_employee.
        l_employee-no = im_no.
        l_employee-name = im_name.
        l_employee-wage = im_wage.
        APPEND l_employee TO i_employee_list.
      ENDMETHOD.
      METHOD display_employee_list.
      Displays all employees and there wage
        DATA: l_employee TYPE t_employee.
        WRITE: / 'List of Employees'.
        LOOP AT i_employee_list INTO l_employee.
          WRITE: / l_employee-no, l_employee-name, l_employee-wage.
        ENDLOOP.
      ENDMETHOD.
      METHOD display_no_of_employees.
      Displays total number of employees
        SKIP 3.
        WRITE: / 'Total number of employees:', no_of_employees.
      ENDMETHOD.
    ENDCLASS.
    Check this link for some more examples on OO ABAP
    http://www.erpgenie.com/sap/abap/OO/eg1.htm
    Thanks,
    Vinay

  • Need sample programs for inbound & outbound interfaces in abap hr?

    hi friends
    i need sample programs for inbound & outbound interface programs in hr abap . any one send me pls
    thanks & regards
    deepurd

    &u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
    *& Report ZPROG65_11 *
    &u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
    REPORT zprog65_11 .
    TABLES : lfa1.
    TYPES : BEGIN OF ven ,
    lifnr LIKE rf02k-lifnr,
    bukrs LIKE rf02k-bukrs ,
    ekorg LIKE rf02k-ekorg,
    ktokk LIKE rf02k-ktokk,
    name1 LIKE lfa1-name1,
    sortl LIKE lfa1-sortl,
    land1 LIKE lfa1-land1,
    spars LIKE lfa1-spras,
    akont LIKE lfb1-akont,
    fdgrv LIKE lfb1-fdgrv,
    waers LIKE lfm1-waers,
    anred LIKE lfa1-anred ,
    END OF ven .
    DATA : t_ven TYPE TABLE OF ven WITH HEADER LINE ,
    t_bdc LIKE TABLE OF bdcdata WITH HEADER LINE .
    DATA : v_file TYPE string ,
    v_temp TYPE i ,
    v_lifnr(10) TYPE n,
    v_hdate LIKE sy-datum.
    DATA : c_tcode LIKE sy-tcode .u201Dvalue u2018XK01u2032.
    PARAMETERS : p_file(30) DEFAULT u2018c:\vendor1_11.txtu2019,
    p_group LIKE apqi-groupid.
    START-OF-SELECTION .
    MOVE p_file TO v_file .
    PERFORM file_upload TABLES t_ven USING v_file .
    v_hdate = sy-datum - 1.
    CALL FUNCTION u2018BDC_OPEN_GROUPu2019
    EXPORTING
    client = sy-mandt
    DEST = FILLER8
    group = p_group
    holddate = v_hdate
    keep = u2018Xu2019
    user = sy-uname
    IMPORTING
    QID =
    EXCEPTIONS
    client_invalid = 1
    destination_invalid = 2
    group_invalid = 3
    OTHERS = 11
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT t_ven .
    clear lfa1.
    v_temp = 0.
    MOVE t_ven-lifnr TO v_lifnr.
    SELECT SINGLE * FROM lfa1 INTO lfa1 WHERE lifnr =
    v_lifnr.
    IF sy-subrc = 0.
    WRITE :/ u2018foundu2019.
    v_temp = 1.
    else.
    write: / u2018not foundu2019.
    ENDIF.
    IF v_temp = 0.
    c_tcode = u2018xk01u2032.
    PERFORM fill_ddc_table .
    ELSEIF v_temp = 1.
    c_tcode = u2018xk02u2032.
    PERFORM fill_bdc_table .
    ENDIF.
    CALL FUNCTION u2018BDC_INSERTu2019
    EXPORTING
    tcode = c_tcode
    TABLES
    dynprotab = t_bdc
    EXCEPTIONS
    internal_error = 1
    OTHERS = 7.
    REFRESH t_bdc .
    ENDLOOP .
    CALL FUNCTION u2018BDC_CLOSE_GROUPu2019
    EXCEPTIONS
    not_open = 1
    queue_error = 2
    OTHERS = 3.
    &u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
    *& Form file_upload
    &u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
    text
    u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
    u2013>P_T_VEN text
    u2013>P_V_FILE text
    u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
    FORM file_upload TABLES p_tven STRUCTURE t_ven
    USING p_vfile.
    CALL FUNCTION u2018GUI_UPLOADu2019
    EXPORTING
    filename = p_vfile
    filetype = u2018ASCu2019
    has_field_separator = u2018Xu2019
    IMPORTING
    FILELENGTH =
    HEADER =
    TABLES
    data_tab = p_tven
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    OTHERS = 17
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. u201D file_upload
    &u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
    *& Form FILL_DDC_TABLE
    &u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
    text
    u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
    u2013> p1 text
    <u2013 p2 text
    u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
    FORM fill_ddc_table .
    SCREN 100
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180100u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018RF02K-LIFNRu2019.
    t_bdc-fval = t_ven-lifnr .
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018RF02K-BUKRSu2019.
    t_bdc-fval = t_ven-bukrs.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018RF02K-EKORGu2019.
    t_bdc-fval = t_ven-ekorg.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018RF02K-KTOKKu2019.
    t_bdc-fval = t_ven-ktokk.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018/00u2032.
    APPEND t_bdc. CLEAR t_bdc.
    110
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180110u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFA1-NAME1u2032.
    t_bdc-fval = t_ven-name1 .
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFA1-SORTLu2019.
    t_bdc-fval = t_ven-sortl.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFA1-LAND1u2032.
    t_bdc-fval = t_ven-land1.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFA1-SPRASu2019.
    t_bdc-fval = t_ven-spars.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018/00u2032.
    APPEND t_bdc. CLEAR t_bdc.
    120
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180120u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018/00u2032.
    APPEND t_bdc. CLEAR t_bdc.
    130
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180130u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018=ENTRu2019.
    APPEND t_bdc. CLEAR t_bdc.
    210
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180210u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFB1-AKONTu2019.
    t_bdc-fval = t_ven-akont .
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFB1-FDGRVu2019.
    t_bdc-fval = t_ven-fdgrv.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018/00u2032.
    APPEND t_bdc. CLEAR t_bdc.
    215
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180215u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018/00u2032.
    APPEND t_bdc. CLEAR t_bdc.
    220
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180220u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018/00u2032.
    APPEND t_bdc. CLEAR t_bdc.
    310
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180310u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFM1-WAERSu2019.
    t_bdc-fval = t_ven-waers .
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018/00u2032.
    APPEND t_bdc. CLEAR t_bdc.
    320
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180320u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018=UPDAu2019.
    APPEND t_bdc. CLEAR t_bdc.
    ENDFORM. u201CFILL_DDC_TABLE
    u201D FILL_DDC_TABLE
    &u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
    *& Form FILL_BDC_TABLE
    &u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
    text
    u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
    u2013> p1 text
    <u2013 p2 text
    u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
    FORM fill_bdc_table .
    SCREN 101
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180101u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018RF02K-LIFNRu2019.
    t_bdc-fval = t_ven-lifnr .
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018RF02K-BUKRSu2019.
    t_bdc-fval = t_ven-bukrs.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018RF02K-EKORGu2019.
    t_bdc-fval = t_ven-ekorg.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018/00u2032.
    APPEND t_bdc. CLEAR t_bdc.
    110
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180110u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018lfa1-anredu2019.
    t_bdc-fval = t_ven-anred .
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFA1-NAME1u2032.
    t_bdc-fval = t_ven-name1 .
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFA1-SORTLu2019.
    t_bdc-fval = t_ven-sortl.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFA1-LAND1u2032.
    t_bdc-fval = t_ven-land1.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018LFA1-SPRASu2019.
    t_bdc-fval = t_ven-spars.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018/00u2032.
    APPEND t_bdc. CLEAR t_bdc.
    300
    t_bdc-program = u2018SAPMF02Ku2019.
    t_bdc-dynpro = u20180300u2032.
    t_bdc-dynbegin = u2018Xu2019.
    APPEND t_bdc. CLEAR t_bdc.
    t_bdc-fnam = u2018BDC_OKCODEu2019.
    t_bdc-fval = u2018=YESu2019.
    APPEND t_bdc. CLEAR t_bdc.
    ENDFORM. u201D FILL_BDC_TABLE
    Best Regards

  • Outbound interface using ABAP Proxy

    Hi Guys,
    I am trying to create an interface between a Z table and XI using ABAP Proxy. I suggested file based interface, but client is insisting using ABAP proxy. Z table is in IS-Retail side.
    I will appreciate is somebody can share a program to do this.
    Any advise/guidance is appreciated.
    Thanks,

    Hi There
    From your  subject line i can see that you want to develop an outbound proxy which means you want to send data to XI from your SAP custom table. That means you need to extract all the information from your Z-table and send it to XI via  proxy.
    If my understanding is correct then what you need to do is :
    1.Ask your XI team team to generate a message interface for you of type 'outbound' and include the structure in the way they want you to send data to them. 
    2.Once the message interface is created by them , you can generate the same in transaction SPROXY .  Search for your interface namespace and then right click
    on it and say 'CREATE' . Give the appropriate package and prefix to it.Generate the proxy, save and activate
    3. Now you can create a report and then according to the structure generated by XI , you can popluate your internal table to be passed back.
    4. Call the method of the proxy in your report and send the data to XI.
    I can give you an example of how to do this:
    suppose you have built up an internal table by extracting data from your Z-table .Lets say it is tbl_output.
    In your report you need to trigger the proxy method as follows:
    Note: i am assuming i am triggering an asynchronous proxy method from my report:
    DATA:lo_senddata  TYPE REF TO CL_DATA_OUT,
                      lo_system_fault TYPE REF TO cx_ai_system_fault,
                      lo_root         TYPE REF TO cx_root.
    ls_output-output_file-data[] = tbl_data[].
    CREATE OBJECT lo_senddata
    TRY.
    * call the asynchronous method of the proxy and send the data
              CALL METHOD lo_senddata->execute_asynchronous
                EXPORTING
                  output = ls_output.
    * get the system exceptions and display the error text
            CATCH cx_ai_system_fault INTO lo_system_fault.
              WRITE:/ 'System Error:'(E01),
                      lo_system_fault->errortext.
              RETURN.
    * get the root exception and display the textid value
            CATCH cx_root INTO lo_root.
              WRITE:/ 'System Error:'(E01),
                      lo_root->textid.
              RETURN.
          ENDTRY.
    COMMIT WORK.
    <b>Note:</b> 1. CL_DATA_OUT is the message interface class.
                      2. ls_output is the output structure to be sent back to XI and data 
                         is an internal table with the same structure as tbl_data.
                      3. It is very imp to catch exceptions as i have shown u above.
    Please let me know if you are a little clear or you need some more clarifications on this.
    cheers
    shivika

  • Interface WD ABAP.

    Dear Experts.
    I am new with WD ABAP. In this moment I am reading the documentation "NET310 ABAP Web Dynpro".
    I never have understand the concept of Interface in Object-Oriented Programming (OOP).
    Please anyone can help me to understandad this concept?
    Regards

    Hi Carmen,
    it is a huge subject itself to explain  and i am afraid that it is not a right forum to discus.
    To understand interface, you need to understand what is Polymorphism.
    Polymorphism  in a nutshell is that the objects receives same message definition but behaves in a different manner.
    example calculate_fuel method in different classes has the same importing parameter and returning parameters but the calculations could be implemented differently in different classes.
    Interface has only definitions, you need to implement them. in this way interface concept enables to achieve Polymorphism.
    ABAP Objects does not support multiple inheritance. Therefore you can only have a single super-class. However a class can implement multiple interfaces to have kind of multiple inheritance.

Maybe you are looking for

  • How do I change my iCloud Apple ID from one account to the other?

    I have two Apple IDs. I want to rationalise iCloud on my devices, but on my iPad I am signed in with one ID and on the iPhone and Mac it is the other. I want to sign in with the other ID on the iPad as well, but I can't find a way short of deleting t

  • Second page of downloaded apps is locked.  How do I get it unlocked?

    New ipad user...For some reason our second page with some downloaded apps is locked up.  Can't open any of them the apps.  First screen is all accessible.  Can't figure out why or how to fix.

  • Attach File in WebDynpro ABAP Application

    Hi everyone I need your help to attach files in custom WebDynpro ABAP application. Kindly share if there is any sample standard WebDynpro ABAP application or share some sample code. Best Regards Iftikhar Ali

  • Xi and R/3

    Hi, while doing file to proxy,how is the connection established between XI and R/3?as we go to SPROXY in R/3, we can see all the desgign objects of xi? Thanks, Jhanavi

  • Verizon cloud doesn't recognize my phone number

    I have went through the entire process and when I get to the last step and click submit it tells me that it doesn't recognize my phone number. .can someone please shed a light on this for me??