Userexit in idoc

Hi Friends,
I have one extension idoc type requirement, now i want to insert the code in userexit. how can i find the user exit related to the idoc.

Hi,
  can u explen what is your Scenario, here i am given some userexit for idoc.
u can find it from SMOD
MWMIDO01
MWMIDO02
MWMIDO03
MWMIDO04
MWMIDO07
MWMIDO08
MWMIDO09
MWMIDO10
MWMIDO11
MWMIDO12
MWMIDO13
SIDOC001
SIDOC002
EX......
MWMIDO01 (User Exit)
With this user exit, the contents and structure of IDOC WMTOID01
'Transfer order' can be influenced customer-specifically in the outbox.
Call transaction and other important requirements
The user exit is performed in the function module that sets up IDOC
WMTOID01. This is done after the IDOC setup but before it is transferre
to the ALE interface. The standard function module for setting up IDOC
WMTOID01 is called L_IDOC_CREATE_WMTOID01. The IDOC setup is part of th
transfer order generation. This means that the source code can run both
asynchronously in the update program and online. For this reason, all
error messages must be issued as abend messages to guarantee a correct
termination with rollback. Furthermore, you must not use any key words
such as COMMIT WORK, ROLLBACK WORK, LEAVE, or the like.
Parameters and options
The user exit in the program is function module EXIT_SAPLLIDO_001. In
order to be able to use the user exit, you must create Include ZXLIDU01 and activate the enhancement with transaction CMOD. As parameters, you
can use the transfer order and IDOC data:
o   TO header (import parameter I_LTAK)
o   TO items (table parameter T_LTAP)
o   Control record of the IDOC that has been set up (import parameter
     X_IDOC_CONTROL)
o   Data records of the IDOC that has been set up (table parameter
     T_IDOC_DATA)
This user exit can basically be used to:
o   change or redetermine the data in IDOC WMTOID01 that were determined
     during the standard procedure or provide partners with additional
     information using empty fields of this IDOC.
o   change or enhance the data for controlling the IDOC processing in
     the control record of the IDOC.
  o   If you enhanced the basic IDOC WMTOID01 with your own segments, you
      have to fill these segments including the necessary data.
  The user exit returns the modified IDOC data to the calling program by
  means of the following parameters:
  o   Control record of the IDOC that has been set up (export parameter
      X_IDOC_CONTROL)
  o   Data records of the IDOC that has been set up (table parameter
      T_IDOC_DATA)
  The modified IDOC is passed on by the calling program to the ALE
  interface for sending.
  Although changes to table T_LTAP are without any meaning, they should
  still not be made.
  Examples
  Below, you will find some conceivable changes including the necessary
  source code.
  o   You want to send additional data on TO item level. These data are
      transferred in the standard segment of IDOC WMTOID01.
      With field 'Goods recipient', information is transferred whether the
      external system should additionally print accompanying documents for
      the sent transfer order. The indicator for printout from the TO
      header and the printer from the TO items are specified in this
      field.
      In addition, a separate description is written into the field
      'Unloading point'.
  INCLUDE ZXLIDU01
      tables: e1ltori,
       loop at t_idoc_data.
*........Zusatzinfos aus dem Transportauftrag..........................
     if t_idoc_data-segnam = 'E1LTORI'.
        move t_idoc_data-sdata to e1ltori.
        loop at t_ltap
         where tanum eq i_ltak-tanum
           and tapos eq e1ltori-tapos.
          exit.
        endloop.
        if sy-subrc eq 0.
          move i_ltak-drukz to e1ltori-wempf.
          move t_ltap-ldest to e1ltori-wempf+2.
          move e1ltori to  t_idoc_data-sdata.
          modify t_idoc_data.
        endif.
*........Zusatzinfos die individuell beschafft werden..................
        move 'USER-EXIT' to e1ltori-ablad.
        move e1ltori to  t_idoc_data-sdata.
        modify t_idoc_data.
     endif.
    endloop.
o   The IDOCs that have been set up are to be transferred to the
     external system via two different logical destinations, depending on
     the transport type. This requires two different partner profiles.
     The partner profile depends on the message type, message variant and
     message function. Message function 'EIN' is used for stock
     placements whereas 'RES' is used for all other movements. You have
     to maintain the partner profile for these two message functions
     'EIN' and 'RES' as well.
  INCLUDE ZXLIDU01
   if i_ltak-trart eq 'E'.
     move 'EIN' to x_idoc_control-mesfct.
   else.
     move 'RES' to x_idoc_control-mesfct.
   endif.
