Idoc. Inbound  Data

Hi.. All
  .................Problem Related  Idoc....................................
  Idoc. got created. and can see it in we02. and its status is  01.
message is : IDoc was sent to an R/3 System .
My problem is  how can i see  output data in  R/3 system.
Regards
  lakhan

Hi
  I  go thru the steps
Create Segment ( WE31)
Create Idoc Type ( WE30 )
Create Message Type ( WE81 )
Assign Idoc Type to Message Type ( WE82 )
set Partner  profile BD64 and we20.
The recieving system is SAPLER.
Than thru ABAP Program , got the Idoc number.
in WE02 , idoc message is . it is : Data passed to port OK
Now where can i see this data..
If you gor time than can we talk on this issue ..plz.
My ID is: [email protected]
Regards
lakhan

Similar Messages

  • IDoc Inbound Business Connector

    Hello
    I am trying to send an inbound IDoc to SAP via Business Connector. This is shortly to be replaced by XI.
    The flow in Business Connector creates a routing rule which is blank because it is not finding the control information from the IDoc I believe.
    I think I am missing a step in my flow.
    Currently the flow is
    document to record
    Transform hierarchy to Flat.
    Map ( mapping the fields into the IDoc)
    Record to Idoc
    Inbound process
    The inbound process always fails because it doesnt recognise the message type, sender etc.
    This is all the idoc and in record to Idoc this is an input with an output of Idoc list which is passed to the inbound process.
    However Idoclist I believe doesn't seem to contain any data.
    I think a step is missing can anyone help??
    Thanks

    Hi,
    Please see this.
    Hi,
    BC adapter can be used when you want to communicate to a existing interface on Business Connector. If you are talking to SAP, you use RFC / IDOC adapters.
    The SAP Business Connector (BC) is used in a large number of SAP production environments. SAP Business Connector will probably be gradually phased out and replaced by SAP XI technology. For the short term SAP Business connector and SAP XI will inevitably continue to coexist in companies IT landscapes.
    See Below links
    Integrating your SAP Business Connector with SAP XI
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/96ed2129-0b01-0010-2e91-c45e1fad0d03
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4f27ad80-0c01-0010-f8b8-c5e153a16ca1
    Before XI
    Before XI
    webMethods Integration Server Vs.  SAP Business Connector 4.7 (BC)
    Choose the Right Adapter to integrate with SAP systems
    /people/ravikumar.allampallam/blog/2005/08/14/choose-the-right-adapter-to-integrate-with-sap-systems
    Thanks
    akshay

  • *IDOC INBOUND ( NON SAP system - SAP system )*

    I am transferring IDOC  INBOUND ( NON SAP system ->> SAP system ) by calling SAP standard funtc module IDOC_INBOUND_SINGLE using SAP JCo.
    In which I am passing all necessary information in Control Record regarding sender and receiver port/IDOC/segment etc.
    BUT help me to clarify my doubt that if i am calling a function and i am able to access SAP FM, then why i have to specify the SAP port/RFC connection at RECEIVER end in WE21.
    Whats the Significance if i am calling the FM from same SAP system and configuring the port explicitly in WE21.*
    If i don't Specify in we02 i am getting error as EDI : RECEIVER PORT in CONTROL RECORD is INVALID

    Dear Sree,
    For Basic understanding of IDOC read : saptechnical - Step-by Step ALE IDOC guide ( all necessary TCodes available here )
    Kindly let me know your data flow .
    In short :
    As per my scenario the data flow is from  non SAP to SAP  i,.e. Inbound processing.
    At my non SAP  i am calling SAP standard function IDOC_INBOUND_SINGLE using SAP Jco 2.1.
    You have to fill all Control Structure EDI_DC40 ( port etc. ) and Table parameter EDI_DD40 ( segment etc. )
    Read IDOC status and error in WE02.
    Goodluck.
    - Aakash

  • Idoc inbound interface

    Hi experts,
    I am working on inbound interface for MATMAS04. I am using BAPI_MASTER_SAVEDATA to create material.
    Now Can anyone suggest me any inbound function module that returns IDOC number. I am getting data in form of File. EDI_DATA_INCOMING doesnot return idoc number.
    Thanks and regards
    Neha Kapoor

    hi neha,
    Creating a Function Module (Direct Inbound Processing)
    This describes how to create a function module which is identified by the IDoc Interface using a new process code and called from ALE (field TBD52-FUNCNAME). Direct inbound processing using a function module (not using a workflow) always includes the ALE layer. This setting (processing with function module and ALE layer) is identified by the value 6 in the field TEDE2-EDIVRS, which is read by the function module IDOC_START_INBOUND. IDOC_START_INBOUND then calls ALE.
    Example
    FUNCTION IDOC_INPUT_TESTER.
    ""Globale Schnittstelle:
    *" IMPORTING
    *" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD
    *" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC
    *" EXPORTING
    *" VALUE(WORKFLOW_RESULT) LIKE BDWFAP_PAR-RESULT
    *" VALUE(APPLICATION_VARIABLE) LIKE BDWFAP_PAR-APPL_VAR
    *" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK
    *" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS
    *" TABLES
    *" IDOC_CONTRL STRUCTURE EDIDC OPTIONAL
    *" IDOC_DATA STRUCTURE EDIDD
    *" IDOC_STATUS STRUCTURE BDIDOCSTAT
    *" RETURN_VARIABLES STRUCTURE BDWFRETVAR
    *" SERIALIZATION_INFO STRUCTURE BDI_SER
    initialize SET/GET Parameter and internal tables
    PERFORM INITIALIZE_ORGANIZATIONAL_DATA.
    Move IDOC to internal tables of application
    PERFORM READ_IDOC_TESTER.
    call transaction Order Entry VA01
    PERFORM CALL_VA01_IDOC_ORDERS USING ERRORCODE.
    set status value
    perform write_status_record using errorcode.
    return values of function module
    PERFORM RETURN_VARIABLES_FILL USING ERRORCODE.
    ENDFUNCTION.
    FORM INITIALIZE_ORGANIZATIONAL_DATA.
    initialize SET/GET parameters
    SET PARAMETER ID 'VKO' FIELD SPACE.
    SET PARAMETER ID 'VTW' FIELD SPACE.
    SET PARAMETER ID 'SPA' FIELD SPACE.
    SET PARAMETER ID 'VKB' FIELD SPACE.
    SET PARAMETER ID 'VKG' FIELD SPACE.
    initialize internal tables
    REFRESH BDCDATA.
    CLEAR BDCDATA.
    CLEAR BELEGNUMMER.
    CLEAR ERRTAB.
    REFRESH ERRTAB.
    REFRESH XBDCMSGCOLL.
    CLEAR XBDCMSGCOLL.
    ENDFORM. " INITIALIZE_ORGANIZATIONAL_DATA
    FORM READ_IDOC_TESTER.
    PERFORM INITIALIZE_IDOC.
    LOOP AT IDOC_DATA
    WHERE DOCNUM = IDOC_CONTRL-DOCNUM.
    CASE IDOC_DATA-SEGNAM.
    header data
    WHEN 'E1HEAD'.
    MOVE IDOC_DATA-SDATA TO E1HEAD.
    PERFORM PROCESS_SEGMENT_E1HEAD.
    position data
    WHEN 'E1ITEM'.
    MOVE IDOC_DATA-SDATA TO E1ITEM.
    PERFORM PROCESS_SEGMENT_E1ITEM.
    ENDCASE.
    ENDLOOP.
    only when there were one or more items
    CHECK FIRST NE 'X'.
    APPEND XVBAP. "last one
    ENDFORM. " READ_IDOC_TESTER
    FORM INITIALIZE_IDOC.
    CLEAR XVBAK.
    REFRESH XVBAP.
    CLEAR XVBAP.
    POSNR = 0.
    FIRST = 'X'.
    ENDFORM. " INITIALIZE_IDOC
    FORM PROCESS_SEGMENT_E1HEAD.
    requested date of delivery
    WLDAT = E1HEAD-WLDAT.
    delivery date
    XVBAK-BSTDK = E1HEAD-BSTDK.
    customer number
    XVBAK-KUNNR = E1HEAD-AUGEB.
    order number
    XVBAK-BSTNK = E1HEAD-BELNR.
    division
    XVBAK-SPART = E1HEAD-SPART.
    distribution channel
    XVBAK-VTWEG = E1HEAD-VTWEG.
    sales organization
    XVBAK-VKORG = E1HEAD-VKORG.
    order type
    XVBAK-AUART = E1HEAD-AUART.
    do not fill incoterms (inco1, inco2)
    customer function
    CALL CUSTOMER-FUNCTION '001'
    EXPORTING
    PI_VBAK621 = XVBAK
    IMPORTING
    PE_VBAK621 = XVBAK
    TABLES
    PT_IDOC_DATA_RECORDS = IDOC_DATA.
    ENDFORM. " PROCESS_SEGMENT_E1HEAD
    FORM PROCESS_SEGMENT_E1ITEM.
    position number
    XVBAP-POSNR = XVBAP-POSNR + 1.
    amount
    XVBAP-WMENG = E1ITEM-MENGE.
    unit
    CALL FUNCTION 'ISO_TO_SAP_MEASURE_UNIT_CODE'
    EXPORTING
    ISO_CODE = E1ITEM-BMEINH
    IMPORTING
    SAP_CODE = XVBAP-VRKME
    EXCEPTIONS
    OTHERS = 0.
    material number
    XVBAP-MATNR = E1ITEM-LMATNR.
    CALL CUSTOMER-FUNCTION '002'
    EXPORTING
    PI_VBAP621 = XVBAP
    IMPORTING
    PE_VBAP621 = XVBAP
    TABLES
    PT_IDOC_DATA_RECORDS = IDOC_DATA.
    APPEND XVBAP.
    ENDFORM. " PROCESS_SEGMENT_E1ITEM
    FORM CALL_VA01_IDOC_ORDERS USING ERRORCODE.
    call transaction first dynpro
    PERFORM DYNPRO_START.
    call transaction double-line entry
    PERFORM DYNPRO_DETAIL2.
    incoterms
    PERFORM DYNPRO_HEAD_300.
    call transaction item datas
    PERFORM DYNPRO_POSITION.
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'SICH'.
    determine input method
    IF INPUT_METHOD IS INITIAL.
    INPUT_METHOD = 'N'.
    ENDIF.
    call transaction VA01
    CALL TRANSACTION 'VA01' USING BDCDATA
    MODE INPUT_METHOD
    UPDATE 'S'
    MESSAGES INTO XBDCMSGCOLL.
    errorcode = SY-SUBRC. " remember returncode for status update
    ENDFORM. " CALL_VA01_IDOC_ORDERS
    form write_status_record using errorcode.
    FILL IDOC_STATUS
    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
    IF ERRORCODE = 0.
    IDOC_STATUS-STATUS = BELEG_GEBUCHT. "value 53
    GET PARAMETER ID 'AUN' FIELD BELEGNUMMER.
    IDOC_STATUS-MSGID = 'V1'.
    IDOC_STATUS-MSGNO = '311'.
    IDOC_STATUS-MSGV1 = 'Terminauftrag'.
    IDOC_STATUS-MSGV2 = BELEGNUMMER.
    ELSE.
    IDOC_STATUS-STATUS = BELEG_NICHT_GEBUCHT. "value 51
    IDOC_STATUS-MSGID = SY-MSwGID.
    IDOC_STATUS-MSGNO = SY-MSGNO.
    IDOC_STATUS-MSGV1 = SY-MSGV1.
    IDOC_STATUS-MSGV2 = SY-MSGV2.
    IDOC_STATUS-MSGV3 = SY-MSGV3.
    IDOC_STATUS-MSGV4 = SY-MSGV4.
    ENDIF.
    APPEND IDOC_STATUS.
    ENDFORM.
    FORM DYNPRO_START.
    PERFORM DYNPRO_NEW USING PROGRAMM_AUFTRAG
    DYNPRO-EINSTIEG
    CHANGING LAST_DYNPRO.
    ordertype
    PERFORM DYNPRO_SET USING 'VBAK-AUART' XVBAK-AUART.
    sales organization
    PERFORM DYNPRO_SET USING 'VBAK-VKORG' XVBAK-VKORG.
    Distribution channel
    PERFORM DYNPRO_SET USING 'VBAK-VTWEG' XVBAK-VTWEG.
    Division
    PERFORM DYNPRO_SET USING 'VBAK-SPART' XVBAK-SPART.
    Sales office
    PERFORM DYNPRO_SET USING 'VBAK-VKBUR' XVBAK-VKBUR.
    Sales group
    PERFORM DYNPRO_SET USING 'VBAK-VKGRP' XVBAK-VKGRP.
    ENDFORM. " DYNPRO_START
    FORM DYNPRO_NEW USING PROGNAME
    DYNPRONR
    CHANGING LAST_DYNPRO.
    CLEAR BDCDATA.
    BDCDATA-PROGRAM = PROGNAME.
    BDCDATA-DYNPRO = DYNPRONR.
    BDCDATA-DYNBEGIN = 'X'.
    APPEND BDCDATA.
    LAST_DYNPRO = DYNPRONR.
    ENDFORM. " DYNPRO_NEW
    FORM DYNPRO_SET USING FELDNAME
    FELDINHALT.
    CLEAR BDCDATA.
    CHECK FELDINHALT NE SPACE.
    dynpro field name
    BDCDATA-FNAM = FELDNAME.
    contents
    BDCDATA-FVAL = FELDINHALT.
    APPEND BDCDATA.
    ENDFORM. " DYNPRO_SET
    FORM DYNPRO_DETAIL2.
    okcode
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' PANEL-UER2.
    fix dynpro number 4001
    PERFORM DYNPRO_NEW USING PROGRAMM_AUFTRAG
    '4001'
    CHANGING LAST_DYNPRO.
    order party
    PERFORM DYNPRO_SET USING 'KUAGV-KUNNR' XVBAK-KUNNR.
    purchase order number
    PERFORM DYNPRO_SET USING 'VBKD-BSTKD' XVBAK-BSTNK.
    requested delivery date
    PERFORM DYNPRO_DATE_SET USING 'VBKD-BSTDK' XVBAK-BSTDK.
    purchase order date
    PERFORM DYNPRO_DATE_SET USING 'RV45A-KETDAT' WLDAT.
    ENDFORM. " DYNPRO_DETAIL2
    FORM DYNPRO_DATE_SET USING FELDNAME
    FELDINHALT.
    DATA: DATE TYPE D.
    CLEAR BDCDATA.
    CHECK FELDINHALT NE SPACE.
    BDCDATA-FNAM = FELDNAME.
    WRITE FELDINHALT TO DATE.
    BDCDATA-FVAL = DATE.
    APPEND BDCDATA.
    ENDFORM. " DYNPRO_DATE_SET
    FORM DYNPRO_HEAD_300.
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' PANEL-KKAU.
    incoterms part 1
    IF NOT XVBAK-INCO1 IS INITIAL.
    PERFORM DYNPRO_SET USING 'VBKD-INCO1' XVBAK-INCO1.
    ENDIF.
    incoterms part 2
    IF NOT XVBAK-INCO2 IS INITIAL.
    PERFORM DYNPRO_SET USING 'VBKD-INCO2' XVBAK-INCO2.
    ENDIF.
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'BACK'.
    ENDFORM. " DYNPRO_HEAD_300
    FORM DYNPRO_POSITION.
    LOOP AT XVBAP.
    dynpro item double line entry
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'UER2'.
    IF XVBAP-POSNR = 1.
    material number
    PERFORM DYNPRO_SET USING 'VBAP-MATNR(01)' XVBAP-MATNR.
    order quantity
    PERFORM DYNPRO_SET USING 'RV45A-KWMENG(01)' XVBAP-WMENG.
    desired delivery date
    PERFORM DYNPRO_DATE_SET USING 'RV45A-ETDAT(1)' WLDAT.
    sales unit
    PERFORM DYNPRO_SET USING 'VBAP-VRKME(1)' XVBAP-VRKME.
    ELSE.
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'POAN'.
    material number
    PERFORM DYNPRO_SET USING 'VBAP-MATNR(02)' XVBAP-MATNR.
    order quantity
    PERFORM DYNPRO_SET USING 'RV45A-KWMENG(02)' XVBAP-WMENG.
    desired delivery date
    PERFORM DYNPRO_DATE_SET USING 'RV45A-ETDAT(02)' WLDAT.
    sales unit
    PERFORM DYNPRO_SET USING 'VBAP-VRKME(02)' XVBAP-VRKME.
    ENDIF.
    ENDLOOP.
    ENDFORM. " DYNPRO_POSITION
    FORM RETURN_VARIABLES_FILL USING ERRORCODE.
    allocate IDOC numbers to Workflow output parameters
    IF MASS_PROCESSING <> SPACE.
    IF ERRORCODE = 0.
    RETURN_VARIABLES-WF_PARAM = PID.
    RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
    APPEND RETURN_VARIABLES.
    RETURN_VARIABLES-WF_PARAM = APO.
    RETURN_VARIABLES-DOC_NUMBER = BELEGNUMMER.
    APPEND RETURN_VARIABLES.
    WORKFLOW_RESULT = C_WF_RESULT_OK.
    ELSE.
    RETURN_VARIABLES-WF_PARAM = EID.
    RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
    APPEND RETURN_VARIABLES.
    WORKFLOW_RESULT = C_WF_RESULT_ERROR.
    ENDIF.
    ELSE.
    IF ERRORCODE = 0.
    RETURN_VARIABLES-WF_PARAM = APE.
    RETURN_VARIABLES-DOC_NUMBER = BELEGNUMMER.
    APPEND RETURN_VARIABLES.
    WORKFLOW_RESULT = C_WF_RESULT_OK.
    ELSE.
    WORKFLOW_RESULT = C_WF_RESULT_ERROR.
    ENDIF.
    ENDIF.
    ENDFORM. " RETURN_VARIABLES_FILL
    Globale Daten von IDOC_INPUT_TESTER
    TABLES: E1HEAD, E1ITEM.
    DATA: BEGIN OF BDCDATA OCCURS 500.
    INCLUDE STRUCTURE BDCDATA.
    DATA: END OF BDCDATA.
    DATA: BEGIN OF XVBAK. "Kopfdaten
    INCLUDE STRUCTURE VBAK621.
    DATA: END OF XVBAK.
    DATA: BEGIN OF XVBAP OCCURS 50. "Position
    INCLUDE STRUCTURE VBAP.
    DATA: WMENG(18) TYPE C.
    DATA: LFDAT LIKE VBAP-ABDAT.
    DATA: KSCHL LIKE KOMV-KSCHL.
    DATA: KBTRG(16) TYPE C.
    DATA: KSCHL_NETWR LIKE KOMV-KSCHL.
    DATA: KBTRG_NETWR(16) TYPE C.
    DATA: INCO1 LIKE VBKD-INCO1.
    DATA: INCO2 LIKE VBKD-INCO2.
    DATA: YANTLF(1) TYPE C.
    DATA: PRSDT LIKE VBKD-PRSDT.
    DATA: HPRSFD LIKE TVAP-PRSFD.
    DATA: END OF XVBAP.
    DATA: BEGIN OF DYNPRO,
    EINSTIEG LIKE T185V-DYNNR VALUE 101,
    KKAU LIKE T185V-DYNNR,
    UER2 LIKE T185V-DYNNR,
    KBES LIKE T185V-DYNNR,
    ERF1 LIKE T185V-DYNNR,
    PBES LIKE T185V-DYNNR,
    PKAU LIKE T185V-DYNNR,
    PEIN LIKE T185V-DYNNR,
    EID1 LIKE T185V-DYNNR,
    POPO LIKE T185V-DYNNR,
    EIPO LIKE T185V-DYNNR,
    KPAR LIKE T185V-DYNNR,
    PSDE LIKE T185V-DYNNR,
    PPAR LIKE T185V-DYNNR,
    KDE1 LIKE T185V-DYNNR,
    KDE2 LIKE T185V-DYNNR,
    PDE1 LIKE T185V-DYNNR,
    PDE2 LIKE T185V-DYNNR,
    PKON LIKE T185V-DYNNR,
    END OF DYNPRO.
    DATA: BEGIN OF PANEL,
    KKAU LIKE T185V-PANEL VALUE 'KKAU',
    UER2 LIKE T185V-PANEL VALUE 'UER2',
    KBES LIKE T185V-PANEL VALUE 'KBES',
    ERF1 LIKE T185V-PANEL VALUE 'ERF1',
    PBES LIKE T185V-PANEL VALUE 'PBES',
    PKAU LIKE T185V-PANEL VALUE 'PKAU',
    PEIN LIKE T185V-PANEL VALUE 'PEIN',
    EID1 LIKE T185V-PANEL VALUE 'EID1',
    EIAN LIKE T185V-PANEL VALUE 'EIAN',
    POPO LIKE T185V-PANEL VALUE 'POPO',
    EIPO LIKE T185V-PANEL VALUE 'EIPO',
    KPAR LIKE T185V-PANEL VALUE 'KPAR',
    PSDE LIKE T185V-PANEL VALUE 'PSDE',
    POAN LIKE T185V-PANEL VALUE 'POAN',
    PPAR LIKE T185V-PANEL VALUE 'PPAR',
    KDE1 LIKE T185V-PANEL VALUE 'KDE1',
    KDE2 LIKE T185V-PANEL VALUE 'KDE2',
    PDE1 LIKE T185V-PANEL VALUE 'PDE1',
    PDE2 LIKE T185V-PANEL VALUE 'PDE2',
    PKON LIKE T185V-PANEL VALUE 'PKON',
    KOAN LIKE T185V-PANEL VALUE 'KOAN',
    END OF PANEL.
    DATA: BEGIN OF ERRTAB OCCURS 20,
    TRANS LIKE TSTC-TCODE,
    ARBGB LIKE T100-ARBGB,
    CLASS(1) TYPE C,
    MSGNR LIKE T100-MSGNR,
    TEXT LIKE T100-TEXT,
    TEXT(123) TYPE C,
    MSGV1 LIKE SY-MSGV1,
    MSGV2 LIKE SY-MSGV2,
    MSGV3 LIKE SY-MSGV3,
    MSGV4 LIKE SY-MSGV4,
    END OF ERRTAB.
    *---- Hilfsfelder -
    DATA: PROGRAMM_AUFTRAG LIKE T185V-AGIDV VALUE 'SAPMV45A'.
    DATA: LAST_DYNPRO LIKE T185V-DYNNR,
    WLDAT LIKE VBAK-BSTDK,
    POSNR LIKE VBAP-POSNR,
    FIRST(1) TYPE C VALUE 'X'.
    DATA: BEGIN OF XBDCMSGCOLL OCCURS 10.
    INCLUDE STRUCTURE BDCMSGCOLL.
    DATA: END OF XBDCMSGCOLL.
    Terminauftrag ( Auftragsart wird fest gesetzt !)
    DATA: BELEGNUMMER LIKE VBAK-VBELN.
    DATA: ERRORCODE LIKE SY-SUBRC.
    Statuswerte fuer IDOC-Status
    DATA: BELEG_NICHT_GEBUCHT LIKE TEDS1-STATUS VALUE '51'.
    DATA: BELEG_GEBUCHT LIKE TEDS1-STATUS VALUE '53'.
    *- Direktwerte für Return_variables -
    data:
    eid like bdwfretvar-wf_param value 'Error_IDOCs',
    pid like bdwfretvar-wf_param value 'Processed_IDOCs',
    apo like bdwfretvar-wf_param value 'Appl_Objects',
    ape like bdwfretvar-wf_param value 'Appl_Object'.
    *- Direktwerte für Workflow_Result -
    DATA: C_WF_RESULT_ERROR LIKE BDWFAP_PAR-RESULT VALUE '99999'.
    DATA: C_WF_RESULT_OK LIKE BDWFAP_PAR-RESULT VALUE '0'.
    http://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7df143d711d1893e0000e8323c4f/frameset.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7df143d711d1893e0000e8323c4f/frameset.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7df143d711d1893e0000e8323c4f/frameset.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7df143d711d1893e0000e8323c4f
    Plz Reward points if helpfull   ...
    Regards,
    Mandeep.

  • Need help for IDOC inbound function module !

    Hi guys please help me to create a IDOC inbound function module.
    What are the parameters and tables.
    How to write the code.
    What it does.
    Please send me one inbound func module code if possuble
                                                                                  Thanks

    Hi,
    You need to create an inbound function module. Then define the process code in transaction we42 and attach the function module to this process code.
    In the function module you create you need to define tables of types EDIDC (Control record (IDoc)), EDIDD (Data record (IDoc)) and BDIDOCSTAT (ALE IDoc status (subset of all IDoc status fields)).
    Regards,
    Soumya.

  • IDOC Inbound and Outbound

    Please let me know How to handle IDOC inbound and Outbound preferably with example. I am new to it.

    hi,
    your question is very broad,
    start reading continue from there...
    <a href="http://help.sap.com/saphelp_46c/helpdata/en/19/3cf334c20ccc52e10000009b38f83b/frameset.htm">Doc Interface: EDI Application Scenarios (BC-SRV-EDI)</a>
    <a href="http://help.sap.com/saphelp_46c/helpdata/en/dc/6b8a4943d711d1893e0000e8323c4f/frameset.htm">IDoc Interface / Electronic Data Interchange (BC-SRV-EDI)</a>
    An example:
    inter company invoiceing:
    the SD invoice has an output type (INVOICE01) that sends an Idoc that creates the mm invoice (invoice verification)
    for more data see the links above
    good luck

  • LSMW idoc Inbound Processing settings

    Hi,
    We have done LSMW with BAPI method to create Bank master.
    In Idoc Inbound Processing settings -
    We created partner type as 'B' i.e, for BANK
    While creating Partner Number it is not allowing to create Partner Number. The error is  "Enter a permissible partner number"
    Please let me know what would be the problem.
    Regards,
    Hari
    Edited by: Bhatlapenumarthy Hari Krishna on Sep 12, 2008 9:31 AM

    Hi,
    Use patner type as US only and LSMW as Patner number.
    this will surely solve your problem .
    plz do this way :
    The first requirement is a file port for the file transfer. If required, create a port of the file type via Maintain ports. To do this, position the cursor on "File" and press Create. You should be in change mode. SAP recommends:
    Port: LSMW
    Name: Legacy System Migration Workbench
    Version: 3 (IDoc record types SAP Release 4.x)
    Outbound file Please enter a (dummy) physical directory and a file name, i.e. u2018filelsmwu2019 ·
    As an addition, you can specify a tRFC port. This port is required, if you do not want to create a file during data conversion but submit the data in packages directly to function module IDoc_Inbound_Asynchronous.
    SAP recommends:
    Port: assigned by the system
    Version: 3 (IDoc record types SAP Release 4.x)
    RFC destination: Name of R/3 System
    Name of port: Legacy System Migration Workbench.
    Then the partner type should be defined or selected. SAP recommends:
    Partner type: "US" (User)
    As of release 4.5A, this partner type is available in the standard system. Up to release 4.0B inclusive, this partner type is not available in the standard program and should be added. SAP recommends:
    Partner type: Create US
    Report name: /SAPDMC/SAP_LSMW_PARTNERTYPES
    Form routine: READ_USER
    Short description: any.
    Finally a partner number should be defined or selected. SAP recommends:
    Partner number: LSMW
    Partner type: US
    Partner status: A (active)
    Type: US
    Language: DE or EN
    Person in charge: Your user ID.
    Activate IDoc inbound processing
    reference : help.sap
    thanx.
    Edited by: Dhanashri Pawar on Sep 12, 2008 7:10 AM

  • ALE IDOC Inbound processing using IDOC_INPUT_ORDERS

    Hi experts,
    I am stuck up with IDOC inbound processing.
    Can you please let me know about the process in Receiving Purchase Order from the customer system and creating Sales Order in the SAP system? using FM IDOC_INPUT_ORDERS. I have an Idea about WE20, NACE etc.
    Can you please explain me about the process on how to go about it?
    Kind regards,
    Shiva.

    Hi,
    I have moved this thread from [ABAP, General Forum |ABAP Development; to [Data Transfers Forum|ABAP Connectivity;.
    The forum Data Transfer is the place to discuss LSMW, ALE, BDC, Data Transfer Techniques, Batch Data Communication, Legacy System Migration Workbench, Application Link Enabling, IDOCs, BAPIs.
    Please, the next time check the most appropriated forum category before posting. Thus you have more chance to have your question answered !
    Best Regards.
    Marcelo Ramos

  • How to use IDoc. in data migration?

    Dear Expert,
    How can I use IDoc. method in Data Migration???

    Hi,
    You can use Idoc method in data migration using LSMW - Idoc method.
    In LSMW select the Idoc method and give the Message type and Basic type according to your requirement.
    Before that you need to maintain the Idoc inbound processing.
    Goto LSMW initial screen,
    LSMW -> Settings -> IDoc Inbound Processing. Maintain File port, partner type and partner no.
    After maintaining the Partner no. goto WE20 (maintain partner no.) and add the message type in the Inbound parameters of the partner no. Also we need to maintain the Process code for the message type.
    After all this settings we can use Idoc method for data migration.
    The rest of the steps are same as other methods till convert data.
    Regards,
    Asif Ali Khan

  • RE:idoc inbound scenario "mapping issue"

    Hi experts,
    we r facing the problem in idoc inbound scenario, while to generate multiple idoc's.
    we need to generate the idoc's based on two fields, Location_code and Date. If any of the field is changing we need to generate the new idoc.
    below is the sender  payload :
    <row>
          <Date>20100111</Date>
          <Sign>+</Sign>
          <Tender_Code>ZSHT</Tender_Code>
          <Tender_Amount>1890.30</Tender_Amount> 
          <Location_Code>0000001000</Location_Code>
       </row>
       <row>
          <Date>20100112</Date>
          <Sign>+</Sign>
          <Tender_Code>ZSHT</Tender_Code>
          <Tender_Amount>1890.30</Tender_Amount>
          <Location_Code>0000001000</Location_Code>
       </row>
       <row>
          <Date>20100112</Date>
          <Sign>+</Sign>
          <Tender_Code>ZSHT</Tender_Code>
          <Tender_Amount>1890.30</Tender_Amount>
          <Location_Code>0000001001</Location_Code>
       </row>
       <row>
          <Date>20100112</Date>
          <Sign>+</Sign>
          <Tender_Code>ZSHT</Tender_Code>
          <Tender_Amount>4532.32</Tender_Amount>
          <Location_Code>0000001001</Location_Code>
       </row>
    for the above payload ,we need 3 idocs as below
    idoc1:
    Location_code>1000    Date->20100111
    idoc2:
    Location_code>1000    Date->20100112
    idoc3:
    Location_code>1001    Date->20100112
    under the third idoc fourth row should get repeated.
    at present we have the following mapping which is generating multiple idocs bsased on only location code, it's like
    Location_code-->removecontext-->sort-->splitbyvalue(valuechange)-->collapsecontext--->idoc
    rgds
    selvam

    Hi,
    Thanks Suraj , logic has worked but there is a simple issue , LOCATION_Code is mapped with SNDRPRN and RCVPRN of the EDI_DC40 segment when i m execuiting the payload it throws error for the second idoc generated , when the LOCATION_CODE changes this should also get updated to that field. Mapping for SDNPRN has been done like this.
    LOCATION_CODE --->removecontext-->|
                                         formatbyexample--->SNDRPRN
    idoc mapping logic---------------->|
    pl suggest...
    rgds
    selvam

  • Idoc Segment data

    HI All,
              I need to pass a constant value for the fields in segments between 2 systems,where can i do that,there a transaction code wher we can do,plz let me know,all useful answers are rewarded

    Hi
    Data Creation in Idoc
    IDocs are text encoded documents with a rigid structure that are used to exchange data between R/3 and a foreign system. Instead of calling a program in the destination system directly, the data is first packed into an IDoc and then sent to the receiving system, where it is analyzed and properly processed. Therefore an IDoc data exchange is always an
    asynchronous process. The significant difference between simple RFC-calls and IDoc data exchange is the fact, that every action performed on IDocs are protocolled by R/3 and IDocs can be reprocessed if an error occurred in one of the message steps.
    While IDocs have to be understood as a data exchange protocol, EDI and ALE are typical use cases for IDocs. R/3 uses IDocs for both EDI and ALE to deliver data to the receiving system. ALE is basically the scheduling mechanism that defines when and between which partners and what kind of data will be exchanged on a regular or event triggered basis. Such a set-up is called an ALE-scenario.
    IDoc is a intermediate document to exchange data between two SAP Systems.
    *IDocs are structured ASCII files (or a virtual equivalent).
    *Electronic Interchange Document
    *They are the file format used by SAP R/3 to exchange data with foreign systems.
    *Data Is transmitted in ASCII format, i.e. human readable form
    *IDocs exchange messages
    *IDocs are used like classical interface files
    IDOC types are templates for specific message types depending on what is the business document, you want to exchange.
    WE30 - you can create a IDOC type.
    An IDOC with data, will have to be triggered by the application that is trying to send out the data.
    FOr testing you can use WE19.
    How to create idoc?
    *WE30 - you can create a IDOC type
    For more information in details on the same along with the examples can be viewed on:
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm#_Toc8400404
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a6620507d11d18ee90000e8366fc2/frameset.htm
    http://www.sappoint.com/presentation.html
    http://www.allsaplinks.com/idoc_search.html
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://www.erpgenie.com/sapedi/idoc_abap.htm
    To Create Idoc we need to follow these steps:
    Create Segment ( WE31)
    Create Idoc Type ( WE30 )
    Create Message Type ( WE81 )
    Assign Idoc Type to Message Type ( WE82 )
    Creating a Segment
    Go to transaction code WE31
    Enter the name for your segment type and click on the Create icon
    Type the short text
    Enter the variable names and data elements
    Save it and go back
    Go to Edit -> Set Release
    Follow steps to create more number of segments
    Create IDOC Type
    Go to transaction code WE30
    Enter the Object Name, select Basic type and click Create icon
    Select the create new option and enter a description for your basic IDOC type and press enter
    Select the IDOC Name and click Create icon
    The system prompts us to enter a segment type and its attributes
    Choose the appropriate values and press Enter
    The system transfers the name of the segment type to the IDOC editor.
    Follow these steps to add more number of segments to Parent or as Parent-child relation
    Save it and go back
    Go to Edit -> Set release
    Create Message Type
    Go to transaction code WE81
    Change the details from Display mode to Change mode
    After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter
    Click New Entries to create new Message Type
    Fill details
    Save it and go back
    Assign Message Type to IDoc Type
    Go to transaction code WE82
    Change the details from Display mode to Change mode
    After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter.
    Click New Entries to create new Message Type.
    Fill details
    Save it and go back
    Check these out..
    Re: How to create IDOC
    Check below link. It will give the step by step procedure for IDOC creation.
    http://www.supinfo-projects.com/cn/2005/idocs_en/2/
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs
    go trough these links.
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    An IDoc is simply a data container that is used to exchange information between any two processes that can understand the syntax and semantics of the data...
    1.IDOCs are stored in the database. In the SAP system, IDOCs are stored in database tables.
    2.IDOCs are independent of the sending and receiving systems.
    3.IDOCs are independent of the direction of data exchange.
    The two available process for IDOCs are
    Outbound Process
    Inbound Process
    AND There are basically two types of IDOCs.
    Basic IDOCs
    Basic IDOC type defines the structure and format of the business document that is to be exchanged between two systems.
    Extended IDOCs
    Extending the functionality by adding more segments to existing Basic IDOCs.
    To Create Idoc we need to follow these steps:
    Create Segment ( WE31)
    Create Idoc Type ( WE30)
    Create Message Type ( WE81)
    Assign Idoc Type to Message Type ( WE82)
    imp links
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    www.sappoint.com
    --here u can find the ppts and basic seetings for ALE
    http://sappoint.com/presentation.html
    www.sapgenie.com
    http://www.sapgenie.com/ale/index.htm
    Check these links.
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs
    Please check this PDF documents for ALE and IDoc.
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf
    Check below link. It will give the step by step procedure for IDOC creation.
    http://www.supinfo-projects.com/cn/2005/idocs_en/2/
    Creation of Custom IDOc type and message Type
    First Create Partner Profile(WE20 Tcode) and Port Definition in WE19 Tcodes.
    take the Basis help to create them.
    1.First create segments in WE31 Tcode with the required dataelements
    2.Create the Basic Idoc Type in WE30
    release the Segments and IDOC type.
    3.Create Message type in We81
    4.Assign the message type to IDOC type in WE82 T code
    5.Create the process code in We41 (for Outbound) WE42 (for Inbound)
    6.Create A fun module in SE37 starting with ZIDOC_OUTPUT_.. by copying some Inbound (for Inbound) Outbound Fun module
    7.Create Workflow setting if needed ..
    8. Assign the fun module to Idoc Type, Message Type and WF object (if it is there0
    9.Define setting for fun module in BD51
    10.In BD51 Define the settings for Fun module..
    10.Assign the Processs Code to Fun mod`ule
    Reward all helpfull answers
    Regards
    Pavan

  • IDOC Inbound Generation from File

    Hi All,
    I'm done with all the testing and config of partner profiles and ports.
    How do I automate the whole IDOC inbound process?
    Thanks.
    Kenny
    Message was edited by: Kenny  Martinez

    Hi Kenny
    I have also faced a similar issue in the past: To automate the process of file reading and triggering the inbound process whenever partner system (legacy system) copies a text file (containing data to be posted) to the SAP application server.
    To automate file reading for inbound process, you have to use SAP events. You can define these events using transaction SM62.
    This event will be used to execute the IDOC create program in a job based on this event.
    Every time the partner system copies the extract file to the SAP application server, this event will be  triggered which then runs the job for processing the data file.
    For more information on using SAP events, click the following link and look into topics under heading ‘Using events to trigger job starts’:
    http://help.sap.com/saphelp_erp2005/helpdata/en/fa/096e44543b11d1898e0000e8322d00/frameset.htm
    the topic, ‘Triggering events from external programs’ is quite interesting.
    Cheers
    Ashish Jain
    [email protected]

  • Sample Custom idoc inbound function module

    Hi Friends
    I am receiving Inbound Idoc ,I Need to save the IDOC data into  ZTable
    Plz ..Can any one give me Sample idoc inbound FM to Config the  WE20(partner profile)
    Regards
    Ram

    HI Rama,
    I presumed that You are talking about a FM to create inbound IDOC. So for creating inbound IDOC you can use '
        CALL FUNCTION 'IDOC_INBOUND_ASYNCHRONOUS'
        TABLES
          idoc_control_rec_40 = gt_edidc
          idoc_data_rec_40    = gt_edidd.
      IF sy-subrc NE 0.
    *    MESSAGE e000 WITH text-003.
    *  ELSE.
    *    MESSAGE i000 WITH text-004  .
      ENDIF.
    just prepare edidc and edidd record in and pass it to the FM..
    Hope this will work for you...
    Thanks

  • What is IDOC Inbound process and Outbound Process?

    What is IDOC Inbound process and Outbound Process?
    can any one explain about the inbound and outbound process step by step?
    Tks in advance,
    Phanikumar

    Hi,
       Inbound means transfer legacy data to SAP system and
      outbound means transfer SAP system data to legacy system.
    Regards,
    Prashant

  • Problem with IDOC inbound function module

    hi
       While excecuting the inbound function module in WE19
    I am getting error (short dump) 
    Incorrect parameter with Call transaction.

    Creating a Function Module (Direct Inbound Processing)
    This step describes how to create a function module which is identified by the IDoc Interface using a new process code and called from ALE (field TBD52-FUNCNAME). Direct inbound processing using a function module (not using a workflow) always includes the ALE layer. This setting (processing with function module and ALE layer) is identified by the value 6 in the field TEDE2-EDIVRS, which is read by the function module IDOC_START_INBOUND. IDOC_START_INBOUND then calls ALE.
    Prerequisites
    You must have completed the required steps in Defining and Using a Basic Type .
    Procedure
    Choose Tools ® ABAP Workbench ® Development ® Function Builder, and create a new function module.
    Create the segments as global data in your function group. The function module should copy the application data from the segments into the corresponding application tables and modify the IDoc status accordingly. If an error occurs, the function module must set the corresponding workflow parameters for exception handling.
    Activate the function module: From the initial screen of the Function Builder select .
    In the example, create the function module IDOC_INPUT_TESTER with a global interface. The function module is called when an IDoc of type TESTER01 is received for inbound processing. You will assign an application object ("standard order") to this IDoc type and therefore maintain tables from SD. To do this, call transaction VA01 using the command CALL TRANSACTION. Please note that the intention here is not to simulate a realistic standard order, but only to illustrate how data reaches application tables from an IDoc table via segment structures (form routine READ_IDOC_TESTER) and how the function module triggers an event for exception handling (by returning suitable return variables to the ALE layer in the FORM routine RETURN_VARIABLES_FILL).
    A comprehensive example of the code for an inbound function module is provided in the ALE documentation in the SAP Library under  Example Program to Generate an IDoc. This function module, for example, also checks whether the logical message is correct and calls a (fictitious) second function module which first writes the application data and then returns the number of the generated document. In addition, status 53 is only set if the application document was posted correctly.
    Administration parameters for IDOC_INPUT_TESTER
    Application abbreviation
    V (Sales and Distribution)
    Processing type
    Normal, start immediately
    Interface for IDOC_INPUT_TESTER (global interface)
    Formal parameters
    Reference structure
    Explanation
    Import parameters
    INPUT_METHOD
    BDWFAP_PAR-INPUTMETHD
    Describes how the function module is to be processed (example: in the background)
    MASS_PROCESSING
    BDWFAP_PAR-MASS_PROC
    Mass inbound processing? (indicator)
    Export parameters
    WORKFLOW_RESULT
    BDWFAP_PAR-RESULT
    Set to 99999 if an event is to be triggered for error handling.
    APPLICATION_VARIABLE
    BDWFAP_PAR-APPL_VAR
    Variable freely available from application for workflow
    IN_UPDATE_TASK
    BDWFAP_PAR-UPDATETASK
    Asynchronous update? (indicator is not set in example)
    CALL_TRANSACTION_DONE
    BDWFAP_PAR-CALLTRANS
    Transaction called? (indicator is not set in example)
    Table
    IDOC_CONTRL
    EDIDC
    IDoc control record
    IDOC_DATA
    EDIDD
    IDoc data records
    IDOC_STATUS
    BDIDOCSTAT
    IDoc status records for ALE
    RETURN_VARIABLES
    BDWFRETVAR
    IDoc assigned to Object type method parameters.
    SERIALIZATION_INFO
    BDI_SER
    If several IDocs are to be processed in a certain sequence: this structure contains the necessary information
    Example
    FUNCTION IDOC_INPUT_TESTER.
    ""Globale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
    *"             VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
    *"       EXPORTING
    *"             VALUE(WORKFLOW_RESULT) LIKE  BDWFAP_PAR-RESULT
    *"             VALUE(APPLICATION_VARIABLE) LIKE  BDWFAP_PAR-APPL_VAR
    *"             VALUE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
    *"             VALUE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
    *"       TABLES
    *"              IDOC_CONTRL STRUCTURE  EDIDC OPTIONAL
    *"              IDOC_DATA STRUCTURE  EDIDD
    *"              IDOC_STATUS STRUCTURE  BDIDOCSTAT
    *"              RETURN_VARIABLES STRUCTURE  BDWFRETVAR
    *"              SERIALIZATION_INFO STRUCTURE  BDI_SER
    initialize SET/GET Parameter and internal tables
      PERFORM INITIALIZE_ORGANIZATIONAL_DATA.
    Move IDOC to internal tables of application
      PERFORM READ_IDOC_TESTER.
    call transaction Order Entry VA01
      PERFORM CALL_VA01_IDOC_ORDERS USING ERRORCODE.
    set status value
      perform write_status_record using errorcode.
    return values of function module
      PERFORM RETURN_VARIABLES_FILL USING ERRORCODE.
    ENDFUNCTION.
    FORM INITIALIZE_ORGANIZATIONAL_DATA.
    initialize SET/GET parameters
       SET PARAMETER ID 'VKO' FIELD SPACE.
       SET PARAMETER ID 'VTW' FIELD SPACE.
       SET PARAMETER ID 'SPA' FIELD SPACE.
       SET PARAMETER ID 'VKB' FIELD SPACE.
       SET PARAMETER ID 'VKG' FIELD SPACE.
    initialize internal tables
       REFRESH BDCDATA.
       CLEAR BDCDATA.
       CLEAR BELEGNUMMER.
       CLEAR ERRTAB.
       REFRESH ERRTAB.
       REFRESH XBDCMSGCOLL.
       CLEAR XBDCMSGCOLL.
    ENDFORM.                    " INITIALIZE_ORGANIZATIONAL_DATA
    FORM READ_IDOC_TESTER.
      PERFORM INITIALIZE_IDOC.
    LOOP AT IDOC_DATA
       WHERE DOCNUM = IDOC_CONTRL-DOCNUM.
        CASE IDOC_DATA-SEGNAM.
    header data
          WHEN 'E1HEAD'.
            MOVE IDOC_DATA-SDATA TO E1HEAD.
            PERFORM PROCESS_SEGMENT_E1HEAD.
    position data
          WHEN 'E1ITEM'.
            MOVE IDOC_DATA-SDATA TO E1ITEM.
            PERFORM PROCESS_SEGMENT_E1ITEM.
        ENDCASE.
    ENDLOOP.
    only when there were one or more items
      CHECK FIRST NE 'X'.
      APPEND XVBAP.                        "last one
    ENDFORM.                    " READ_IDOC_TESTER
    FORM INITIALIZE_IDOC.
      CLEAR XVBAK.
      REFRESH XVBAP.
      CLEAR XVBAP.
      POSNR = 0.
      FIRST = 'X'.
    ENDFORM.                    " INITIALIZE_IDOC
    FORM PROCESS_SEGMENT_E1HEAD.
    requested date of delivery
      WLDAT = E1HEAD-WLDAT.
    delivery date
      XVBAK-BSTDK = E1HEAD-BSTDK.
    customer number
      XVBAK-KUNNR = E1HEAD-AUGEB.
    order number
      XVBAK-BSTNK = E1HEAD-BELNR.
    division
      XVBAK-SPART = E1HEAD-SPART.
    distribution channel
      XVBAK-VTWEG = E1HEAD-VTWEG.
    sales organization
      XVBAK-VKORG = E1HEAD-VKORG.
    order type
      XVBAK-AUART = E1HEAD-AUART.
    do not fill incoterms (inco1, inco2)
    customer function
      CALL CUSTOMER-FUNCTION '001'
           EXPORTING
                PI_VBAK621           = XVBAK
           IMPORTING
                PE_VBAK621           = XVBAK
           TABLES
                PT_IDOC_DATA_RECORDS = IDOC_DATA.
    ENDFORM.                    " PROCESS_SEGMENT_E1HEAD
    FORM PROCESS_SEGMENT_E1ITEM.
    position number
      XVBAP-POSNR = XVBAP-POSNR + 1.
    amount
      XVBAP-WMENG = E1ITEM-MENGE.
    unit
      CALL FUNCTION 'ISO_TO_SAP_MEASURE_UNIT_CODE'
           EXPORTING
                ISO_CODE  = E1ITEM-BMEINH
           IMPORTING
                SAP_CODE  = XVBAP-VRKME
           EXCEPTIONS
                OTHERS    = 0.
    material number
      XVBAP-MATNR = E1ITEM-LMATNR.
    CALL CUSTOMER-FUNCTION '002'
           EXPORTING
                PI_VBAP621           = XVBAP
           IMPORTING
                PE_VBAP621           = XVBAP
           TABLES
                PT_IDOC_DATA_RECORDS = IDOC_DATA.
    APPEND XVBAP.
    ENDFORM.                    " PROCESS_SEGMENT_E1ITEM
    FORM CALL_VA01_IDOC_ORDERS USING ERRORCODE.
    call transaction first dynpro
      PERFORM DYNPRO_START.
    call transaction double-line entry
      PERFORM DYNPRO_DETAIL2.
    incoterms
      PERFORM DYNPRO_HEAD_300.
    call transaction item datas
      PERFORM DYNPRO_POSITION.
      PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'SICH'.
    determine input method
      IF INPUT_METHOD IS INITIAL.
        INPUT_METHOD = 'N'.
      ENDIF.
    call transaction VA01
    CALL TRANSACTION 'VA01' USING    BDCDATA
                             MODE     INPUT_METHOD
                             UPDATE   'S'
                             MESSAGES INTO XBDCMSGCOLL.
    errorcode = SY-SUBRC.       " remember returncode for status update
    ENDFORM.                    " CALL_VA01_IDOC_ORDERS
    form write_status_record using errorcode.
    FILL IDOC_STATUS
    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
    IF ERRORCODE = 0.
    IDOC_STATUS-STATUS = BELEG_GEBUCHT. "value 53
       GET PARAMETER ID 'AUN' FIELD BELEGNUMMER.
       IDOC_STATUS-MSGID = 'V1'.
       IDOC_STATUS-MSGNO = '311'.
       IDOC_STATUS-MSGV1 = 'Terminauftrag'.
       IDOC_STATUS-MSGV2 = BELEGNUMMER.
    ELSE.
        IDOC_STATUS-STATUS = BELEG_NICHT_GEBUCHT. "value 51
        IDOC_STATUS-MSGID = SY-MSwGID.
        IDOC_STATUS-MSGNO = SY-MSGNO.
        IDOC_STATUS-MSGV1 = SY-MSGV1.
        IDOC_STATUS-MSGV2 = SY-MSGV2.
        IDOC_STATUS-MSGV3 = SY-MSGV3.
        IDOC_STATUS-MSGV4 = SY-MSGV4.
      ENDIF.
      APPEND IDOC_STATUS.
    ENDFORM.
    FORM DYNPRO_START.
      PERFORM DYNPRO_NEW USING PROGRAMM_AUFTRAG
                               DYNPRO-EINSTIEG
                      CHANGING LAST_DYNPRO.
    ordertype
      PERFORM DYNPRO_SET USING 'VBAK-AUART' XVBAK-AUART.
    sales organization
      PERFORM DYNPRO_SET USING 'VBAK-VKORG' XVBAK-VKORG.
    Distribution channel
      PERFORM DYNPRO_SET USING 'VBAK-VTWEG' XVBAK-VTWEG.
    Division
      PERFORM DYNPRO_SET USING 'VBAK-SPART' XVBAK-SPART.
    Sales office
      PERFORM DYNPRO_SET USING 'VBAK-VKBUR' XVBAK-VKBUR.
    Sales group
      PERFORM DYNPRO_SET USING 'VBAK-VKGRP' XVBAK-VKGRP.
    ENDFORM.                    " DYNPRO_START
    FORM DYNPRO_NEW USING    PROGNAME
                             DYNPRONR
                    CHANGING LAST_DYNPRO.
    CLEAR BDCDATA.
    BDCDATA-PROGRAM = PROGNAME.
    BDCDATA-DYNPRO  = DYNPRONR.
    BDCDATA-DYNBEGIN   = 'X'.
    APPEND BDCDATA.
    LAST_DYNPRO = DYNPRONR.
    ENDFORM.                    " DYNPRO_NEW
    FORM DYNPRO_SET USING    FELDNAME
                             FELDINHALT.
      CLEAR BDCDATA.
      CHECK FELDINHALT NE SPACE.
    dynpro field name
      BDCDATA-FNAM = FELDNAME.
    contents
      BDCDATA-FVAL = FELDINHALT.
      APPEND  BDCDATA.
    ENDFORM.                    " DYNPRO_SET
    FORM DYNPRO_DETAIL2.
    okcode
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' PANEL-UER2.
    fix dynpro number 4001
      PERFORM DYNPRO_NEW  USING    PROGRAMM_AUFTRAG
                                   '4001'
                          CHANGING LAST_DYNPRO.
    order party
      PERFORM DYNPRO_SET      USING 'KUAGV-KUNNR'  XVBAK-KUNNR.
    purchase order number
      PERFORM DYNPRO_SET      USING 'VBKD-BSTKD'   XVBAK-BSTNK.
    requested delivery date
      PERFORM DYNPRO_DATE_SET USING 'VBKD-BSTDK'   XVBAK-BSTDK.
    purchase order date
      PERFORM DYNPRO_DATE_SET USING 'RV45A-KETDAT' WLDAT.
    ENDFORM.                    " DYNPRO_DETAIL2
    FORM DYNPRO_DATE_SET USING    FELDNAME
                                  FELDINHALT.
      DATA: DATE TYPE D.
      CLEAR BDCDATA.
      CHECK FELDINHALT NE SPACE.
      BDCDATA-FNAM = FELDNAME.
      WRITE FELDINHALT  TO DATE.
      BDCDATA-FVAL = DATE.
      APPEND  BDCDATA.
    ENDFORM.                    " DYNPRO_DATE_SET
    FORM DYNPRO_HEAD_300.
      PERFORM DYNPRO_SET USING 'BDC_OKCODE' PANEL-KKAU.
    incoterms part 1
      IF NOT XVBAK-INCO1 IS INITIAL.
       PERFORM DYNPRO_SET USING 'VBKD-INCO1' XVBAK-INCO1.
      ENDIF.
    incoterms part 2
      IF NOT XVBAK-INCO2 IS INITIAL.
       PERFORM DYNPRO_SET USING 'VBKD-INCO2' XVBAK-INCO2.
      ENDIF.
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'BACK'.
    ENDFORM.                    " DYNPRO_HEAD_300
    FORM DYNPRO_POSITION.
      LOOP AT XVBAP.
    dynpro item double line entry
      PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'UER2'.
        IF XVBAP-POSNR = 1.
    material number
          PERFORM DYNPRO_SET      USING 'VBAP-MATNR(01)'   XVBAP-MATNR.
    order quantity
          PERFORM DYNPRO_SET      USING 'RV45A-KWMENG(01)' XVBAP-WMENG.
    desired delivery date
          PERFORM DYNPRO_DATE_SET USING 'RV45A-ETDAT(1)'  WLDAT.
    sales unit
          PERFORM DYNPRO_SET      USING 'VBAP-VRKME(1)'   XVBAP-VRKME.
        ELSE.
         PERFORM DYNPRO_SET      USING 'BDC_OKCODE'      'POAN'.
    material number
          PERFORM DYNPRO_SET      USING 'VBAP-MATNR(02)'    XVBAP-MATNR.
    order quantity
          PERFORM DYNPRO_SET      USING 'RV45A-KWMENG(02)'  XVBAP-WMENG.
    desired delivery date
          PERFORM DYNPRO_DATE_SET USING 'RV45A-ETDAT(02)'   WLDAT.
    sales unit
          PERFORM DYNPRO_SET      USING 'VBAP-VRKME(02)'    XVBAP-VRKME.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " DYNPRO_POSITION
    FORM RETURN_VARIABLES_FILL USING ERRORCODE.
    allocate IDOC numbers to Workflow output parameters
      IF MASS_PROCESSING <> SPACE.
        IF ERRORCODE = 0.
          RETURN_VARIABLES-WF_PARAM = PID.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          RETURN_VARIABLES-WF_PARAM = APO.
          RETURN_VARIABLES-DOC_NUMBER = BELEGNUMMER.
          APPEND RETURN_VARIABLES.
          WORKFLOW_RESULT = C_WF_RESULT_OK.
        ELSE.
          RETURN_VARIABLES-WF_PARAM = EID.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
        ENDIF.
      ELSE.
        IF ERRORCODE = 0.
          RETURN_VARIABLES-WF_PARAM = APE.
          RETURN_VARIABLES-DOC_NUMBER = BELEGNUMMER.
          APPEND RETURN_VARIABLES.
          WORKFLOW_RESULT = C_WF_RESULT_OK.
        ELSE.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
        ENDIF.
      ENDIF.
    ENDFORM.                    " RETURN_VARIABLES_FILL
    Globale Daten von IDOC_INPUT_TESTER
    TABLES: E1HEAD, E1ITEM.
    DATA: BEGIN OF BDCDATA OCCURS 500.
            INCLUDE STRUCTURE BDCDATA.
    DATA: END OF BDCDATA.
    DATA: BEGIN OF XVBAK.                 "Kopfdaten
         INCLUDE STRUCTURE VBAK621.
    DATA: END OF XVBAK.
    DATA: BEGIN OF XVBAP OCCURS 50.        "Position
           INCLUDE STRUCTURE VBAP.
    DATA:  WMENG(18) TYPE C.
    DATA:  LFDAT LIKE VBAP-ABDAT.
    DATA:  KSCHL LIKE KOMV-KSCHL.
    DATA:  KBTRG(16) TYPE C.
    DATA:  KSCHL_NETWR LIKE KOMV-KSCHL.
    DATA:  KBTRG_NETWR(16) TYPE C.
    DATA:  INCO1 LIKE VBKD-INCO1.
    DATA:  INCO2 LIKE VBKD-INCO2.
    DATA:  YANTLF(1) TYPE C.
    DATA:  PRSDT LIKE VBKD-PRSDT.
    DATA:  HPRSFD LIKE TVAP-PRSFD.
    DATA: END OF XVBAP.
    DATA: BEGIN OF DYNPRO,
          EINSTIEG          LIKE T185V-DYNNR VALUE 101,
          KKAU              LIKE T185V-DYNNR,
          UER2              LIKE T185V-DYNNR,
          KBES              LIKE T185V-DYNNR,
          ERF1              LIKE T185V-DYNNR,
          PBES              LIKE T185V-DYNNR,
          PKAU              LIKE T185V-DYNNR,
          PEIN              LIKE T185V-DYNNR,
          EID1              LIKE T185V-DYNNR,
          POPO              LIKE T185V-DYNNR,
          EIPO              LIKE T185V-DYNNR,
          KPAR              LIKE T185V-DYNNR,
          PSDE              LIKE T185V-DYNNR,
          PPAR              LIKE T185V-DYNNR,
          KDE1              LIKE T185V-DYNNR,
          KDE2              LIKE T185V-DYNNR,
          PDE1              LIKE T185V-DYNNR,
          PDE2              LIKE T185V-DYNNR,
          PKON              LIKE T185V-DYNNR,
          END OF DYNPRO.
    DATA: BEGIN OF PANEL,
          KKAU              LIKE T185V-PANEL VALUE 'KKAU',
          UER2              LIKE T185V-PANEL VALUE 'UER2',
          KBES              LIKE T185V-PANEL VALUE 'KBES',
          ERF1              LIKE T185V-PANEL VALUE 'ERF1',
          PBES              LIKE T185V-PANEL VALUE 'PBES',
          PKAU              LIKE T185V-PANEL VALUE 'PKAU',
          PEIN              LIKE T185V-PANEL VALUE 'PEIN',
          EID1              LIKE T185V-PANEL VALUE 'EID1',
          EIAN              LIKE T185V-PANEL VALUE 'EIAN',
          POPO              LIKE T185V-PANEL VALUE 'POPO',
          EIPO              LIKE T185V-PANEL VALUE 'EIPO',
          KPAR              LIKE T185V-PANEL VALUE 'KPAR',
          PSDE              LIKE T185V-PANEL VALUE 'PSDE',
          POAN              LIKE T185V-PANEL VALUE 'POAN',
          PPAR              LIKE T185V-PANEL VALUE 'PPAR',
          KDE1              LIKE T185V-PANEL VALUE 'KDE1',
          KDE2              LIKE T185V-PANEL VALUE 'KDE2',
          PDE1              LIKE T185V-PANEL VALUE 'PDE1',
          PDE2              LIKE T185V-PANEL VALUE 'PDE2',
          PKON              LIKE T185V-PANEL VALUE 'PKON',
          KOAN              LIKE T185V-PANEL VALUE 'KOAN',
          END OF PANEL.
    DATA: BEGIN OF ERRTAB OCCURS 20,
           TRANS  LIKE TSTC-TCODE,
           ARBGB  LIKE T100-ARBGB,
           CLASS(1) TYPE C,
           MSGNR LIKE T100-MSGNR,
         TEXT LIKE T100-TEXT,
           TEXT(123) TYPE C,
           MSGV1 LIKE SY-MSGV1,
           MSGV2 LIKE SY-MSGV2,
           MSGV3 LIKE SY-MSGV3,
           MSGV4 LIKE SY-MSGV4,
          END OF ERRTAB.
    *---- Hilfsfelder     -
    DATA: PROGRAMM_AUFTRAG LIKE T185V-AGIDV VALUE 'SAPMV45A'.
    DATA: LAST_DYNPRO      LIKE T185V-DYNNR,
          WLDAT            LIKE VBAK-BSTDK,
          POSNR            LIKE VBAP-POSNR,
          FIRST(1)         TYPE C VALUE 'X'.
    DATA: BEGIN OF XBDCMSGCOLL OCCURS 10.
            INCLUDE STRUCTURE BDCMSGCOLL.
    DATA: END OF XBDCMSGCOLL.
    Terminauftrag  ( Auftragsart wird fest gesetzt !)
    DATA:   BELEGNUMMER LIKE VBAK-VBELN.
    DATA:   ERRORCODE LIKE SY-SUBRC.
    Statuswerte fuer IDOC-Status
    DATA:   BELEG_NICHT_GEBUCHT LIKE TEDS1-STATUS VALUE '51'.
    DATA:   BELEG_GEBUCHT       LIKE TEDS1-STATUS VALUE '53'.
    *- Direktwerte für Return_variables -
    data:
        eid like bdwfretvar-wf_param value 'Error_IDOCs',
        pid like bdwfretvar-wf_param value 'Processed_IDOCs',
        apo like bdwfretvar-wf_param value 'Appl_Objects',
        ape like bdwfretvar-wf_param value 'Appl_Object'.
    *- Direktwerte für Workflow_Result -
    DATA: C_WF_RESULT_ERROR LIKE BDWFAP_PAR-RESULT VALUE '99999'.
    DATA: C_WF_RESULT_OK    LIKE BDWFAP_PAR-RESULT VALUE '0'.

  • Urgent: Automate IDOC Inbound/ Outbound

    Hi all,
    I need to automate the whole IDOC process, inbound and outbound.
    For inbound, I need to run or schedule a program that will read all files in a given directory as separate idocs. Note that the filename is not constant, whatever file is in the given directory should be consumed. I don't know if I can use we16 for this still. If I could do this, I just need to schedule RWPOS_PARA_ENQUEUE and I' finished.
    For outbound, what do I do for the system to automatically generate IDOCs? I thought if I activate change pointers, IDOCs will automatically be generated if a change is detected. I am using SAP Retail, one of the idocs is similar to matmas but I cant use BD10 for this. The other two idocs are still problems for me.
    In short, what do I do to automate eveything?
    Thanks so much,
    Kenny

    Hi Kenny Martinez ,
    For Inbound Automation
    First attach your idoc to a process code.
    In the process code you can tell the system that the specified program should be triggered whenever an idoc of that type comes to the system.
    Then you want to have a Z-function module for your idoc processing, if I understand correctly.The steps should be:
    1. Create a z function module for idoc inbound posting (copy from a function module idoc_input_*).
    2. Set Function Modules as Inbound: - Transaction BD51
    3. Assign Function Modules to Logical Messages and Idoc types:- Transaction WE57
    4. Create process codes : Transaction WE42, and link the z-function module.
    5. Create partner profile: transaction WE20 and attach the message type and process code.
    6. In the Z- function module, extract data from the idoc segments, do whatever processing you want to do, and then call BAPI_CREATE_SALES_ORDER_FROMDAT2.
    Good Luck and Reward me for the same.
    Thanks
    Ashok.N

Maybe you are looking for

  • Report Cancelled PO

    How can i genearte a report onf canclled PO? Thanks KKSK

  • PowerPivot removed table replicated into the data model on refresh

    Hey I am facing the following problem which is absolutely persistent and annoying in nature. I am using a data model created with PowerPivot with connections to three different SQL servers and 25 tables. The bug is that every time I refresh my data,

  • Display '0' when data is not available in Crosstab

    Hi Friends, I have a simple crosstab, which will show, Country as a "row header"---only one country is available Department as a "column" No.Of employees in "Body" of cross tab. The table will how much percentage of employees are contributed under ea

  • Create PDF without image compression?

    How do i create a pdf from multiple images without any compression? Seems like even if i do optimize pdf and select png(edit the settings to do max res and no downscaling), when it saves the pdf, at 100% zoom, it's obviously bigger than my original p

  • Palm tx: how to make five way button scroll down a page at a time

    i knew how to do this once, but have forgotten:  on my palm tx, how do i make the five way button scroll down a page at a time? thank you, kj Post relates to: Palm TX