Skip to Content
author's profile photo Former Member
Former Member

IDOC

hi to all

can any one tell the abt idocs & bapis with some exampls

give one exaple for each.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 07:12 AM

    Hi

    Data Creation in Idoc

    IDocs are text encoded documents with a rigid structure that are used to exchange data between R/3 and a foreign system. Instead of calling a program in the destination system directly, the data is first packed into an IDoc and then sent to the receiving system, where it is analyzed and properly processed. Therefore an IDoc data exchange is always an

    asynchronous process. The significant difference between simple RFC-calls and IDoc data exchange is the fact, that every action performed on IDocs are protocolled by R/3 and IDocs can be reprocessed if an error occurred in one of the message steps.

    While IDocs have to be understood as a data exchange protocol, EDI and ALE are typical use cases for IDocs. R/3 uses IDocs for both EDI and ALE to deliver data to the receiving system. ALE is basically the scheduling mechanism that defines when and between which partners and what kind of data will be exchanged on a regular or event triggered basis. Such a set-up is called an ALE-scenario.

    IDoc is a intermediate document to exchange data between two SAP Systems.

    *IDocs are structured ASCII files (or a virtual equivalent).

    *Electronic Interchange Document

    *They are the file format used by SAP R/3 to exchange data with foreign systems.

    *Data Is transmitted in ASCII format, i.e. human readable form

    *IDocs exchange messages

    *IDocs are used like classical interface files

    IDOC types are templates for specific message types depending on what is the business document, you want to exchange.

    WE30 - you can create a IDOC type.

    An IDOC with data, will have to be triggered by the application that is trying to send out the data.

    FOr testing you can use WE19.

    How to create idoc?

    *WE30 - you can create a IDOC type

    For more information in details on the same along with the examples can be viewed on:

    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm#_Toc8400404

    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a6620507d11d18ee90000e8366fc2/frameset.htm

    http://www.sappoint.com/presentation.html

    http://www.allsaplinks.com/idoc_search.html

    http://www.sapgenie.com/sapedi/idoc_abap.htm

    http://www.erpgenie.com/sapedi/idoc_abap.htm

    To Create Idoc we need to follow these steps:

    Create Segment ( WE31)

    Create Idoc Type ( WE30 )

    Create Message Type ( WE81 )

    Assign Idoc Type to Message Type ( WE82 )

    Creating a Segment

    Go to transaction code WE31

    Enter the name for your segment type and click on the Create icon

    Type the short text

    Enter the variable names and data elements

    Save it and go back

    Go to Edit -> Set Release

    Follow steps to create more number of segments

    Create IDOC Type

    Go to transaction code WE30

    Enter the Object Name, select Basic type and click Create icon

    Select the create new option and enter a description for your basic IDOC type and press enter

    Select the IDOC Name and click Create icon

    The system prompts us to enter a segment type and its attributes

    Choose the appropriate values and press Enter

    The system transfers the name of the segment type to the IDOC editor.

    Follow these steps to add more number of segments to Parent or as Parent-child relation

    Save it and go back

    Go to Edit -> Set release

    Create Message Type

    Go to transaction code WE81

    Change the details from Display mode to Change mode

    After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter

    Click New Entries to create new Message Type

    Fill details

    Save it and go back

    Assign Message Type to IDoc Type

    Go to transaction code WE82

    Change the details from Display mode to Change mode

    After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter.

    Click New Entries to create new Message Type.

    Fill details

    Save it and go back

    Check these out..

    how-to-create-idoc

    Check below link. It will give the step by step procedure for IDOC creation.

    http://www.supinfo-projects.com/cn/2005/idocs_en/2/

    ALE/ IDOC

    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

    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs

    go trough these links.

    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

    http://http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm

    An IDoc is simply a data container that is used to exchange information between any two processes that can understand the syntax and semantics of the data...

    1.IDOCs are stored in the database. In the SAP system, IDOCs are stored in database tables.

    2.IDOCs are independent of the sending and receiving systems.

    3.IDOCs are independent of the direction of data exchange.

    The two available process for IDOCs are

    Outbound Process

    Inbound Process

    AND There are basically two types of IDOCs.

    Basic IDOCs

    Basic IDOC type defines the structure and format of the business document that is to be exchanged between two systems.

    Extended IDOCs

    Extending the functionality by adding more segments to existing Basic IDOCs.

    To Create Idoc we need to follow these steps:

    Create Segment ( WE31)

    Create Idoc Type ( WE30)

    Create Message Type ( WE81)

    Assign Idoc Type to Message Type ( WE82)

    imp links

    http://www.allsaplinks.com/idoc_sample.html

    http://www.sapgenie.com/sapedi/idoc_abap.htm

    www.sappoint.com

    --here u can find the ppts and basic seetings for ALE

    http://sappoint.com/presentation.html

    www.sapgenie.com

    http://www.sapgenie.com/ale/index.htm

    WE30 - you can create a IDOC type.

    An IDOC with data, will have to be triggered by the application that is trying to send out the data.

    Try this..Hope this will help.

    >>>> SAP ALE & IDOC<<<<

    Steps to configuration(Basis) >>

    1. Create Logical System (LS) for each applicable ALE-enabled client

    2. Link client to Logical System on the respective servers

    3. Create background user, to be used by ALE(with authorizaton for ALE postings)

    4. Create RFC Destinations(SM59)

    5. Ports in Idoc processing(WE21)

    6. Generate partner profiles for sending system

    The functional configuration(Tcode: SALE)

    • Create a Customer Distribution Model (CDM);

    • Add appropriate message types and filters to the CDM;

    • Generate outbound partner profiles;

    • Distribute the CDM to the receiving systems; and

    • Generate inbound partner profiles on each of the clients.

    Steps to customize a new IDoc >>>

    1. Define IDoc Segment (WE31)

    2. Convert Segments into an IDoc type (WE30)

    3. Create a Message Type (WE81)

    4. Create valid Combination of Message & IDoc type(WE82)

    5. Define Processing Code(WE41 for OUT / WE42 for IN)

    6. Define Partner Profile(WE20)

    Important Transaction Codes:

    SALE - IMG ALE Configuration root

    WE20 - Manually maintain partner profiles

    BD64 - Maintain customer distribution model

    BD71 - Distribute customer distribution model

    SM59 - Create RFC Destinations

    BDM5 - Consistency check (Transaction scenarios)

    BD82 - Generate Partner Profiles

    BD61 - Activate Change Pointers - Globally

    BD50 - Activate Change Pointer for Msg Type

    BD52 - Activate change pointer per change.doc object

    BD59 - Allocation object type -> IDOC type

    BD56 - Maintain IDOC Segment Filters

    BD53 - Reduction of Message Types

    BD21 - Select Change Pointer

    BD87 - Status Monitor for ALE Messages

    BDM5 - Consistency check (Transaction scenarios)

    BD62 - Define rules

    BD79 - Maintain rules

    BD55 - Defining settings for IDoc conversion

    WEDI - ALE IDoc Administration

    WE21 - Ports in Idoc processing

    WE60 - IDoc documentation

    SARA - IDoc archiving (Object type IDOC)

    WE47 - IDoc status maintenance

    WE07 - IDoc statistics

    BALE - ALE Distribution Administration

    WE05 - IDoc overview

    BD87 - Inbound IDoc reprocessing

    BD88 - Outbound IDoc reprocessing

    BDM2 - IDoc Trace

    BDM7 - IDoc Audit Analysis

    BD21 - Create IDocs from change pointers

    SM58 - Schedule RFC Failures

    Basic config for Distributed data:

    BD64: Maintain a Distributed Model

    BD82: Generate Partner Profile

    BD64: Distribute the distribution Model

    Programs

    RBDMIDOC – Creating IDoc Type from Change Pointers

    RSEOUT00 – Process all selected IDocs (EDI)

    RBDAPP01 - Inbound Processing of IDocs Ready for Transfer

    RSARFCEX - Execute Calls Not Yet Executed

    RBDMOIND - Status Conversion with Successful tRFC Execution

    RBDMANIN - Start error handling for non-posted IDocs

    RBDSTATE - Send Audit Confirmations

    FOr testing you can use WE19.

    Check these links.

    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

    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs

    Please check this PDF documents for ALE and IDoc.

    http://www.sappoint.com/abap/ale.pdf

    http://www.sappoint.com/abap/ale2.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf

    Check below link. It will give the step by step procedure for IDOC creation.

    http://www.supinfo-projects.com/cn/2005/idocs_en/2/

    what is BAPI?

    BAPI stands for Business API(Application Program Interface).

    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..

    You can make your function module remotely enabled in attributes of Function module but

    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).

    BAPI 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. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.

    The following standardized BAPIs are provided:

    Reading instances of SAP business objects

    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.

    The BAPI GetList() is a class method.

    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type

    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.

    Create( ) and CreateFromData! ( )

    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.

    Change( )

    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.

    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.

    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.

    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.

    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.

    BAPI-step by step

    http://www.sapgenie.com/abap/bapi/example.htm

    list of all bapis

    http://www.planetsap.com/LIST_ALL_BAPIs.htm

    for BAPI's

    http://www.sappoint.com/abap/bapiintro.pdf

    http://www.sappoint.com/abap/bapiprg.pdf

    http://www.sappoint.com/abap/bapiactx.pdf

    http://www.sappoint.com/abap/bapilst.pdf

    http://www.sappoint.com/abap/bapiexer.pdf

    http://service.sap.com/ale

    http://service.sap.com/bapi

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf

    http://www.planetsap.com/Bapi_main_page.htm

    http://www.topxml.com/sap/sap_idoc_xml.asp

    http://www.sapdevelopment.co.uk/

    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf

    Also refer to the following links..

    www.sappoint.com/abap/bapiintro.pdf

    www.sap-img.com/bapi.htm

    www.sap-img.com/abap/bapi-conventions.htm

    www.planetsap.com/Bapi_main_page.htm

    www.sapgenie.com/abap/bapi/index.htm

    Checkout !!

    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html

    http://techrepublic.com.com/5100-6329-1051160.html#

    http://www.sap-img.com/bapi.htm

    http://www.sap-img.com/abap/bapi-conventions.htm

    http://www.sappoint.com/abap/bapiintro.pdf

    u can check the below the material also

    Example Code

    U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.

    U can find these parameters for a particular condition type in table KONV.

    &----


    *& Form saveTransactionJOCR

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM saveTransactionJOCR .

    data: salesdocument like BAPIVBELN-VBELN,

    order_header_inx like bapisdh1x,

    order_header_in like bapisdh1,

    return type standard table of bapiret2 with header line,

    conditions_in type standard table of bapicond with header line,

    conditions_inx type standard table of bapicondx with header line,

    logic_switch like BAPISDLS,

    step_nr like conditions_in-cond_st_no,

    item_nr like conditions_in-itm_number,

    cond_count like conditions_in-cond_count,

    cond_type like conditions_in-cond_type.

    salesdocument = wa_order_information-VBELN.

    LOGIC_SWITCH-COND_HANDL = 'X'.

    order_header_inx-updateflag = 'U'.

    • conditions

    clear conditions_in[].

    clear conditions_inx[].

    clear: step_nr,

    item_nr,

    cond_count,

    cond_type.

    step_nr = '710'.

    item_nr = '000000'.

    cond_count = '01'.

    cond_type = 'ZCP2'.

    CONDITIONS_IN-ITM_NUMBER = item_nr.

    conditions_in-cond_st_no = step_nr.

    CONDITIONS_IN-COND_COUNT = cond_count.

    CONDITIONS_IN-COND_TYPE = cond_type.

    CONDITIONS_IN-COND_VALUE = 666.

    CONDITIONS_IN-CURRENCY = 'EUR'.

    append conditions_in.

    CONDITIONS_INX-ITM_NUMBER = item_nr.

    conditions_inx-cond_st_no = step_nr.

    CONDITIONS_INX-COND_COUNT = cond_count.

    CONDITIONS_INX-COND_TYPE = cond_type.

    CONDITIONS_INX-UPDATEFLAG = 'U'.

    CONDITIONS_INX-COND_VALUE = 'X'.

    CONDITIONS_INX-CURRENCY = 'X'.

    append conditions_inx.

    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

    EXPORTING

    SALESDOCUMENT = salesdocument

    ORDER_HEADER_IN = order_header_in

    ORDER_HEADER_INX = order_header_inx

    LOGIC_SWITCH = logic_switch

    TABLES

    RETURN = return

    CONDITIONS_IN = conditions_in

    CONDITIONS_INX = conditions_inx

    .

    if return-type ne 'E'.

    commit work and wait.

    endif.

    ENDFORM. " saveTransactionJOCR

    Bdc to Bapi

    The steps to be followed are :

    1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).

    [for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]

    2. Create a Z program and call the BAPi (same as a Funtion module call).

    2. Now, if you see this BAPi, it has

    -> Importing structures.

    eg: SALESDOCUMENT: this will take the Sales order header data as input.

    -> Tables parameters:

    eg: ORDER_ITEM_IN: this will take the line item data as input.

    Note :

    Only specify fields that should be changed

    Select these fields by entering an X in the checkboxes

    Enter a U in the UPDATEFLAG field

    Always specify key fields when changing the data, including in the checkboxes

    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.

    Maintain quantities and dates in the schedule line data

    Possible UPDATEFLAGS:

    U = change

    D = delete

    I = add

    Example

    1. Delete the whole order

    2. Delete order items

    3. Change the order

    4. Change the configuration

    Notes

    1. Minimum entry:

    You must enter the order number in the SALESDOCUMENT structure.

    You must always enter key fields for changes.

    You must always specify the update indicator in the ORDER_HEADER_INX.

    2. Commit control:

    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.

    For further details... refer to the Function Module documentation for the BAPi.

    Bapi to VB(Visual Basic)

    Long back I had used the following flow structure to acheive the same.

    Report -> SM59 RFC destination -> COM4ABAP -> VB.exe

    my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.

    You need to have com4abap.exe

    If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.

    else refer OSS note 419822 for installation of com4abap

    after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.

    for setting up com4abap and rfc destination please refer to the documentation for com4abap.

    • Invoke NEW DCOM session

    call function 'BEGIN_COM_SESSION'

    exporting

    service_dest = service_dest "(this will be a RFC destination created in SM59)

    importing

    worker_dest = worker_dest

    exceptions

    connect_to_dcom_service_failed = 1

    connect_to_dcom_worker_failed = 2

    others = 3.

    call function 'create_com_instance' destination worker_dest

    exporting

    clsid = g_c_clsid

    typelib = g_c_typelib

    importing

    instid = g_f_oid

    exceptions

    communication_failure = 1 message g_f_msg

    system_failure = 2 message g_f_msg

    invalid_instance_id = 3

    others = 4.

    call function 'com_invoke' destination worker_dest

    exporting

    %instid = g_f_oid

    %method = 'UpdatePDF'

    sntemp = g_v_const_filent

    snsysid = sy-sysid

    snflag = 'N'

    tables

    rssaptable = g_t_pdfdetail1

    %return = g_t_pdfdetail1 "t_test

    exceptions

    communication_failure = 1 message g_f_msg

    system_failure = 2 message g_f_msg

    invalid_instance_id = 3

    others = 4.

    then close the com session , using

    FM delete_com_instance

    FM END_COM_SESSION

    example

    REPORT z34332_bdc_create_material .

    data: la_headdata type BAPIMATHEAD,

    la_clientdata type BAPI_MARA,

    la_CLIENTDATAX type BAPI_MARAX,

    la_return type BAPIRET2.

    data: i_materialdescription type table of BAPI_MAKT,

    wa_materialdescription like line of i_materialdescription.

    la_headdata-MATERIAL = '000000000000000004'.

    la_headdata-IND_SECTOR = 'M'.

    la_headdata-MATL_TYPE = 'FERT'.

    la_clientdata-BASE_UOM = 'FT3'.

    la_CLIENTDATAX-BASE_UOM = 'X'.

    la_clientdata-MATL_GROUP = '01'.

    la_CLIENTDATAX-MATL_GROUP = 'X'.

    wa_materialdescription = 'TEST'.

    append wa_materialdescription to i_materialdescription.

    clear: wa_materialdescription.

    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

    EXPORTING

    headdata = la_headdata

    CLIENTDATA = la_clientdata

    CLIENTDATAX = la_CLIENTDATAX

    • PLANTDATA =

    • PLANTDATAX =

    • FORECASTPARAMETERS =

    • FORECASTPARAMETERSX =

    • PLANNINGDATA =

    • PLANNINGDATAX =

    • STORAGELOCATIONDATA =

    • STORAGELOCATIONDATAX =

    • VALUATIONDATA =

    • VALUATIONDATAX =

    • WAREHOUSENUMBERDATA =

    • WAREHOUSENUMBERDATAX =

    • SALESDATA =

    • SALESDATAX =

    • STORAGETYPEDATA =

    • STORAGETYPEDATAX =

    • FLAG_ONLINE = ' '

    • FLAG_CAD_CALL = ' '

    IMPORTING

    RETURN = la_return

    TABLES

    MATERIALDESCRIPTION = i_materialdescription

    • UNITSOFMEASURE =

    • UNITSOFMEASUREX =

    • INTERNATIONALARTNOS =

    • MATERIALLONGTEXT =

    • TAXCLASSIFICATIONS =

    • RETURNMESSAGES =

    • PRTDATA =

    • PRTDATAX =

    • EXTENSIONIN =

    • EXTENSIONINX =

    .

    write: la_return-TYPE, ',', la_return-MESSAGE.

    clear: la_headdata, la_return, la_clientdata, la_clientdatax.

    <b>Reward points for useful Answers</b>

    Regards

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 07:10 AM

    Hi,

    Application Link Enabling

    - Application Link Enabling (ALE) is a mechanism for the exchange of business data between loosely-coupled R/3 applications built by customers of SAP, the enterprise resource management program. ALE provides SAP customers with a program distribution model and technology that enables them to interconnect programs across various platforms and systems.

    There are three layers in the ALE system: application services, distribution services, and communication services. The vehicle for data transfer is called an IDoc (intermediate document), which is a container for the application data to be transmitted. After a user performs an SAP transaction, one or more IDocs are generated in the sending database and passed to the ALE communication layer. The communication layer performs a Remote Function Call (RFC), using the port definition and RFC destination specified by the customer model. The IDoc is transmitted to the receiver, which may be an R/3, R/2, or some external system. If the data is distributed from a master system, the same transaction performed by the sender will be performed by the receiving system, using the information contained in the IDoc.

    Changes made to fields in master data tables can be set to trigger distribution of the changes to slave systems, so that multiple database servers can update the same information simultaneously. IDocs carry information directly between SAP systems. In order to communicate with a non-SAP system, an IDoc is first transmitted to an intermediary system that translates the data to a format that will be understood by the receiver. Return data also passes through the translating system, where it is again encapsulated into an IDoc.

    IDoc

    - IDoc (for intermediate document) is a standard data structure for electronic data interchange (EDI) between application programs written for the popular SAP business system or between an SAP application and an external program. IDocs serve as the vehicle for data transfer in SAP's Application Link Enabling (ALE) system. IDocs are used for asynchronous transactions: each IDoc generated exists as a self-contained text file that can then be transmitted to the requesting workstation without connecting to the central database. Another SAP mechanism, the Business Application Programming Interface (BAPI) is used for synchronous transactions.

    A large enterprise's networked computing environment is likely to connect many geographically distributed computers to the main database. These computers are likely to use different hardware and/or operating system platforms. An IDoc encapsulates data so that it can be exchanged between different systems without conversion from one format to another.

    IDoc types define different categories of data, such as purchase orders or invoices, which may then be broken down into more specific categories called message types. Greater specificity means that an IDoc type is capable of storing only the data required for a particular transaction, which increases efficiency and decreases resource demands.

    An IDoc can be generated at any point in a transaction process. For example, during a shipping transaction process, an IDoc may be generated that includes the data fields required to print a shipping manifest. After a user performs an SAP transaction, one or more IDocs are generated in the sending database and passed to the ALE communication layer. The communication layer performs a Remote Function Call (RFC), using the port definition and RFC destination specified by the customer model. The IDoc is transmitted to the receiver, which may be an R/3, R/2, or some external system.

    ******************please reward points if the information is helpful to you

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 07:16 AM

    Hi,

    BAPI stands for Business API(Application Program Interface).

    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..

    You can make your function module remotely enabled in attributes of Function module but

    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).

    BAPI 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. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.

    The following standardized BAPIs are provided:

    Reading instances of SAP business objects

    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.

    The BAPI GetList() is a class method.

    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type

    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.

    Create( ) and CreateFromData! ( )

    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.

    Change( )

    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.

    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.

    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.

    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.

    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.

    BAPI-step by step

    http://www.sapgenie.com/abap/bapi/example.htm

    list of all bapis

    http://www.planetsap.com/LIST_ALL_BAPIs.htm

    for BAPI's

    http://www.sappoint.com/abap/bapiintro.pdf

    http://www.sappoint.com/abap/bapiprg.pdf

    http://www.sappoint.com/abap/bapiactx.pdf

    http://www.sappoint.com/abap/bapilst.pdf

    http://www.sappoint.com/abap/bapiexer.pdf

    http://service.sap.com/ale

    http://service.sap.com/bapi

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf

    http://www.planetsap.com/Bapi_main_page.htm

    http://www.topxml.com/sap/sap_idoc_xml.asp

    http://www.sapdevelopment.co.uk/

    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf

    Also refer to the following links..

    www.sappoint.com/abap/bapiintro.pdf

    www.sap-img.com/bapi.htm

    www.sap-img.com/abap/bapi-conventions.htm

    www.planetsap.com/Bapi_main_page.htm

    www.sapgenie.com/abap/bapi/index.htm

    Checkout !!

    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html

    http://techrepublic.com.com/5100-6329-1051160.html#

    http://www.sap-img.com/bapi.htm

    http://www.sap-img.com/abap/bapi-conventions.htm

    http://www.sappoint.com/abap/bapiintro.pdf

    ALE IDOC

    Sending System(Outbound ALE Process)

    Tcode SALE ? for

    a) Define Logical System

    b) Assign Client to Logical System

    Tcode SM59-RFC Destination

    Tcode BD64 ? Create Model View

    Tcode BD82 ? Generate partner Profiles & Create Ports

    Tcode BD64 ? Distribute the Model view

    Message Type MATMAS

    Tcode BD10 ? Send Material Data

    Tcode WE05 ? Idoc List for watching any Errors

    Receiving System(Inbound ALE )

    Tcode SALE ? for

    a) Define Logical System

    b) Assign Client to Logical System

    Tcode SM59-RFC Destination

    Tcode BD64 ? Check for Model view whether it has distributed or not

    Tcode BD82 -- Generate partner Profiles & Create Ports

    Tcode BD11 Getting Material Data

    Tcode WE05 ? Idoc List for inbound status codes

    ALE IDOC Steps

    Sending System(Outbound ALE Process)

    Tcode SALE ?3 for

    a) Define Logical System

    b) Assign Client to Logical System

    Tcode SM59-RFC Destination

    Tcode BD64 !V Create Model View

    Tcode BD82 !V Generate partner Profiles & Create Ports

    Tcode BD64 !V Distribute the Model view

    This is Receiving system Settings

    Receiving System(Inbound ALE )

    Tcode SALE ?3 for

    a) Define Logical System

    b) Assign Client to Logical System

    Tcode SM59-RFC Destination

    Tcode BD64 !V Check for Model view whether it has distributed or not

    Tcode BD82 -- Generate partner Profiles & Create Ports

    Tcode BD11 Getting Material Data

    Tcode WE05 !V Idoc List for inbound status codes

    Message Type MATMAS

    Tcode BD10 !V Send Material Data

    Tcode WE05 !V Idoc List for watching any Errors

    1)a Goto Tcode SALE

    Click on Sending & Receiving Systems-->Select Logical Systems

    Here Define Logical Systems---> Click on Execute Button

    go for new entries

    1) System Name : ERP000

    Description : Sending System

    2) System Name : ERP800

    Description : Receiving System

    press Enter & Save

    it will ask Request

    if you want new request create new Request orpress continue for transfering the objects

    B) goto Tcode SALE

    Select Assign Client to Logical Systems-->Execute

    000--> Double click on this

    Give the following Information

    Client : ERP 000

    City :

    Logical System

    Currency

    Client role

    Save this Data

    Step 2) For RFC Creation

    Goto Tcode SM59-->Select R/3 Connects

    Click on Create Button

    RFC Destination Name should be same as partner's logical system name and case sensitive to create the ports automatically while generating the partner profiles

    give the information for required fields

    RFC Destination : ERP800

    Connection type: 3

    Description

    Target Host : ERP000

    System No:000

    lan : EN

    Client : 800

    User : Login User Name

    Password:

    save this & Test it & RemortLogin

    3)

    Goto Tcode BD64 -- click on Change mode button

    click on create moduleview

    short text : xxxxxxxxxxxxxx

    Technical Neme : MODEL_ALV

    save this & Press ok

    select your just created modelview Name :'MODEL_ALV'.

    goto add message type

    Model Name : MODEL_ALV

    sender : ERP000

    Receiver : ERP800

    Message type :MATMAS

    save & Press Enter

    4) Goto Tcode BD82

    Give Model View : MODEL_ALV

    Partner system : ERP800

    execute this by press F8 Button

    it will gives you sending system port No :A000000015(Like)

    5) Goto Tcode BD64

    seelct the modelview

    goto >edit >modelview-->distribute

    press ok & Press enter

    6)goto Tcode : BD10 for Material sending

    Material : mat_001

    Message Type : MATMAS

    Logical System : ERP800

    and Execute

    7)goto Tcode : BD11 for Material Receiving

    Material : mat_001

    Message Type : MATMAS

    and Execute --> 1 request idoc created for message type Matmas

    press enter

    Here Master Idoc set for Messge type MATMAS-->press Enter

    1 Communication Idoc generated for Message Type

    this is your IDOC

    Change Pointers

    I know how to change the description of a material using ALE Change Pointers.

    I will give the following few steps

    1) Tcode BD61---> check the change pointers activated check box

    save and goback.

    2) Tcode BD50---> check the MATMAS check box save and comeback.

    3) Tcode BD51---> goto IDOC_INPUT_MATMAS01 select the checkbox save and comeback.

    4) Tcode BD52---> give message type : matmas press ok button.

    select all what ever you want and delete remaining fields.

    save & come back.

    5) 5) go to Tcode MM02 select one material and try to change the description and save it

    it will effects the target systems material desciption will also changes

    6) goto Tcode SE38 give program Name is : RBDMIDOC and Execute

    give Message type : MATMAS and Executte

    ALE/IDOC Status Codes/Messages

    -


    01 Error --> Idoc Added

    30 Error --> Idoc ready for dispatch(ALE Service)

    then goto SE38 --> Execute the Program RBDMIDOC

    29 Error --> ALE Service Layer

    then goto SE38 --> Execute the Program RSEOUT00

    03 Error --> Data Passed to Port ok

    then goto SE38 --> Execute the Program RBDMOIND

    12 Error --> Dispatch ok

    Inbound Status Codes

    50 Error --> It will go for ALE Service Layer

    56 Error --> Idoc with Errors added

    51 Error --> Application Document not posted

    65 Error --> Error in ALE Service Layer

    for 51 or 56 Errors do the following steps

    goto WE19 > give the IDOC Number and Execute >

    Press on Inbound function Module

    for 65 Error --> goto SE38 --> Execute the Program RBDAPP01 then your getting 51 Error

    <b>Reward points</b>

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 10, 2007 at 07:21 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 11:57 AM
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.