BAPI - doubt

hi SDN'rs,
What is the use of Interface in a Business Object .
Thanks

hi ganesh
hopen this helps
Interfaces are independent structures that you can implement in a class to extend the scope of that class.a universal point of contact.They provide one of the pillars of polymorphism, since they allow a single method within an interface to behave differently in different classes.
Can be declared globally or locally within a program.
Locally declared in the global portion of a program using:-
INTERFACE <intf>.
ENDINTERFACE
The definition contains the declaration for all components (attributes, methods, events) of the interface. They automatically belong to the public section of the class in which the interface is implemented.
Interfaces do not have an implementation part, since their methods are implemented in the class that implements the interface.
Interfaces do not have instances.
To implement an interface in a class, use the statement
INTERFACES <intf>.
in the declaration part of the class.
A component <icomp> of an interface <intf> can be addressed as though it were a member of the class under the name <intf~icomp>.
Interface References
Addressing Objects Using Interface References
Using the class reference variable <cref>:
To access an attribute <attr>: <cref>-><intf~attr>
To call a method <meth>: CALL METHOD <cref>-<intf~meth>
Using the interface reference variable <iref>:
To access an attribute <attr>: < iref>-><attr>
To call a method <meth>: CALL METHOD <iref>-><meth>
Addressing a constant <const>: < intf>=><const> (Cannot use class name).
Addressing a static attribute
<attr>: < class>=><intf~attr>
Calling a static method <meth>: CALL METHOD <class>=><intf~meth>
(Cannot use Interface method ).
<<simple program.>>
report ysubdel .
interface i1.
data : num type i .
methods : meth1.
endinterface.
class c1 definition.
public section.
methods : meth1.
interfaces : i1.
endclass.
class c1 implementation.
method : meth1.
write:/5 'I am meth1 in c1'.
endmethod.
method i1~meth1.
write:/5 'I am meth1 from i1'.
endmethod.
endclass.
start-of-selection.
data : oref type ref to c1. create object oref.
write:/5 oref->i1~num.
call method oref->meth1.
call method oref->i1~meth1.
u acan also refeer the following link
<a href="http://www.sapgenie.com/interfaces/index.htm">http://www.sapgenie.com/interfaces/index.htm</a>
regards
navjot
reward accordingly
Message was edited by:
        navjot sharma

