Create idocs from custom program

hi
i have a custom program and will have custome segements.
so i can fill both control and data records.from here i need to generate idoc..any FM's to do this??
appreciate any help.
thanks
siva

Hi Siva ,
There is no FM to fill segments data , you need to write your own logic fill IDOC data ,
then use 'MASTER_IDOC_DISTRIBUTE' to send IDOC.
check this sample code :
DATA :idoc_line       TYPE edidd,
      idoc_data       TYPE STANDARD TABLE OF edidd.
  x_a00-transaction_type  = c_trans_type_a00.
  x_a00-organisation_id   = x_externalid.
  x_a00-file_type         = 'XXX'.
  x_a00-creation_date     = sy-datum.
  x_a00-creation_time     = sy-uzeit.
  x_a00-generation_number = ''.
  x_a00-int_file_type     = 'XXX'.
  idoc_line-sdata  = x_a00.
  idoc_line-segnam = 'ZX_A00'.
  cnt_no = cnt_no + 1.
  idoc_line-segnum = cnt_no.
  APPEND idoc_line TO idoc_data.
DATA : x_idoc_control like edidc.
x_idoc_control-mestyp = x_mestyp.         "Message type
x_idoc_control-idoctp = x_idoctp.         "Basis Idoc Type
x_idoc_control-cimtyp = space.            "Customer extension
x_idoc_control-mescod = space.
x_idoc_control-sndpfc = space.
x_idoc_control-sndprn = x_sender_no.
x_idoc_control-sndprt = x_sender_type.
x_idoc_control-rcvpfc = space.                 "Partner Role Receiv.
x_idoc_control-rcvprn = x_distributor.         "Partner Nr.
x_idoc_control-rcvprt = x_sp_type.            "Partner Type Receiv.
Regards
Appana

