Filter for custom IDoc?

Hi,
I have custom IDoc , that i am sending to 4 different destinations (systems). My requirement is i need to send for 4 th destinations only header segment.
How do i filter this on the basis of partner profile number
Please don't suggest to change the code. I am looking for this can done without change function module or triggering program.

Hi,
You can use segment filtering (transaction BD56).
Here you can suppress a whole segment irrespective of data inside it .
You have to give Message Type/Sender Partner/Receiver Partner.
Regards,
Ferry Lianto

Similar Messages

  • Inbound function module for  custom IDOC

    HI,
    I have created custom IDOC.I need to create inbound function module for that custom IDOC.Can any one send me sample
    function module for custom IDOC.(what are all the import Export,tables  parameters and exceptions  that I need  to create for function module)
    Thanks&Regards
    Rama.Mekala

    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

  • How to Assign a function module for customized IDOC

    Hi,
           I have created a customized IDOC. Can any body explain how to assign a FM for customized IDOC? Is same IDOC can be used for both Outbound and Inbound Process? In WE41 and WE42 we have to give the outbound and inbound function module name. can we give same function module? Is process code is same for both outbound and inbound process?
          Valuable suggetions are appreciated.
    Regards,
    Ram

    Hi ,
    Here is the Procedure for the Inbound Idoc Funtion Module
    Function Module : SE37
    Message : WE81
    Assign message : WE82
    Assgin FM : we57
    Process Code : WE42.
    Assign Partner Profile - WE20,
    To test the Inbound IDOC.
    In WE19, Give the IDOC number & execute ... then put the cursor on the idoc control record . then click on the Standard Inbound push button on the application tool bar.it will show show all the details like partner no,type , message type , process code & function module name ...
    now put a break point in the function module .. & debug .
    if u r using customised inbound function module , then click on inbound function module .. there u will get a pop screen with FM name & debugging option in both background & foreground mode...
    Reward Points if it is Useful.
    Thanks,
    Manjunath MS

  • Custom process code and FM for custom IDoc...

    Hello Experts,
    I created a custom IDoc based from ARTMAS05 IDoc. This is because we only need 3 segments and
    the standard idoc(Artmas05) contains so many segments that we need.
    Now, will I create a custom process code and FM for this? how do I go about this?
    Thank you guys and take care!

    Hello,
                 Here are the Steps that we need to be following while creating a Custom Process Code with Custom Function Module. ( Since the Segments to be handled are very Less, I am recommending that you go for a Custom Function Module).
    1. Go to SE37 Create a Function Module. Please ensure to Create it with the IMPORT / EXPORT /TABLES parameters exactly in the way that they exist in any Standard SAP Inbound FM (Refer to IDOC_INPUT_ORDERS for example).
    2. Once our FM is Ready (Need not be Complete with the Code to go ahead with the Process Code Creation) and Active, the next Step is to Create an Entry in the Transaction Code BD51 where we will register the Function Module.
    3. Next, we'll have to go to T-Code WE57 where we'll have to make an entry for the Function Module with the IDoc Type & Message Type.
    4. Finally, go to WE42 and Create a New Process Code and assign the Function Module and the Message Type.
    NOTE 1 : The Process Code is, as we know, Client Dependent. So, once you create a Process Code, we need to have it migrated to the Testing Environment to Start & Carry Out Testing.
    NOTE 2: If Step 2 & 3 are missing, then we'll not be able to assign the Function Module in WE42 while Creating Process Code.
    Hope it was helpful.
    Thanks and Regards,
    Venkata Phani Prasad K

  • INBOUND program  For custom IDOC

    Hi ,
          i have a one  senario on creation of IDOC,that is interface for the transmission of the Acknowledgement of check Remittance and Supplemental interface,once the message is received Successfully through OUTBOUND program it triges the Acknowledge other wise it send one mail to respective team for that i need to create a one inbound program please explain me i am new in the area of ALE/ IDOC please give in deatials.
    Thanks,
    Harinath

    Hi Harinath,
    In your case SAP is sending <b>Check Remittance and Supplemental</b> data to legacy system which in turn need to send acknowledgement for that. And its going to be in form of an idoc. for this we dont have an idoc you need to create one from scratch. please find the steps to be followed to create a custom idoc.
    1) Create ‘Z’ segment with required fields(fields coming towards you) using WE31
    2) Create ‘Z’ idoc using segment created in step 1 using WE30.
    3) Create ‘Z’ message type using WE81.
    4) Link idoc created in step 2 with message type created in step 3 in WE82.
    5) Create ‘Z’ function module to post the idoc in SE37. Include all validations, updations to tables, Error handling in source code tab of this FM.
    6) Maintain Inbound process code using the FM in WE42
    Coming to sending a mail, It can only be done using workflow. But i think in your case it is not required. so it need to be done manually.
    Get back if you have any doubts.
    Regards,
    Younus
    <b>Reward Helpful Answers!!!</b>

  • How to check IDOC Serialization for custom idoc

    In one of my interfaces, we are receiving idocs ARTMAS, INFREC, COND_A and ZMD_ARTHIER in ECC system.Last one is customized one in which basically we have to assign one article to an article hierarchy. So this idoc will contain only article no, hierarchy id and node level in which article will be assigned.
    Now here we have to implement idoc serialization so that if ARTMAS in any case fails then INFREC, COND_A and ZMD_ARTHIER idocs should not be posted. We will be using RBDSER04 program for inbound processing.
    My concern is that whether we have to do any special coding for serialization check in custom function module for the last idoc ZMD_ARTHIER.
    If yes, please please let me know how to do handle that in custom inbound function module.
    Edited by: suman pandit on May 19, 2009 10:47 AM

    Hi,
    you need to create a serialization group (in customizing) and assign all the IDocs (in specific order) to this group incl. your custom IDoc.
    When data is transfered first a SERDAT01 IDoc will be sent, after this your IDocs have to follow in specific order. At last again a SERDAT01 follows and triggers the processing in the destination system.
    Regards,
    Kai

  • When do we ceate custom messagae type apart for custom idocs type

    Hi all.
        Can u pls let me know when do we create custom message type in ALE/IDOCS. what I know is we can create a custom message when we create custom idoc type & when we have reduced idoc type.Pls let me what are other cases in which I need to create a custom message type.Thanks in advance.
    Kind regards,
    sami.

    I think these are the only cases where we need to create. Its basically when we dont have standard SAP message type available.

  • SMOEAC-Filter for Customer Changes not to replicate from CRM to R/3

    Hi,
    We have 4 subscriptions in SMOEAC for CRM to R/3 replication. They are
    1.ALL BUSINESS PARTNERS
    2.ALL BUSINESS PARTNERS RELATIONSHIPS
    3.ALL BUSINESS PARTNERS HIERARCHIES
    4.SALES DOCUMENT ECC.
    In the business partners, Now we need to put filter to avoid flow of Customer Master data changes (to R/3) done in CRM.
    Iam seeing information in forums that we can able to do that by changing the publication type from Simple Bulk(MSG) to Simple Intelligent(MSG).But Iam not able to change it for ALL BUSINESS PARTNERS in transaction SMOEAC.
    pl advice on the possibility.
    Regards
    A.Sureshbabu.

    Hello,
    Assuming X is the replication object.
    1. Remove all the sites assigned current bulk X object. Check the REALIGN and SUBCHECK queues in Tx: SMOHQUEUE and make sure that all jobs triggered due to this removal are complete.
    2. Delete the subscription for bulk X.
    3. Delete the publication for bulk X.
    4. Delete the existing bulk X object.
    5. Create a Replication Object (Intelligent) for BDoc type X with Criterial Field selected.
    6. Create a Publication for the Replication Object above.
    7. Create a Subscription for the Publication and set the Criteria Value.
    Please note the subscriptions corresponding to the replication object must be deleted from ALL clients of the server.
    Hope that helps.
    Thanks,
    Rohit

  • Filter for custom added site columns using rest

    Hi everybody,
    I'm trying to filter a REST Response by a custom added site column.
    when i'm using the endpoint lists() with /Items the filter works great:
    site/_api/Web/Lists(guid'805e17b0-2728-4b30-a889-a7e8f025696b')/items?$filter=astringcolumn%20eq%20%27dfg%20-----------------------------%27
    but when I'm trying to filter using
    site/_api/Web/GetFolderByServerRelativeUrl('/sites/DennisDevSite/alib')/Files?$filter=astringcolumn%20eq%20%27dfg%20-----------------------------%27
    I get a response that states Field or property "astringcolumn" does not exist.
    event if I add &$select=astringcolumn&$expand=astringcolumn to the url the same error is returned
    Why does the first work and the second does not?
    Thx in advance
    Dennis
    P.S.: sorry: I also posted this question in the sharepoint 2013 apps forums. but I think it's better to post it here

    Hi Dennis,
    Steve as mentioned the reason this happens. You may try any of the following workarounds:
    Get the files using Files Rest endpoint and then perform the filteration in the success handler based on the custom column. The Rest query needs to include ListItemAllFields. Example: site/_api/Web/GetFolderByServerRelativeUrl('/sites/DennisDevSite/alib')Files?$expand=ListItemAllFields
    Note that you cannot use filter in the Url.  
    The other option is to use CAML Query Payload, but that can only be used with getitems REST endpoint. However, this will return the ListItem corresponding to the file. It wont be a file object. Example:
    function getListItems(viewXml)
    var url = "http://aissp2013/_api/web/lists/getbytitle('Management Documents')/getitems";
    var queryPayload = {
    'query' : {
    '__metadata': { 'type': 'SP.CamlQuery' },
    'ViewXml' : viewXml,
    'FolderServerRelativeUrl': '/ManagementDocuments/F1'
    return $.ajax({
    url: url,
    method: "POST",
    data: JSON.stringify(queryPayload),
    headers: {
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "Accept": "application/json; odata=verbose",
    "content-type": "application/json; odata=verbose"
    var query = "<View><Query><Where><Eq><FieldRef Name='Location' /><Value Type='Text'>Srinagar</Value></Eq></Where></Query></View>";
    getListItems(query)
    .done(function(data)
    console.log(data);
    .fail(
    function(error){
    console.log('Error');
    Still, the other option is to use old fashioned ListData.svc. It will allow filter in the url and will also return some file properties like Name, approval status, version etc along with all custom properties. Example:
    http://aissp2013/_vti_bin/ListData.svc/ManagementDocuments/?$filter=Path eq '/ManagementDocuments/F1' and Location eq 'Srinagar'
    Please remember to up-vote or mark the reply as answer if you find it helpful.

  • Regarding Custom IDOC Creation

    Hi All,
    I Am New to ABAP , Any one Please Give me the Step -By Step Procedure to create Custom IDOC.
    I Have this Link with me.
    Step by step custom IDOC creation
    But I Don't Know that What should i Give field names and Data elements
    How to create Field names And Data elements
    Regards
    Vamsi

    Hi,
    U need a custom IDOC when the elements in the standard IDOC is not there according to requirement. ex. in IDOC cremas04 u want the Country code should be there.
    Then U go for custom iDOC and create a Y/Z i.e custom idoc and add one structure and add the required fiellds.
    Check this link for Step by Step guide
    http://www.erpgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    CHeck this link for a IDOC ...The steps are mentioned in details about creating custom idoc..
    http://www.allsaplinks.com/idocbasicsunderstanding.html
    http://www.allsaplinks.com/idoc.html
    http://www.allsaplinks.com/idoc_sample.html
    Please check this link.
    http://help.sap.com/saphelp_46c/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    Regards

  • Custom IDoc program to send PO ?

    Hai,
    Can any one send the complete program, on how to send PO (Purchase Oeder) through custom IDoc .
    Please send code for both outbound and inbound process ?

    Hi Vamsi,
    Here i am sending sample codes for Inbound and Outbound Processes..
    IN OUTBOUND SIDE :
    REPORT  ZSTAND_PROGRAM.
    *1.     Create parameters/select-options for input data. i.e., empno, message type, logical system.
    PARAMETERS : P_SNO LIKE ZSAMP1-SNO OBLIGATORY,
                 P_MESTYP LIKE EDMSG-MSGTYP DEFAULT 'ZMSG1',
                 P_LOGSYS LIKE TBDLST-LOGSYS OBLIGATORY.
    *2.     Create Data objects for control record, data record and database table.
    DATA : C_SEGMENT LIKE EDIDD-SEGNAM VALUE 'ZSEG1',
           C_IDOCTP LIKE EDIDC-IDOCTP VALUE 'ZIDOC1'.
    DATA : BEGIN OF IT_ZSAMP1,
              SNO LIKE ZSAMP1-SNO,
              SNAME LIKE ZSAMP1-SNAME,
           END OF IT_ZSAMP1.
    DATA : INT_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.
    DATA : INT_CONTROL_RECORD LIKE EDIDC.
    DATA : INT_COMM_IDOC LIKE EDIDC OCCURS 0 WITH HEADER LINE.
    *3.     Select the data from corresponding tables into internal table for a defined condition.
    SELECT SINGLE SNO SNAME FROM ZSAMP1 INTO CORRESPONDING FIELDS OF IT_ZSAMP1 WHERE SNO = P_SNO.
    *4.     create control record into internal table.
    INT_CONTROL_RECORD-MESTYP = P_MESTYP.
    INT_CONTROL_RECORD-IDOCTP = C_IDOCTP.
    INT_CONTROL_RECORD-RCVPRT = 'LS'.
    INT_CONTROL_RECORD-RCVPRN = P_LOGSYS.
    *5.     create data record into internal table.
    INT_EDIDD-SEGNAM =   C_SEGMENT.
    INT_EDIDD-SDATA =    IT_ZSAMP1.
    APPEND INT_EDIDD.
    *6.     Process ALE Service Layer using the function module  MASTER_IDOC_DISTRIBUTE.
    It returns the corresponding IDoc No.s.
    CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
      EXPORTING
        master_idoc_control                  = INT_CONTROL_RECORD
      tables
        communication_idoc_control           = INT_COMM_IDOC
        master_idoc_data                     = INT_EDIDD
    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.
    ENDIF.
    *7.     Display Communication IDocs.
    LOOP AT INT_COMM_IDOC.
      WRITE : / 'Communication IDoc No. is : ', INT_COMM_IDOC-DOCNUM.
    ENDLOOP.
    *8.     Commit Work.
    COMMIT WORK.
    IN INBOUND SIDE :
    FUNCTION ZL_IDOC_INPUT_MATMAS_MDM.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
    *"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
    *"  EXPORTING
    *"     VALUE(WORKFLOW_RESULT) LIKE  BDWF_PARAM-RESULT
    *"     VALUE(APPLICATION_VARIABLE) LIKE  BDWF_PARAM-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
    *"      OTHER_EXC
    *1.     Call workflow include program MBDCONWF.
    INCLUDE MBDCONWF.
    *2.     Create Data Objects for segment(s) and DB Table.
    TABLES : ZSAMP1.
    DATA : FS_SHDR_DATA LIKE ZSEG1.
    DATA : FS_APP_SDET LIKE ZSAMP1.
    *3.     Raise the exception if the message type is not ZMSG1.
    IF IDOC_CONTRL-MESTYP NE 'ZMSG1'.
      RAISE WRONG_FUNCTION_CALLED.
      CLEAR FS_APP_SDET.
    ENDIF.
    *4.     Process Each segment in the IDoc.
    LOOP AT IDOC_CONTRL.
      LOOP AT IDOC_DATA WHERE DOCNUM EQ IDOC_CONTRL-DOCNUM.
        CASE IDOC_DATA-SEGNAM.
          WHEN 'ZSEG1'.
            FS_SHDR_DATA = IDOC_DATA-SDATA.
           MOVE-CORRESPONDING FS_SHDR_DATA TO FS_APP_SDET.
             FS_APP_SDET-mandt = '000'.
             FS_APP_SDET-sno = FS_SHDR_DATA-zsno.
             FS_APP_SDET-sname = FS_SHDR_DATA-zsname.
        ENDCASE.
      ENDLOOP.
    5.     If the data already exists update the data or else insert the data.
      SELECT SINGLE * FROM ZSAMP1 WHERE SNO EQ FS_APP_SDET-SNO.
        IF SY-SUBRC NE 0.
          INSERT INTO ZSAMP1 VALUES FS_APP_SDET.
          ELSE.
            UPDATE ZSAMP1 FROM FS_APP_SDET.
        ENDIF.
    *6.     If the data successfully posted maintain status as 53 or if unsuccessful give status as 51.
        IF SY-SUBRC EQ 0 .
         POPULATE RETURN VARIABLES FOR SUCCESS.
            RETURN_VARIABLES-WF_PARAM      = 'PROCESSED_IDOCS'.
            RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
            APPEND RETURN_VARIABLES.
         ADD STATUS RECORD INDICATES SUCCESS.
            IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
            IDOC_STATUS-STATUS = '53'.
            IDOC_STATUS-MSGTY  = 'I'.
            IDOC_STATUS-MSGID  = 'ZM'.
            IDOC_STATUS-MSGNO  = '006'.
            IDOC_STATUS-MSGV1  = FS_APP_SDET-SNO.
            APPEND IDOC_STATUS.
            ELSE.
           POPULATE RETURN VARIABLES FOR ERROR.
              RETURN_VARIABLES-WF_PARAM      = 'ERROR_IDOCS'.
              RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
              APPEND RETURN_VARIABLES.
           ADD STATUS RECORD INDICATES ERROR.
              IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
              IDOC_STATUS-STATUS = '51'.
              IDOC_STATUS-MSGTY  = 'E'.
              IDOC_STATUS-MSGID  = 'ZM'.
              IDOC_STATUS-MSGNO  = '007'.
              IDOC_STATUS-MSGV1  = FS_APP_SDET-SNO.
              APPEND IDOC_STATUS.
       ENDIF.
    ENDLOOP.
    ENDFUNCTION.
    These are sample code for custom idoc...i did this for customized tables..change this according to your requirement.
    Reward if it useful..
    Lakshmi.
    Edited by: lakshmi matti on May 26, 2008 11:05 AM

  • 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

  • Assigning filter criteria for custom message type.

    Hi everyone,
    In our requirement i have created a custom message type ZDEBMAS like debmas. now while creating a distribution model with this message type, i need to create a filter for this.
    only IDOCs of customers with Account group 0001, 0002 and 0012 has to be triggered. I'm able to create the filter with message type DEBMAS, but while i'm using message type ZDEBMAS i'm unable to create any filter. Can any help me in this.
    thanks in advance,
    Rajni

    Hi!
    Do you create filter with BD95 and  allocation with BD59 transactions?

  • I need to set up an expense form so that our consultant can "filter" by customer type, program type, and finally the purpose of the trip. For instance: the customer types are churches, schools, organizations. The program type would be fund raising, gift p

    I need to set up an expense form so that our consultant can "filter" by customer type, program type, and finally the purpose of the trip. For instance: the customer types are churches, schools, organizations. The program type would be dependent on the customer type selection from the first list. Some examples would be: fund raising, gift planning, surveys, and others. The purpose of the trip would be dependent on the program type selected from the second list. Some examples of trip purposes would be: presentation, design, prospecting. Further, the purpose of trip selection from the third drop-down box would then have to determine the values of other fields by expense type: such as commission, airfare, hotel. etc. I've tried pop-up menu but can't figure out how to "select" from the final popup list and have it populate a field for the purpose of the trip. I've tried to look at the JavaScript examples for dependent drop-down boxes, but can't find any that quite fit what I'm trying to accomplish. I am very new to all of this. No training in writing Javascripts - just trying to wing it. The form has to be very simple for our consultants to use, but also give our office the detail we need to process through the correct account numbers. I would appreciate any detailed step-by-step instructions - kind of a javascript for dummies type of info. HELP!

    An AcroForm is the name given to the type of PDF form that you create in Acrobat. An XFA form is the type of form that you create in LiveCycle Designer. Although they are both PDF files, they are very different structurally and have significant;y different scripting models. So pay attention to the information on AcroForms and ignore anything about XFA. Be sure to get the sample PDF forms so you can look at how it works and where the scripts are placed.
    What you want to do will require scripting, and if you don't have the experience and are unable to use the information in the tutorials to create what you want, you might consider getting someone who has experience do this for you. I'll often suggest code if I can do so quickly, but what you want requires more than a few minutes.

  • Creation of Custom IDoc with Message control for sales Order

    Hi all,
    I am trying to create custom Outbound IDoc with message control.
    I wrote the code in a function module and i want to register that function module. (as in inbound registration of function module as in BD51).I am not knowing if that registration is necessary for outbound Idoc, if so in which transacition?
    Please list me the steps to create a custom IDoc for Message control.
    Thanks in advance,
    Regards,
    John.

    Hi,
    You need to use FM : MASTER_IDOC_DISTRIBUTE to create outbound idoc.fill the data in the tables EDIDC,EDIDD and generate the IDOC.
    check this link:
    Re: Master_IDoc_Distribute
    and use transaction : WEDI for IDOC configurations.
    here you will have all the transactions(step by step) to set the outbound IDOC configurations.
    Regards
    Appana

Maybe you are looking for