Doubt in ALE & IDOC

Hi Gurus,
I created Custom Z Segment type, Z Idoc Type , Z Message type , and attached the Idoc type to Message type. All these steps I done sucessfuly.
Now my Requirement is I have to develop one Inbound function Module, Through this Function Module I need to update the Z Table.
For this, before developing Function modules, What are the steps I have to follow, and what are the settings I have to check, From where I can found the Sender and Receiving System Details.
Please can any one give me the advices on this.
Thanks and Regards
AbinavaSiri.

Hi Abinava,
Create a FM with the following parameters :
*"  IMPORTING
*"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
*"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
*"  EXPORTING
*"     VALUE(WORKFLOW_RESULT) TYPE  BDWFAP_PAR-RESULT
*"     REFERENCE(APPLICATION_VARIABLE) TYPE  BDWFAP_PAR-APPL_VAR
*"     VALUE(IN_UPDATE_TASK) TYPE  BDWFAP_PAR-UPDATETASK
*"     VALUE(CALL_TRANSACTION_DONE) TYPE  BDWFAP_PAR-CALLTRANS
*"  TABLES
*"      IDOC_CONTRL STRUCTURE  EDIDC
*"      IDOC_DATA STRUCTURE  EDIDD
*"      IDOC_STATUS STRUCTURE  BDIDOCSTAT
*"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
*"      SERIALIZATION_INFO STRUCTURE  BDI_SER
*"  EXCEPTIONS
*"      WRONG_FUNCTION_CALLED
Inside the FM :
1) Read the IDOC_CONTRL table and get the IDOC number
2) Fetch the values from the IDOC_DATA table into an internal table
3) Perform validations if any and update the Ztable.
Hope this helps.
Thanx & Rgds

