Inbound custom IDOC  function module

I have created a custom idoc and attached a process code to it. The proceesing function module, reads values from the idoc and inserts into a database table.
My question is will this function module be invoked simultaneously? If so, should I first lock the table before inserting and then unlock it?
Thanks in advance.

Hi,
As soon as the idoc reaches SAP, it will trigger the function module you have connected through process code.
If the table is used only by your function module no need to lock the same.
It is always good to lock the table before updating the same.
Regards,
Baburaj

Similar Messages

  • IDoc Function Module(Invoices)

    Dear All,
    I want IDoc Function Module(Inbound) for T Codes FB60, FB65, FB70, FB75 for Invoices.
    Actual Scenario is that i want to transfer data from JAVA system to SAP(Vendor Invoice,Customer Invoice,Credit Memo,Debit Memo) using IDoc.
    Please give me the funcion module(IDoc Inbound and Outbound) can be used in above case.
    thanks,
    RP

    Hi
    They are several function modules.
    Pls Go to SE37 and enterr idoc and press f4 then you are able to see
    all the idoc function module.
    http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
    http://www.erpgenie.com/abap/functions.htm
    Regards,
    Ram

  • Changing IDOC function module?

    Hello everyone!
    I would like to make changes to the function module responsible for creating Sales Order Idocs: IDOC_INPUT_ORDERS. How should I go about this procedure? Do I need to copy the existing function module and create a new one? If so, how do I point the IDOC (ORDERS05) to the new function module (for example, ZIDOC_INPUT_ORDERS).
    Thanks in advance!
    Warm regards,
    Glenn

    > I would like to make changes to the function module responsible for creating Sales
    > Order Idocs: IDOC_INPUT_ORDERS. How should I go about this procedure?
    > Do I need to copy the existing function module and create a new one?
    (1)This is one possible solution, another one is to use some (2)customer function exits for inbound Idoc – these enhancements might be useful: MM06E001, VEDA0001or (depending on platform you are) you might go for e.g. (3)“Implicit enhancement”. In last two cases you probably don’t need to create Z-FM and Z-process code.
    > If so, how do I point the IDOC (ORDERS05) to the new function module (for
    > example, ZIDOC_INPUT_ORDERS).
    1) Copy FM to ZFM
    2) Specify characteristic of FM – BD51
    3) Create Z-inbound process code: WE42 and assign a Z-FM to it.
    4) Assign FM to message type – WE57
    >If you have any other information on how to properly edit the IDOC function
    > module (for example, adding ABAP checking codes before populating the IDOC
    > fields) it would be great if you could share them!
    To add some checks at the beginning you might use all three possible solutions:
    (1) in ZFM you might add you code at the very beginning and return some error message
    (2) you might use on of the available customer function exits to do some checks
    (3) you can do the implicit enhancement and also return some error code at the very beginning of standard FM
    In both cases I recommend to go for approach no (2). Useful tcodes: CMOD and SMOD.
    Regards,
    Jakub

  • Inbound Custom IDoc Processing

    Hi,
    I've created an Inbound Custom IDoc, Created the ABAP function module to post it to the application, configured workflow and IDoc processing.  All my setup appears fine as I can create IDocs from our AS400 subsystem and trigger a successful posting via the IDoc test tool.
    Having got this working I now want to automate the posting.
    At present I create the IDoc's on our Legacy AS400 System and FTP them onto the SAP Application Server which runs on a Windows 2003 platform.
    How do I get SAP to process each of my waiting Idoc's?
    Any examples appreciated....

    Hi
    For CUSTOM IDOC inbound processing
    Firstly attach your idoc to a process code.
    In the process cod 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.
    Check out this sample Function Module on the inbound system
    FUNCTION Z_IDOC_INPUT_EMPREP.
    ""Local interface:
    *"  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
    *"      IDOC_DATA STRUCTURE  EDIDD
    *"      IDOC_STATUS STRUCTURE  BDIDOCSTAT
    *"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
    *"      SERIALIZATION_INFO STRUCTURE  BDI_SER
    *"  EXCEPTIONS
    *"      WRONG_FUNCTION_CALLED
    Database Tables
      TABLES: ZAK_EMPLIST.
    Include programs
      INCLUDE MBDCONWF.
    Data Declarations
    *--- Employee Header -IDOC
      DATA: FS_EMPHDR_DATA LIKE Z1R_SEG1.
    *--- Employee Details -IDOC
      DATA: FS_EMPDET_DATA LIKE Z1R_SEG2.
    *--- Employee Header - application data
      DATA: FS_APP_EMPHDR LIKE ZAK_EMPLIST.
    *--- Employee Details - application data
      DATA: FS_APP_EMPDET LIKE ZAK_EMPLIST.
    Program Logic
    *---Initialize Work Flow Result
      WORKFLOW_RESULT = C_WF_RESULT_OK.
      LOOP AT IDOC_CONTRL.
    *--- Check whether the correct message was passed to us
      IF IDOC_CONTRL-MESTYP NE 'ZR_MSG'.
          RAISE WRONG_FUNCTION_CALLED.
      ENDIF.
    *--- Clear application buffers before reading a new record
      CLEAR   FS_APP_EMPDET.
      CLEAR   FS_APP_EMPHDR.
    REFRESH FS_APP_EMPDET.
    REFRESH FS_APP_EMPDET.
    *--- Process all records and pass them on to application buffers
        LOOP AT IDOC_DATA WHERE DOCNUM EQ IDOC_CONTRL-DOCNUM.
          CASE IDOC_DATA-SEGNAM.
            WHEN 'Z1R_SEG1'.            " Employee Header
              FS_EMPHDR_DATA = IDOC_DATA-SDATA.
              MOVE-CORRESPONDING FS_EMPHDR_DATA TO FS_APP_EMPHDR.
            WHEN 'Z1R_SEG2'.            " Employee Details
              FS_EMPDET_DATA = IDOC_DATA-SDATA.
              MOVE-CORRESPONDING FS_EMPDET_DATA TO FS_APP_EMPDET.
          ENDCASE.
        ENDLOOP.
    *--- If data is ok
      SELECT * FROM ZAK_EMPLIST WHERE ENUMBER = FS_APP_EMPHDR.
        IF SY-SUBRC NE 0.
          INSERT INTO ZAK_EMPLIST VALUES FS_APP_EMPHDR.
          INSERT INTO ZAK_EMPLIST VALUES FS_APP_EMPDET.
        ELSE.
          UPDATE ZAK_EMPLIST FROM FS_APP_EMPHDR.
          UPDATE ZAK_EMPLIST FROM FS_APP_EMPDET.
        ENDIF.
      ENDSELECT.
      IF SY-SUBRC EQ 0.
    *--- Populate Return variables for success
          RETURN_VARIABLES-WF_PARAM    = 'Processed_IDOCs'.
          RETURN_VARIABLES-DOC_NUMBER  = IDOC_CONTRL-DOCNUM.
          RETURN_VARIABLES-WF_PARAM    = 'Appl_Objects'.
          RETURN_VARIABLES-DOC_NUMBER  = FS_APP_EMPHDR-ENUMBER.
          APPEND RETURN_VARIABLES.
    *--- Add Status Reocrds indicating success
          IDOC_STATUS-DOCNUM           = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS           = '53'.
          IDOC_STATUS-MSGTY            = 'I'.
          IDOC_STATUS-MSGID            = 'ZE'.
          IDOC_STATUS-MSGNO            = '006'.
          IDOC_STATUS-MSGV1            = FS_APP_EMPHDR-ENUMBER.
          APPEND IDOC_STATUS.
      ELSE.
          WORKFLOW_RESULT              = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM    = 'Error IDOCs'.
          RETURN_VARIABLES-DOC_NUMBER  = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
    *--- Add status record indicating failure in updating
          IDOC_STATUS-DOCNUM           = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS           = '51'.
          IDOC_STATUS-MSGTY            = 'E'.
          IDOC_STATUS-MSGID            = 'ZE'.
          IDOC_STATUS-MSGNO            = '007'.
          IDOC_STATUS-MSGV1            = FS_APP_EMPHDR-ENUMBER.
          APPEND IDOC_STATUS.
        ENDIF.
    ENDLOOP.
    ENDFUNCTION.
    Good Luck and reward me for the same
    Thanks
    Ashok

  • How to find IDOC Function Module for Basic Type:ORDERS05

    Hi,
    What is the Transaction Code to locate the Function Module linked to the IDOC Basic Type & IDOC Message Type?
    Appreciate Your Help.
    Thanks,
    Kannan.

    Hi Seshu,
    Thanks for your reply. While creating a Custom IDOC, How do I link the IDOC Function Module and Basic Type. Appreciate Your Help.
    Thanks,
    Kannan.

  • To find Custom Developed Function Module -Belonging to a Development Class

    Hi Experts,
    How to find custom developed function modules belong to a particular development class.
    Or Funtion Group belonging to a particular development class.
    Thanks in Advance,
    Regards,
    IFF

    Hi,
    Ofcourse you can get function group or function module associated with a Development class from Transaction SE80 or SE84.
    Step-by-step.
    1. From SAP start call transaction se84.
    2. Expand Program Library
    3. Select Function Group or Function Module
    4. In the standard selections give the 'Package' as the name of your development class.
    You will get the list of all function modules associated with your development class. The function modules starts with 'Z' or 'Y' will be the custom developed ones.
    Regards,
    Renjith Michael.

  • How to create dropdown list for custom remote function module

    HI ,
           I created a custom remote function module for a ztable.table having four fields.But now the requirement is to maintain the dropdown list for input parameter .
    For eg: I maintain Input parameter as action.For that Action we have to maintain a dropdown list(display,insert,update and delete  values ) in function module.Is it possible.

    Hi
    Try using POPUP_GET_VALUES function module in the begining of the Function module this gives a POP to provide a value to you
    In this you can provide a value
    Check the import parameters of this Function module if it has COMBOBOX as parameter ( I dont have SAP access at this point of time) you can pass X to it so you get List box for the following fields
    Create a domain to field and assing fixed values to it and use it in any table(As this works with only existing tables)
    refresh fields.
    DATA: fields LIKE SVAL OCCURS 0.
    fields-tabname = 'MAKT'.
    FILEDS-FIELDNAME = 'MAKTX'.
    APPEND FIELDS.
    CALL FUNCTION 'POPUP_GET_VALUES'  " Try copying this in a Test program and execute
            EXPORTING
              POPUP_TITLE  = 'Enter Mail Id here'
              START_COLUMN = '5'
              START_ROW    = '5'
            IMPORTING
              RETURNCODE   = SRETURN
            TABLES
              FIELDS       = FIELDS.
    Cheerz
    Ramchander Rao.K
    Edited by: Rob Burbank on Nov 23, 2011 9:50 AM

  • Error in Inbound Customer IDOC (WE19)

    Hi All
    I am creating Inbound Customer IDOC
    Message Type : DEBMAS
    & FM : IDOC_INPUT_DEBITOR.
    But getting error(51) : "No batch input data for screen SAPMF02D 0340".
    According to previous threads, I have seen this screen for Mandatory fields but I didnt found any.
    Could anyone tell me what mandatory fields to enter in DEBMAS or  the Solution for this Error.
    Regards.

    Hi Nikhil I am getting this error which you got it before but this time I am getting it in LSMW when creating customer master screen."No batch input data for screen SAPMF02D 0340"
    what am i supposed to check?
    Can u plz send me ur mail ID.

  • How to debug outbound Idoc function module for invoice

    I have to debug the outbound IDOC function module and UserExit for invoice message type INVOIC, process code SD09, function module is IDOC_OUTPUT_INVOIC and user exit for the function module LVEDF001.
    I tried putting the break point in function module IDOC_OUTPUT_INVOIC and recreate the IDOC using WE19 but it creates the idoc but does not stop at the break point. I have also tried generation of idoc through VF02. It again creates the idoc but does not stop at the function module.
    Please let me know if I am missing any thing and not doing it right.
    Appreciate your help.
    Rohit

    Hi Ali,
        I faced the same problem. Thing is the break point is not getting triggered when i ran tha IDOC through WE19.
    What i have done is i created a project for my exit in CMOD and kept some junk code in the exit and executed it through BD21. Then the Break point got triggered. See if it works.
    Regards,
    Uday S.

  • Inbound Idoc Function Module

    Hi gurus,
    I am new to IDOC's. My requirement is from some third party systems data come to IDOC.
    For this I created Custom Z segments, Z Idoc and Z message type.
    Now I have to develop one Inbound function module. Based on this function module two Z custom tables need to be updated.
    Please can any one give me a valubale sugestion. Or send to me the step by step Procedure.
         Thanks in Advance.
    Thanks and Regards
    Abinava Siri.

    Hi,
    Refer to the tutorial below. This will solve all your queries.
    Its with all the spanshots available.
    http://www.geocities.com/xplosion78/customised_ALE_IDOC_BY_SACHIN_DABHADE.zip
    Please reward if you find this useful.
    Pranu.

  • Inbound Idoc function module  for Cycle count with msg type WVINVE

    Can any one tell me which is the standard function Module which processes Cycle count for message type WVINVE.
    My requirement is to setup Inbound Idoc for cycle processing with message type WVINVE.

    Hi Mukesh,
             Inbound FM is IDOC_INPUT_STORE_INVENTORY , and Process code is WVIN.
             Yoou can check this in Tcode WE42 for process code WVIN.
    Regards
    Srikanth M

  • Idoc/ Function module to create a Licence in GTS

    Dear experts,
      I have a situation where in I need to create Licence in GTS system based on the information from a 3rd party system. So, Is there any inbound idoc in GTS system to automatically create the licence (I'm using middle ware to convert the XML from 3rd party to an IDOC).
    Or is there any function module, to create a licence in GTS system.
    Thanks for the Info.
    Sorry for the duplication of same question that i posted in GTS forum. I couldn't get a single reply from 3 days, so I reposted the same.
    Thanks
    -Amit.

    Hi Amit
    I'm facing the same problem you had.
    May I ask you how you created the function module?
    Thanks in Advance
    Ashwaan

  • How to find the outbound idoc function module?(Urgent)

    Dear All,
    How to identify the outbound function module if there is process code assigned to message type.
    For partner profile the mesasge type is assigned and idoc type .This is the only information maintained .
    Now my question is how to identify the fucntion module which is getting trigger in the system is there any data maintained in the standard table  or any t-code .
    Points will be rewarded for right answers.
    Thank You.
    Regards,
    Ravi Ganji

    Hi,
    If u know the message and basictype then we can know the process code for that message type in transaction code WE64.
    if we know process codes then we can know the function modules in transaction codes WE41(Outbound process code) and WE42(Inbound process code).
    Each process code is attached with a FM...
    Reward if helpful
    Regards,
    Nagaraj

  • Idoc function Module

    Hi Experts!!,
    How to find out Function Module which system is using for Inbound Idocs ?
    Thanks in advance.

    Anil,
    If these are existing iDocs being processed in your system, I would recommend you run WE19 for an existing iDoc, click on 'Standard inbound', and make a note of the Function Module determined. That will let you know which FM is used for those specific conditions. You might also want to check transaction WE57, which shows FM assignments to iDoc & Message Types, also WE42 for Process Codes. Process Codes are selected in the WE20 Partner Profile, and point to an FM, therefore in theory you could use different FMs for different Partner Profiles.
    Cheers, Paul.

  • Idoc function module problem

    Hi all,
    I have a idoc. In this Idoc i need to populate a segment which is not populated previously if it satisfies the selection criteria.
    For this i have to write a function module and this function module should check theselction and populate this field in Idoc.
    Can anyone help me in doing this.
    <REMOVED BY MODERATOR>
    Regards,
    Saroja.
    Edited by: Alvaro Tejada Galindo on Jan 31, 2008 11:28 AM

    You can hook into a user exit in the IDOC and directly populate the segments at the time the IDOC is created or processed.
    The process and user exit to use depends on:
    - what IDOC are you using
    - is it inbound or outbound
    - what are the criteria for the population of the segment
    Hope that helps,
    Michael

Maybe you are looking for

  • Auto-open 'Completed' Service ticket based on tracking text in email...

    When sending out e-mails we embed a so called tracking number into the end of the e-mail text saying something like: DO NOT DELETE ***      Ticket No. [[1234567]] DO NOT DELETE *** This is pretty common, I believe, and how this is achieved is documen

  • How to access Infocube content using an ABAP program

    Hi,    I am trying to access infocube contents using a ABAP program in BW.    It is easy to access ODS content as we have NEW DATA or ACTIVE DATA    tables. Is there any way we can access Infocube content.    I tried using the FACT table but it has o

  • ALV doesn't expand/collapse subtotals

    Hi everyone, I have an old ALV program in wich i made some changes. For example, added form USER_COMMAND so that when you double-click on a row, it makes a CALL TRANSACTION to the referenced document. But a problem emerged, and it didn't happended be

  • 3.0 causes BSOD in Windows 7 on Mac Pro

    I just did my third reinstallation of windows 7 on my mac pro and I think I've narrowed the bsod problem to the 3.0 bootcamp drivers. Every time I go to install steam, which is really the only reason I use windows, It gives me the bsod. The bsod refe

  • HT4061 unable to switch on

    unable to switch on my iphone