Need help in INBOUND idoc generation function module!

Can anyone send me the inbound idoc function module !
i have the outbound code but i need the inbound code

Might be a constant C_WF_RESULT_OK is assigned to
variable WORK_RESULT .
Please check if they are declared in the function module ..

Similar Messages

  • Inbound IDoc Posting Function Module

    Give me an example of   how to write "Inbound IDoc Posting Function Module".
    In my IDOC i have 10 segments each containing 1 field.
    How do i create the Inbound IDoc Posting Function Module ??
    Is the following code correct ??
    FUNCTION ZIDOC_INBOUND.
    ""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:LIKPUK.
    *DATA DECLARATIONS
        DATA: SALES_ORDER_NUM             LIKE Z1VBELN.
        DATA: DEL_TYPE                    LIKE Z1LFART.
        DATA: ACTUAL_GOODS_MOVEMENT_DATE  LIKE Z1WADAT_IST.
        DATA: SHIPPING_POINT              LIKE Z1VSTEL.
        DATA: LOADING_POINT               LIKE Z1LSTEL.
        DATA: ROUTE_PGI                   LIKE Z1ROUTE.
        DATA: PICK_DATA                   LIKE Z1KODAT.
        DATA: CUST_NO                     LIKE Z1KUNNR.
        DATA: LOCAL_DATE                  LIKE Z1STDAT.
        DATA: TOTAL_GOOD_MOV              LIKE Z1WBSTK.
    *INTERNAL TABLE DECLARATION
    DATA:
    IT_LIKP LIKE LIKPUK OCCURS 0 WITH HEADER LINE.
    INITIALIZE WORK FLOW
        WORK_RESULT = C_WF_RESULT_OK.
         LOOP AT IDOC_CONTRL.
    MAKE SURE WE HAVE CORRECT MESSAGE TYPE PASSED.
         IF IDOC_CONTRL-MESTYP NE 'Z_IDOC_PGI'.
         RAISE WRONG_FUNCTION_CALLED.
         ENDIF.
    CLEAR APPLICATION BUFFERS BEFORE READING NEW ENTRY
        CLEAR :IT_LIKP.
      REFRESH IT_LIKP.
    *PROCESS ALL THE DATA RECORDS IN AN IDOC AND TRANSFER THEM TO
    *APPLICATION BUFFERS
    INCLUDE MBDCONWF.
    LOOP AT IDOC_DATA WHERE DOCNUM EQ idoc_contrl-docnum.
    CASE IDOC_DATA-SEGNAM.
    WHEN'Z1VBELN'.
       SALES_ORDER_NUM  =    IDOC_DATA-SDATA.
       MOVE-CORRESPONDING SALES_ORDER_NUM TO IT_LIKP.
    WHEN 'Z1LFART'.
       DEL_TYPE    = IDOC_DATA-SDATA.
       MOVE-CORRESPONDING DEL_TYPE TO IT_LIKP.
    WHEN 'Z1WADAT_IST'.
       ACTUAL_GOODS_MOVEMENT_DATE    = IDOC_DATA-SDATA.
       MOVE-CORRESPONDING ACTUAL_GOODS_MOVEMENT_DATE TO IT_LIKP.
    WHEN 'Z1VSTEL'.
       SHIPPING_POINT    = IDOC_DATA-SDATA.
       MOVE-CORRESPONDING SHIPPING_POINT TO IT_LIKP.
    WHEN 'Z1LSTEL'.
       LOADING_POINT   = IDOC_DATA-SDATA.
       MOVE-CORRESPONDING LOADING_POINT TO IT_LIKP.
    WHEN 'Z1ROUTE'.
       ROUTE_PGI    = IDOC_DATA-SDATA.
       MOVE-CORRESPONDING ROUTE_PGI TO IT_LIKP.
    WHEN 'Z1KODAT'.
       PICK_DATA =   IDOC_DATA-SDATA.
       MOVE-CORRESPONDING PICK_DATA TO IT_LIKP.
    WHEN'Z1KUNNR'.
       CUST_NO  =   IDOC_DATA-SDATA.
       MOVE-CORRESPONDING CUST_NO TO IT_LIKP.
    WHEN'Z1STDAT'.
       LOCAL_DATE  =   IDOC_DATA-SDATA.
       MOVE-CORRESPONDING LOCAL_DATE TO IT_LIKP.
    WHEN'Z1WBSTK'.
       TOTAL_GOOD_MOV  =   IDOC_DATA-SDATA.
       MOVE-CORRESPONDING TOTAL_GOOD_MOV TO IT_LIKP.
    ENDCASE.
    ENDLOOP.
    selecting data from the database
    select * from likp into corresponding fields of table it_likp.
    add status record
        IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = it_likp-VBELN.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = it_likp-VBELN.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
    IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = IT_LIKP-LFART.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = IT_LIKP-LFART.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
    IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = IT_LIKP-WADAT_IST.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = IT_LIKP-WADAT_IST.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = IT_LIKP-VSTEL.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = IT_LIKP-VSTEL.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = IT_LIKP-LSTEL.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = IT_LIKP-LSTEL.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = IT_LIKP-ROUTE.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = IT_LIKP-ROUTE.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = IT_LIKP-KODAT.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = IT_LIKP-KODAT.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = IT_LIKP-KUNNR.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = IT_LIKP-KUNNR.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = SY-DATLO.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = SY-DATLO.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '53'.
          IDOC_STATUS-MSGTY = 'I'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '004'.
          IDOC_STATUS-MSGV1 = IT_LIKP-WBSTK.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
        ELSE.
          IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
          IDOC_STATUS-STATUS = '51'.
          IDOC_STATUS-MSGTY = 'E'.
          IDOC_STATUS-MSGID = 'YM'.
          IDOC_STATUS-MSGNO = '005'.
          IDOC_STATUS-MSGV1 = IT_LIKP-WBSTK.
          APPEND IDOC_STATUS.
          CLEAR IDOC_STATUS.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
          RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          CLEAR RETURN_VARIABLES.
        ENDIF.
    endloop.
    endfunction.

    Hi,
    First goto WE20-> click on the logical system , now select the receiver LS which you are using as your partner. Now in the inbound parameters cehck what is the process code is attached.
    once you get the process code then go to WE42 tcode.. there you give the process code and then double click you will get the function module IDOC_INPUT_FIDCMT.
    Hopw you got my point.
    Regards,
    Nagaraj

  • ALE-IDOC Error -Function module not allowed: ZIDOC_INPUT_MATCLASS

    Hello all,
    I am having a requirement to enhace bd10  to suit for material master.For that i have written a Z-function module to at inbound side.
    Function module has coading for extended segments and z processing code is created for the same.
    The issue is that i am getting error-Function module not allowed: ZIDOC_INPUT_MATCLASS.Please help to resolve the issue.
    Thank you.

    I have checked as per your suggestion in detail the error reported as-
    Function module not allowed: ZIDOC_INPUT_MATCLASS
    Message no. B1252
    Diagnosis
    The function module ZIDOC_INPUT_MATCLASS and the application object type which were determined are not valid for this IDoc.
    Procedure
    1. Please check that the process code in the inbound partner profile is correct.
    2. If this is the case, you should check the ALE inbound methods ALE inbound methods for the process code and see whether the specified function module and application object type are correct.
    3. If this is also the case, then the function module and the application object type are not permitted for the logical message type, message variant, message function and basis type that are contained in the IDoc control record. You should check whether the correct values have been assigned to these fields in the control record. If they do have the correct values, then the assignment to the function module and the application object type needs to be maintained.
    I am done with all the procedure.
    I am currently using-BUS1001006.I really dont know if this is the one for extended idocs and z function module for material master.Please guide me if this is the issue. And i f so please guide right buziness object.
    Thanks.
    Edited by: sanjivrd on Sep 22, 2009 1:27 PM

  • Help , if there exists a Function Module

    Hello everybody,
       I want a help whether SAP has some Function Module which can take an "Internal Table" as an Import Parameter and give us "CSV File" as an export parameter , more-or-less like the "GUI_DOWNLOAD" Function Module , which downloads the file as ".DAT" or ".ASC" .
        Please remember that i would need a CSV file , which i can read later through Opening a Dataset and transferring the contents into a file.
         Your immediate answers is most needed.
    Thanks,
    Suddha Laik

    hi suddha,
    try with GUI_DOWNLOAD with filetype as 'ASC' and
    give the filename as 'C:\TEST.CSV'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = 'C:\TEST.CSV'
       FILETYPE                        = 'ASC'
      APPEND                          = ' '
       WRITE_FIELD_SEPARATOR           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = itab
      FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22.
    do reward if it helps,
    regards,
    priya.
    Message was edited by: Priya

  • IDoc outbound function module to generate Purchase order PORDCH IDoc

    Hi all,
    Can anyone help me with the outbound function module to generate PORDCH IDoc

    instead of that you can use the Below For PO's.
    Message Type : ORDCHG
    Process Code  : ME11
    Function : IDOC_OUTPUT_ORDCHG

  • I need help to create  idoc from scrach.

    i need help to create  idoc from scrach.

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

  • Need help in inbound function module !

    What is the meaning of this in the inbound function module ?
    WORK_RESULT = C_WF_RESULT_OK.
    In my function module its showing some error !

    Might be a constant C_WF_RESULT_OK is assigned to
    variable WORK_RESULT .
    Please check if they are declared in the function module ..

  • Need help on Inbound Delivery - Mapping from IDoc to LIKP Table

    Hi,
    For the DESADV IDoc (Inbound Delivery) we are currently mapping data to the LIKP table for a subset of fields via  function module INPUT_IDOC_DESADV.  If I wanted to map the ABLAD - Unloading Point field from the IDoc to the LIKP - ABLAD - Unloading Point field is this possible and if yes, what work would be required? 
    And could you please let me know how to find out an user exit for the message type? (message type = desadv)

    Hi Murphy,
    Try this custom function '002'.
    CALL CUSTOMER-FUNCTION '002'
           EXPORTING
                xekko     = ekko
                xlfa1     = lfa1
                xlfb1     = lfb1
                dobject   = object
           TABLES
                int_edidd = int_edidd
                xekpo     = xekpo
                xeket     = xeket
                dvbak     = xvbak
                dvbap     = xvbap
                dvbkd     = xvbkd
           EXCEPTIONS
                error_message_received        = 1
                data_not_relevant_for_sending = 2.
    Hope this will help.
    Regards,
    Ferry Lianto

  • How to create IDOC from Function module or RFC

    Hi all,
            I have tested one inbound IDOC for Time Upload to CAT2 using basic type "CATS_INSERT01"  in WE19 through function module BAPI_IDOC_INPUT1 .It works well.
    Now i need to create this IDOC once the sale order gets created thru BAPI.
    For creation of Sale order i wrote one RFC in which i will call the Standard Sale Order Bapi.My question is once the Sale order gets created in that RFC How do i trigger the IDOC for CATS upload.

    Hi,
    Which SAP product of wich release of which SP are you using ?
    The procedure is documented in help.sap.com and in blogs and SDN forum messages.
    It means that the use of the SEARCH button should give plenty of answers...
    >When I check "Local object" checkbox I get a message "Test objects cannot be created in foreign >namespaces"
    As usual, begin your choosen name with an "Z".
    Regards,
    Olivier

  • Inbound Idoc Generation

    Hello All,
    We have a ALE concept to transfer data between clients. We have made the settings and the process was fine. But on some days Inbound Idoc is not getting generated with respect to the outbound Idoc, and after some times once again system comes to normal state and the idoc generation is fine. How ever we dont have any root cause for the failure of Idoc generation. Could someone let me know where i can chk the info and what all the parammetres needs to be checked.
    Note ; There are no issues in ALE ocnfig settings.

    Hi ,
    See the following code :
    Program To Generate IDoc
    *& Report  ZZ_Program_To_Create_Idoc                                        
    report  zz_program_to_create_idoc                     .
    tables: ekko,ekpo.
    selection-screen skip 3.
    selection-screen begin of block b1 with frame title titl.
    selection-screen skip.
    select-options s_ebeln for ekko-ebeln.
    selection-screen skip.
    selection-screen end of block b1.
    data: header_segment_name like edidd-segnam value 'Z1EKKO',
          item_segment_name like edidd-segnam value 'Z1EKPO',
          idoc_name like edidc-idoctp value 'Z19838IDOC1'.
    data: header_segment_data like z1ekko,
          item_segment_data like z1ekpo.
    data: control_record like edidc.
    data: messagetyp like edmsg-msgtyp value 'ZZ9838MESG1'.
    data: i_communication like edidc occurs 0 with header line,
          i_data like edidd occurs 0 with header line.
    data: begin of i_ekko occurs 0,
          ebeln like ekko-ebeln,
          aedat like ekko-aedat,
          bukrs like ekko-bukrs,
          bsart like ekko-bsart,
          lifnr like ekko-lifnr,
          end of i_ekko.
    data: begin of i_ekpo occurs 0,
          ebelp like ekpo-ebelp,
          matnr like ekpo-matnr,
          menge like ekpo-menge,
          meins like ekpo-meins,
          netpr like ekpo-netpr,
          end of i_ekpo.
    start-of-selection.
    select  ebeln aedat bukrs bsart lifnr from ekko
              into table i_ekko where ebeln in s_ebeln.
    select ebelp
           matnr
           menge
           meins
           netpr
           from ekpo
           into table i_ekpo
           where ebeln in s_ebeln.
    control_record-mestyp = messagetyp.
    control_record-rcvprt = 'LS'.
    control_record-idoctp = idoc_name.
    control_record-rcvprn = '0MART800'.
    loop at i_ekko.
    header_segment_data-ebeln = i_ekko-ebeln.
    header_segment_data-aedat = i_ekko-aedat.
    header_segment_data-bukrs = i_ekko-bukrs.
    header_segment_data-bsart = i_ekko-bsart.
    header_segment_data-lifnr = i_ekko-lifnr.
    i_data-segnam = header_segment_name.
    i_data-sdata = header_segment_data.
    append i_data.
    select ebelp
           matnr
           menge
           meins
           netpr
           from ekpo
           into table i_ekpo
           where ebeln = i_ekko-ebeln.
    loop at i_ekpo.
    item_segment_data-ebelp = i_ekpo-ebelp.
    item_segment_data-matnr = i_ekpo-matnr.
    item_segment_data-menge = i_ekpo-menge.
    item_segment_data-meins = i_ekpo-meins.
    item_segment_data-netpr = i_ekpo-netpr.
    i_data-segnam = item_segment_name.
    i_data-sdata = item_segment_data.
    append i_data.
    endloop.
    clear i_ekpo.
    refresh i_ekpo.
    endloop.
    call function 'MASTER_IDOC_DISTRIBUTE'
      exporting
        master_idoc_control                  = control_record
      OBJ_TYPE                             = ''
      CHNUM                                = ''
      tables
        communication_idoc_control           = i_communication
        master_idoc_data                     = i_data
    exceptions
       error_in_idoc_control                = 1
       error_writing_idoc_status            = 2
       error_in_idoc_data                   = 3
       sending_logical_system_unknown       = 4
       others                               = 5
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
      loop at i_communication.
        write: 'IDOC GENERATED', i_communication-docnum.
      endloop.
      commit work.
    endif.
    initialization.
    titl = 'ENTER THE PURCHASE ORDER NUMBER'.
    Reward points if helpful.
    Regards.
    Srikanta Gope.

  • Ergent help about inbound IDoc for Goods Receipts

    Dear friends
    We have an ergent issue needing your help.
    It is about DEVRY03.
    Senarios is as following:
    When we create a delivery by using VL31n, system try the IDoc and transfer to XI.
    This is ok.After external warehouse system processes the IDoc,a message is sent back to SAP to post the goods receipts for the delivery.
    Inbound IDoc type is DEVRY03. Is it right?
    Which function module or which process ok is used for this senario?
    Can anyone suggest how to do it?
    Minghan

    Hi !
    Here comes some information for the INBOUND idocs....
    There is a IDOC for transmitting goods movements from a legacy system.
    It's message-type is: WMMBXY
    IDOC-Type is: WMMBID02 (See we60 for it's pretty good docu....)
    Prcoess-Code is :WMMB
    The function that processes the data is: L_IDOC_INPUT_WMMBXY
    Hope that helped a bit (for inbound)....
    Regards
    Rainer
    Some points would be nice if that helped.

  • RE: Idoc types , Function modules

    HI All
    What are the generic <b>Idoc types</b> and <b>function modules</b> used for the following objects for SAP R/3 4.7
    Invoice Release (inbound)
    Payments (outbound)
    Purchase Orders (outbound)
    Goods Receipts (outbound)
    Cost Centers (outbound)
    GL Codes (outbound)
    Internal Orders (outbound)
    WBS (outbound)
    Materials (outbound)
    Invoices (inbound)
    Invoices Blocked (outbbound)
    Any help will be very much appreciated
    And How do i judge which IDOC types and function module fit my requirement( I mean what are the things i have to keep in mind while choosing idoc types and function modules)
    Thnk you
    Steve

    I have an idea.
    Build an idoc from scratch with all the fileds or use the idoc invoic01 and extend it. Comming to function module write a function module that will extract the data from the idoc and will pass the data to bapi BAPI_INCOMINGINVOICE_CREATE( MIRO SCREEN). Please comment on this!!!

  • IDOC: Incorrect function module problem

    Hi,
    I am working on inbound IDOC processing. I created an extension for an IDOC. I created custom segment & included it in the extension that I created. The Message type was also custom. (I merely copied an existing standard Message Type for some other purpose). I also assigned Function Module to Message Type & IDOC type. I have other necessary settings configured as required. The problem that I am encountering is as follows:
    Incorrect function module IDOC_INPUT_SHPCPR called up
    Message no. B1044
    Diagnosis
    The function module IDOC_INPUT_SHPCPR, which was called for the application input, was not able to process the IDoc. A possible cause is that the IDoc has wrong message type or IDoc type.
    Procedure
    Please check the message type assignment for the application function module in the ALE customizing.
    Now to troubleshoot the above error, I made sure that I have an entry with FM. IDOC_INPUT_SHPCPR,  IDOC Basic Type ,custom  IDOC extension & custom Message Type. But even then I see the above error. This error appears as Status 51 for the test IDOC that I processed.
    Can anyone please tell me how to solve this? Thanks in advance.

    On line 49 of the function module :
    * Loop through the IDocs' control records
      LOOP AT idoc_contrl.
    *   Check the IDOCs message type
        current_mestyp = idoc_contrl-mestyp.
        PERFORM idoc_message_type_check
                     TABLES   idoc_status
                     USING    idoc_contrl
                              mestyp-shpcpr
                     CHANGING subrc.
    Perform looks like this ( in Include LV56IF0C...)
    FORM idoc_message_type_check
              TABLES   t_idoc_status  STRUCTURE bdidocstat
              USING    f_idoc_contrl  STRUCTURE edidc
                       default_mestyp LIKE edidc-mestyp
              CHANGING subrc          LIKE sy-subrc.
      IF current_mestyp <> default_mestyp.   " Here the variable default_mestyp has the value SHPCPR
        MESSAGE ID      msg-id             "Global variable
                TYPE    'E'
                NUMBER  msg-nr_wrong_function    "Global variable
                WITH    current_mestyp     "message type
                        'IDOC_INPUT_SHIPPL'"Your function module
                        f_idoc_contrl-sndprt     "Sender partner type
                        f_idoc_contrl-sndprn     "Sender number
                RAISING wrong_function_called.
    Again let me warn you that you will have to copy the entire function group V56I. Copying the function module alone will not help because there are many reusable subroutines in different includes of the function-pool.
    regards,
    Advait

  • Idocs and function modules

    HI All
    Can anyone suggest <b> function modules</b> used for the following objects or idoc types (If not atleast provide me a link where i can find them ??We are on SAP R/3 4.7.
    Purchase Orders (outbound)             <b>orders05</b>
    Goods Receipts (outbound)              <b>acc_goods_movement02</b>
    Cost Centers (outbound)          <b> cosmas01</b>
    GL Codes (outbound)                           <b>glmast01</b>
    Internal Orders (outbound)              <b>  INTERNAL_ORDER01</b>
    WBS (outbound)                           <b>HRCC1DNWBSEL01</b>
    Materials (outbound)                           <b>matmas05</b>
    Invoices (inbound)                   <b>invoic02</b>
    Invoices Blocked (outbbound)   <b>ACC_INVOICE_PYMNTBLK01</b>
    Any help will be very much appreciated
    Thank you
    Steve

    Hi steve,
    If you are searching for Outbound FM for those idoc types, 1st you have to get the <b>Process code</b> linked with the Message type of the Idoc types.
    So go to <b>WE41(Outbound process code)</b>, then search for the message types, you will get the process codes, then double click on the process codes, you will get the appropriate FM.
    e.g.Purchase order- process code:-ME10
                                  FM:- <b>IDOC_OUTPUT_ORDERS</b>
         Invoice- process code:- SD09
                     FM:- <b>IDOC_OUTPUT_INVOIC</b>
    when <b>Inbound process code</b> you can go for <b>WE42</b> and do the similar process to find out the FM.
    e.g. Material master- process code:-MATM
                          FM:- <b>IDOC_INPUT_MATMAS01</b>
          GL master- process code:- GLMA
                           FM:- <b>IDOC_INPUT_GLMAST</b>
    In this fashoin you can find out.
    Reward points if helpful,
    Best Regards,
    Bhawani
    Message was edited by:
            BHAWANI SHANKAR MOHANTY

  • Help in Creation of a Function Module.

    Hi Abapers,
                    I am new to ABAP and hardly have knowledge abt it. I need to create a Function Module which is of the type RFC. Pls provide me information and steps to create the same.
    Many thanks in Advance.

    Hi Pooja,
    Please follow the below steps to create a function module :
    1. Goto Transaction code : SE37.
    2. Create a Function Group first.
       a) From the Menu Bar Choose Goto -> Function groups ->  Create group.
       b) Specify the function group name and a short text.
       c) Choose Save.
    When you create a new function group, the system automatically creates a main program containing two includes. Like any other programs and includes, you can display them in the Repository Browser.
    3. Now create a Function Module.
    4. Enter the function's name in the field Function module.
    5. Choose Create.
    6. In the Enter function group dialog box, enter the function group to which you want to assign the function module.
    7. In The Attributes Tab select Remote Enabled Module (since you want a RFC function module ).
    8. Give the Import and Export parameters and exceptions(if any).
    9. Write the functioning part of the fuction module in the Source code tab.
    10. Save and Activate your function Module.
    Now go ahead and use your function module where ever you want.
    Hope it helps.
    Reward if helpful.
    Regards
    Hemant Khemani

Maybe you are looking for