SRM - R3 item position mapping

Hi all experts,
the question is quite tricky; basically I have a report that, given a Purchase Order Number, must get the PO from SRM AND from the backend and do a comparison at item granularity.
From the SRM side, the task is quite simple; I can use the BBP_PD_PO_GETDETAIL FM to retrieve all the data I need about the PO.
The problem is: how to get a mapping (R3 <---> SRM)  for every single item position ?
Thanks in advance

Hi Federico,
well the question is quite complex, in the sense that you must take into account eventual customizations that are strictly related to you SAP installation.
Anyway... in my case: a PO have a "quite" standard header, so I assume I can skip the mapping process for this item; I just considered that only the PO number is sufficient to retrieve the order from both backend and SRM.
How: in SRM --> BBP_PD_PO_GETDETAIL.
In R3 --> BAPI_PO_GETDETAIL.
My question was about items mapping so here's the solution I found... First of all; in my R3 and SRM system I can have 3 kind of items, say:
- material items;
- service items, that can be organized in hierarchies, so:
  - a father in a hierarchy;
  - a son in the hierarchy.
I did as follows; I simply translated the R3 PO into SRM-like data structure, in order to work on the same fields. Then I simply proceeded with some mapping rule that, I must remember, are valid in my system, it's not an absolute mapping that works anywhere. In particular: my SRM system is really old and doesn't support natively service hierarchies, so that it has been implemented in a "custom" way. Anyway...
Looping of the SRM_item table:
How to see it's a material item? Field PRODUCT_TYPE is set to '01'.
How to find the related R3 item? READ TABLE R3_item with key: PRODUCT_TYPE = '01' and SRM_item-EXT_DEM_SUBPOSID = R3_item-ZZXNUMBER.
(here ZZXNUMBER is a custom field; in my system it represents the ordering number of the item in the purchase order... It's related anyway to the kind of item we're considering).
Quite the same thing for a father in a service hierarchy:
How to see it's a service item (father)? Field PRODUCT_TYPE is set to '02' and ITM_TYPE = 'HIER'.
How to find the related R3 item? READ TABLE R3_item with key: PRODUCT_TYPE = '02' and SRM_item-ITM_TYPE = 'HIER'  and EXT_DEM_SUBPOSID = R3_item-ZZXNUMBER.
(here ZZXNUMBER is a custom field; in my system it represents the ordering number of the item in the purchase order... It's related anyway to the kind of item we're considering).
Quite complex mapping for a child in a service hierarchy... A child in my SRM system can be seen as an item which has PRODUCT-TYPE = '02' and ITM_TYPE = BLANK. There's however any way to map it directly to the corrispective R3 item... Moreover, my specs tell that not all the SRM items in a PO MUST be present in the corrispective R3 PO... this is indeed, a report to allineate both sys.
This is a schema in pseudo-code:
- if the SRM_item considered is a child...
- find the father of the hierarchy in which the SRM_item is involved;
- find the corrispective element in R3_item set;
- go for an exact mapping using the mapping-between-position based on the fields ZZXNUMBER.
Well, I know it is quite complex, also because of the fact these systems are really customized. Maybe the code that follows can help you understanding what I've done.
Bye,
Matteo
LOOP AT srm_item INTO wa_srm_item.
    CLEAR wa_rowmap. " maptable that keeps index from the SRM_item and corrisp. ITM_item
    wa_rowmap-index_SRM = sy-tabix.
* consider item position type
    IF wa_srm_item-PRODUCT_TYPE EQ '01'.
* case 1: material
      READ TABLE r3_item INTO wa_r3_item WITH KEY PRODUCT_TYPE = '01' zzxnum = wa_srm_item-ext_dem_subposid.
      if sy-subrc = 0.
        wa_rowmap-index_R3 = sy-tabix.
      else. "if no pos. is found, it isn't present in R3 -> must be cancelled in SRM
        wa_rowmap-index_R3 = SPACE.
      endif.
    ELSEIF wa_srm_item-PRODUCT_TYPE EQ '02' AND wa_srm_item-ITM_TYPE EQ 'HIER'.
