Delete Outbound Idoc Segment based on target system

Hello Folks,
Problem:
I have extended the sub structure of an idoc for IT0002 with custom field,
E1P0002
     Q1P0002
          Z1P0002
Where Z1P0002 has custom fields.
When the destination system is 'ABCD' - system should allow the idoc
else
When destination is other than 'ABCD' - Z1P0002 segment should be deleted and idoc should be sent.
How can this be achieved, any sample code.

Use user-exits .
if edidc-RCVPRN eq 'ABCD'
process data .
else
call FM segment_delete ( use ur parameters )
endif.
Edited by: anil sasidharan on Feb 18, 2009 12:40 PM
Edited by: anil sasidharan on Feb 18, 2009 12:46 PM
Edited by: anil sasidharan on Feb 18, 2009 12:48 PM

Similar Messages

  • Delete Outbound Idoc Segment based on taget system

    Hello Folks,
    Problem:
    I have extended the sub structure of an idoc for IT0002 with custom field,
    E1P0002
         Q1P0002
              Z1P0002
    Where Z1P0002 has custom fields.
    When the destination system is 'ABCD' - system should allow the idoc
    else
    When destination is other than 'ABCD' - Z1P0002 segment should be deleted and idoc should be sent.
    How can this be achieved, any sample code.

    Hi,
        Make use of Segment level filtering in distribution medel (BD64).
    Thanks,
    Asit Purbey

  • Delete Outbound Idoc Segment

    Hello Folks,
    Problem:
    I have extended the sub structure of an idoc for IT0002 with custom field,
    E1P0002
         Q1P0002
              Z1P0002
    Where Z1P0002 has custom fields.
    When the destination system is 'ABCD' - system should allow the idoc
    else
    When destination is other than 'ABCD' - Z1P0002 segment should be deleted and idoc should be sent.
    How can this be achieved, any sample code.

    Hi,
        Make use of Segment level filtering in distribution medel (BD64).
    Thanks,
    Asit Purbey

  • Outbound Idoc Segment Creation via BD52 trigger

    hi all,
    i am new to Idocs so please forgive me if i am missing the obvious.   i am using standard the material master Idoc type MATMAS05 to transmit any material master changes to an existing legacy system.   i set up some fields in BD52 to trigger an Idoc when they are changed.   the problem is when i change a field in the MARC segment (ie: MARC-PRCTR - Profic Center) 3 segments are generated (E1MARAM, E1MAKTM, EIMARCM), but when i change something in the MARA segment (ie: MARA-PRDHA - Product Hierarchy) only E1MARAM and E1MAKTM are sent.  
    the receiver is set up for all three Idoc segments so when only 2 are sent it errors out.   how can i force all 3 segments to send every time?
    many thanks.
    James Hinkin

    Hi, I think you must be running the program RBDMIDOC to send an IDoc based on the change pointers.
    SAP has designed such a way that it will create IDocs only with changed data. In other words, E1MARAM is always populated as it is header data. Its obvious that you dont want to send the data that is not changed. Hence if you are changing Product hierarchy, only relevent segments are populated with values.
    If you still want to send all the data irrespective of whether those fields are changed or not, either you may have to code in a user-exit to populate these fields(segments) or, change the program accordingly.
    Hope this helps you and let me know if you need further help
    Vamsi

  • ** File to IDoc scenario - IDoc not created in target system

    Hi friends,
    We are doing File to IDoc scenario. We made required setting in both application as well as XI system. While test the scenario, the file is picked up and successfully processed in SXMB_MONI, but the inbound IDoc is not created in target system. What could be the problem?
    We are using DEBMAS message type DEBMAS06 IDoc type. We checked the following.
    1) SM59 - Connections are OK both application and XI system
    2) IDX1 - In XI System, we have assigned SAP<R/3> port.
    3) IDX2 - IDoc is imported.
    4) In ID - Sender File - Business Service - Adapter-Specific Identifier - Logical System name is given.
    5) In application system. - Partner Profile maintained correctly.
    6) SM58 - There is no error.
    So, what could be the reason ?
    Kindly reply, friends,
    Thanking you.
    Kind Regards,
    Jeg P.

    Hi,
    Check all the steps ..
    File to IDOC
    Do these configurations in R/3 and in XI...
    SAP XI
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (IDX1)
    a) Select create new button
    b) Enter the port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Load Meta Data for IDOC (IDX2)
    a) Create new
    b) IDOC Message Type
    c) Enter port created in IDX1.
    SAP R/3
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (We21)
    a) First Select Transactional RFC and then click create button
    b) Enter the destination port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Create Partner Profile (WE20)
    a) Create New
    b) Create the Partner no. name as same the logical system name of the destination system.
    c) Select Partner type LS
    d) Enter details for Type: US/USER, Agent, and Lang.
    e) Click on the + button to select the message type.
    f) Select Partner no. and LS which ever create above.
    g) Select Message type
    h) Select Process code related to the Message type.
    I) save.
    Thanks,
    Satya

  • Deletion of Idoc Segments

    Hello everyone,
    I would just like to ask on how to delete a specific segment of an Idoc aside from using transaction WE19. I would like to preserve the Idoc that's why I'm looking for another transaction that can be able to perform the deletion.
    Thanks in advance!

    in WE19 you cannot modify an existing IDOC.
    you can open an existing IDOC, but with any change SAP creates a new IDOC which has the current values, the old IDOC is then still as it was before.
    Try it, if you back out after saving your changes,  then you see the new IDOC number in WE19 initial screen

  • Data elements for IDoc Segments to non-SAP system

    Hi,
    I need to create IDocs for transferring data to non-SAP system. When I create segmet fields should I create new data elements for all the fields with attributes specific to receiving system? Because there are many fields where the field attributes of SAP system do not match the corresponding fields of receiving non-SAP system.
    Thanks in advance!!
    Regards,
    Sriram

    Hi Sriram,
    When I create segmet fields should I create new data elements for all the fields with attributes specific to receiving system
    Is it custom  segments .
    Regards,
    Madhu.

  • To delete the IDOC Segment in the Inbound i.e.Item Data

    Hi All,
    Idoc is received for orders05 as inbound.
    The IDoc Data contains two levels of item data
    i.e. Segment E1EDP01 - In this we Pass only the quantity.
          in the Sub Segment of item E1EDP19 - Customer Material in the segment IDTNR with qualifier 002.
    The same segment is repeated again but the customer material is different.
    Now need to check the material, if it is different, i need to delete the entire second item segment and put the customer material in the Segment E1EDP19 which has empty field.
    His there any Function Module or so to delete the incoming data of the idoc through inbound?.
    Could you please let me know if there any way to do the same.
    Thank you.
    Regards,
    Dinesh.

    yes here you can access only one segment, if you don't control that here, then the information will be populated to xvbap. or else you can even try to implement the error handling exit EXIT_SAPLVEDA_008 /EXIT_SAPLVEDA_011
    already item information will be populated to xvbap  table . so try to delete the item from xvbap also

  • Filter Idoc segment based on date in XSLT map

    Hi,
    In a Idoc to flat file XSLT mapping, I have a requirment to filter segment out of multiple segment occurance in HRMD_A idoc. Idoc has two date fields(actually string data, containing date in YYYYMMDD format) in the segment(end date and start date). I need to filter only one segment from multiple segments where current date falles within start and end dates (end date >= current date >= start date). Then map output fields from the filtered segment.
    Its easy doing it in graphical mapping, but its difficult to use graphical mapping here as the message structure are enormous. I dont have much hands on in XSLT but think many of you have been through this kind of requirement using XSLT. So holding my hope high :). Please suggest a logic for this, will be highly appretiated.
    Regards
    Suman.

    This functions will give you the current date:
    fn:current-dateTime()     => Returns the current dateTime (with timezone)
    fn:current-date()                 => Returns the current date (with timezone)
    fn:current-time()                 => Returns the current time (with timezone)
    To compare:
    fn:compare(comp1,comp2)
    fn:compare(comp1,comp2,collation)
    => Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 is greater than comp2 (according to the rules of the collation that is used)
    Example: compare('ghi', 'ghi')
    Result: 0
    Also I suggest working with an IF condition like this:
    <xsl:if test="price &gt; 10">
            <tr>
              <td><xsl:value-of select="title"/></td>
              <td><xsl:value-of select="artist"/></td>
            </tr>
          </xsl:if>
    Edited by: Kai Lerch-Baier on Apr 14, 2009 10:21 AM

  • Deleting an idoc segment in memory

    I am using the user-exit EXIT_SAPLEINM_011 to delete a segment for materials that I do not want to send to the interface. The material is in the E1EDP19 segment. I search for all E1EDP19 segment where material is stored and get the PSGNUM for each materials that needs to be deleted and store the PSGNUM in a table (LT_PSGNUM). Then I loop throught the PSGNUM table to read each PSGNUM and delete all entries in the internal table EDIDD where PSGNUM matched PSGNUM and SEGNUM so that I can delete parent and children. The problem is somehow it deletes more than what I intend to delete. I have total 28 segments and if deleted cofrrectly I should get only 23 segments instead I get only 4 segments.
    Any help is appreciated and thanks in advance.
    - Vijay

    loop at t_edidd into ls_edidd.
        IF ls_edidd-SEGNAM = 'E1EDP19' and ls_edidd-sdata+0(3) = '001'.
          lv_tabix   = sy-tabix.
          lv_psgnum = ls_edidd-psgnum.
          lv_e1edp19 = ls_edidd-sdata.
          ls_matnr-matnr = lv_e1edp19-idtnr.
    *--- Select the maximo relevant material from MARA
          SELECT SINGLE matnr zzmaximo_relvnt INTO ls_matnr FROM mara
            WHERE matnr = ls_matnr-matnr
            and   ( zzmaximo_relvnt = c_mxtrk  OR
                     zzmaximo_relvnt = c_mxvw ).
          if sy-subrc ne 0.
            append lv_psgnum to lt_psgnum.
          endif.
        endif.
      endloop.
      loop at lt_psgnum into lv_psgnum.
        loop at t_edidd into ls_edidd where segnum = lv_psgnum or psgnum = lv_psgnum.
          lv_tabix = sy-index.
          delete t_edidd index lv_tabix.
        endloop.
      endloop.

  • Delete idoc segments

    Hi all,
    I need to delete the idoc segments for some condition based on the table KNVV value. It is basic type is DEBMAS05.
    I have used a wrapper FM ZIDOC_INPUT_DEBITOR as i could not find a user exit in IDOC_INPUT_DEBITOR.
    In test run we19, in debuggin i see the incorrect records/segments are getting deleted from IDOC_DATA which is the way i have coded. However when i see the generated idoc number i can see all the segments and the incorrect segments are not getting deleted. Let me know how to delete idoc segments through code.
    Note : I have tried in BD59 to reduce the idoc segment, but the condition for our requirnment cannot be possible in BD59.
      LOOP AT idoc_data.
        CASE idoc_data-segnam.
          WHEN 'E1KNA1M'.
            gwa_deb_hdr = idoc_data-sdata.
          WHEN 'E1KNVVM'.
            gwa_deb_sale = idoc_data-sdata.
          WHEN 'E1KNMB1'.
            gwa_deb_comp = idoc_data-sdata.
           APPEND gwa_aex_item TO gt_aex_item.
        ENDCASE.
       IF gwa_deb_hdr+0(3) = '004'.
          IF sy-tabix > 1.
        SELECT SINGLE kunnr vkorg vtweg INTO (lv_kunnr, lv_vkorg, lv_vtweg)
                FROM knvv
                WHERE kunnr = gwa_deb_hdr+3(10)
                   AND vkorg = gwa_deb_sale+3(4)
                   AND vtweg = gwa_deb_sale+6(2).
            IF sy-subrc NE 0.
              DELETE idoc_data INDEX sy-tabix.
            ENDIF.
          ENDIF.
       ENDIF.
      ENDLOOP
    Thanks,
    Senthil

    Just want to know.
    If the standard idoc segmets cannot be deleted through code or this doesnot work as i ran in test run we19?

  • IDOC to and from eternal system

    Hi All,
    I've following scenario:
    Sender SAP R/3 system is sendind IDOC of type say A to XI system, XI system is mapping IDOC of type A to say IDOC B, then finally XI is sending IDOC B to receiver SAP R/3 system [External system}
    Note: Reverse scenario is also there in which we are receiving IDoc from external r/3 system and mapping it to different IDOC in XI then sending to SAP System.
    Development done so far:
    ID:
    I've imported IDOC A in XI. SInce I didn't had authoriztion to import IDOC B from target so I asked client to provide XSD od IDOC B.
    I created one inbound message interface using IDOC B XSD and also completed the mapping part using same XSD.
    IR:
    I've created one IDOC receiver communcation channel for external system. I completed the configuration
    ALE:
    I've created on RFC destination of type 3 to connect external SAP system. I created port in IDX1 for IDOC communcaition.
    Problem:
    When I am sending IDoc to exxternal sap system then message is getting failed in moni. IDoc adapter is not accepting the message interface creted based on IDoc XSD.
    I believe  I need to import IDoc meta data from target system for IDOC B. since in XI i didn't imported IDOC instead I used IDO XSD.
    it may be the reason.
    Please help me to solve the problem

    HI Experts,
    I am doing testing of my scenario.
    As I've described the scenario in my last post. I am sending a IDoc A from my sender system and traslating it to IDoc B in XI, then sending it to the external SAP system (SAP 4.6). Basically IDOC XI IDC scenario but with the slightly change of converting one idoc to other.
    During test:
    I received following error:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="IDOC_ADAPTER">ATTRIBUTE_IDOC_METADATA</SAP:Code>
      <SAP:P1>I::000</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error: I::000</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Trace:
    <Trace level="1" type="T">Parse XML-BODY</Trace>
      <Trace level="1" type="T">Get the Metadata for port SAPLSD</Trace>
      </Trace>
      </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST" />
      <Trace level="1" type="System_Error">Error exception return from pipeline processing!</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST" />
    I've created one idoc port in XI named 'SAPLSD' inside I've used RFC destination to the target system. During runtime metadata is not loaded in IDX2.
    When I tried importing metadata manually, i received the following error
    "No RFC destination is maintained for the port"
    is there any particular naming i should use for idx port and for rfc destination??
    what could be the problem?? ....
    Q. is it because of the RFC destination is not OK or
    Q. the I do not have proper authoirsation to import metadata from LES system or
    Q. Since target system is SAP 4.6 system.... is it could be the problem? [Unicode]
    Please suggest

  • Generate multiple Idoc segments

    Hi all,
    I have a Flat file to Idoc Scenario.
    I need to generate no. of multiple Idoc Segments based on the source field value.
    For Eg: if Field1 starts with 5 or 6 then E1 segment should be created 5 times,
    similarly if Field1 starts with 4 then E1 segment is created 6 times
    And as many times E1 is created that many times the corresponding other E2,E3 segments are created
    i.e E2 E3 has 1-1 relationship with E1
    Can this be done graphically ?
    Working on PI 7.0 Environment
    I would appreciate your Inputs.
    Regards,
    Varun
    Edited by: Varun Reddy on Oct 5, 2010 8:21 AM

    Im pretty sure that if you duplicate the target segment the max number of times (6) but you only map to 4 of them, only 4 will be created in the target structure. Let the Mapping/Data drive how many segments actually get created in your target structure.
    I could be wrong but Im pretty sure thats how Ive handled repeating segments before.

  • FM for Outbound Idoc

    Hi ..
    Actually we are looking for the function module for the Outbound Idoc segment - BOMMAT in Bill of material . we need to know which is the correct FM to be used.Please help me with this.

    Hi,
    Check if you can use FM- MASTER_IDOC_CREATE_BOMMAT.
    Regards,
    Anup

  • How to send Outbound IDocs through an RFC-enabled FM

    Good day to all;
    A partner system (AS/400) wants to use a Java Connection to execute a RFC Function Module, in SAP, that will then return a collection of IDocs.
    Currently, the Function Module builds the IDocs, but I'm not exactly sure how to simply send those IDocs back to the AS/400.
    If anyone can help in this regard, that would be great.
    My current thoughts are to use Master_IDoc_Distribute, but then I imagine that requires a port configuration for the AS/400.  And if this is the case, does that mean that SAP will send the IDocs back itself instead of using the RFC interface?

    Hi Tavares,
    If you want to send outbound IDoc to AS/400 (external system), you need to setup file port (t/code WE21).
    For RFC interface, you need to setup RFC file port with RFC Destination (t/code SM59). In this case, SAP will send IDoc (individually or batch) to receiver system (AS/400). Perhaps you need a middleware for data transformation, if AS/400 does not perform data mapping for outbound IDoc. 
    For FTP interface, you need to setup flat/XML file port for outbound. then you can FTP the file to AS/400 later on.
    In addition to file port configuration, you also need to setup partner profile for outbound parameter (t/code WE20) and the distribution model (t/code BD64).
    Hope this will help.
    Regards,
    Ferry Lianto

Maybe you are looking for

  • How do I straighten out my account?

    We upgraded my wife's phone to a new iPhone, but when we got it and I tried to activate it I ran into issues - the phone (which was connected to our internet router) kept telling me it couldn't connect to the server and I should call the activation p

  • Should i buy it or not ?

    i was keen to order a copy of aperture, but after reading through a few of the messages in this discussion its got me worried to say the least ! It seems as if there are people talking a bout its bad points more than its good but that could be becaus

  • Tomcat Can't Find Bean

    Hello- I am trying to use JSP to call a bean and it keeps telling me that it could not compile because... "Class org.apache.jsp.DataBaseSelect not found." All my files are located in the webapps/ROOT under my own directory called "project". DataBaseS

  • Watching movies

    I have transferred my own DVDs to mp4 format to play on my ipad2. I put them on a memory stick to save the moment in the iPad. I bought a camera connection kit/USB kit but I can't get the movies to register - is this possible to do or do I have to pu

  • Group leftreport

    Hi, I have to display a very big report. I have increased size of the report by setting main section width and height. But, one small pbm. for eg, if i have 10 columns [group left report] / horizontal elasticity is fixed and vertical is variable for