For transfer orders on deliveries, the external system requires
additional delivery data such as name of the goods recipient, route,
shipping point, and the like. In this case, the large amount of
additional data can only be transferred via an additional IDOC
segment. That is, you have to define a seprate IDOC type that
consists of the basic IDOC type WMTOID01 and a separate enhancement
type. In the enhancement type, you define the new segment, for
example Z1LTORZ, that refers to the standard segment E1LTORH. Filling the data of the new segment can be done as follows.
  INCLUDE ZXLIDU01
      tables: e1ltori,
              z1ltorz,
              edidd,
              likp.
      data: flg_neues_segment.
      data: begin of xidoc_data occurs 0.
             include structure edidd.
      data: end   of xidoc_data.
  *....>>> Neues Segment anlegen Z1LTORZ <<<.............................
  *........Bestehendes IDOC sichern......................................
  loop at t_idoc_data.
    move t_idoc_data to xidoc_data.
    append xidoc_data.
  endloop.
*........Neuen IDOC-Typ und Erweiterungs-Typ im Kontrolsatz fortschr...
  move:
       'ZZWMTOID' to x_idoc_control-doctyp,
       'ZWMTOID1' to x_idoc_control-cimtyp.
*........Aus dem bestehenden IDOC ein neues IDOC erstellen.............
       dabei wird das neue Segment aufgebaut und eingebettet
  refresh t_idoc_data.
  loop at xidoc_data.
*........Merken:neues Segment soll nach dem Segment E1LTORH kommen.....
       if xidoc_data-segnam = 'E1LTORH'.
         flg_neues_segment = 'X'.
       endif.
   *........Standard-Segmente übernehmen..................................
       move xidoc_data to t_idoc_data.
       append t_idoc_data.
   *........Neues Segment übernehmen......................................
       if flg_neues_segment eq 'X'.
   *........Lesen Lieferung und Daten in neues Segment übergeben..........
         if not i_ltak-vbeln is initial.
           select single * from likp
            where vbeln eq i_ltak-vbeln.
           if sy-subrc eq 0.
             clear t_idoc_data.
             move-corresponding likp to z1ltorz.
   *........Neues Segment sichern.........................................
             move 'Z1LTORZ' to t_idoc_data-segnam.
             move z1ltorz to t_idoc_data-sdata.
             append t_idoc_data.
           endif.
         endif.
       endif.
       move space to flg_neues_segment.
     endloop.
if it is help full to u please give max rewad point.