Similar Messages

  • Doubt in ale/idocs urjent

    hi,
    i have a doubt in ALE/IDOCS requirement is add a field to segment
    in tcode BD53(reduce message type) after adding a field.
    what configuration i need to do.

    welcome to SDN.
    Post this ABAP forum for quicker response.
    ABAP Development
    Regards
    Raja

  • Basic doubts in ALE/IDOC processing

    Hi All,
    1.How are IDOC Type and Message Type related? Many to one or One to Many?
    2. what is the prominence of msg code and msg function in ALE outbound processing?
    3. During outbound processing what is the startegy followed by the ALE service layer to pick up the customer model?
       It would be great if any one can answer these questions in plain words rather than referring links. Reward guaranteed.

    Hi Ravi,
    1.Can'te we assign more than one IDOC to the same msg type if the IDOC's are of different versions?
    Yes we can. Doesn't SAP do that? For example, ORDERS01, ORDERS02 ... ORDERS05 are having the same message type ORDERS. You can also create your own IDoc type or extend the standard IDoc type.
    3. When we run a stand alone program to trigger IDOC processing the only mandatory field will be the message type, so how can the sending system identify the receiving system?
    You need to setup partner profile (t/code WE20) and distribution model (t/code BD64). Once this configuration are done, The system will populate automatically the IDoc Control Record for sender and recepient system information when the IDoc generated based partner profile setup.
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward points if helpful.

  • Doubt in ALE/IDOC's

    Hi Friends,
        I have 2 inbound idocs in which
         one idoc posts the document in SAP
         seecond oneconfirms that document.
    what my problem is if the second idoc comes first and try to confirm before the documnet posted it gets fail. SO that i want this confirmation to be done only after the document is posted. How can i achieve this.
    Thanks& Regards,
    Naren.

    hi,
    there is an excellent concept in ALE called <b>SERIALIZATION</b>.
    1. goto transaction code SALE.
    2. MODELLING AND IMPLEMENTING BUSINESS PROCESS -> MASTER DATA DISTRIBUTION -> SERIALIZATION FOR SENDING AND RECEIVING DATA -> SERIALIZATION USING MESSAGE TYPES
    3. what u actually do is,
    <b>example :</b>
    let us say IDoc1 is of message type CLFMAS, IDoc2 is of message type MATMAS. now u configure in the path given above that, MATMAS should be received first and CLFMAS should be received next. this is known even to the partner.
    this is how u correctly receive IDoc in the sequence.
    hope it helps.
    reward if useful...

  • Doubts in ale/idoc

    hi abapers please guide me
    1. what is process code why use this?
    2. what is collect idoc in partner profile?
    3. diffrences between enhance idoc custom idoc and extending idoc?

    Hi,
    1. what is process code why use this?
    Ans - Process code will be used to process the applicate data, which we will attach in the inbound partner profile. To the process code we can attach either function module / workflow. Check the transaction code - WE41 & WE42 for more understanding on process codes.
    2. what is collect idoc in partner profile?
    Ans: We can process idocs individually or as package. If you select Collect idocs, then all idocs will be buffered until you process those idocs manually with the help of standard program RSEOUT00 program. It means until you execute this program data wont be updated in the database. 
    3. diffrences between enhance idoc custom idoc and extending idoc?
    Ans:
    Extending Idoc & enhance idocs , both are same. It means when you create the idoc first time then we will call that idoc type as Basic type and when you enhance the existed idocs with new segments then we will call it as extendings idocs.
    Thanks
    jaya
    Reward, if its useful for you.

  • Doubt on ALE/idoc

    Hi All,
    i genereted idoc, but it have errors, how it can be reprocess. after reprocessing 'idoc no' will change or not
    Thanks,
    Ravindra.

    HI,
    Whenever IDOC has been re-processed a new number will generate.
    But in transaction BD87 and re-process it, then this will not generate new IDOC number but status of message
    will be changed.
    For more details refer this
    How to reprocess the same idoc
    Regards and Best wishes.

  • ALE & Idocs doubts

    Hi  Experts,
       I have big doubts in ALE & Idocs
    1.There are lot of function modules to create idocs.
      So how to find the relavent function modules for our
      requirement.Is there any criteria for this.
    2.When will we go to create idocs through BAPI,when we
      have both systems(sending & Receiving) are SAP.
    3.In INBOUND Idocs processing program,do we need to
      compulsary use BDC to update the data in conserned
      tables?
    Advanced Thanks for your replies

    Hi Murali,
    u can findout the list of fm related to the concerned msgtypes in <b>WE57</b> tcode.
    We have standard inbound function modules wich takes care of process/updation in inbound side. (Se37--> search by IDOC_INPUT* ).
    if those doen't suits to ur req. u can develop ur custom one and use BDC to update.
    Thanks
    eswar

  • ALEAUD - ALE -IDOC

    Hi,
    I have doubt in ALE-IDOC. I would like to modify message that would get send from ALEAUD for which i am looking
    for function module or available user exits.
    Please let me know if u have any idea about it.
    Thanks
    Parag

    Hi All,
    We have the internal table u2013
    This has to be as below
    Hard code the Table lines till the end ( say 10 items ) u2013 end of the page = footer                                                                               
    The table lines are static  10 rows u2013 if table has 2 items only 2 items are displayed and the 8 rows will be displayed but blank and end of the page = footer.
    In case 12  items are there u2013 display 10 items in first page and DO NOT DISPLAY FOOTER IN FIRST PAGE IN CASE line items are spreading to next page u2013
    Second page will have rest two items and few more static lines as above and then FOOTER at last.
    Over all the footer must appear in the LAST PAGE ONLY
    Please send the details as soon as possible.
    Thanks,
    raghava

  • Reg:ALE/IDOCS

    Hi Experts,
    I have one doubt in ale/idocs that is , some idocs are accidently posted, how to solve this issue. at the same time how to avoid duplication of idocs. please send the answers.
    Thanks & Regards,
    N.Narasimha Rao.

    I understand what you mean by "Duplicates", but the question that I have to ask is what do you mean by "accidentily posted".
    The key thing to the ALE framework is the proper use of DB transactions.  The updateing of the ALE status and message tables are combined in the same DB transaction as the actual buisness logic updates that are happening in your IDoc processing function.  So what does this mean to you you're asking?  It means that the implimentation of your update logic can sometimes cause the possibility of duplicates.
    Certain types of updates are ones that cause issues, and these would be updates that are beyond your control when it comes to the DB transaction:
    - BDC/Call Transaction - On these they have their own seperate DB transaction, so it is possible that the BDC can sucsesfully post a transaction and then when the logic returns to the IDoc processing function if something causes it to terminate before completing then it is possible that the buisness transaction is complete and your IDoc status has never been updated.  Because the IDoc status has never been updated the same IDoc will get picked up for processing again.
    - Calls to API functions where they contain a commit inside them or an option to include a commit and you don't supress it - Similiar to Call Transaction issues on this one that the buisness transaction can be commited before the framework commits its final status.
    - Multiple transactions - Sometimes it is nesasary to call multiple APIs inside your processing function but they require commits in between them in order to work properly.  An example of this could be first creating a customer master record and then creating a sales order for that customer.  In this case a commit is required inbetween the two calls.  In a case like this it is possible that half of your buisness logic has been executed and commited, the second part hasn't been commited and the framework hasn't commited the status.  The requriment for the commit would be that the customer master API doing the update uses an update task and therefore the actual updates to the DB aren't executed until an explicit commit statement is executed (note also that the ALE framework sets update tasks to local mode so that it doesn't require the use of asynch update processes).
    So, with these above things being issues when it comes to the DB transactions for ALE processing, what can you do to prevent them:
    - For Call transaction issues there isn't much that you can do, becuase the DB transactions is out of your hands.  The only solution I would recommend here is to not use Call Transactions.  It is an old technology anyways and there are much better ways to do it usually by calling APIs.
    - If the API you are calling contains a commit, you should look to see if there is an option for you to turn it off via an input parameter.  If not then you will end up with some of the same issues as Call transaction but there is a technique that you can use to supress duplicates from posting since the DB transaction (unlike in Call Transaction) is actaully the same transaction that was started by the ALE framework, the technique is what I refer to as ALE Stages.
    - If you require multiple API calls which require commits in between them then the solution that I have used many times is what I refer to as ALE Stages.
    So how do you do ALE stages?  The following is an overview of what you'll need to do:
    - Create a new custom table as a copy of the INDX table (data cluster table).  This table is going to be used for two purposes, one is to store information about what has been processed so far and secondly is to handle the passing of transient data if processing is restarted.
    - In your processing function consider it as a number of stages (one for each transaction) and perform the following logic for each stage:
    1) Use the import statement to read in data from the cluster table (Keyed off of the IDoc number).  This contains information about what stages have been completed and also any transient data that has been generated by one stage and needs to be passed to another.  You can use a complex data structre to store all of this information.
    2) If the current stage has already been executed then skip this section of your processing logic.  Otherwise execute it:
    2a) Execute the API call
    2b) Used an export statement to write an updated status to the data cluster table including any transient data that will be required for the next stage.
    2c) Execute a commit
    - After all stages are complete, do a delete on the record in the data cluster table.  Important point though is to not do a commit.  The reason that you don't do a commit is if there is a failure prior to commit inside the ALE framework that update the final IDoc status then you will have lost your stage status information and the entire IDoc would be duplicated again.
    - By doing stages of this type you are creating sub-transactions that if the IDoc fails at any point then when it is reexecuted it will skip the parts that have already been done.
    - The secret to this is that each stage is it's own DB transaction and includes the API call and the update to the stage status table together.  The final deleting of the stage status is linked in with the overall DB transaction done by the ALE framework.
    - In the case where you are using an API that has a commit embbeded inside it that you don't have control over, you can still use stages.  The secret is that you need to update the stage status table prior to the API call.  Even though it is done first it isn't commited until the API executes it's embeded commit.  The only issue with this is that you can't depend on return values from the API as transient data to support the next stage becuase you have no way of writing it to the stage status table as part of the same transaction as the API update.
    This is a failry high-level description of some of the things to look out for and how to handle them.  The use of stages is something I've done a lot and is nice because if implimented properly it will provide a bullet-proof way to ensure that no part of your transaction will be updated twice.  The main issue I find when I see developers try to implimnet this though is that they don't understand completly how DB transactions work and they end up with holes in their logic.
    Hope this helps.  If I've got some time at some point I'll post some specific pieces of code as an example of stages.
    ~Ian
    Edited by: Ian Maxwell on Aug 3, 2008 5:43 PM

  • Ale/idoc reduce messagetype

    hi,
    i have a doubt in ALE/IDOCS requirement is add a field to segment
    in tcode BD53(reduce message type) after adding a field.
    what configuration i need to do.

    requirement is already developed in reducemessagetype for message type is zdebmas
    now i want add one field.
    if add one field in  BD53 next what i need to do.again need to configur patner profile?

  • Question on ALE/IDOC

    Hi to all,
    I have some doubts regarding ALE/IDOC can any one tell me answers to those question.
    1. what is a process code? what is the purpose of process code?
    2. what is a stand alone program?
    3.How to handle to errors in ale/idoc?
    4. ALE processes in asynchronous why?
    5. How to run idocs in parallel?
    6.What is a posting program
    7. Can any one can send me one complete ALE/IDOC scenario with documentation ?
    Please send me the answers to this mail id [email protected]

    Hi guys,
    I must thank every one of you for sending such quick and helpful responses. I bought the book "ALE, EDI and IDOC" from Aravind Nagpal and its a great book for beginner as well as for an expert. I have started practising ALE my PC by logging into 2 clients and it is working fine. I was able to send and receive the IDOC.
    Thank you again.
    This is a great forum,
    Cheers,
    Mahesh.
    Edited by: Mahesh Kumar on Jan 21, 2009 3:32 PM

  • Doubt regarding  ALE SETTINGS in IDOC scenario.

    Hi Friends,
            I have some doubts regarding ALE settings for IDOC scenarios,  can anyone  please clarify my doubts.
    For exmaple take IDOC to FILE scenario
    The knowledge i got from SDN is --
    One need to do at the  R3 side is  --- RFC DESTINATION (SM59)  for the XI system.
                                                       --- TRFC PORT  for sending IDOC  to the  XI system
                                                       --- CREATING LOGICAL SYSTEM
                                                       --- CREATING PARTNER PROFILE 
                   at the XI side is  --- RFC  Destination ( For SAP sender system)
                                           --- CREATING  PORT  for receiving IDOC from the SAP sending system(IDX1).
    1. Do we create two logical systems for both Sender ( R3 system ) and Receiver( XI system ) in R3 system itself or in XI system or in both systems we create these logical systems? Is this a mandatory step in doing ALE configurations?
    In IDOC to IDOC scenario-------
      2.  Do we craete two RFC destinations in XI system? One RFC DESTINATION for the Sender R3 system and another RFC DESTINATION for the Receiver R3 System? and do we create RFC DESTINATION for the XI system in receiver R3 system? If not.....y we don't create like this........Please give me some clarity on this.............
      3.  If we use IDOC adapter ,since IDOC adapter resides on the ABAP STACK ,we don't need sender communication channel ,for the similar reason----
    y we r creating receiver communication channel in the case of FILE to IDOC scenario?
      4. Can any one please provide me the ALE settings for IDOC to FILE scenario,
                                                                                    FILE to IDOC scenario,                                                                               
    IDOC to IDOC scenario individually.
    Thanks in advance.
    Regards,
    Ramana.

    hi,
    1. Yes, we create two logical systems for both Sender ( R3 system ) and Receiver( XI system ) in R3 system itself and
    it is a mandatory step in doing ALE configurations
    2. We create 1 RFC destination each in R3 and XI.
        R3 RFC destination points to Xi and
        XI RFC destination  points to R3
    3 We need to create Communication Channel for Idoc receiver as the receiver channel is always required but sender may not be necessary
    4. ALE settings for all IDOC scenarios are same  as follows....
    Steps for ALE settings:-
    Steps for XI
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the R3 system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto IDX1.
         Create a new port.
         Give the port name.
         Give the client number for the R3 system.
         Select the created Rfc Destination.
    Step 3)
         Goto IDX2
         Create a new Meta data.
         Give the Idoc type.
         Select the created port.
    Steps for R3.
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the XI system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto WE21.
         Create a port under transactional RFC.(R3->XI)
         Designate the RFC destination created in prev step.
    Step 3)
         Goto SALE.
         Basic settings->Logical Systems->Define logical system.
         Create two logical systems(one for XI and the other for R3)
         Basic settings->Logical Systems->Assign logical system.
         Assign the R3 logical system to respective client.
    Step 4)
         Goto WE20.
         Partner type LS.
         Create two partner profile(one for XI the other for R3).
         Give the outbound or inbound message type based on the direction.
    Step 5)
         Goto WE19
         Give the basic type and execute.
         fill in the required fields.
         Goto IDOC->edit control records.
         Give the following values.(Receiver port,partner no.,part type and sender Partner no. and type)
         Click outbound processing.
    Step 6)
         Go to SM58
         if there are any messages then there is some error in execution.
         Goto WE02.
         Check the status of the IDOC.
         Goto WE47.
         TO decode the status code.
    Step 7)
         Not mandatory.
         Goto BD64.
         Click on Create model view.
         Add message type.
    BD87 to check the status of IDOC.
    In case if not authorized then go to the target system and check in SU53, see for the missing object
    and assign it to the user.
    SAP r3
    sm59(status check)(no message)
    WE02(status check)
    WE05(status check)
    BD87(status check)
    Xi
    IDx5(Idoc check)
    SU53(authorization check)
    Reward points if helpful
    Prashant

  • ALE/IDOC[custom table transfer]

    Hi All,
    I have a doubt regarding the type of programs used to post the idocs using ALE in the outbound process.
    Please also tell me which program I will use to post a custom table of mine to another server using ALE/IDOC.
    Please also tell me the procedure to do the same mentioned above.
    Please help. Its a urgent requirement...........................
    Thanks in advance......................................................

    Hi Guru,
    if you cannot use a standard idoc then you´ll need to create a custom one starting from the segment (WE31) where you can create an Idoc segment starting from your own Z table structure using the wizard.
    Then you´ll need to also create the idoc type (WE30) and link the segment to the IDoc.
    Then you´ll need to create a message type and link the message type to the Idoc type (WE81, WE82).
    Then you´´ll use RFC "MASTER_IDOC_DISTRIBUTE" to populate the IDOC and send the data.
    This is a sample code just to give you an idea:
    DATA:          
      Z_SEGNAME(7) TYPE C VALUE 'SEGMENT',
      Z_MESTYPE(9) TYPE C VALUE 'MESSAGE',
      Z_IDOC_TYPE(8) TYPE C VALUE 'IDOC'.
    DATA:
      IDOC_CONTROL LIKE EDIDC,
      T_COMM_CONTROL LIKE EDIDC OCCURS 0 WITH HEADER LINE,
      IDOC_DATA LIKE EDIDD OCCURS 0 WITH HEADER LINE.
    *Reads data from Z table
    SELECT *
    FROM ZTABLE
    INTO TABLE L_ZTABLE.
    *Set the control data info required for the distribution
    IDOC_CONTROL-MESTYP = Z_MESTYPE.
    IDOC_CONTROL-DOCTYP = Z_IDOC_TYPE.
    *Populate the IDoc
    LOOP AT L_ZTABLE.
      CLEAR IDOC_DATA.
      IDOC_DATA-SEGNAM = Z_SEGNAME.
      IDOC_DATA-SDATA = ZTABLE.
      APPEND IDOC_DATA.
    ENDLOOP.
    *Deliver the IDOC as defined in distribution model/partner profile
    CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' IN UPDATE TASK
      EXPORTING
        MASTER_IDOC_CONTROL          = IDOC_CONTROL
      TABLES
        COMMUNICATION_IDOC_CONTROL     = T_COMM_CONTROL
        MASTER_IDOC_DATA               = IDOC_DATA
      EXCEPTIONS
        ERROR_IN_IDOC_CONTROL               = 1
        ERROR_WRITING_IDOC_STATUS          = 2
        ERROR_IN_IDOC_DATA               = 3
        SENDING_LOGICAL_SYSTEM_UNKNOWN      = 4
        OTHERS                         = 5.
    IF sy-subrc = 0.
      COMMIT WORK.
    ENDIF.

  • ALE/IDOC[custom table]

    Hi All,
    I have a doubt regarding the type of programs used to post the idocs using ALE in the outbound process.
    Please also tell me which program I will use to post a custom table of mine to another server using ALE/IDOC.
    Please also tell me the procedure to do the same mentioned above.
    Please help. Its a urgent requirement...........................
    Thanks in advance......................................................

    hi,
    u can do it using CHANGE POINTERS method.For this u need to do the following configurations.
    1>WE81
    2>WE31
    3>WE30
    4>WE82
    5>SCDO
    6>BD61
    7>BD52
    8>BD50
    9>BD60
    10>WE20
    11>BD64.
    First create an object in tcode -SCDO,there u specify ur tablename.
    now the fields which are there in the ztable,in the further characteristics of the dataelement u need to check the check box CHANGE DOCUMENT HEADER.Now in SCDO u need to generate the upgarde program,the sap will generate four includes,u need to call them in ur program.
    U need to write one FM ,where u need to use the FM's.
    CHANGE_POINTERS_READ,
    CHANGE_POINTERS_STATUS_WRITE.
    Regards,
    nagaraj

  • ALE/IDOC/BAPI/BADI/EDI

    Hi,
    ABAP GURUS
    I am a new bie to SAP .Now I want to learn the following things :-
    ALE
    IDOC
    BAPI
    BADI
    EDI
    My doubt is that which should be learned first so that I can understand them more effectively. It may be possible that is not a question to ask but please guide me and also provide me some good links of ppt which gives me the complete overview of all these and the steps to use them.
    Thanks In Advance
    Bharti Jain

    Hi Bharti,
    EDI is Electronic Data Interchange, and is not linked to any technology, is just the definition of the communication of data using electronic equipment. ALE is Application link enabled, and is used by SAP to communicate data between systems, to build distributed systems, using electronic communication.
    iDoc is a data format to send and receive data, then, can be used for EDI and ALE.
    Bapi and Badi are programming tools, that allow to modify the data in the system, and also, a BAPI can be used to send data to other systems, but, in short, are just functions.
    Regards,
    Ivan.

