GR for Subcontracting Orders

Hello ,
We need to do a GR for subcontracting orders , when i read the documentation for the fm MB_CREATE_GOODS_MOVEMENT , it says that subcontracting orders are not supported .
Searching the forum i found that we can use the fm BAPI_GOODSMVT_CREATE , but i am not sure how to use the fm , what about the components will the BAPI find it or do we need to pass the components .
So please suggest it there is some way we can use the FM MB_CREATE_GOODS_MOVEMENT to create GR for subcontracting orders as in i think the BAPI calls the same FM and how to handle the components.
Regards,
Arun

Hi,
Internally, within BAPI_GOODSMVT_CREATE, again it calls the function module MB_CREATE_GOODS_MOVEMENT.
for the TABLES field IMSEG, we need to pass only the parent material and its quantity.
Internally using the function module MD_KOMPONENTENVORSCHLAG_WE, it will calculate the components from the table RESB if we are creating with respect to any purchase or else take the reference from STKO/StPO i.e. CS03 transaction ration for the bom component.

Similar Messages

  • Goods receipt for subcontracting order! BAPI_GOODSMVT_CREATE

    I wanna use BAPI "BAPI_GOODSMVT_CREATE"  to create goods receipt for subcontracting order.
    But it says that this combination is not possible.  Combination of my movement type and this BAPI.
    What can i do to solve it?
    thanks in advance.

    >
    Julia Nikiforva wrote:
    > I wanna use BAPI "BAPI_GOODSMVT_CREATE"  to create goods receipt for subcontracting order.
    > But it says that this combination is not possible.  Combination of my movement type and this BAPI.
    >
    > What can i do to solve it?
    >
    > thanks in advance.
    Might work
    report zbapi_goodsmovement.
    parameters: p-file like rlgrap-filename default
    'c:\sapdata\TEST.txt'.
    parameters: e-file like rlgrap-filename default
    'c:\sapdata\gdsmvterror.txt'.
    parameters: xpost like sy-datum default sy-datum.
    data: begin of gmhead.
    include structure bapi2017_gm_head_01.
    data: end of gmhead.
    data: begin of gmcode.
    include structure bapi2017_gm_code.
    data: end of gmcode.
    data: begin of mthead.
    include structure bapi2017_gm_head_ret.
    data: end of mthead.
    data: begin of itab occurs 100.
    include structure bapi2017_gm_item_create.
    data: end of itab.
    data: begin of errmsg occurs 10.
    include structure bapiret2.
    data: end of errmsg.
    data: wmenge like iseg-menge,
    errflag.
    data: begin of pcitab occurs 100,
    ext_doc(10), "External Document Number
    mvt_type(3), "Movement Type
    doc_date(8), "Document Date
    post_date(8), "Posting Date
    plant(4), "Plant
    material(18), "Material Number
    qty(13), "Quantity
    recv_loc(4), "Receiving Location
    issue_loc(4), "Issuing Location
    pur_doc(10), "Purchase Document No
    po_item(3), "Purchase Document Item No
    del_no(10), "Delivery Purchase Order Number
    del_item(3), "Delivery Item
    prod_doc(10), "Production Document No
    scrap_reason(10), "Scrap Reason
    upd_sta(1), "Update Status
    end of pcitab.
    call function 'WS_UPLOAD'
    exporting
    filename = p-file
    filetype = 'DAT'
    IMPORTING
    FILELENGTH =
    tables
    data_tab = pcitab
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_READ_ERROR = 2
    NO_BATCH = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE = 5
    OTHERS = 6
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
    endif.
    gmhead-pstng_date = sy-datum.
    gmhead-doc_date = sy-datum.
    gmhead-pr_uname = sy-uname.
    gmcode-gm_code = '01'. "01 - MB01 - Goods Receipts for Purchase Order
    loop at pcitab.
    itab-move_type = pcitab-mvt_type.
    itab-mvt_ind = 'B'.
    itab-plant = pcitab-plant.
    itab-material = pcitab-material.
    itab-entry_qnt = pcitab-qty.
    itab-move_stloc = pcitab-recv_loc.
    itab-stge_loc = pcitab-issue_loc.
    itab-po_number = pcitab-pur_doc.
    itab-po_item = pcitab-po_item.
    concatenate pcitab-del_no pcitab-del_item into itab-item_text.
    itab-move_reas = pcitab-scrap_reason.
    append itab.
    endloop.
    loop at itab.
    write:/ itab-material, itab-plant, itab-stge_loc,
    itab-move_type, itab-entry_qnt, itab-entry_uom,
    itab-entry_uom_iso, itab-po_number, itab-po_item,
    pcitab-ext_doc.
    endloop.
    call function 'BAPI_GOODSMVT_CREATE'
    exporting
    goodsmvt_header = gmhead
    goodsmvt_code = gmcode
    TESTRUN = ' '
    IMPORTING
    goodsmvt_headret = mthead
    MATERIALDOCUMENT =
    MATDOCUMENTYEAR =
    tables
    goodsmvt_item = itab
    GOODSMVT_SERIALNUMBER =
    return = errmsg
    clear errflag.
    loop at errmsg.
    if errmsg-type eq 'E'.
    write:/'Error in function', errmsg-message.
    errflag = 'X'.
    else.
    write:/ errmsg-message.
    endif.
    endloop.
    if errflag is initial.
    commit work and wait.
    if sy-subrc ne 0.
    write:/ 'Error in updating'.
    exit.
    else.
    write:/ mthead-mat_doc, mthead-doc_year.
    perform upd_sta.
    endif.
    endif.
    FORM UPD_STA *
    form upd_sta.
    loop at pcitab.
    pcitab-upd_sta = 'X'.
    modify pcitab.
    endloop.
    call function 'WS_DOWNLOAD'
    exporting
    filename = p-file
    filetype = 'DAT'
    IMPORTING
    FILELENGTH =
    tables
    data_tab = pcitab
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_READ_ERROR = 2
    NO_BATCH = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE = 5
    OTHERS = 6
    endform.

  • Adjust to Minimum Quantity for Subcontracting Order

    Dear guru.
    I can set up the Control profile in purchasing customizing in order to round to the minimum quantity filled in the info record.
    I have verified that this happen only for standard purchase order.
    Do you know a solution in order to Adjust to the Minimum Quantity also for Subcontracting Purchase Order ?
    Thanks in advance

    solved. it was a my mistake

  • Delivery for Subcontracting Orders - SC

    Hi,
    I have create a subcontracting PO.
    I would like to ask which should be the proper way of creating the outbound delivery?
    I've seen that in a ME2O there is a button to make the post Good Issue and another to create the delivery, but as the transaction is called "Stock Monitor for Vendor" I believe it must be another place to create the delivery.
    Nevertheless, when I try to create the delivery I'm getting the message: "Essential transfer parameters are missing in record:  000001"
    Thanks

    Hi,
    To create a delivery (against Subcontracting PO), the following data has to be maintained in the system:
    1. The plant must be assigned a sales organization, a distribution channel, and a division. You can define this in Customizing for Purchasing, in the step Set Up Stock Transport Order.
    2. A delivery type has to be defined for the plant from which the items are to be delivered. You can define this in Customizing for Purchasing, in the step Set Up Subcontract Order.
    3. If you want to reference a reservation when you create a delivery, you also have to set the Predecessor necessary indicator to L (Provision to subcontractor necessary) when defining the delivery type. This means that the requirements generated by the reservations can be correctly offset against the deliveries created. You can define this in Customizing for Shipping, in the step Define Delivery Types.
    4. The vendor for the stock with subcontractor must be entered as the customer in the organizational units in the delivering plant, such as sales organization, distribution channel, and division.
    5. The material to be provided has to be entered for the organizational units in the delivering plant, such as sales organization, distribution channel, and division.
    6. The combination of shipping condition (from the subcontractoru2019s customer master record), loading group (from the material master record for the components to be provided), and the plant have to be assigned to a shipping point. You can define this in Customizing for Shipping, in the step Assign Shipping Points.
    To create a delivery (in ME2O), choose Edit ® Create delivery. A dialog box appears, in which you can enter the data required to post the delivery. The system posts the delivery in the background and, after posting, it informs you in a dialog box how many items were posted.

  • Cofiguration step for  SubContracting Order Cycle  (SCO)

    Pls,provide me the the configuration steps of SCO(Suncontracting Order Cycle)

    Sub Contracting Cycle
    (1) You have a material that can be procured externally, and you have maintained BOM with components. Any waste generated and received during subcontracting process can be maintained as component with negative quantity. (special procurement type should be 30 in material MRP2 view for the mateiral you are getting back from subcontractor)
    (2) You create a subcontracting PO (PO with Item Category L). You can also maintain Purchase Info Record for Subcontract category for material and subcontractor.
    (3) You make a transfer posting to issue components for SC PO. Material is sent to subcontractor. As material remains under your ownership, system does not make any value entry. But quantity is shown as "Material Provided to Vendor"
    (4) You receive finished material against SC-PO. You also specify components consumed in manufacturing of finished goods. Additionally, if you have negative components in BOM, now you'll also receive subcontracting by-products. There are three events, so three accounting entries are generated:
    DR FG Stock/ SC By-Product Stock
    CR Change in Stock (FG/ SC By-Product )
    (for finished goods received)
    DR Subcontracting Charges
    CR GR/IR Clg
    (for moneys payable to Subcontractor)
    DR Consumption (Components)
    CR Change in Stock (FG/ SC By-Product ) 0
    (material provided to Vendor is now charged to expense)
    (5) You do the IV for SC Invoice, and the process is complete.
    Process of Subcontract in MM
    Sub-contract business process:
    You want to buy material from the supplier (processed material/ assembled item) , but for some reason (quality of certain item / price ) you will give some component to vendor .
    Vendor shall process the item / use the item provided & supply the final item.
    SAP process:
    1.Create the finished goods material code.
    2.Maintain the BOM for the material.
    3.Create PO with item category as "L" .
    4.Issue material to vendor with movement type 541
    5.Receive the material against the PO with movement type 101.
    6.MIRO to account for vendor's invoice for the service charge& material used by him.
    Note:: At the Time of GR 543 Mvt is up dated for Raw Material.
    Can anybody tell me how a process has to be given to subcontracting?
    Suppose, I have 3 operations 1)weaving 2)dyeing 3)cutting & packing
    if no 2 process (i.e Dyeing) has to be given to subcontracting, what process should i follow ?
    The following process to be followed for subcontracting.
    1. Item code(material master) to be created at the stage of before dyeing.
    2. Item code(material master) to be created after Dyeing as subcontracted item.(F30)
    3. Bill of material to be created for the material(2) calling for material(1)
    4. Info record and source list to be created for material(2) with the corresponding vendor
    5. PO to be released for material (2)
    6.Along with PO the material(1) to be issued to vendor
    7.On receipt of material when GR is made the stock with vendor will get updated.
    How to Create a Subcontract Order?
    To create a subcontract order, proceed as follows:
    Enter the material you want to order and the item category for subcontracting (L) in the order item.
    Press ENTER to display the screen for component processing.
    Enter the components that the vendor requires to manufacture the product.
    Please note:
    u2013 You do not need to enter the date required for the components. This date is proposed by the system when you press ENTER.
    It is calculated as follows:
    Delivery date of the item - Planned delivery time
    u2013 If you do not want the quantity of the components to be changed if the order quantity of the end product is altered, set the indicator Fixed quantity (column F).
    u2013 You can determine whether the components are available on the date required by selecting Edit -> Availability check.
    If you entered a bill of material as the material in the subcontract order, the components are created automatically.
    If you want to determine the components in the bill of material at a later date (for example, if the bill of material is subsequently changed), choose Item -> Component -> New BOM explosion. The existing components are deleted and redetermined in the bill of material.
    Save the purchase order.

  • Batch determination for subcontract orders in MIGO

    Hi,
    I have a doubt. I´ve customized a batch determination strategy for Inventory Management, for movement type 543.
    When i receive a subcontract order, using transaction MIGO, the batch determination process is NOT triggered automatically, until i press button "Stock Determination".
    Is there a way to determine batches in MIGO without pressing this button? (fully automatic).
    Best regards.

    Hello Alejandro,
    Thanks for the further clarification!
    It depends on how you are processing the goods receipt in MIGO:
    .- If you post the Goods Receipt for the Subcontracting purchase order and you do not expand the components, then just flag the main item and post, an automatic batch determination for the batch component will be processed then by the system and the goods receipt will be processed.
    .- If you post the Goods Receipt for the Subcontracting purchase order and you expand the components, then, the batch field will be opened for input and the user manually will need to start the process pressing the icon for the batch determination (or also the one for the stock determination).
    I hope this helps!
    Esther

  • Runtime error in MIGO for subcontracting order

    Hi All
    We have an issue in subcontracting process. We are trying to complete goods receipt for the multiple line items for subcontracting PO.
    These multiple line item contains serialized materials. When we are trying to complete the GR, We are getting runtime error saying u201COnly 0 serial numbers entered instead of 1u201D
    Any pointers in resolving this issue will be a great help to us.

    Mohandevegowda wrote:
    Hi All

    > We have an issue in subcontracting process. We are trying to complete goods receipt for the multiple line items for subcontracting PO.

    > These multiple line item contains serialized materials. When we are trying to complete the GR, We are getting runtime error saying u201COnly 0 serial numbers entered instead of 1u201D

    > Any pointers in resolving this issue will be a great help to us.
    Hi,
    Pls check whether you have maintained the serial no for the material in mm01 tcode. When it comes to subcontracting process you will create a BOM by listing all your materials but when you take GR from subcontractor after some action is performed on that list of materials then definitely you have to manually give the serial no in MIGO or check automatic serial no there.you might have not placed anything over there.
    Thanks

  • Shipping point error while creating delivery for subcontracting order

    Hi,
    I am trying to send Materials Provided to a Subcontractor via an SD Delivery using std SAP functionality using IDES preconfigured system.
    In transaction ME2O, while creating delivery, i am facing following error:
    Essential transfer parameters are missing in record:  000002
    The dignosis gives following details.
    Diagnosis
    Information necessary for this delivery is missing.
    Please help to sort out the problem.
    Regards
    SAmeer

    Hi Sameer
    please check OSS notes 102104 for detail help about this error.
    regards
    Srinivas

  • Batch Determination for SubContracting Order in MIGO

    Hello all,
    In the transaction, MIGO the batch determination is not being automatically generated when we enter the PO on the GR screen in Migo. One has to click the "Stock Determination" button for each line item.
    What setting needs to be done so that the batches could pop in there automatically without clicking 'Determine Stock' Button for each line item.
    Thanks,
    Gauravjit.

    Hi Gauravjit ,
    check these steps :
    For Auto batch determination the system carries out the following steps in succession:
    1     it looks for a search procedure for the business transaction
    2     it searches through the strategy types listed in the search procedure for a search strategy. The first valid search strategy is adopted and all other search strategies are ignored.
    3     it then uses the characteristics from the selection class of the search strategy to look for batches with suitable specifications
    4     it checks whether the batches are available
    5     it sorts the batches that were found and are available according to the sort rule from the search strategy
    6     the system selects a proposed quantity in accordance with the proposed quantity from the search strategy.
    7     the system proposes that batch determination is to run online, providing that the search strategy contains the information
    You allocate batch search procedures to those Inventory Management movement types for which batch determination is to be carried out, and activate batch checking.
    Allocate a search procedure to each movement type.
    Set indicator Check batch if you want the system to check manually entered batches.
    regards
    kp

  • Account postings in GR & IR for Subcontracting

    Hi Experts,
    I need to know the account postings for both GR & IR during Sub contracting.
    Let us take the scenario . .
    PO price - 1000(Gross) +  200(Tax) = 1200 (Net) for 1 Qty
    GR - PO Net Price due to Moving Average price.
    IR - 1200(Gross) + 240 (Tax) = 1440
    Please explain the accounting entries during Goods Receipt and Invoice Receipt.
    By
    Prabhu

    If Material has Price Control as "V" (MAP)
    (BSX) Stock A/c of Assembly - Dr
    (BSV) Change in Subcon Stock - Cr
    (FRL) Subcontracting Charges - Dr
    (WRX) GR/IR Clearing A/c - Cr
    (BSX) Stock A/c of Components - Cr
    (GBB-VBO) Consumption A/c of Components - Dr
    If Material has Price Control as "S" (Std. Price)
    If Material is having Price Control as "S" then Price Difference A/c will also in picture.
    This depends on configuration; SPRO > MM > Inventory Management and Physical Inventory > Goods Receipt > Price Differences for Subcontract Orders at Goods Receipt
    Price Differences for Subcontract Orders at Goods Receipt
    In this step, you configure for each valuation area whether price differences are generated for a Subcontract order at the time of a goods receipt if the manufactured material is managed at standard price and the standard price varies from the receipt value (externally performed service + value of components + delivery costs).
    Example
    Finished product: $400 (value at standard price)
    Subcontract order:
    o Ext. service : $250
    o Components : $100
    Posting schema without price differences:
    Stock account FERT : 400 +
    Stock change : 400 -
    GR/IR clearing acct : 250 -
    External service acct : 250 +
    Compon. stock account : 100 -
    Consumption account : 100 +
    Posting schema with price differences:
    Stock account FERT : 400 +
    Stock change : 350 -
    Price difference : 50 -
    GR/IR clearing acct : 250 -
    External service acct : 250 +
    Compon. stock account : 100 -
    Consumption account : 100 +
    hope it help

  • Batch number issue when posting goods receipt for Subcontracting PO

    Dear expert,
    I always heard there will be issues while posting goods receipt for subcontracting PO. If the component is managered by batch.
    No batch number will be proposed during PGR in MIGO...
    I dont quite understand where is the issue??
    My understanding:
    We have batch managered components and End Product. All have batch numbers, then we PGI the stock to 'SC stock' via 541 movement type.
    Then Vendor will finish the end product and send us back the end product.
    We consumption the components use 543 O movement type? And GR the end product..
    So while goods receipt, the sytem just need pick the existing batch number for both components and finish products..
    Where are the issues???
    Thanks.

    Hoo Laa wrote:
    I have questions for people always mentioning there are issues with batch determination while post goods receipt for subcontracting orders.
    >
    > I am thinking maybe they didnt active the batch determination for 543 movement type..
    >
    > Thanks.
    Hi Hoo,
    You are right!!
    Setting of batch number determination has its importance in Mvt Type be it 541, 543....
    The issue you might have observed would be with Batch Determination in Goods Issues which folks find it bit tough to achieve n make it work for them.
    Cheers!!
    Shiva

  • Batch determination in Subcontracting order

    Hi,
    Can any one of you explain me the steps for doing batch determination for subcontracting orders. i am facing the same issue, but i dont know what steps to follow.
    our scenario is:  we do a GR against a Sub contracted PO using 101 mvt type and when i am trying to post the document, it's asking me to enter the batch for few components which are maintained as vendor consigned stock and in batches.
    is it possible to automate the process? can any body explain how to setup the customization for batch determination?
    thanks in advance,
    Kanth

    Follow the below steps.
    01. For movement type 543 "O" assign your search procedure T code : OMCG
    02. Maintain conditions record or strategy record.
    A1) Normaly we use batch determination at delivery level, because at the time of order material may or may not be created.for this material should be configured with batch and batch determination should be checked in sales views of material.
    A2) Batch Determination during order Creation.
    For this you need to maintain a Classes d for you Material. Depending on the Manufacturing process you can define the characteristics for your material.
    Ex: Purity for Medicines,  Resistance for Electric Items.
    You need to create a class (You might have to create a new class type) which incorporates the characteristic.
    First Create the Characteristic Using Ct04 and then using Cl02 create the Class  including this characteristic.
    Then in your material master Classification View Enter this class.
    Then Create a Batch for the particular plant and Stor Loc using MSC1N.Give the value of the characteristics in this batch.
    Then go to SPRO ->Logistics General ->Batch Management and maintain the Condition Technique (Procedure, Strategy Types and assignment to sales docs etc).
    Then Create the Batch Determination Record using VCH1.

  • BOM Explosion in PO for Subcontract.

    Hello Gurus,
    I have Created the BOM using CS01 for subcontract order. i could not able to explode it during my PO. I wantend to know weather there is any prerequsit to be made for the BOM Explosion in the PO..?
    regards,
    Mahesh.

    Dear Mahesh,
    1.Create the BOM for the sub-contract material(header material) in T code CS01 for BOM usage 1.
    2.Mention the procurement type as F and special procurement type as 30 in the  material master of the header material(which you
    recieve from sub-contractor) in MRP2 view.
    3.Maintain the sub-contracting Purchase info record in ME11.
    Check and revert
    Regards
    Mangalraj.S

  • Account postings in GR for Subcontracting

    Hi Experts,
    As I know, for GR of subcontract PO,  Price Difference  (PRD) A/c will also in picture  should depends on configuration; SPRO > MM > Inventory Management and Physical Inventory > Goods Receipt > Price Differences for Subcontract Orders at Goods Receipt'.
    I hit an issue for that. We didn't select the indicate for the Price Differences for Subcontract Orders at Goods Receipt but active the material ledger functionality for the plant. The company code currency is SGD and group currency is USD.
    Then when do the GR of subcontract PO, there are two finance document created. One is for 101 E which document currency is USD, the other one is 543 O for component consumption which document currency is SGD.
    Now the issue is for the 101 E document. Although we didn't select the indicate 'Price Differences for Subcontract Orders at Goods Receipt' , but the PRD is still posted here.
    Could you pls tell me how that happens and what is the control?
    Appreciate your help!
    Thanks
    Jimmy

    Sorry, forget to show the posting. Below is the detail.
    101E posting:
    Itm PK Account    Account short text   Tx Trs           Amount     Amount in LC       LC2 amount
      1 89 13420000   FG Inventory  Mat       BSX          100.00           139.00           100.00
      2 96 23900306   AP Accr Clearing        WRX           20.00-           27.80-           20.00-
      3 93 35220000   Material Price Var      PRD           22.45-           31.20-           22.45-
      4 91 35280000   Mat Qty Variance        BSV           77.55-          107.80-           77.55-
      5 86 35280000   Mat Qty Variance        FRL           20.00            27.80            20.00
    543O posting:
    Itm PK Account    Account short text   Tx Trs           Amount     Amount in LC       LC2 amount
      1 99 13100000   PurParts&RawMatInv      BSX           80.00-           80.00-           57.55-
      2 81 35280000   Mat Qty Variance        GBB           80.00            80.00            57.55

  • Account Determination in Subcontracting order

    Below lists accounting entries for subcontracting order for Goods Receipt in our system.
    Debit     Subcontract cost
    Credit     GR/IR
    Debit     Finished Goods stock
    Credit     COGS_Subcontract
    Debit     COGS_Raw material consumption
    Credit     Raw Material Stock
    I want to split 'Subcontract cost' by intercom vendor & external vendor, such as Subcontract cost_Intercom or Subcontract cost_External.
    But at OBYC -> 'FRL', there is only Valuation mod & Valuation class but no column of General modification.
    Do anyone have suggestion? Or any user exit support this issue?
    Br.
    Karen

    Hi Paul,
    Thanks for your help.
    I just test by using new transaction key, but it does not work.
    Do you know what's wrong of my setting?
    Br
    Karen
    Message was edited by:
            Karen Chan