Similar Messages

  • ZXF08U06 - userexit coding - Idoc syntax problem.

    I am doing IDOC coding in the userexit <b>ZXF08U06</b> in which I am   modifying values in structure edidd.
    It was working fine previously.
    But in further testing we got below error :
    26  Error during syntax check of IDoc (outbound).
    Could you please help me in solving this issue.
    Thanks in advance.

    yeah
    u go to TCODE WE30 and give ur object name and enter.
    then u will see all the segments related to ur object.
    u can double click on each segment and see whethet it is mandatory or not.
    regards
    jai
    please reward if helpful.

  • Find UserExit from IDoc Type

    Dear all,
    here I have a IDCO Type ACC_GOODS_MOVEMENT02
    Is there any one who can tell me the UserExit of it?
    How can I find generelly UserExits from IDoc typ?

    Hi,
    Enhancement: ACBAPI01  & Exit: EXIT_SAPLACC4_001.
    We can find the exits by searching in inbound function modules.
    Reddy

  • Userexit for extended idoc for std. idoc WMMBID02 for T.Code MB1A & MB1B

    Hi,
    Which userexit we have to use to populate values in to extended idoc fields of the standard inbound idoc WMMBID02?
    Pls share ur experience.
    Thanks & Regards,
    Balaji

    Hello using this you can find out used user exit
    1.From SE93 get the program name corresponding to the transaction.
    2. then se38 - > enter program name -> attribute -> display
    3. Get the package from here.
    4.  Go to SMOD . Do f4 on enhancement -> information system. enter your package here
    5. You will get the list of all the available exits for the package.
    List could be a long one.Now best thing to do is to sit with your functional analyst. find out approproate exit from the description. put a break-point there. ask functional analyst to run the transaction. if transaction stops at the break point that's the exit you want

  • URGENT ..userexit Idoc(inbound ) to mir4 tcode

    Am coding in two userexits (ZXM08U25, ZXM08U26 ) of INBOUND Idoc which will update t-code of mir4, and I am testing this using we19.
    some field ( field sgtxt of bseg table ) we forgot to send to( they did not give how to pass in functional specs  ) ….through IDoc .
    Just want to know how the mir4 tcode gets updated by we19 tool..Is it BDC or some direct abap coding UPDATE/MODIFY ?
    ERROR is 51 : Field Text is a required field for G/L account IP50 21300010.
    Functional specs are not stating that this particular text field … how ever specs stated other texts to pass in  internaltable . How can I solve this problem please.

    your transaction is posting accounting document and it looks like for the account you use a field-gorup is defined where text field is marked as mandatory.
    So you have 2 options here
    - either populate the text in your exit (it either can be passed in teh IDOC or you can populate it in your userexit based on your own logic - check with your functional analyst)
    - or change field-gorup for your account to make text field non-mandatory -> this obviously requires verification with your accounting folks and your functional analyst.

  • Userexit for extension of TPSSHT01 IDOC

    Hi..
    I have created an extension of the shipment idoc TPSSHT01... this extension has 2 fields VSBED and TNDR_TRKID.... Now the IDOC is inbound, so i need to write code in a userexit to update the VTTK table with the values of these fields.. which USEREXIT should I use for this purpose?

    hi does anybody have any answer for me..

  • Userexit: Outbound matmas idoc

    Hi Guys,
    I am looking for a suitable userexit for Outbound matmas idoc.
    The requirement is once the idoc number has been generated with idoc status AFTER that only i need a userexit for my own .
    I am using BD10 transaction code to create the MATMAS idoc.
    Will appriciate your help..!
    Thanks,
    Biswajit.

    Hi,
    The flow is like this in BD10....
    CALL FUNCTION 'MASTERIDOC_CREATE_REQ_MATMAS'
       CALL FUNCTION 'MASTERIDOC_CREATE_MATMAS'
          CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'        " it return the control record with idoc no after execution
              CALL FUNCTION 'IDOC_CREATE_ON_DATABASE'    " it return the control record with idoc no after execution
                  CALL FUNCTION 'EDI_DOCUMENT_CLOSE_CREATE_TAB'     " it return the control record with idoc no after execution
                          PERFORM F09_IDOC_INSERT_WITH_NUMBER USING IDENTIFIER    " idoc no generates here in control record
                                                DOCNUM
                                                IDOC_CONTROL
                                                SYNTAX_RETURN
                                                FREE_RETURN
                                                SYN_ACTIVE.
    So i need a userexit / enhancement point after that with control record data.......

  • Inbound idoc MATMAS - find userexit to map extension

    Hi !
    I have an inbound IDOC MATMAS04 with a specific extension. I need to map the fields of the extension : some of them into an append of MARA, some others into characteristics.
    <b>I can't find the user exits I need.</b>
    I guess there are 2 of them. The first one for mara append BEFORE the creation of the material, and the second one for the characteristics AFTER the creation of the material.
    Does anyone know where I can find such user exits (even HOW to find them would be so much appreciated) ?
    Kind regards,
    Yann

    Hi..
    This is the Enhancement <b>MGV00001</b>
    and The FM exit is <b>EXIT_SAPLMV02_002</b> To Enhance IDOC for MARA segment in Inbound.
    <b>Reward if Helpful</b>

  • Userexit in the idoc invoice

    hi experts,
    i have a requirment like that , our client sending the invoices through idoc.
    my requirment is that, in  the invoice now the name of the payer is printing ,but in that place it should  print the contacat person name.
    could u please tell me any what is the process to do that ,
    iam new to IDOC.
    Thanks .

    Check the below points,
    1. Check the internal table IDOC_DATA in MASTER_IDOC_DISTRIBUTE in debug mode whether the segement with values are populated.
    2. Are you populating the parent & hierarchy level in segment, if yes check whether the values are right one.
    3. There may be a possiblity the std SAP code would delete the custom segment if its any syntax error in segment defenition.
    Check this and if you still have the issue come back.

  • Userexit or Badi to change Outbound ORDERS Idoc

    Hi all,
                 As per my requirement, I want user exit or Badi which can change Outbound Idoc for ORDERS. I am aware of enhancement MM06E001 with user exit EXIT_SAPLEINM_011. Here in our old system 4.6 we implemented same. But for our new system ECC 6.0 control is not going inside after changing PO, it is creating new Idoc & posting but not going inside same user exit. Is there any Badi available?
    Is it because of version change?
    Please its kind of urgent.
    Point will be rewarded for helpful answers.
    Thanks,
    neo

    Hi,
    These are the exits available for Outbound ORDERS idoc.
    1. ORDERS Purchase order / order MM06E001 EXIT_SAPLEINM_001 Customer enhancements
    for control
    record: purchasing
    document, outbound
    2. ORDERS Purchase order / order MM06E001 EXIT_SAPLEINM_002 Customer enhancements
    to data segments,
    purchasing
    document, outbound
    3.ORDERS Purchase order / order MM06E001 EXIT_SAPLEINM_011 Final customer enhancement
    EDI purchase
    order outbound
    You should create the project before implementing the exits. So that the break point is going to stop over there.
    Check this link to know how to find BADI -
    http://www.sap-img.com/abap/how-to-find-bapi-for-particular-transaction-in-sap.htm
    In your case this BADI is there for the given program.

  • UserExit or Badi for inbound posting idocs after commit

    Hello Folks,
    I want to know the User Exit/Badi that can be used after inbound idoc gets posted-iam using FM IDOC_INPUT_HRMD for posting idocs, as i want to use perform on commit statement.
    Thanks & Regards,
    Nishanth Kumar

    Hi Nishanth
    Dont sure about the question actually.Can you elaborate.
    see the [thread|Re: User Exit or BADI   for ME21N or ME51N;
    it may help you
    Regards
    Sachin

  • Idoc userexit for MBGMCR/MBGMCR03

    Hello,
    Iam using the message type MBGMCR/MBGMCR03 fn module BAPI_IDOC_INPUT1 process code BAPI.I want to convert the unit of measure to ISO codes on receipt of an IDOC and post the receipt.When I searched for the user exits i could find only ALE00001 with EXIT_SAPLBD11_001(User Exit for IDoc Version Change) can i use that for calling another function module to do the conversion?or any other way to achieve this.....
    Thanks,
    Larry

    We can create conversion rules using BD55,BD79.
    May be u can do this here. Try it once.

  • IDOC UserExit

    Hi all,
    Is there any specific way specially for searching a user exit for enhancements in a standard inbound or outbound function module?

    Hi Faraz,
    See for all CALL CUSTOMER-FUNCTION in that function module. These are the user-exits.
    Reward if helpful.
    Younus

  • Pls help me to identify in the SD userexit what triggers "del of items"

    Here's the background of the problem. (it is difficult to explain the problem and I will try my best).
    When processing certain IDOCs, something in the SD userexit is causing the change logs of vbap records to be set with a message for every item "Item has been deleted".  I could not reproduce the problem in either the development or QA environment. It is happening in production and it happens when the IDOC is processed every night by a batch job running a standard SAP program RBDAPP01.
    It then becomes too late for me to debug the issue in production...and I can't real mess around with idoc procesing in production either..
    Since it has become impossible to reproduce the problem in QA or Dev , I am trying to figure out how to prevent it from happening...
    (I know fixing the existing records is another problem) I'm trying to figure out what code in the user exit thinks that it should log a message "Item has been deleted" for every item of vbap. The item itself is not deleted or marked for deletion..it;s just that this is appearing in the change history...  
    Can anyone suggest what may be causing this issue.,..
    Thanks....
    Sam
    Edited by: SammyBoy on Apr 8, 2011 10:39 PM
    Edited by: Sam on Apr 8, 2011 10:40 PM

    If u want to add Items data, u have to handle the Table control by writing the complete code.
    U have to write code for 2 items, when u press enter u will get new row to enter new record one by one.
    Narendra

  • Return order with reference to the billing document created via IDOC.

    Dear Colleagues,
    I’m struggling to understand and confirm whether standard functionality of ORDERS05 idoc allows creating a return order with reference to existing billing document?
    I have tried using standard segment E1EDK02 and E1EDP02 with qualifiers 009,010,011,087 but unfortunately idol is not creating a return order with reference and ignoring this segment.
    Have any one came across similar problem? If yes then will be grateful for sharing his experience.
    Best regards,
    AL

    Dear Friend
    Welcome to SDN
    Return order is itself a challenge to SAP standard settings
    There are some scenarios
    1. Return order qty should not be increasesd say Billed qty of material X is 20 units
    While returning Material X should be a maximum of 20 units
    If made 21 it should throw error T code OVAH message class V4 message no 299 convert from warning to error thro customization
    2.Return order should be created only once referencing billing doc
    To control that T code SE91 message class V1 message no 499 convert from warning to error thro ABAP help
    3 Your issue is same like case 1 but the material X is entered as second line item in the return order with some qty
    This case system is not throwing even a warning
    Yes correct
    This is to be handled with userexit
    Discuss the same with ABAPer
    Check these threads on return issues which is of different scenario than of yours
    Forum post in ERP - Sales and Distribution (SD) General: Order Qty.
    Order Qty.
    Forum post in ERP - Sales and Distribution (SD) General: Return order
    Return order
    Regards
    Raja

Maybe you are looking for