Maybe you are looking for

  • G/L account error In MIRO

    Dear Sap experts, I have problem in MIRO. My goods receipt is successfully done.But while doing miro system gives error message that " G/L account dose not exists in chart of account INT." I have created own company code without copying. Pls give the

  • I have Firefox 15.0.1 but Gmail keeps telling me it is out of date & I need to upgrade to a modern browser.

    I have a Macbook Pro running OS X 10.7.5. My Gmail inbox is my home page, and every time it opens it says that my version of Firefox is outdated and that I should update to a "modern" browser. I have 15.0.1, so I am puzzled as to why this happens. Th

  • Bringing xml data into flash

    I would like to know how to bring xml data into flash. Specifically images that someone can click on the thumbnail and view the larger image. please can anyone point me to some tutorials or sites that i can start to learn how to do this. thanks.

  • Audio signal (3.5mm jack) constantly panned to the left.

    Hiya, I've had my Macbook Pro for over a year with no significant problems, however today when I plugged my headphones in and started to listen to music, the sound came out much stronger from the left earphone than the right. I tested with different

  • Pavilion g6 turns on but screen stays off

    My laptop screen will not turn on. I hear the laptop itself turn on but screen does not turn on. This is the second time within a year that I've had problems with this laptop. I've tried the hard reset and tried powering it up without the battery and