Similar Messages

  • Bapi doubts

    Hi All ,
    I have some doubts in Bapi
    1) why we can not use exception in Bapi ?
    2)  BAPI must not execute a COMMIT-WORK command.
    3) why its necessary to released the bapi & how ?
    4) In Bapi there is a test  for Example IF 1 = 2. If the test is true a message is displayed. The condition will obviously never be true, and we will never want to display a message in a BAPI
    then why it is necessary ?
    Thanks in advance
    Rahul

    solved

  • Bapi doubt ...difference rfc and bapi

    Plese give me the following information.
    1) wt is the difference between BAPIRETURN, BAPIRET1 and BAPIRET2?
    2) wt is the diff. between an RFC-enabled fm and BAPI ?

    Hi again,
    1. YES, Definitely it will behave like BAPI.
    2. The sap concept of
       naming function modules (related to business object)
       and naming them as BAPI*
       is JUST FOR IDENTIFIECATION PURPOSE,
               and nothing else.
      We can give ANY NAME.
    regards,
    amit m.
    Message was edited by: Amit Mittal

  • Hi guys doubt on bapi please reply

    hi,
    i have doubt on which import parameters to be used in the bapi BAPI_ACC_GL_POSTING_REV_POST we have posting date and document no with us we are confused about what import parameters to be sent as an input to this bapi...........
    reward will be given for nice reply...............

    Give any field string (variable) of type BAPIACREV
    Finally it will give these values..
    Reversal document number:
    o OBJ_TYPE Sender ID
    o OBJ_KEY Reference number of the reversal document (source
    document)
    o OBJ_SYS Logical system
    o OBJ_KEY_R Reference number of the document to be reversed.
    i gave the sender id as bkpff which i was using as obj type for posting.
    is obj_key the new unassigned document number in the row.
    obj_sys gave the specific logical system.
    obj_key_r can i give any document number generated during gl posting using bapi_acc_gl_posting_post
    i even specified the other parameters such as posting date and reversal type but no reversal is done...........need more clarification on this .....
    reward is sure..........

  • Doubt in Basic Bapi function

    Hi experts,
    I have a small doubt in BAPI, Actually i want to add the vendor price only in MEK1. For that am using BAPI to add the vendor price.
    Can anyone tell where we need to write the source code? We need to write a report program? How it will trigger the particular transaction?
    Can any one explain this?
    Mohana

    Hi Mohana,
    for that you need to seacrh for the BADI or Userexit,...when ever any changes are maded in that transaction based one the situation your BADI or userexit will trigger and that will update to the data base...if you use that BAPI in that EXIT.....
    if you are using separatly the program...every time you need to execute that program for updating that field in that transaction...
    Thanks!

  • Doubt in BAPI

    Hi All I have a doubt in BAPI.
    I have created a function module which is remote enabled module. I didnu2019t create any BAPI using Tcode SWO1 or BAPI. Am using this function module in my VB code to get the data from SAP, Its working fine am getting all data from SAP database.
    My Question is since we can use sap Function module (which is remote enabled module) with out creating BAPI. Then what is the use of creating BAPI.?    
    If we click on radio button Remote enabled module is that function module act as BAPI?
    Please help me.
    Regards
    Prajwal K.

    Hi Prajwal,
    Please check this link
    RFC and BAPI Interfaces to SAP Systems
    http://help.sap.com/saphelp_45b/helpdata/en/cf/8ccab761ea11d2804a00c04fada2a1/content.htm
    BAPI's are the remote enabled Function modules which are defined in the Business Object Repository (BOR) as the methods of the business objects.I can say BAPI is the subset of RFC. RFC connects to the other system via BAPI and vice versa.
    BAPI methods are RFC enabled function modules. The difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call.Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs.BAPI is having all Key fields, methods, interfaces etc.
    Best regards,
    raam

  • Doubt about BAPI

    Hi Experts,
    I have one doubt. I want to Attach document to the material of a particular BAPI  that have been existed in the sap r/3 system.Which BAPI wil work for this to attach a document to the material.Please let me know . Its very urgent.
    Helpful Answers wil be reward
    Regards
    Khanna

    Hi.
    Both of the listed BAPI's have no functionality/option to link a document!
    Can anyone suggest a BAPI/RFC to link a Document while creating a Material? Also, You can link a Document to a Material by "BAPI_DOCUMENT_CHANGE2".

  • Doubt about How to test the BAPI

    Hi Experts,
    I have one doubt. How to test one BAPI. I have BAPI_DOCUMENT_SAVEOBJECTLINKS
    I am using this BAPI to attach the document to the material. I opened se37 .Here how to test the BAPI wether the BAPI is Suitable to attach the document  or not. Please let me know . Its very urent.
    Helpful answers may be reward points
    Regards
    Khanna

    Hi,
    First you have to create a new document using CV01N tcode. Here leave the document field as blank, document type value can be choosen from F4 help and document part and document version can be given as 0. Press enter and add the necessary values and save. It will then create a new document. Using that document go to SE37 and execute the BAPI. In the BAPI also you need to give the document no that is generated, and document type, document part and document version of the newly generated document. In the OBJECTLINKS table of the BAPI give the material number and other details. Please see the function module documentation of this BAPI also.
    Please reward points if it helps.
    Regards
    Vimal

  • Doubt in BAPI - BAPI_TRANSACTION_COMMIT

    Hi Gurus,
    I am posting material from customer storage palce to activate storage location through the follwo\ing BAPI-
    BAPI_TRANSACTION_COMMIT.
    in that i got error as follow
    Material 30000004 not maintained in plant SUND
    Material 30000005 not maintained in plant SUND
    Material 30000006 not maintained in plant SUND
    Material 30000007not maintained in plant SUND
    Material 30000008 not maintained in plant SUND
    BUt if i post through MIGO trasaction directly means, no errors occur.
    only through BAPI the above error occurs.
    Help me to Solve this problem.
    Thank in Advance.
    Regards,
    Bhuvana.

    Hi,
      Sit with your functional consultant .May be the plant parameters have been maintained for your plant
    under Inventory management and Physical inventory If not pl maintain the same in SPRO.
    Regards
    Kiran Sure

  • Doubt on Good movements using BAPI'S for Uploading

    Hi Experts,
             i am doing a bdc program to upload for mb1a transaction using BAPI..I am new to BAPI area..But with some reference i have finished the program..But i dont know why in clear statement and in gui upload showing error..IN gui upload when i activate the exception its throwing error..Hereby i am pasting the code...Any idea pls share with me..
    <removed by moderator>
    I dont know how to make the code show correctly...any help???????
    Regards
    Karthick
    Moderator message: please post only relevant code parts, observe the maximum of 5000 characters per post to preserve formatting, leave out commented lines, etc.
    Edited by: Thomas Zloch on Feb 10, 2011 6:05 PM
    sorry moderator...it will not happen again..
    my scenario is like this i ahve to upload the serial number with respect to the quantity in unit of measure..i am not getting any idea on this..for example if the quantity for the material is 5 then it has to upload five serial numbers...
    please help me on this!!!!!!!!
    regards
    Karthick
    Edited by: karthicksap on Feb 12, 2011 5:25 AM

    Hi kris,
         Finally i finished the coding..its working fine...but now its throwing material is not maintained in plant..checked with that..but material is maintained there..i dont know why its throwing the error..i checked with debugging and i found that its taking the last serial number only..for every material..my flatfile is like this..
    11.01.2011     11.01.2011     abc     9051     5101     stbdx300     3     600001     0     1000000000000001
    11.01.2011     11.01.2011     abc     9051     5101     stbdx300     3     600001     0     1000000000000002
    11.01.2011     11.01.2011     abc     9051     5101     stbdx300     3     600001     0     1000000000000003
    any idea kris.>?????
    regards
    Karthick

  • Doubt on bapi

    Hi all   suppose if iwant to upload a material using bapi,  than how can i know the FM's that are avialable for this..

    Hi Gurus
    I am using the extension parameters of BAPI to load some customized fields for the object-BUILDING in REAL ESTATE MODULE using LSMW-BAPI.
    Here's the code-
    *Target Field: E1BPPAREX-VALUEPART1 Data part of BAPI extension paramet
    DATA:
    lt_extension_in TYPE TABLE OF bapiparex,
    ls_extension_in TYPE bapiparex,
    ls_ci_data TYPE rebd_building_ci.
    ls_ci_data-zgisx = hsouthernwater-zgisx.
    ls_ci_data-zgisy = hsouthernwater-zgisy.
    ls_ci_data-zdeed = hsouthernwater-zdeed.
    ls_ci_data-zland = hsouthernwater-zland.
    ls_ci_data-zsite = hsouthernwater-zsite.
    ls_extension_in-structure = 'CI_DATA'.
    ls_extension_in-valuepart1 = ls_ci_data.
    CALL METHOD cl_abap_container_utilities=>fill_container_c
    EXPORTING
    im_value = ls_ci_data
    IMPORTING
    ex_container = ls_extension_in-valuepart1
    EXCEPTIONS
    OTHERS = 0.
    e1bpparex-valuepart1 = ls_extension_in-valuepart1.
    I AM GETTING THE ERROR IN THE LINE-
    ls_extension_in-valuepart1 = ls_ci_data.
    SAYING THAT
    ls_extension_in-valuepart1 and ls_ci_data. are mutually not convertible
    I have written the same code for 3 objects in RE-The code was working fine in those objects.But in object- building i am getting this error..
    Anyone out there please help me regarding this..
    Thanks in advance

  • Doubt regarding populating a field in BAPI

    Hi guys,
    I'm doin a JDBC to RFC scenario.
    My JDBC output returns a field which contains carriage returns. For example my tag would look like...
              <LONG_DESCRIPTION>WIRE/CABLE:ELECTRICAL,POWER,600V,TEXT: OKONITE;500&apos;/  ROLL  STRUXURE
    Varun
    Mukund
    SAP
    Exchange
    Infrastructure</LONG_DESCRIPTION>
    Currently i did one to one mapping to my input field in the BAPI.
    Now when i view this material after its creation through XI, I find this text as continuos and without new line.
    Should i include some extra character while populating the corresponding field in BAPI for new line???
    Thanks guys
    Varun

    Hey Sumit,
    I'm using BAPI_MATERIAL_SAVEDATA...
    I'm trying to populate the field TEXT_LINE under MATERIALLONGTEXT
             <MATERIALLONGTEXT>
                <item>
                   <APPLOBJECT/>
                   <TEXT_NAME/>
                   <TEXT_ID/>
                   <LANGU/>
                   <LANGU_ISO/>
                   <FORMAT_COL/>
                   <TEXT_LINE/>
                   <DEL_FLAG/>
                </item>
             </MATERIALLONGTEXT>

  • Doubt on IDoc and BAPI

    Hi Experts,
    I doing Idoc to file scenario, my question is when we go ahead to use IDOC or BAPI. please give me some basic understanding of when and how you use IDoc?
    When to use BAPI?
    Please provide some links of document
    Regards,
    Venkatesh

    Hi,
    when u want  asynchronous communication u have to use IDOCS
    when u want to use synchrnous communciation and want to communicate external langauges u have to use BAPIS
    For File to IDOC,
    in R/3
    1.create rfc connection using sm59
    2.create Logical sys using bd54
    3.create port using we21
    4.create partner profile using we20
    in xi
    1.create rfc connection using sm59
    2.create Logical sys using bd54
    3.create port using IDX!
    for IDOC to FIle
    R/3 side
    1.create rfc connection using sm59
    2.create Logical sys using bd54
    3.create port using we21
    4.create partner profile using we20
    5.distribute busynessmodel using bd64
    for xi side
    1.create rfc connection using sm59
    2.create Logical sys using bd54
    3.create port using IDX!
    4.create partner profile using we20
    ALE configuration for pushing idocs from SAP to XI
    /people/swaroopa.vishwanath/blog/2007/01/22/ale-configuration-for-pushing-idocs-from-sap-to-xi
    IDOC testing using WE19
    /people/sameer.shadab/blog/2005/07/25/reposting-idocs-instead-of-recreating--for-testing-purpose-xi
    File To IDOC - Part1 (SLD and Design):
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/11/fileToIDOC&
    File To IDOC - Part2 (Configuration):
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/11/fileToIDOC-Part2+(Configuration)&
    File To IDOC - Part3 (Steps required in XI and R3):
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/11/fileToIDOC-Part3(StepsrequiredinXIandR3)&
    SAP R/3
    R/3 to XI
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (We21)
    a) First Select Transactional RFC and then click create button
    b) Enter the destination port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Create Partner Profile (WE20)
    a) Create New
    b) Create the Partner no. name as same the logical system name of the destination system.
    c) Select Partner type LS
    d) Enter details for Type: US/USER, Agent, and Lang.
    e) Click on the + button to select the message type.
    f) Select Partner no. and LS which ever create above.
    g) Select Message type
    h) Select Process code related to the Message type.
    I) save.
    XI to R/3
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (IDX1) ( Create port to get IDOC Meta data from sender system)
    a) Select create new button
    b) Enter the port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Load Meta Data for IDOC (IDX2) (To maintain IDOC Metadata, it is needed by XI because XI needs to construct IDOC-XML from IDOC. It is not needed by any sap system).
    a) Create new
    b) IDOC Message Type
    c) Enter port created in IDX1.
    Edited by: krishnachitanya siddavattam on Mar 7, 2008 5:37 AM

  • Miro doubt - batch input, bapi,

    Hi,
    actually, in our system we do miro manually. I wonder if there is a possibility to make MIRO automatically using a batch input (LSMW) or BAPI ?? Or There are other possibilities besides batch input via LSMW or BAPIs?
    Which is the best way to solve this problem? Any idea, help, example, links would be apreciated.
    Many thanx.

    Hi,
    If any BAPI is available it is the best way, beacuse the other optionsa are not convenient when there are lot of fields and screens.
    You may use BTE also:
    Possible useful BAPIs:
    BAPI_GOODSMVT_CREATE
    BAPI_GOODSMVT_RELEASE
    BAPI_INCOMINGINVOICE_CREATE
    BAPI_INCOMINGINVOICE_RELEASE
    BAPI_PO_CHANGE
    BAPI_PO_CREATE1
    BAPI_REQUISITION_CHANGE
    BAPI_MATERIAL_SAVEDATA
    BTE:
    MRM_PRELIMINARY_INVOICE
    Regards,
    Renjith

  • Doubt in BAPI:BAPI_SALESORDER_CREATEFROMDAT1

    How to pass alternate tax classification under billing header???

    Hi Prajwal,
    Please check this link
    RFC and BAPI Interfaces to SAP Systems
    http://help.sap.com/saphelp_45b/helpdata/en/cf/8ccab761ea11d2804a00c04fada2a1/content.htm
    BAPI's are the remote enabled Function modules which are defined in the Business Object Repository (BOR) as the methods of the business objects.I can say BAPI is the subset of RFC. RFC connects to the other system via BAPI and vice versa.
    BAPI methods are RFC enabled function modules. The difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call.Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs.BAPI is having all Key fields, methods, interfaces etc.
    Best regards,
    raam

