cancel
Showing results for 
Search instead for 
Did you mean: 

REG : Issue in Fetching the approved vendor

Former Member
0 Kudos

Hi Procurement Gurus,

I have a requirement, wherein I need a warning message when a Requisitioner tries to check / Save / Order a  Shopping cart.
Now I got that the coding needs to be done in the DOC_CHECK_BADI as it is a validation.

But I am not getting how to proceed with the same, here in I need a check for the source of supply field, as the warning message 'Please update the actual price' will be induced every time an approved vendor is entered as the source of supply, thus reminding the Requisitoner to update the actual price, in case it is the estimated price which gets defaulted.

Now I will need to check the source of supply if it has the approved vendor or not.

Please let me know the step by step procedure to achieve the above functionality also if possible the pseudo code for the same.


Thanks & Regards,

Aakash Awasthi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Aakash,

Based on your information if Vendor is not approved then why you are replicating in SRM? You could put some logic in Retrieving vendor data via BADI BBP_GET_VMDATA_CF so that it does not be available for search....

Hope this helps.


Thank you
Ritesh

Former Member
0 Kudos

Hi Ritesh,

Thank You for the reply,

I need the check as the we can also get the vendors from the catelog or contract, so it is necessary to check whether it is an approved vendor or not.


Regards,

Aakash Awasthi

YayatiEkbote
Contributor
0 Kudos

Hello Aakash,

You need to check partner table with partner functions for the supplier. First you need to check if the supplier is preffered supplier or fixed supplier on SC. Hence in check BADI when you get the details of SC, the et_partner exporting parameter will return all the partner data of SC. In this internal table you have to identify the entry with supplier partner function. For fixed supplier, the partner function is '00000019' and for preffered supplier is '000000039'.

Regards,

Yayati

Former Member
0 Kudos

Hi Yayati,

So, I do not need to check the source of supply field.

as I need to just post an error every time an approved vendor is entered as the source of supply, thus reminding the Requisitioner/Operational
Purchaser
to update the actual price in case it is the estimated price which gets defaulted.

I have coded as you've indicated, but I still had a doubt,

How will we know whether the vendor in that partner function is an approved vendor or not, as if the user has a purchaser role any vendor can be updated as a fixed supplier.

Is there any table wherein AVL data is stored ? as it will be a good practise to get the details from the approved Vendor list table.

I am using the sample code,

Please let me know, if I am missing anything.

    INCLUDE bbp_pd_con_cl.

    DATA : lt_partner     TYPE TABLE OF BBP_PDS_PARTNER,
           lt_items       TYPE          bbpt_pd_item,
           lt_messages    TYPE TABLE OF bbp_pds_messages.

    DATA : lo_doc_access  TYPE REF TO  /sapsrm/if_pdo_model_access,
           lv_partner     TYPE         bu_partner_guid.

    DATA : ls_header      TYPE         BBP_PDS_HEADER,
           ls_messages    TYPE         BBP_SMESSAGES_BADI,
           ls_item        TYPE         bbp_pds_item,
           ls_partner     TYPE         bbp_pds_partner.

    CONSTANTS : c_19    TYPE bu_partner   VALUE '00000019'.
  
           REFRESH ET_MESSAGES.

    IF lo_doc_access IS NOT BOUND.
          lo_doc_access = /sapsrm/cl_pdo_model_factory=>get_instance( ).
    ELSEIF lo_doc_access IS BOUND.
           lo_doc_access->get_detail(
                  EXPORTING
                        iv_guid                      = iv_doc_guid
                       iv_with_itemdata             = abap_true
                       iv_without_header_totals     = abap_false
                IMPORTING
                       es_header                    = ls_header
                       et_item                      = lt_items[]
                       et_partner                   = lt_partner
                      ET_MESSAGES                  = lt_messages ).
       ENDIF.
            READ TABLE lt_partner into ls_partner  WITH KEY partner_fct = c_19
                                                        p_guid      = iv_doc_guid BINARY SEARCH.

           if sy-subrc EQ 0 and lt_items[] is not initial.
          Read table lt_items into ls_items.

                 CLEAR ls_messages.
                 ls_messages-MSGTY     = c_msgty_w.
                 ls_messages-message   = 'Please update actual item price'.

                ls_messages-ITEM_GUID = ls_item-guid.

               APPEND ls_messages to et_messages.
                  Exit.
      ENDIF.

Many Thanks,

Regards,

Aakash Awasthi.

YayatiEkbote
Contributor
0 Kudos

Hello Aakash,

As far as vendor check is concerned, the above code will work. But i think there is no approval workflow for Vendor. You may need to develop a custom workflow for that and should provide a custom role for the approver in SU01. Hence after the approval action by the approver, the check BADI will be riggered again and there you can add your custom code to check the approval.

To identify, user as purchaser, your user should come under some purchasing group in org structure. Once that is available, you may use FM 'BBP_READ_ATTRIBUTES' FM by passing sy-uname as user name and attribute as 'PURCH_GRP', if the purch group is returned with sy-subrc EQ 0, then the user is a purchaser.

Regards,

Yayati

Former Member
0 Kudos

thank u Yayati,

what I want is I want to check the fixed supplier field and accordingly check if the contract field and catelog fields are blank.

Then check the record from for product category from AVL table..

Can I achieve the approved vendor/supplier using the above, if yes, how do I use it in the coding.

Regards,

Aakash Awasthi

Answers (0)