Maybe you are looking for

  • How to restore emlx files in their rightful place (Mail.app)

    This might be the wrong place to post this, but I don't really know where else to try. The story goes like this. My girlfriend uses mail for business and personal, but never filed any of her emails away. There they were, 2000+ emails all in one folde

  • SQL Error Code: 1461

    We are currently facing a problem in which we are getting "SQL Error Code: 1461 java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column" . This issue is not happening always and only happens in the PROD environment.

  • How do we unload a DLL with multiple different CLFN?

    Hi everybody, I'm currently designing an application that implements multiple functions of a DLL that I build. I have to call two functions one after the other to obtain the results of my functions.The first function (Read_Property) is doing many ope

  • Meaning of  KF: 0OPORDQTYBM and 0OPORDVALSC in 0SD_c03

    Hello everybody, I try to use the Sales overview cube - 0SD_C03. There are two KF: 0OPORDQTYBM and 0OPORDVALSC, which are pretty strange to me. As far as I could follow the extraction from R/3, those two KF are set from the Info Source 2LIS_11_V_ITM.

  • Please help : How to remove duplicates in BIP

    Hi All, As told you all before that i have just started using the BIP and now i am facing an issue filtering out the duplicates from the sql query. Following is the issue and the output which i want. This is how the data is ( example) Srno product_id