Maybe you are looking for

  • How do i find out who the carrier is and can i get it unlocked to use in australia?

    Hi there, I got a iphone4 from my friend ewho brought it from someone from ebay in the states I am unable to use the phone and was told that the phone had been updated to a baseband that can not be unlocked and that I need to contact the carrier. How

  • Query for UDF

    Hi All I need some help here , One of our clients doesnot report on vat or can't not claim , but the vendors they deal with some are vat vendors and do claim so it need to be shown on the marketing docs. So what we've done is on the client side we us

  • Company code pop up

    hi, i have a problem with the pop up that appears while we run FB60 transaction. the pop up comes once when we enter for the first time, if i want to enter for the next time it doesnot give the company code popup. for that i got a solution of using t

  • Right clicking to save photos from web source

    I am trying to save PICS from a web-site and I am stumped about the "right-click." What is the Mac substitute for this command? It is a subscription service so I can't send you the URL. If you'd like to save photos to your computer, simply hold the c

  • [b]ORA-02299 : duplicate keys found[/b]

    When I create my first CUBE in ORACLE 9.2.0.5 on my windows 2000 server,the cube wizard wrote this error message : ORA-02299:cannot validate(JANCO.UK_ON_0CASOVA_ID_DIMENZIA)-duplicate keys found I dont know , why cube wizrad wrote "duplicate keys fou