Similar Messages

  • Creating IDOC from ABAP  Program

    Hi folks,
              Could any one tell me the procedure how to process IDOC form ABAP program. for example i want to send MATMAS idoc to other system. now we are able to send through Tcode BD10 to XI.  we jsut want to send through ABAP program. is it possible to do so..if so  could u pls let me know the procedure..thanks in advance.
                   santosh.

    Just check abap program RBDSEMAT.
    In short:
    - select the materials you want to send.
    - call following function module:
                    CALL FUNCTION 'MG_IDOC_CREATE_FULL_MAT'
                      EXPORTING
                        rcvpfc       = ' '
                        rcvprn       = receiver_prn
                        rcvprt       = receiver_prt
                        sndpfc       = ' '
                        sndprn       = ' '
                        sndprt       = ' '
                        message_type = mestyp
                      TABLES
                        marakey      = t_matkeypack
                      EXCEPTIONS
                        OTHERS       = 0.

  • Create IDOC from file

    I have received an IDOC order file, and I know there is a standard program RSEINB00 to create IDOC in system.
    I would like to delete/add segments, change field contents in segements in the IDOC according to some of the segments in IDOC. Where can I manuplate it?
    Thanks for your advice.

    I am not test an IDOC file. I regularly receive IDOC file and need to manuplate the content, e.g. delete some of the segments, determine and fill in field content in some segments.
    I just wonder if I can change the IDOC content after it is created in system, just like what I can do in WE19, but using a program. Is there any standard program for this purpose?
    Or is there any user exit I can use when creating IDOC from file?
    Thanks.

  • Sending IDOCS from ABAP Program

    hi friends,
               can we send IDOC ( of type MATMAS) form ABAP Program. if it possible how can we send, are there any function modules to do so....could any one tell me the procedure to accomplish the task...i have finished the configuration sting in both reciver and sender systems....just need to send material in form of IDOC from abap program.
    ( Note: not form BD10).
    Thanks in advance,
    Santosh.

    Hi,
      Follow this code it will help u...
    This is for the user created IDOC but as u are making use of ur own basic type i.e., Idoc type MATMAS05
    and u can write the code.
    *& Report  ZZ_Program_To_Create_Idoc                                        
    report  zz_program_to_create_idoc                     .
    tables: ekko,ekpo.
    selection-screen skip 3.
    selection-screen begin of block b1 with frame title titl.
    selection-screen skip.
    select-options s_ebeln for ekko-ebeln.
    selection-screen skip.
    selection-screen end of block b1.
    data: header_segment_name like edidd-segnam value 'Z1EKKO',
          item_segment_name like edidd-segnam value 'Z1EKPO',
          idoc_name like edidc-idoctp value 'Z19838IDOC1'.
    data: header_segment_data like z1ekko,
          item_segment_data like z1ekpo.
    data: control_record like edidc.
    data: messagetyp like edmsg-msgtyp value 'ZZ9838MESG1'.
    data: i_communication like edidc occurs 0 with header line,
          i_data like edidd occurs 0 with header line.
    data: begin of i_ekko occurs 0,
          ebeln like ekko-ebeln,
          aedat like ekko-aedat,
          bukrs like ekko-bukrs,
          bsart like ekko-bsart,
          lifnr like ekko-lifnr,
          end of i_ekko.
    data: begin of i_ekpo occurs 0,
          ebelp like ekpo-ebelp,
          matnr like ekpo-matnr,
          menge like ekpo-menge,
          meins like ekpo-meins,
          netpr like ekpo-netpr,
          end of i_ekpo.
    start-of-selection.
    select  ebeln aedat bukrs bsart lifnr from ekko
              into table i_ekko where ebeln in s_ebeln.
    select ebelp
           matnr
           menge
           meins
           netpr
           from ekpo
           into table i_ekpo
           where ebeln in s_ebeln.
    control_record-mestyp = messagetyp.
    control_record-rcvprt = 'LS'.
    control_record-idoctp = idoc_name.
    control_record-rcvprn = '0MART800'.
    loop at i_ekko.
    header_segment_data-ebeln = i_ekko-ebeln.
    header_segment_data-aedat = i_ekko-aedat.
    header_segment_data-bukrs = i_ekko-bukrs.
    header_segment_data-bsart = i_ekko-bsart.
    header_segment_data-lifnr = i_ekko-lifnr.
    i_data-segnam = header_segment_name.
    i_data-sdata = header_segment_data.
    append i_data.
    select ebelp
           matnr
           menge
           meins
           netpr
           from ekpo
           into table i_ekpo
           where ebeln = i_ekko-ebeln.
    loop at i_ekpo.
    item_segment_data-ebelp = i_ekpo-ebelp.
    item_segment_data-matnr = i_ekpo-matnr.
    item_segment_data-menge = i_ekpo-menge.
    item_segment_data-meins = i_ekpo-meins.
    item_segment_data-netpr = i_ekpo-netpr.
    i_data-segnam = item_segment_name.
    i_data-sdata = item_segment_data.
    append i_data.
    endloop.
    clear i_ekpo.
    refresh i_ekpo.
    endloop.
    call function 'MASTER_IDOC_DISTRIBUTE'
      exporting
        master_idoc_control                  = control_record
      OBJ_TYPE                             = ''
      CHNUM                                = ''
      tables
        communication_idoc_control           = i_communication
        master_idoc_data                     = i_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.
    message id sy-msgid type sy-msgty number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
      loop at i_communication.
        write: 'IDOC GENERATED', i_communication-docnum.
      endloop.
      commit work.
    endif.
    initialization.
    titl = 'ENTER THE PURCHASE ORDER NUMBER'.

  • Error while creating IDOC from payment run

    Dear All,
    I 've alredy done all EDI settings for creating IDOC from payment run. But system in not generating IDOC as end with a result as "House bank is not designated as a EDI Partner'.
    Please suggest how to define house bank as a EDI partner.
    Regards,
    Subhash

    From We20 u have to create the partner profile for the bank u r using in ur transaction. In we20 select the partner type B (Bank) and as Partner no give ur bank numbrer.
    Regards,
    Joy.

  • I need help to create  idoc from scrach.

    i need help to create  idoc from scrach.

    Swamy Katta,
    Please read "[the rules|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]" before you post any further, and confirm that you have read them?
    => Search first, ask questions later please!
    Julius

  • How to create IDOC for customer defined table

    hi,
    How to create IDOC for customer defined table Records and how to send this IDOC to target system.
      what message type will be used and on receiving system how to post these records.
      thankx.
      pillac.

    Hi,
    You need to create a custom message type and custom IDOC type for this with whatever fields you want send. You need to create segments (WE30), IDOC type (WE30), Message types (WE81) and assign the message type to the IDOC type (WE82).
    You will have trigger the IDOC using a Report or something after doing the partner profile settings.
    Similary in the target system also, you will have do all the settings.
    Take a look the links to find out what settings needs to be done.
    http://help.sap.com//saphelp_470/helpdata/EN/0b/2a611c507d11d18ee90000e8366fc2/frameset.htm
    http://www.sappro.com/downloads/OneClientDistribution.pdf
    Regards,
    Ravi
    Note : Please mark the helpful answers and close the thread if the issue is resolved.

  • Create Idoc from transaction

    Hi,
    I want to create a Idoc from a transaction.
    For example, if i will execute transaction "MM02" to change the material detail then i want to create a idoc for that changed material,
    Does anyone have idea regarding this?
    {{Actually remaining configuration i have done to sent a idoc from one system to other system but right now i am generating idoc manually using transaction "BD10" in which i am selecting the material manually.
    Now i want the whole procedure to be done automatically so that whenever a change in material will be done, a idoc will be generated.}}

    Actually i have already set "Trigger idoc immediately" in WE20. I am using Transactional RFC instead of file in we21.
    Configuration for WE21 is for port defination i am using transactional RFC which is defined in SM59.
    In WE20 i am creating Logical system in which i am using message type MATMAS in outbound for which i am using transactional RFC in receiver port.Output mode i am choosing "TransferIdoc immediately". and Idoc type is "MATMAS02".
    In BD50 i am assigning change pointer to "MATMAS".
    Also i have created distribution model but i am not able to distribute which i have already told u.
    At the receiver side i am creating another logical system in WE20 in which i am defining message type "MATMAS" as inbound parameter.Process Code is "MATM". and i am choosing "Trigger immediately" in processing option.
    So this is the configuration i have done and i m able to send idoc successfully but still i cant make it automatically. I have to use transaction bd21 to create idoc from change pointer. This is the only problem i am getting.
    So anything else is required to be done????????

  • MDS_LOAD_COCKPIT Error: Create BP from Customer

    I am creating BP from customer using cockpit transaction. While running PPO, I am getting the below two error for single customer.
    No transfer of interval for object BU_PARTNER
    Message no. NR028
    Diagnosis
    The last number of the internal interval should be assigned.
    Number assignment usually begins in the following call at the start of the interval. However this function is blocked for some number range objects for technical system reasons.
    Procedure
    If possible extend the interval of the affected number range object. If this is not possible you must reorganize the relevant data and reset the interval status manually.
    Business partner ##1 does not exist
    Message no. R1201
    Please suggest.
    Thanks,
    Arpit Kothari

    check the number ranges of the customer account group, and the BP role to ensure they are aligned.

  • Create  BP from customer

    HI Gurus ,
    I am using Real Estate module. In that we are creating  business partner from cusomer  code  using FLBPD1 transaction code .
    However system doesn't respond anything  after running the transactions .
    Can any suggest me how to create BP from customer code .
    Suitable points will be awarded on answer .
    Thanks & rgds
    Anchal Pawae

    Hi,
    Try implementing the note 973178.
    Thanks and warm regards,
    Smita.

  • Create Idoc from program

    Hello Friends.
    I want to create a inbound IDOc from program which has delivery items for IDOC type DESADV01.
    How can I create an IDOC from program?
    Regards,
    RH

    Hi ronny
    look this..http://help.sap.com/saphelp_nw04/helpdata/en/78/21785851ce11d189570000e829fbbd/frameset.htm
    hope this help you
    Marco

  • Create IDOCs from DMEE Files

    Hi SDN,
    Can I create Custom IDOCs from the DMEE file format.
    The file is getting downloaded after the DMEE Run in a specific format individual to every company code.
    I want to generate IDOCs for every DMEE Run.
    Thanks,
    Manu

    Take a look at this :
    http://www.sappoint.com/ppt/idoc.ppt
    you need to create File port in Tr.WE21 , as file port
    Then you have to sechdule the program RSEout00 to collect Idocs .
    You can test it in Tr.WE19 , you can also use the Tr.BD87 to see your Idoc status
    Hope this’ll give you idea!!
    <b>P.S award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • Transfer GOS Attachment (Single/Multiple) from custom program to XK01

    Hi,
    GOS - Generic Object Service is a way one can attach single / multiple attachment. I have a custom program where there is a GOS with some attachment (used CL_GOS_MANAGER class).
    Next I need to send / transfer this GOS attachment from my custom program to say a standard transaction , eg XK01.
    Whether we can achieve this functionality, ie. we are able to create/save attachment but is there a way to send attachment (not via email) such that the same attach itself to the GOS of the standard transaction. I don't see any method in the CL_GOS_MANAGER class by which we can achieve this!
    Any suggestion/solution will be highly appreciated!
    Thanks,
    Deb

    Hi,
    I am trying to send attachment linked to a custom BO to standard BO eg, LFA1 using 'GOS_SERV_TOOLS_TEST' (copy_linked_objects).
    Surprisingly, I am able to copy/send attachment list within same BO (LFA1) from one LIFNR to another LIFNR. But the same method does not work when I try to copy attachment between diff BO example from VENDOR BO to MATERIAL BO. Why is it so?
    Also it does not work between a custom BO & standard BO. Please suggest in case I am missing on anything!
    Thank,
    Deb

  • Creating IDoc from DMEE File Format

    Hi SDN,
    Can I create Custom IDOCs from the DMEE file format.
    The file is getting downloaded after the DMEE Run in a specific format individual to every company code.
    I want to generate IDOCs for every DMEE Run.
    Thanks,
    Manu

    Hi,
    your problem is just like filling the segements using the data in other segements. that means if you have knowledge of enhancing the idoc and populating the enhanced segments then in the same way you can populate the BATCH segment also.
    you just go to the function module which will be creating the idoc(if its outbound) / function module which will be posting the idoc which is for inblund and then find the perform where it fills the segments ( it will be the one which you will use to fill the segment BATCH )and go that and at last of form you will find one customer function which you can use to fill the BATCH segment.
    i think this will help u,
    Regards,
    Ravi

  • Create IDoc from flat file - How to do the message mapping

    Hi everybody,
    I want to create an IDoc from a flat file.
    The file structure looks like this:
    MT_XYZ
    - Node001       0...1
      - Leaf001
    - Node002       0...unbounded
       - Node003    0...1
          - Leaf002
          - Leaf003
       - Node004    0...1
          - Leaf004
       - Node005    0...1
          - Leaf005
    I have created a mapping and all the other stuff to set up the IDoc adapter.
    Now when I try to test the interface the IDoc is created properly but obviously no information from the nodes "Node003" to "Node005" is inserted in the IDoc. Only the information kept in the elements (leafs) of "Node001" are inserted.
    All IDoc segments and their "Segment" elements are linked to the root node of the file structure "MT_XYZ". I tried to link some IDoc segments only to "Node002" but then this segment is not created.
    So how can I set up the message mapping in a way that the information from "Node003" to "Node005" is transported to the IDoc? Can anyone help me here?
    Thanks in advance for all answers!
    Regards,
    Torben
    Edited by: Torben Hönemann on Dec 14, 2009 4:26 AM

    Hi Torben,
    >>I want to create an IDoc from a flat file.
    So you are using File content Conversion on the sender side. Right?
    >>no information from the nodes "Node003" to "Node005" is inserted in the IDoc.
    Are these information available in the source XML (you can check in transaction SXMB_MONI-> Input Payload).. There is a limitation in File Content Conversion of File adapter and it is that I can make an XML structure of 3 level.. Since these nodes details are in level 4 and 5 they should be missing in Source XML structure itself (after content conversion of File adapter). check that
    >>So how can I set up the message mapping in a way that the information from "Node003" to "Node005" is transported to the IDoc? Can anyone help me here?
    So you need to take an alternate approach where you do File Content Conversion and make 3 level structure.. then using a mapping convert this three level structure to your 5 level one and then try to map with the idoc.
    Check this blog for an idea
    http://www.riyaz.net/blog/xipi-file-content-conversion-for-complex-structures/
    http://www.riyaz.net/blog/xipi-convert-flat-file-to-deeply-nested-xml-structures-using-only-graphical-mapping/
    Regards
    Suraj