* case 2: father in a service hierarchy
      READ TABLE r3_item INTO wa_r3_item WITH KEY PRODUCT_TYPE = '02' zzxnum = wa_srm_item-ext_dem_subposid.
      if sy-subrc = 0.
        wa_rowmap-index_R3 = sy-tabix.
      else. "if no pos. is found, it isn't present in R3 -> must be cancelled in SRM
        wa_rowmap-index_R3 = SPACE.
      endif.
    ELSEIF wa_srm_item-PRODUCT_TYPE EQ '02' AND wa_srm_item-ITM_TYPE EQ SPACE.
* case 3: son in a service hierarchy
*   look for the father in SRM
      READ TABLE srm_item INTO wa_srm_father WITH KEY NUMBER_INT = wa_srm_item-ZZXHIER ITM_TYPE = 'HIER'. "child refers to the corrisp. father thru the number_int field
*   look for the father in R3
      READ TABLE r3_item INTO wa_r3_father WITH KEY PRODUCT_TYPE = '02' ITM_TYPE = 'HIER' ZZXNUM = wa_srm_father-ext_dem_subposid.
      if sy-subrc <> 0. "father's not on R3 anymore -> the son will not be on R3 too
        wa_rowmap-index_R3 = SPACE.
      else.
*   go for the service item thru the father.
        READ TABLE r3_item INTO wa_r3_item WITH KEY ZZXHPOS = wa_r3_father-NUMBER_INT ZZXNUM = wa_srm_item-ZZXNUM.
        if sy-subrc = 0.
          wa_rowmap-index_R3 = sy-tabix.
        else. "the service item is not on R3 anymore
          wa_rowmap-index_R3 = SPACE.
        endif.
      ENDIF.
    ENDIF.
    APPEND wa_rowmap TO tbl_SRMmapR3.
  ENDLOOP.

