ORDERS05 Idoc Type Extension

Hello,
I am extending the segment E2EDKA3 in ORDERS05. Please let me know any user exit or any other way to populate the values in the extended segments.
I am adding these fields: VBPA-KUNNR,VBPA-ADRNR,VBPA-XCPDK & VBPA-ADRNP                         .
Thanks in advance,
Suresh

Hi Suresh,
Go through this info ucan able to do.
Enhancement of IDoc Type
Usually enhancement takes place when the content in IDocs provided by SAP are not sufficient for the business process. IDoc extension can take place whenever dictionary table has a new structure appended required by the business process. 
In brief IDoc extension takes place when extra fields are required for the business process.
Let us take a scenario and understand the process of IDoc extension.
In this scenario say visitor is different from the actual customer who has came to the sales office in behalf of the customer to obtain the quotation or inquiry etc. Or an authorized agent qualified by the actual customer to order for items. So a field by name NAMEVI (Visitor) is added to Customer master data. As there is no provision given by SAP to handle this, we need to extend an IDoc. 
The standard message type and IDoc type provided by SAP are DEBMAS and DEBMAS05. 
Consider the data in the table below for extending the IDoc. These details can be understood in different sections in the process of extending it. 
Basic IDoc type      DEBMAS05
Version      4.7
IDoc extension      DEBMASEXT
Custom segment      Z1KNA1
Fields in Custom Segment      Visitor
Parent of Custom Segment      E1KNA11
Outbound process
Step1. Customize kna1 table by appending a structure provided by SAP (ZAKNA1) 
Component                Component Type
VISITOR                     NAMEVI
Step2: Write a module pool program to update some existing customers to add data  for Visitor. 
Step3: Create a custom segment
Transaction Code: WE31
Segment type: Z1KNA11   Click  (create). Provide short text 
Field Name                Data element
VISITOR                NAMEVI
Save 
Step4: Create IDoc extension
Transaction      WE30
Object Name      DEBMASEXT
Choose Extension
Click   and it leads to next screen.
Linked basic type: DEBMAS05
Provide description and enter
Observe all the segments to be copied into your IDoc extension from linked basic
type.
Select E1KNA11 and click  (create segment) to obtain a popup window
Provide the required values and observe child segment Z1KNA11 to be added to
parent segment E1KNA11. 
Step5: Release segment and IDoc extension
Transaction: WE31
Segment type: Z1KNA11
Path: Edit à Set release
Step6: Assign Basic type to extension / messages
Transaction: WE82
Click  , then 
Select DEBMAS message type against DEBMAS06 basic type
Click   provide the information
Message Type      Basic Type      Extension      Version
DEBMAS      DEBMAS06      DEBMASEXT           4.7
Delete the earlier one from which it was copied.
Save. 
Observe the result as follows
Step 7: Check and Transport IDoc extension
Transaction: WE30
Object name: DEBMASEXT
Path: Development object à Check
Ensure that there are no errors or warnings
Now transport
Path: Development à Transport 
Step8: Find suitable user exit for writing code to support IDoc extension
Transaction: SE84.
Click Enhancements
In short text provide customer
Find suitable enhancement to be VSV00001 
                         Alternative way
Transaction: SMOD
Click F4 help for Enhancement
Path: F4help à SAP Applications à Logistics general à Logistics Basic Data à
Business partners à Vendor Master.
Find the enhancement as VSV00002, which is an approximate user exit.
Now search for different extensions like VSV00001. Then see for its components.
Identify the appropriate user exit to be ‘EXIT_SAPLVV01_001’ (Create Export of
Additional Customer Master Segments). This user exit can be used in outbound ALE
process, meant for filling the data into custom segments. 
You have to identify here another user exit as ‘EXIT_SAPLVV02_001’, which is
helpful for inbound ALE process. This user exit can be used to read the segments
and post it to Application repository. 
Step9: Develop a project to encapsulate enhancements and components.
Transaction: CMOD.
Enhancement: custex and click Create to provide attributes.
Click Enhancement Assignments.
Provide VSV00001, short text and save.
From the initial screen of the transaction, select components and click change.
Find 4 components to be added.
Activate them.
Select user exit EXIT_SAPLVV01_001 for outbound process and double click it. It leads to function builder.
Double click on provided include program ZXVSVU01 and press enter.
Now, write supporting code for IDoc extension, i.e., populating custom segments in IDoc.
Check the code and activate.  
Code in ZXVSVU01
*& Include           ZXVSVU01                                         *
*In this scenario, the E1KNA11 has been extended to accommodate
*User-defined fields in the customer table kna1. The name of the
*extended
*segment is z1kna11. There is one custom field: visitor
*Data declarations
DATA: kna1m like e1kna1m,
      kna11 like e1kna11,
      z1kna11 like z1kna11,
      w_kna1 like kna1. 