Maybe you are looking for

  • How do I move notes within the Notes App to a different account?

    My iPhone4 has iOS 4.2.1, and I didn't realize until today that that came along with an updated Notes app that allows syncing with email accounts. Somehow I managed to unknowingly move about half of my notes to one of my email accounts, which deleted

  • Blue & White G3 upgrade to G4?

    Hello - I have an old G3 Blue/white which I would like to use to run a slideshow in my gallery. How do I upgrade this machine to achieve this? I don't need to use the machine for anything beyond running a slideshow through an LCD projector. Thanks.

  • Condition types in tax calculation procedures

    hi sap Gurus, Tax calculation procedures cointains the order of steps, tax types{condition types}, and account keys.I am not able to understand what condition types are and its importance in the tax calculation procedures. Please help me SAP Gurus C.

  • EscalatedPrivilegeFileOperationDaemon.exe - what is it?

    When launching Adobe Extension Manager (CS5.5) on a Win7 x32 device using an account that has standard user privileges I receive a UAC prompt in order to run the file EscalatedPrivilegeFileOperationDaemon.exe. I am within a corporate estate and users

  • HTTP Server Error - 403 Forbidden

    Hi all i was checking the performance of my application server, in HTTP Server (AS instance, not infrastructure instance) HTTP Server error rate is high, drilling down if found that i have an unusual number of 403 - Forbidden errors. In the access.lo