Similar Messages

  • Add field to item position overview of Purchase Order

    Dear SRM gurus,
    I'm working on a change request of a customer.
    They want to add a field to the item overview position of Purchase Orders.
    They are using SRM 4.0 in Extended Classic Scenario.
    When displaying the list of Purchase Orders only the headers are shown. When clicking on a header the item positions are shown below the header. In this item overview the customer wants a field to be added.
    The field to be added is the GL Account. The customer wants this field to be visible before opening the item of the Purchase Order.
    We already know which screen should be changed to display the field.
    The screen is SAPLBBP_PO_UI_ITS and screen number 4000.
    Is it possible to add fields to this screen?
    If it is possible, how can this be done?
    Thank you in advance for your support,
    Best regards,
    Jean-Pierre

    Is there a solution yet?
    At my company they also want  to add a column to block Items in Shopping Cart.
    The structures mentioned in the note are all in the item details but not in the overview.
    regards,
    Wim

  • How to add a new item-position to salesorder in dialog

    Dear all,
    i have a request to add a new item position to an existing sales order in dialog. The information I have are material number and quanity. After adding these infos the system should work like the user has added the line manually (Entered MatNr and Quantity and pressed Enter). All error messages and checks and rereading data should be processed. Any idea how to do this?
    Every help is welcome.
    Best regards
    Roman

    Maybe not exactly. The user jumps from an "extension" button to a dialog where he can select materials an quantity´s these should be added as new positions to the order.
    BR
    Roman

  • Adding item positions with reference to contract in sales order

    Hi all,
    I would be very grateful if some of you could help on this:
    I have a requirement to add lines with reference to a contract while the user is creating or modificating it via VA01 or VA02. The logic flow will be as follows:
    if the user enters a new item position with reference to a contract, and the qty entered exceeds the qty in the position selected of the contract, we have to skip the standard error message and try to spli the quantities in several positions with the same material in the contract.
    As an example:
    the contract 000000000001 has 5 lines:
    line     material       qty
    01       mat1           100
    02       mat1           50
    03       mat1           50
    04       mat2           n/a
    05       mat2           n/a
    if the user picks up the line 02 of the contract to create a new line in the sales order, and enters 180 as qty, the sap standard will raise an error, saying the qty has exceeded the contract qty. Ok, we have to skip that error (maybe could we set it as a warning??) and 'split' the qty as follows:
    in the sales orders, 3 lines will be created automatically
    line    material     qty
         mat1         100
         mat1         50
         mat1         30
    and of course, the released quantities in the contract must be updated: i.e the contract should be as follows:
    line     material       available qty
    01       mat1           0
    02       mat1           0
    03       mat1           20
    Any ideas? : )
    What i've done by the moment is to check is that 'split' is possible, in userexit_save_document. If not (e.g. if the user enters 220 for mat1 in the previous example), a custom error will appear. If it is possible, then the sales order will be created (only with the line the uswer entered) and I will trigger somehow a FM processed in background to modify the sales order.
    my question now is: how can i add lines to the created sales order, making reference to some contract lines?
    I've seen BAPI BAPI_SALESORDER_CREATEFROMDAT2 is used to create a document with reference, but can i use it to MODIFY an existing sales order?
    any help would be greatly appreciated.
    thanks a lot for your help.
    regards.

    Hello,
    there's a function module called 'BAPI_SALESORDER_CHANGE', which could change a sales order. The problem could be,that these BAPI's enque the salesorder. So if you start them in background via an userexit, you have to be sure that the salesorder is updated and dequeued by posting.
    An other way could be to use the exit 'userexit_check_vbap' in MV45AFZB. It's called after creating a new position or changing a position. All existing positions at that time in a internal table 'XVBAP', which you could change. (But be carefull, that you don't create an endless loop !).  
    The check about the contract quantity is in a form routine called 'vbep-wmeng_pruefen_folgebeleg(sapfv45e)'.
    Have a look into the form 'vbap_pruefen_ende' in FV45PFAP_VBAP_PRUEFEN_ENDE. There's the whole thing done including the call of the userexit.
    Regards Wolfgang

  • MIRO cannot changing amounts at item position.

    Hi,
    I'm trying to change amount in MIRO at item level.
    System allows this only for the first item position. The second position has the amount in grey so that
    I cannot perform the change of amounts at item level.
    Before a similar problem happened to tax code.
    Help
    Best regards

    pls take a look that while doing miro at extreme right position there is a term LAYOUT just opposite to where u input the PO/Scheduling aggrement.
    there at LAYOUT choose ALL INFORMATION.
    regards,
    indranil

  • MIRO trx adding item position

    Hi,
    how adding in MIRO an item position for unplanned costs?
    I woul like giving to users the possibility to post the above costs
    in <b>two ways simultaneously</b>:
    -Unplanned delivery costs are distributed among the invoice items;
    -Unplanned delivery costs are posted to a separate general ledger.
    Is this possible or not? If not, is possible doing that with a specific FI trx?
    Best regards

    Hey,
    Sorry about the delayed reply. I had trouble accessing my r/3 systems.
    First understand the "Other Unplanned Expenses" and "Unplanned Delivery Costs" are two different things treated differently by LIV. The only thing you CANNOT do simultaneously is the distribution of "Unplanned Delivery Costs" to invoice item (PO ref tab) and to Seperate G/L account. But you can post other costs simultaneously with PO line items in PO ref tab. Simulate the posting and make sure Debit/Credit Balance is ZERO.
    In IMG, you can set this at "Configure How Unplanned Delivery Costs Are Posted" activity under LIV-->Incoming Invoice (read the IMG documentation). This setting is Per CoCd.
    <u><b>For "Other Unplanned Expenses":</b></u>
    If you want to add additional invoice line you can add in the G/L tab. For example some misc expense to a cost center.
    <u><b>For "Unplanned Delivery Costs":</b></u>
    1.First enter the Unplanned Delivery Costs in the "Details" tab of the Invoice Header
    2. Maintain Account Determination (OBYC) for TE Key UPF (for Unplanned Delivery Costs). Find out from FI people what the G/L account they want affected in this case.
    Let me if this helped further.  

  • Item positioning

    Hi,
    how can I control item positioning? For example I would like to display html region in the middle of the screen and text area in this region above other items in the same region?
    Is there any possibility to control them with html?
    Thanks

    Hi Costas,
    i know this issue.
    the problem here is that usually the item moves when you have it on the "right" side on the form.
    the best is to place your added item on the left side of the form, than it will not move.
    thats the workaround iam doing ...
    or you catch the resize event and set the position again.
    regards
    David

  • Batch Input ME47 - Get Item position error

    I'm doing BDC to ME47 passing header and several positions in a RFC. The functional wants  the RFC inform which position
    caused the error. In the message table of the call transaction doesn't show any info of the position.
    I think it can't be done but any help will be appreciated.

    Hi,
    When you do the same steps manually you would be getting an error message. Are you able to interpret the item position number based on the error message ?
    If not, then it wont be possible to do so in the RFC as well. You may have to build some custom logic if you are able to intrepret it.
    Thanks,
    Best regards,
    Prashant

  • Which Item Position for screws

    Hi,
    I want to create a PO. I don't know which Item position for materials "screws" I must give.
    Thanks
    Dede

    Hi
    You need explain your question clearly.
    Please find this link, may be helpful
    http://help.sap.com/saphelp_47x200/helpdata/en/75/ee0d9b55c811d189900000e8322d00/content.htm
    regards
    Srinivas

  • Automatic PO creation - only for PRs based on catalog SRM/EBP items

    Dear Experts,
    i am facing the following question w.r.t. automatic PO creation:
    Is it possible to have automatic PO creation in R/3 only for those purchase requisition items, that are based on shopping cart/EBP/SRM items that are from a third party punch out catalog?
    The idea is, that the requisitioner on the SRM EBP side shops in a catalog. Once the the SC is approved and the purchase requisition is created in the R/3 system, automatically a PO should be created based on that PReq. This would save the time for the buyer, who do not need to pay attention to this document, because the purchase from the catalog guarantees the buyer, that the already pre-agreed conditions are getting applied.
    But PReqs that are based on Free Text shopping cart EBP items must not be taken into account for the automatic PO creation.
    Is there a way to distinguish between the catalog-based and the non-catalog based PReq positions?
    Thank you.

    Auto PO transaction ME59N comes with huge selection crieteria. If you can distinguish between catelog vs non catalog requisition then it very easy to set up variant to filter non catalog based requistion. you can also think about ehnacement of polulating text fields like Requisitioner or Requirement tracking number  with unque idetifier  in case of non catalog based PR then you can set variant to filter out those requistions..

  • SRM-MDM Catalog image mapping

    Dear All,
    I am trying to map image field but the field does not appears on the web dynpro user interface, can anyone advise me how to map image field in order to display the images in SRM.
    And I am using standard Repository SRM-MDM.
    Regards,
    Aklilu

    Hi Aklilu,
    Hope you have followed the following steps.
    You have created the mask containing Image field and mapped to the end user say User1.
    In the WebDynpro UI config logged in as UI Configuration Manager.
    Go to Customize Display tab
    Select Result set radio button
    Select the image filed and add to the display item.
    The problem would be you might have included Image field in the webdynpro and forgot to include the Image field in the Mask.
    The fact is that the display fields assigned to the user can be over ridden by the mask assigned to the user.
    Please check the fields in the Mask and field added using Webdynpro UI Config for the end user.
    Thanks,
    Arun Prabhu S

  • Not able to approve SRM PO items through UWL

    Hi All,
    We have an issue in approving SRM Purchase Order (PO) Items through Portal UWL.  We can approve SRM Contracts & Bid Invitations thru UWL, no issues with them. On click of the link to Contracts/Bid Invitations in the item detail section opens up a  separate window where it displays the item detail and action buttons to approve or reject it. However the same does not get displayed for PO items. If you click the PO link in the item detail section, it opens up a separate window but point to a blank ITS Page.
    Has anybody faced such problems with PO Items.
    Your help is appreciated.
    Thank you, John

    Hi John,
    I have got the same problem. Could you please let me know of how you resolved this problem. I would appreciate your help.
    Regards,
    Gopal.

  • Adding the line items in mapping

    Hi Experts,
    I got the structure like this.
    Item    (0 to unbounded)
        amount   (1 to 1).
    I am getting more than one amounts, I need to add all the amounts and map it to target field "sum".
    For this how can i do the mapping can anybody please help me.
    Kind Regards,
    Kumar

    hi
                     for Amount field ---(set the context to message type node)
                then Map directly amount field to sum (statistic functions)
                then connect the sum function to target field....
    hope this helpful....
    Message was edited by:
            sasitharan

  • Change wrong item positions in region

    Hello dear Apex-experts,
    within a report region I want to have three items for Search-Fields. This works, but these fields cannot be placed, where I want them to be displayed. While switching over into the wysiwyg-mode at "items" everything looks like I want it to be. but the "real" form doesn't display it correctly.
    This is the WYSIWYG-positioning:
    "Anzahl Zeilen:"[P5_ROWS] [P5_GO]
    "Suche:"
    [P5_TYP_SEARCH][P5_Kurzname][P5_Langname]
    within the Report:
    [P5_TYP_SEARCH][P5_Kurzname_SEARCH]
    [P5_Langname_SEARCH]
    "Anzahl Zeilen:"[P5_ROWS][P5_GO]
    "Suche:"
    that means the P5_..._SEARCH-Fields are to far above and there is a linefeed between them.
    Does somebody know this problem? And what is to be done to solve it?
    I tried a lot with "new line" and "new field". Nothing worked.
    Thank you,
    Hergen
    Message was edited by:
    Heeschen

    Hi Patrick, hi BoilerUP,
    I did not forget this post but had worser trouble in between.
    There is a trick that solved the problem:
    We "framed" the items that have been displayed in wrong order by two items that are of the type :"Display as: Stop and Start Html Table (Display label only)".
    e.g.:
    Sequence# 100: Px_START_SEARCH : Display as: Stop and Start Html Table (...)
    Sequence# 110, 120, 130, ... : the other text fields ordered with criterias New Line, new field as desired.
    Sequence # 200 Px_STOP_SEARCH : Display as: Stop and Start Html Table (...).
    With Sequence # <100 we have some other items that from now on do not disturb our ordering.
    If I find the time, I will try to create an example at apex.oracle.com.
    But not now.
    Thank you Patrick,
    Hope to help you BoilerUP.
    Kind regards,
    Hergen.

  • XI content for SRM and CCM scenario - mapping

    Hi All,
    We are using the standard business content for integrating SRM with CCM to update contract information from SRM to CCM. Both SRM and CCM are on the same system.
    The configuration scenario used is MasterDataInclusionInCatalogOnWAS700 which is in the name space SAP CATALOG CONT.MGMT. 2.0_700 , http://sap.com/xi/CCM/CAT.
    There are 2 interfaces being referred by this scenario: CatalogUpdateNotification_Out and this CatalogUpdateNotification_In and both the interfaces are pointing to the same meesage type CatalogTransmission but they are in different name spaces.
    Once the scenario was configured there was no interface mapping available in the standard business content to map the above 2 interfaces.
    SAP SRM SERVER 5.5
    CatalogUpdateNotification_Out
    CatalogTransmission
    http://sap.com/xi/EBP
    SAP CATALOG CONT.MGMT. 2.0_700 ,
    CatalogUpdateNotification_In
    CatalogTransmission
    http://sap.com/xi/CCM/CAT
    Is this the normal case and we need to develop our own mapping or is the standard content not imported correctly?
    The service pack details are as follows:
    PI 7.0 SP level 14
    XI content
    u2022 SAP BASIS 7.00 - SP 14
    u2022 SAP CATALOG CONT.MGMT. 2.0_700 - SP 12
    u2022 SAP SRM SERVER 5.5 - SP 11
    u2022 SAP ABA 7.00 - SP 14
    Thanks,
    Shravan

    ditto, anybody received a response from SAP with regards to this problem?
    As suggested above, we could build our own mapping in XI but this would obviously be a modification to SAP standard which we would prefer to avoid.
    Regards, Kyle.
    OK Received a response from SAP dated Oct. 9, 2008
    I assume that you have installed NW 7.00 SP14 (or higher).
    Within earlier versions the mapping from XML to ABAP was to lax.
    The XML message was processed witout regarding the name of the root
    element. This was fixed with SP14.
    When you call an interface the XML message must match with the type
    defined in the WSDL used for proxy generation.
    Either the message or the WSDL used to generate the proxy seems to be
    wrong here.
    Here is a work around should solve this problem until we make available in a standard note soon.
    I will do it internally to our development team but I am sorry that i can not tell now when the note will be ready.
    Disable the new check by adding the following entry in transaction sproxset
    -Name: ST_USE_LAX_ON
    -Value: X
    -User: <empty>
    -Inactive: <empty>
    Edited by: Kyle Freeman on Oct 9, 2008 5:54 PM

Maybe you are looking for