make sure you are processing correct message type
check message_type eq 'DEBMAS'.
make sure data is added after the correct segment
check segment_name eq 'E1KNA1M'.
since customer number is not passed in this user exit, you need to go
through the data records to find the customer number
loop at idoc_data.
  case idoc_data-segnam.
     when 'E1KNA1M'.
       move idoc_data-sdata to kna1m.
     when 'E1KNA11'.
       move idoc_data-sdata to kna11.
  endcase.                             " case idoc_data-segname.
endloop.                               " loop at idoc_data. 
select data from the user-defined fields in kna11.
select single *
  from kna1                            " Customer master table
  into w_kna1
where kunnr = kna1m-kunnr.
if sy-subrc eq 0.
set the idoc extension name for control record
  idoc_cimtype = 'DEBMASEX'.
clear custom fields from kna1 to extended segment
  clear z1kna11.
copy custom fields from kna1 to extended segment 
move-corresponding w_kna1 to z1kna11. " field name must be same
condense all fields of extended segment
  condense: z1kna11-visitor.
populate segment name in the data record, copy data contents into it 
and append the data record to existing data records in
  move 'Z1KNA11' TO IDOC_data-segnam.    " administrative section
  move z1kna11 to idoc_data-sdata.       " data section 
  append idoc_data.
endif.                                 " if sy-subrc eq 0.
Step 10: 
Define Logical System
Assign client to Logical System
Maintain RFC Destination
Maintain Customer Distribution Model
Generate Partner Profiles
Distribute Customer Distribution Model
INBOUND PROCESS
Step 11: Append the custom structure to the table KNA1 similar to the process done
        in outbound process.
Step 12.
Define Logical System
Assign client to Logical System
Generate Partner Profiles
Step 13. Execute the transaction to ‘Send Customers’ from Outbound system.
Step 14. Now in the Inbound system, create the project in the similar way as done at
        outbound side.
In the user exit EXIT_SAPLVV02_001, find include ‘ZXVSVU02’. Write the code to
support IDoc extension.
Code in ZXVSVU02
*&  Include           ZXVSVU02                                         *
data: kna1m like e1kna1m,
      kna11 like e1kna11,
      z1kna11 like z1kna11.
data fs_kna1 type kna1.
message i000(0) with 'INBOUND PROCESS CALLED'.
LOOP AT IDOC_data.
  case idoc_data-segnam.
    when 'E1KNA1M'.
      kna1m = idoc_data-sdata.
    when 'E1KNA11'.
      kna11 = idoc_data-sdata.
    when 'Z1KNA11'.
      z1kna11 = idoc_data-sdata.
      select single *
        from kna1
        into fs_kna1
       where kunnr = kna1m-kunnr.
      if sy-subrc eq 0.
        update kna1
           set visitor = z1kna11-visitor
         where kunnr = kna1m-kunnr.
      else.
        idoc_status-docnum = idoc_control-docnum.
        idoc_status-status = '51'.
        idoc_status-msgty = 'E'.
        idoc_status-msgid = 'ZE'.
        idoc_status-msgno = '005'.
        idoc_status-msgv1 = kna1m-kunnr.
     append idoc_status.
      endif.                           " if sy-subrc eq 0.
  endcase.                             " case idoc_data-segnam.
endloop.                               " LOOP AT IDOC_data.
Step 15. Assign FM to extension/Message type
Transaction:      WE57
Path: Change à New Entries
Select ‘IDOC_INPUT_DEBITOR’ against DEBMAS06 basic type, to fill extra
information as shown below.
Function Module          Basic Type     Message Type          Extension
IDOC_INPUT_DEBITOR     DEBMAS06     DEBMAS          DEBMASEXT
Step 16. Execute the transaction to ‘Get Customers’.
And observe that records with extra data are saved in database.
Rewards some points.
Rgds,
P.Nag

