The IDOC INBOUND function is locking an object

Hi ,
       I have created a wrapper bapi around IDOC_INPUT_SHPMNT , this is because i need to change the shipment using a BDC. No the problem is that once the control comes out of IDOC_INPUT_SHPMNT the locks are still maintained on the shipment.Now is this beacuse i am using WE19 to test the program or will i have manually realease the lock from this. Any pointers with function modules will be helpful.

IDOC_INPUT_SHPMNT  will be locking the shipment. The lock will not be released until the IDoc has finished processing.
You could remove the lock yourself.
Can you not use a user exit in IDOC_INPUT_SHPMNT to provide your solution instead of running a BDC yourself. If your BDC fails how will this error be reported back to the IDoc. You would then not be able to re-process the IDoc either.

Similar Messages

  • 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.

  • Creating a custom IDoc inbound function module

    I have created a custom idoc.I wanted to create a custom IDoc inbound function module, this Function module will provide to launch a BAPI .Tell me how to "create" inbound function module for the custom idoc ?

    Goto any standard for the Paramtetres
    *"  IMPORTING
    *"     REFERENCE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
    *"     REFERENCE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
    *"  EXPORTING
    *"     REFERENCE(WORKFLOW_RESULT) LIKE  BDWFAP_PAR-RESULT
    *"     REFERENCE(APPLICATION_VARIABLE) LIKE  BDWFAP_PAR-APPL_VAR
    *"     REFERENCE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
    *"     REFERENCE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
    *"     REFERENCE(DOCUMENT_NUMBER) LIKE  VBAK-VBELN
    *"  TABLES
    *"      IDOC_CONTRL STRUCTURE  EDIDC
    *"      IDOC_DATA STRUCTURE  EDIDD
    *"      IDOC_STATUS STRUCTURE  BDIDOCSTAT
    *"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
    *"      SERIALIZATION_INFO STRUCTURE  BDI_SER
    *"      EDI_TEXT STRUCTURE  EDIORDTXT1 OPTIONAL
    *"      EDI_TEXT_LINES STRUCTURE  EDIORDTXT2 OPTIONAL
    Do the below configs.
    1.Recognise the funcmod as Inbound -BD51
    2.Register the Function  module in WE57 .
    3.we42 Process code .
    4. WE20 -PARTNER Profile
    I hope it resolves ur Query.
    Rgds
    Sree M

  • IDOC inbound function module!

    Has anybody worked on IDOC inbound function module !
    What is the meaning of the following steps !
    IDOC_STATUS-DOCNUM = IDOC_CONTROL-DOCNUM.
    IDOC_STATUS-STATUS = '51'.
    IDOC_STATUS-MSGTY = 'E'
    IDOC_STATUS-MSGID = ' ZE'
    IDOC_STATUS-MSGNO = '007'
    IDOC_STATUS-MSGV1 =  IT_LIKP-vbeln.
    APPEND IDOC_STATUS.
    What are possible values for MSGTY,MSGID, MSGNO.....
    What do they mean !
    Edited by: Alvaro Tejada Galindo on Mar 10, 2008 7:18 PM

    "here nothing complicated ...
    "status 51 means 'Application document not posted'
    "in WE02 you can see this message
    IDoc: 0000000000001254 Status: Application document not posted
    IDOC_STATUS-DOCNUM = IDOC_CONTROL-DOCNUM. "IDoc number
    IDOC_STATUS-STATUS = '51'.                                      "stauts code
    IDOC_STATUS-MSGTY = 'E'                                         "error type
    IDOC_STATUS-MSGID = ' ZE'                                       "message class ID
    IDOC_STATUS-MSGNO = '007'                                     "message number in ZE
    IDOC_STATUS-MSGV1 =  IT_LIKP-vbeln.                      "document number or order number
    APPEND IDOC_STATUS.

  • How to create the change document functionality for a dependent objects?

    May I please know how to create the change document functionality for a dependent objects?
    I have done it follow the same process as for business process objects. But when i try to test it in BOBT, there is no records under "FIELD_CHANGE_WITH_FILTER". It seems the change hasn't been recorded.
    If the way I did to create change document for dependent object is correct, please also kindly advise the possibilities for why there is no record during testing.
    thanks in advance.

    I also have some doubts about the business object.In this case,one abstract BO hase a subnode wihich is root extended.I added the change document for this node under the category "root_extended" and then tested the function in BOBT.I got some error message "can't find the root key".Shall i redefine the method /BOFU/IF_CDO_CREATION~IS_CDO_CREATION_ACTIVE so as to solve the problem?
    Thx.

  • 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'.

  • Idocs - Inbound function module

    Hi All,
    I'm facing a prolem while testing the inbound function module thru transaction WE19.
    The steps i'm following.
    1) i'll give the message type & will proceed further
    2) when i select the idoc & click on the push button "inbound function module " , My Z FM will displayed afterwards when i press enter a error message will be displayed.as"Interface for the Z function module is Incorrect"
    i have created Z funtion module, Z message type,Z IDOC type,Z segment type. Z process Code
    All the configuration like WE57,WE20,WE42 has been done.
    Please help.
    Points will be rewarded
    Thanks,
    Sureshkumar

    Suresh , please check if ure function module interface is as per the template below:
    IMPORTING     
         INPUT_METHOD LIKE  BDWFAP_PAR-INPUTMETHD
         MASS_PROCESSING  LIKE  BDWFAP_PAR-MASS_PROC
    EXPORT     
         WORKFLOW_RESULT  LIKE  BDWFAP_PAR-RESULT
         APPLICATION_VARIABLE  LIKE  BDWFAP_PAR-APPL_VAR
         IN_UPDATE_TASK  LIKE  BDWFAP_PAR-UPDATETASK
         CALL_TRANSACTION_DONE  LIKE  BDWFAP_PAR-CALLTRANS
    TABLES     
         IDOC_CONTRL STRUCTURE  EDIDC
         IDOC_DATA STRUCTURE  EDIDD
         IDOC_STATUS STRUCTURE  BDIDOCSTAT
         RETURN_VARIABLES STRUCTURE  BDWFRETVAR
         SERIALIZATION_INFO STRUCTURE  BDI_SER
    This is the general required format for IDoc inblund processing using FM.
    Message was edited by:
            Ayan Banerjee

  • Reg : IDOC - inbound function module

    HI guys,
    I have an ....list of error inbound idocs .......(presently using function module X)......
    but recently we made lot of changes in  inbound function module and release as "Y"...hence presently all idocs Uses the inbound function module 'Y'.
    In this scenario i wanted to re-process the old idocs.....(which were in error state 51).......Which should use the old function module 'X'.....(it should not use Function module 'Y') 
    In short 'based on the date ....my inbound function module should be assigned while processing idocs.
    idoc date <   01.01.2011   then old function module  (I.E  FM  "X")
    idoc date > = 01.01.2011  then new function module (i.e. FM "Y")
    regards
    Girish

    You can't do that via the standard config.  You can, however, embed the call to your 'X' function in your new 'Y' function based on your date criteria.  Whether that date is hard-coded or stored in TVARVC is up to you.

  • 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

  • IDOC Inbound processing and Locks

    Hi there,
    we are trying to process an incoming idoc. But all the time we get an error: Immediately processing not possible: EDI: IDOC "XYZ" is currently locked.
    There is an lock entry for this IDOC in table EDIDC. We get this error while calling the FM IDOC_STATUS_WRITE_TO_DATABASE with status 52 (application doucument not fully posted).
    What can we do?

    Exactly why are you trying to write the IDoc status to the database? 
    It sounds like you have written a custom IDoc.  If this is so, you would pass the IDoc status back in table IDOC_STATUS, and it will get updated automatically by SAP. 
    When SAP extracts the IDoc data, it places an Enqueue lock on the IDOC.  That is why you are getting the error message.
    HTH,
    John

  • CATS IDoc inbound problem - Transaction lock, LR002

    Customer is posting CATS records via interface from externa system to IDoc for CATS processing. Either the create BAPI (BAPI_...) is used or if there is a change to an already existing posting (BAPI_...). For his i have slightly modified the SAP standard existing FM for CATS inbound processing (IDOC_) to handle both scenarios, create and change. I basically examine CATS data from external system and if it is already existing then I call the change BAPI and if not found the I call the create BAPI.
    We have no problem posting with these BAPIs when there postings are imported one by one. But, when several CATS postings arrive at the same second then not all postings are handled correctly. We receive error message "Transaction locked by user XXX" (error message e002(lr)) and XXX is the background communication user. No luck using "Where used" for error 002 in message class LR either. Also tried tracing with trans SE30 but no luck there either.  Data is always different but can be for the same personell number. User is correct and not locked - it is the transaction (like CAT2) thats SAP standard reports as locked. Some postings go through alright but then after a few corrrect posting this problem pops up. Very frustating.
    Code is correct as it seems only to be a "overflow" problem. Config and data is also correct. Customer was also facing the very same error using the same BAPIs called via RFC and not via IDoc.
    Reason to change to IDoc was of course to set the posting as synchronous thus avoiding this "overflow" problem. In standard SAP is IDocs processed in parallell which is fine in many circumstances but not here. Or it might be OK as long as this error don't occur but have found no way so far. Customer is in production and this must be solved. We also tried this in a band new upgraded ECC 6.0 EhP5 system as customer is in the process of upgrading. Same error.
    I have found very few hints when searching through Google, SAPNet, SDN etc. This is one of the very few links I found: [Locking problem with FM EDI_DATA_INCOMING;
    So I checked this in trans WE46 but as customer is running ECC 6.0 EhP3 we have no such option. Then tried trans nOYEAn setting the parameter "Synchronous processing" but I do not understand how this is supposed to work. Problem stills remains. The values are stored in table EDICONFIG and here parameter INBSYNC is used for the synchrounous setting as of my understanding but we only have this for a user called EDIADMIN and that is certainly not our background user. I don't understand how to set this parameter correctly I guess. SAP help doen't give more insight either - at least not for me.
    Does anyone have a suggestion how to solve this problem? Anyone solved this before and willing to share a solution?
    << Moderator message - Please do not promise points >>
    I maybe beed to send this to SAP OSS but trying this option first.
    To me this is puzzling. Find very few references which normally means few have encountered this. Strange. CATS BAPI interfacing must be used by a lot of companies.
    BR, Johan
    Edited by: Rob Burbank on Nov 7, 2011 2:36 PM

    Hi Johan,
    These kind of problems arise when there is a very little time gap between two successive postings. So put a 'WAIT UP TO 2 SECONDS' between each of the postings. This will give time for the previous posting to perform the updates even before the next posting hits the same transaction. This will solve your problem.

  • IDOC inbound processing ( Function module Rquired )

    Hi,
    I am working on IDOC inbound, I am looking for a standard FM for Production order confirmation which i need to assign in WE57 along with the standard Message type(Production order confirmation).
    Could you please let me know where i can get the standard inbound function modules for the standard idoc types,
    for eg: IDOC_INPUT_ORDERS for sales order.
    Thanks.
    Krishnakumar

    Hi,
    Go to WE42 for inbound processing codes and WE41 for outbound.
    OR
    We  have WE19 which is a test tool for IDOC processing.
    Provide the IDOC number  then press F8, then in the next screen , you will have inbound function module.
    Click that  button. Then enter the text in search criteria.
    Then you can get related function module.
    Reward points if helpful.
    Thanks and Regards

  • SO IDOC inbound create SO with reference to INV or SO #

    Hi all,
    I have a situation where I will get the inbound SO IDOC, through IDOC_INPUT_ORDERS and create a sales order with reference to a invoice number or another sales order (eg: consignment pick up and consignment fill up).
    Except modifying the standard formed BDC in the FM, by adding additional screen code into the BDC, is there any other way to do so?
    (eg: assign value into certain field in IDOC? Using another IDOC FM?)
    Please advice.
    Thanks.
    Best Regards,
    JL

    Hi ,
    At a high level, the IDOC processing executes in the following manner:
    1.     Interpret IDOC header segments and captures organizational, customer master and purchase
                    order header details. Performs user exits for each segment to process customizations to data
                    processing.
    2.     Interprets item level segments and captures item level details like material information. Again, it
                   performs user exits for each segment.
    3.     Sums up the order data and determines the posting criterion viz. creating order with reference
                  etc.
    4.     Builds up batch data communication sequence (BDC) with respect to the required screen
                    sequence of posting a sales order.
    5.     While building up the BDC data, system performs user exit to process customizations to BDC
                      data.
    6.     Calls transactions VA01 using the BDC data.
    7.     If the processing fails, an appropriate workitem is generated for workflow processing.
    User Exit - ZXVEDU03
    This user exit will be performed after each segment read in the IDOC processing function module. Exit is called during the perform interpret_idoc_orders in the idoc processing function module. The exit is executed before the BDC data building process and it is here where the invoice  number would be retrieved into a variable from segment E1EDK02.
    IF SEGMENT-SEGNAM = 'E1EDK02'.
        IF SEGMENT-SDATA(3) = 'Z43'.
           Save the  you Number XXXXXXXXXX into a temporary variable.
        Endif.
    Endif.
    User Exit - ZXVEDU04
    In the function module IDOC_INPUT_ORDERS, form call_va01_new_orders is performed wherein BDC data is built up for every screen required to post a sales order. User Exit ZXVEDU04 is performed at various stages during the built up of BDC data. It is here in this user exit that a coding needs to be performed to insert BDC data for assigning sales order to the invoice
    The BDC data for assign to invoice  should be added soon after the BDC data for purchase order type is generated. The following BDC data logic should be coded in the user exit to facilitate assign to invoice
    if you give me brief i can help you out more.
    if helpful REWARD points
    Thank you .
    Regards
    Ramana

  • The idoc number changes when I execute it in WE19

    Hi,
    I am executing an inbound idoc with message type ORDERS in WE19. I then choose the relevant inbound function module, choose the foreground processing and then execute in debug mode.
    The control then goes inside the function module. I then check the table IDOC_CONTROL which refers to EDIDC. Here I find that the idoc_contrl[1]-DOCNUM refers to a different idoc number. This number is a different one everytime I execute the WE19. Why is this so?
    Thanks and regards,
    Anishur

    Hi,
    In most cases WE19 is used as a test tool , apart from this in case of any changes are required in the fields present in the segment, immediate changes can be done using WE19. For eg if the Posting Period for a FIDCC2 has to be changed to a previous date on which the posting would actually be executed, it can done using WE19.
    IDocs generated for purely testing purpose maybe in a preproduction environment before bringing it live to a production environment, to check for the validity of the data along with the generation of fields WE19 is used.
    Thanks
    Krithika

  • Inbound scenario: Z inbound function module

    Hi chaps,
    I have a standard Idoc Type that should be processed by an individual inbound function module.
    The processcode is BAPI as the IDoc is mapped to a BAPI.
    I thought I could use the message code or function. But the standard inbound function module BAPI_IDOC_INPUT1 is executed (at least in WE19) all the time.
    Can somebody please tell me how I can trigger my Z inbound function module?
    Thanks.
    Achim

    Hi Achim,
    If you want to process the IDOC with the help of your custom function module, then you need to following things:-
    1. Create the custom function module
    2. Assign the function module to the Message Type in WE57 transaction
    3. Define Setting for the custom function module in BD51 transaction
    4. Create a new Process Code in WE42 transaction
    5. Assign this new Process in the PArtner profile in WE20 transaction
    Once you complete all the above steps then you can process your IDOC with your custom function module automatically.
    If you want to use WE19 transaction to test the IDOC with your custom function module you can follow the below steps as well:-
    1. Create your IDOC using WE19 transaction
    2. Click the button Inbound Function module and then give your custom function module and click the tick mark in the pop up.
    By doing the above 2 steps you can test whether your function module is correctly working or not as well.
    Thanks,
    Mahesh.

Maybe you are looking for

  • I am not able to print in cannon ir series 2520 after Maverick update

    I am not able to print in cannon ir series 2520 after Maverick update, printer is in pause and even after resuming it it dosent work. Pl help Same case with the projector not able to connect it.

  • Not seeing a pdf logo in word to save the file

    Hi anyone, I just loaded Adobe Acrobat standard 7.0 and I cannot see a pdf tab to save my doc or docx file as a pdf before I email it. the people I send to need it in pdf format. any help for me?

  • Correlated subquery help

    Hi I've the following tables and the requirement create table test1 (id number,rk varchar2(11),rk_cd varchar2(11)) create table test2 (id number,rk1 varchar2(11),rk_cd1 varchar2(11)) insert into test1 values(1,'I+','LG') insert into test1 values(2,'I

  • Availability check in PM order

    Hi, In a PM refurbishment order with components, when I press the 'Availibility Check' button before release of the order, I am getting the message "No check exists for planning (item: 0010, mat.:XXXXX" (Message no. C2119). I have already maintained

  • Can't update my iphone software (firmware) issue

    Hi, im trying to update to 5.1.1 and it keeps saying - cannot be updated firmware is not compatible. i dont know much about this stuff so i just need some help. i want to update because my phone runs so slow. and i have never updated the software on