Similar Messages

  • Idoc type extension

    Hi Experts ,
    I have created an extesnion for standrad message type DEBMAS  and Idoc type DEBMAS05 . In devlopment system it is working fine . when transported to other system  it is not working and after analsys it is found that EDISYN table has differnt values for differnt systems .Please let me know how can solve this , is any customization need to be mainatined or how it can be done .
    Regards
    Arun .

    Hi,
    You have to transport the idoc Extension object to fix this issue. It is not related to customization and it is more of IDOC development related. Try to find out the request under which the idoc extn is saved and retransport the request or include the extn related objects into new request and move it to target system. This should solve your problem.
    Cheers,
    Prasanna

  • Why message type if  idoc type or idoc is already there.

    Experts.
    this has been posted several times and i gone through so many threads but stil some confusion . So anyone can tell in simple terms what is the difference and why sap has given this two instead of one.
    Diff. with IDOC type
    An IDoc type specifies the structure of the data.
    A message type specifies the meaning of the data
    *****from the above statements , by seeing the name of the idoc type ex matmas01 also we ca n say that it is used for material data, then why message type matmas needed?

    Hi,
    Idoc type means combination of segements
    Message type means Combination of idoc type
                              or
    Message type mean combination of Idoc type + Extension idoc type( Custom segments added to idoc type)..
    Example:-
    If you want to fill the data to custom segment which is available at exension idoc ...
    then first check the message type then check basic idoc type then check it contains exetension idoc type ..then fill the segment
    Generally the communication occurs between system through message type...
    Prabhudas

  • Custom IDoc Type missing segment parent/child relationships

    Hi.
    I copied the standard ORDERS05 IDoc type to a custom type and cut out quite a few segments.  My new IDoc type is setup with parent/child segment relationships, similar to many of the original relationships in ORDERS05. 
    When I use the standard FM IDOC_OUTPUT_ORDRSP to generate an IDoc, it's not creating with parent/child segment relationships.  It's placing the children at the same level as the parent. 
    Anyone know what I'm doing wrong?
    Thanks!
    Cal

    figured out the problem.  was missing a required segment used to establish the parent/child relationship.

  • ORDERS05  idoc ship-to party determination

    Hi there
    I am creating sales orders using ORDERS05 idoc type for EDI documents from customers. Customer files are translated to idoc format by a third party. The idoc input file contains an E1EDKA1 segment for parvw = WE but third party and customer do not know our ship-to number. I need to determine the correct ship-to party from e.g. GLN number supplied in input file. I would appreciate some ideas how to do this.

    Liz,
    We currently use a Custom solution, reading the Customer's internal Store code from E1EDKA1-KNREF, and matching it up with the SAP Internal Customer number via a Z Table. Our Customers do not currently use GLN Codes. From what I can tell, although SAP have enabled the GLN fields in the Customer & Vendor Masters (see table below), they are not utilised in any Inbound ORDERS iDoc processing. The GLN (or ILN) does have a placeholder in the ORDERS05 iDoc - in E1EDKA3, child segment of E1EDKA1 - see transaction WE60 for documentation.
    GLN Fields (from KNA1)
    BBBNR     NUMC     7     0     International location number  (part 1)
    BBSNR     NUMC     5     0     International location number (Part 2)
    BUBKZ     NUMC     1     0     Check digit for the international location number
    I believe it would be quite easy to put code into Include ZXVEDU03 to lookup the GLN Code from KNA1 and return KUNNR.
    Good luck,
    Paul.

  • How can i pass the  segments and fields to the ORDERS05 IDOC

    Hi All,
    I want to use ORDERS05 Idoc type for creating sales order. How can I pass the order type, sales org., distr. channel, division, sold-to-party, material and quantity to the Idoc?
    please help me out in this.
    thanks in advance
    jasmine

    Hi,
    Goto WE19 TC and there select your IDOC and there u can pass the data.
    Regards,
    Phani

  • ERROR IN CREATING SALES ORDER,USING IDOC TYPE ORDERS05

    I am using exit to write my code for creating sales order of IDOC Type ORDERS05 and order type ZDRX.
    IF I proceess the Idoc in background each time error message comes
    FIELD kuwev-kunnr(ship to party)is not an input field.
    but if i run in foreground in debugging mode,sales order is getting created..
    please suggest something.

    If thats not working..
    try BAPI_SALESORDER_CREATEFROMDAT2
    If BAPI is not working. try creating a bdc for the same if there's not error on trying from VA01

  • Idoc Types with customer extension in XI

    Hello,
    I have a question / problem.
    Is it possible to import an IDOC Type like HRMD_A06 with an customer extension like ZRMD_A06 into XI ?
    I have no idea how that could works ...
    Thanks for your feedback !
    Regards
    Florian

    Hi,
    You can import IDoc structure with extensions also. It will be same as importing normal idoc structure.
    We have done many like that in our project.
    What is the problem you are facing ?
    Regards,
    Sridhar

  • Find Idoc extension type for Basic Idoc type

    Hi all,
    Is there any way to find existing extesions for Idoc given by SAP? For example, for basic idoc DEBMAS05 for version 4.7 , Idoc extension is DEBMASEXT.
    In similar way I want to know what is Idoc extension for Idoc basic type PREQCR02 [Create Purchase Requisition].
    Thanks in advance.
    Madhura

    The reason is preqcr02 is a generated idoc type  and matmas05 and debmas05 are not generated idoc types .
    You can search in table EDBAS for this .  If you go for dynamic debuggin , message comes from form
    create_ext_structure  in include MSED5F02 
    data: l_edbas type edbas.
      select single * from edbas into l_edbas
         where idoctyp eq edi_iapi01-idoctyp.
    if l_edbas-generated eq 'X'.
       message e099(b1) with
          'Action is not possible for generated idoctypes'.
    endif.
    Edited by: anil sasidharan on Feb 25, 2009 12:51 PM
    Edited by: anil sasidharan on Feb 25, 2009 12:59 PM

  • Extension of generated Idocs types

    hello,
    does anybody knows why I can not create extension of generated (means in table EDBAS-GENERATED = 'X') idocs?
    I tried to extend idoc BATMAS03 on R/3 Ecc 6 and got message:
    message e099(b1) with
             'Action is not possible for generated idoctypes'
    In former version of R/3 4.6C it was possible to extend such IDoc BATMAS02 (generated one) without any problems.
    Of course I found in program MSED5F02  in routine CREATE_EXT_STRUCTURE new (in comparison to 4.6C) extra check which protects against extension of generated IDocs, but I want to get to know what was behind that decision or how to workaround that problem.
    Thanks in advance,
    Marcin

    Hi,
    User Exits are used to populate data in new segments added and to read them
    back which provides extension to existing idocs.
    IDOC EXTENSIONS
    SAP delivers Basic IDOC types such as DEBMAS02, MATMAS02, ORDERS02, and WMMBID01. By extending the Basic IDOC type, you are actually creating a new IDOC type. You create a new segment with the additional fields. This new segment has to be associated with one of the existing Basic IDOC segments. Then you create a new extension type, which is associated with the Basic IDOC type. This results in a new IDOC type. In order for ALE function modules to relate to this new IDOC type, the IDOC type is linked to the corresponding message type. Note that you should not add fields to existing segments but should create a new segment and associate it with an existing segment. This, in a nutshell, is the process of creating IDOC extensions.
    In our example, the Basic IDOC type DEBMAS02 is used to communicate Customer Master data to the SAP Customer Master application. Even though the application has a screen to enter and store a contact personâs business address (see Figure 1), DEBMAS02 does not have a segment or fields that communicate the contact personâs business address. If your business requires that this business address be communicated to the other system through the ALE interface for Customer Master, then you have to extend the DEBMAS02 IDOC type, and enhance the corresponding ALE function module.
    In DEBMAS02 the contact person fields are present in segment E1KNVKM and the business address of the contact person is stored on the SADR SAP table. You need to create a new segment, Z1SADRX, that is associated with E1KNVKM. This will be done in the process of creating an extension type ZDEBMASX. This extension type will then be associated with a new IDOC type, ZDEBMASZ. IDOC type ZDEBMASZ will be linked to message type DEBMAS for Customer Master. The final step in the IDOC extension process is to check the new objects. This check also verifies the structural integrity of the IDOC type. Letâs look at each of these steps in more detail.
    1. Create an Extension Type and a New Segment.
    First, determine the fields on table SADR that you are going to provide for in the new segment Z1SADRX. You need fields for name, street, city, region, and country to give the business address of the contact person. You also need fields for the address number. ADRNR is a field in SAP tables such as SADR that uniquely identifies the address of an entity. This field is cross-referenced from other tables to the SADR table to obtain the full description of the address. Because this is an IDOC type for master data, the first field of the new segment will be MSGFN. The message function field informs the receiving system of the action to be taken for that particular segment. In the code that you write for populating the new segment, the value of the message function is the same as that of the parent segment E1KNVKM. In all, you will have 12 fields in segment Z1SADRX (see Table 1).
    To create an extension type and new segment:
    Use transaction WE30 or from WEDI go to Development -> IDOC types.
    Enter ZDEBMASX for Object Name.
    Choose Extension Type.
    Click on Create.
    You will see a pop-up screen. Choose Create New, and enter a description. For version 4.x, enter DEBMAS02 in the Linked Basic Type field. Enter.
    You will see a screen with ZDEBMASX and its description in the first line. Click on this line, and press Create. For version 4.x, expand the tree of segments, and place the cursor on E1KNVKM.
    You will see a pop-up screen. Enter E1KNVKM as the reference segment. Enter.
    For 4.x, press Create after placing the cursor on segment E1KNVKM.
    You will see a line appear with E1KNVKM hierarchically below ZDEBMASX, with a description "Customer Master contact person (KNVK)."
    Click on this line and press Create. You will receive a message indicating that the new segment being created will be a child segment of E1KNVKM. Enter. A pop-up box appears for the new segment.
    Enter Z1SADRX as the segment type, 1 for Minimum, 1 for Maximum. Leave Mandatory segment unchecked. These entries imply that there is only one Z1SADRX segment for every occurrence of the E1KNVKM segment, and also that this segment is not mandatory. Note that if the parent segment is not mandatory, then the child segment should not be mandatory, because this could result in a syntax error during the creation or processing of the IDOC.
    For 4.x, you must first create the IDOC segment Z1SADRX (Iâll explain why in a moment) from the menu path WEDI -> IDOC -> Development -> IDOC Segment.
    Click on Segment Editor.
    On the next screen, click on Create.
    Enter a development class for the object. Enter.
    This will take you to the screen for segment definition. Enter a description for the segment. Enter the field name, data element, and the data element documentation name. In most cases, all three fields may have the same values. If you are using a field in the segment that is not present in the ABAP/4 data dictionary, you must first create the domain, data element, field, and appropriate documentation before using it in the new segment.
    Enter these three columns for all 12 fields. Save.
    Click on Generate/Activate, F3 to step back.
    From screen Maintain Segment, go to Segment Type -> Release. A checkbox now appears beside the segment definition Z1SADRX (see Figure 2). Check this box. Save. Save again to store the descriptions of the segment, F3 to step back.
    Save the extension type.
    It is possible to have several new segments with relevant Basic IDOC type parent segments in a single extension type. However, you can form only one IDOC type based on a single extension type.
    Pls reward helpful points.
    Regards,
    Ameet

  • IDOCs - IDOC type ORDERS05 with message type MSGCHG

    Hi,
    I'm in my first IDOC project and I'm facing a problem. I need to change sales orders with EDI messages, so I've decided to use message type ORDCHG and IDOC type ORDERS05. I'm filling segments E1EDK01, E1EDP01 and E1EDP19. In header the action is '003' to indicate I'm going to change items, and in item the action is '002' - change. I'm not changing all items of the order, so I only fill item segments for the item I want to change.
    The problem is the F.M. IDOC_INPUT_ORDCHG looks to use batch input technique to update the order and the BDCDATA contents does not look good. And I receive a message saying VBAP-PSTYV is not an input field. I'm not entering the contents of PSTYV in segment E1EDP01.
    Does anyone have any idea of what can be the reason for this problem ? For the error, and for the fact of the contents of BDCDATA do not look good.
    And any idea of how to solve it.
    And does anyone knows if the batch input technique is mandatory, or is there any way to avoid it like forcing the standard to use a BAPI ?
    I'll really apreciate any possible help, because i'm without any idea about how to solve problem.
    Thanks in advance,
    Paulo Sousa

    If you go to SE11 and enter VBAP then finf the field PSTYV, double click on the field and see if the !fixed Value. ex" field is ticked, if it is this means that SAP is trying to get a value for this field from a fixed set of values.
    You could try using WE19 to mess around with the IDOC in error and process the document as a standard inbound IDOB.  See here https://websmp105.sap-ag.de/~sapidb/011000358700002529571998E/default4.htm for some field entry examples
    Hope this helps,
    Conor.

  • Custom segments to basic IDOC type without extension

    Hi,
    Is it possible that an IDOC has custom segments which are getting populated and the basic type does not have any custom segments.
    How should we find from where the custom segments are getting populated and displayed?
    Regards,
    Subhashini

    Hello,
              Lets say in DELVRY05 Idoc Type, we have a Segment Called E1EDL20 and since this is a Standard SAP Provided Basic Type, it will not have any Custom Segments ( Z-Segments). Now, If I want some additional Information to be populated as part of a Custom Segment, what I would do is to Create an IDoc Extension ZDELVRY05 with reference to the Basic Type DELVRY05 and Create a Custom Segment Z1EDL20 (Per Say) in which I'll populate the Custom Data Fields using an Exit. So, unless we create an IDoc Extension for a Basic Type, the Standard SAP Basic Type will not have any Custom Segments-Fields (Z-Segments).
    Thanks,
    Venkata Phani Prasad K

  • Passing header text into Idoc(Idoc type orders05)

    Hi,
      we have header text, header note etc in text tab(under details) in  PO.
           now i have to pass the data's from the header text into the IDoc(idoc type Orders05),
    In which segment the data's will be populated, How to shall i go.

    Hi,
    if you are using idoc PORDCR102 or PORDCR101, header texts are populated in E1BPMEPOTEXTHEADER and both position & header in E1BPMEPOTEXT.
    Then you are using ORDERS01-05 Idoc types, header texts were filled in E1EDKT1 & E1EDKT2 while texts are filled in E1EDPT1 & E1EDPT2.
    The PO header texts are stored in the segments E1EDKT1 whose child segment is E1EDKT2 in IDoc type ORDERS05.
    The actual text will be found in E1EDKT2 and the text id will be found in E1EDKT1.
    You have to do some config so that The segment gets update
    in the IDoc.
    go to SPRO  MM->Purchasing ->messages->Text for messages->Define texts for PO. Here you can find out on the left side of the window.In  Header texts & supplements text.
    Add the text IDF01( with all  details like your document type, object for PO will be EKKO) in header text .
    Then Add all other to the supplement texts(details).
    It is now the IDoc should update the segments.
    Regards
    Raj.
    Moderator message:
    Warning. Reason: plagiarism, this is a copy-paste answer from:
    PO texts in purchase order idoc*
    Edited by: Csaba Szommer on Nov 8, 2011 2:00 PM

  • Basic IDOC types

    what are these  ORDERS05, DELIVERY03 & WMMBID02
    i found that these are basic idoc types. what does it mean?
    Regards,
    pandu.

    Some IDoc types are supplied by SAP in the standard system,
    these are the basic types. Other IDoc types are customer
    extensions. In these cases, a basic type is combined with
    an extension which is created by the customer, according to
    certain rules. Unlike customer extensions , these extended
    basic types are upward compatible.
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • PO and SO IDoc Type

    Hi,
    I understand that the IDoc type ORDERS05 can be used for Sales Order as well as Purchase Order. My requirement is to receive Order IDoc and create the sales order and send the PO details to a partner. Please let me know whether I can use the IDoc ORDERS05 for both these cases.
    Also I found that IDoc type PORDCR04 is available for PO. Can we use this IDoc type for sending Purchase order details.
    Thanks
    N

    Hello Nanditha,
    Yes you can do that.
    Also go to WE60 and put in PORDCR04 and downloadd to your PC if needed.
    Then search if all the fields you need are in that Idoc type.
    There are no rules as to which Idoc type you have to use, but you should try your best to stick to SAP recommended one's.
    Hope this helps.

Maybe you are looking for