Badi - BBP_TARGET_OBJTYPE - Code approach

My Scenario is Extended Classic scenario -for completed shopping carts it creates PO and for catalog item it creates PO. For incomplete carts it creates PR
But our requirement for a particular vendor from the catalog it should create a PR but not PO.
Please SRM guru's send me some sample code or approach to write it in the badi
If I am not suppose to user the above badi please also send which badi to be used.
Thanks
NSSRM

Hi,
the BBP_TARGET_OBJTYPE is the rigtht BAdI.
Here inside you need to call the BBP_PD_SC_GETDETAIL, and check the partner tab for a fixed vendor.
Depending on this partner you need to change the type of the follow-on document.
Regards,
Peter

Similar Messages

  • BBP_TARGET_OBJTYPE - Code Approach

    My Scenario is Extended Classic scenario -for completed shopping carts it creates PO and for catalog item it creates PO. For incomplete carts it creates PR
    But our requirement for a particular vendor from the catalog it should create a PR but not PO.
    Please SRM guru's send me some sample code or approach to write it in the badi BBP_TARGET_OBJTYPE.
    If I am not suppose to user the above badi please also send which badi to be used.
    Thanks
    NSSRM

    Hi,
    Following enhancements (BADIs) will have to be coded based on rules defined for PO / PRs. These rules can vary from organization and hence I am not providing any sample code for the same.
    Badi BBP_TARGET_OBJTYPE : Use method DETERMINE_TARGET_OBJECT_TYPES to determine follow-on document type for PO. Here reservations object type is replaced by PO object type.
    Badi BBP_BS_GROUP_BE : Use method GROUP_PO_BACKEND to split line items for PO . Method GET_NUMBER_OR_RANGE can be used to get a new PR/PO number as defined in configuration. 
    Badi BBP_CREATE_BE_PO_NEW : This Badi is called before PO/PR is created in the backend.
    Hope this helps (*only for the approch and may differ from your requirement*).....
    Best Regards,
    NMK

  • BADI  BBP_TARGET_OBJTYPE

    Hello,
    I'm working with SRM 5.O and due to some specific business requirements we needed to implement the BADI BBP_TARGET_OBJTYPE. But we still didn't cover all our requirements.
    <u>Here is the required logic we need to pud into the BADI:</u>
    1. If we're buying via "free text item" or via "Internal Goods/services" --> always PR
    2. If we're buying items directly out of catalog (CCM catalog or punch out catalog), then we have 2 cases:
    a) if account assignment different from ST --> always PO
    b) if account assignement = ST --> if enough stock --> reservation else always PO
    Point 1 is covered by our logic into the BADI. Point 2.a) also but we still have problems with 2.b). What would be nice is to put here the logic of the customizing table where you can define your follow-on documents. I think we need to change something in our first LOOP.
    Below the logic of our BADI:
    method IF_EX_BBP_TARGET_OBJTYPE~DETERMINE_TARGET_OBJECT_TYPES.
    data: inti type i value 0.
    data: ls_badi_item_data  like line of ct_item,
            ls_index type i.
    data: t_accdata like line of IT_ACCOUNT.
    field-symbols: <item> like line of ct_item,
                     <account> like line of IT_ACCOUNT.
    loop at ct_item into ls_badi_item_data.
    ls_index = sy-tabix.
    *Catalog buying
        if ls_badi_item_data-catalogid ne space.
          <b>loop at IT_ACCOUNT into t_accdata where p_GUID eq ls_badi_item_data-guid.
            if t_accdata-ACC_CAT ne 'ST'.
              ls_badi_item_data-PACK_OBJTYPE = 'BUS2012'.                      "PO
             ls_badi_item_data-FIXED_VEND = '1'.
            endif.</b>      endloop.
        else.
         loop at IT_ACCOUNT into t_accdata where p_GUID eq ls_badi_item_data-guid.
            if t_accdata-ACC_CAT ne 'ST'.
              move space to ls_badi_item_data-CTR_HDR_NUMBER.
              move space to ls_badi_item_data-CTR_ITEM_NUMBER.
              ls_badi_item_data-PACK_OBJTYPE = 'BUS2105'. "PR
            endif.
          endloop.
        endif.
    modify ct_item index ls_index from ls_badi_item_data transporting   PACK_OBJTYPE.
    modify ct_item index ls_index from ls_badi_item_data transporting CTR_HDR_NUMBER.
    modify ct_item index ls_index from ls_badi_item_data transporting CTR_ITEM_NUMBER.
    clear ls_badi_item_data.
        clear ls_index.
      endloop.
    endmethod.
    Does anybody know how I can put the required logic into this BADI?
    Thanks a lot,
    regards,
    Caroline

    Hi Caroline,
    To activate this scenario you have to use BADI: BBP_EXTLOCALPO_BADI. Menupath: SPRO-> SRM Server -> Business Addinns -> Control Extended classic scenario -> Activate extended classic scenario
    Regards,
    Jos

  • Corrupt JPEG: Bad Huffman Code

    Hello
    I've been having intermittent trouble with images going all
    crazy on me. I have Dreamweaver 8 on my Intel based Mac. I
    downloaded the free trial version of CS3 onto my husband's PC and
    when I tried opening the same document on his computer I get
    "Corrupt JPEG File: Bad Huffman code". Does anyone know what this
    means and how do I fix it. This has happened the odd time before.
    Please help!

    quote:
    Originally posted by:
    SnakEyez02
    How are you creating and saving those images?
    I am trying to figure out the same error about the huffman
    code. When i open a page in dreamweaver and get that code the page
    is a pixelated and discolored like they colors are layered very
    hard to describe ...

  • Unable to connect to SQL Server : bad return code or status

    When attempting to connect to a server running Windows Server 2008 R2 and SQL Server 2008 R2 the following error message is returned.
    Error Connecting to Database
    A SQLServer request resulted in a bad return code or status but no error message was returned.
    The client is pointed to another similar server running Windows Server 2008 R2  and SQL Server 2008 R2, a connection can be made successfully.  Looking at the registry both servers have the same version of MDAC 6.1.7601.17514.
    UPDATE 
    The SQL Server Error Log records the following information.
    Message
    Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT: 10.1.30.106]
    Message
    Error: 17836, Severity: 20, State: 17.
    It seems like the client is actually reaching the SQL Server but failing to login.

    The version of MDAC on the server doesn't matter.  It is the client version of MDAC/WDAC that is used.  Do you know what SQL Server API the client application is using (i.e. ODBC, OLE DB, SqlClient, JDBC, etc)?  You might try a simple connection
    test from ODBC data source manager or script.
    I think this may be error message from a Sybase client.  That would explain a lot.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • How to know if implementation with a filter value exist for a BAdI in code?

    Hi all,
    Scenario:
    I created a BAdI. There will be a button on the UI to call its implementation(s); while if there is no implementation with specified filter value, this button needs to be hidden. Thus I need to know if the implementation exist before calling it.
    Question:
    In the ABAP code, how to get whether implementation with specified filter value exists for a BAdI?
    If it's possible, please help provide code.
    Thanks and regards,
    Said

    Problem solved:
    data: r_badi type ref to YOUR_BADI,
              badi_impl_num type i.
      get badi r_badi
        filters
          flt_name = fit_val.
      badi_impl_num = cl_badi_query=>number_of_implementations( badi = r_badi ).
      if badi_impl_num > 0.
        "there are badi implementation(s)
      endif.

  • F4 HELP does not hit BADI exit code after upgrade BI 3.1 to 7.0

    Hi folks
    Context : Using a virtual characteristic, after upgrading from 3.1 to 7.0
    Problem :  the BADI user exit code is not run when using F4 help during navigation.
    (The BADI works OK selecting data in the Provider, but not when navigating in the report.)
    Any ideas ?
    I have tried the SDN and Sapnotes & debug (nice ...) but no dice.
    Thanks

    Hi James,
    BADI's must be reactivated after system upgrade, try to reactivate it and check again the query.
    Regards,
    Daniel

  • Recommended Dimension language code approach matching SEO/ISO standards?

    Hi All,
    I noted that some language codes are alluded to in the developer guide for configuring Dimensions, but are not listed in their entirity.
    - en_US (US English)
    - de_DE (German)
    - de_CH (Swiss German)
    - de_AT (Austrian German)
    Is there a defined standard for these which allows successful use of the values with the various SEO meta tags and ISO language codes?
    <html lang="en">
    <meta http-equiv="content-language" content="en, fr">
    <link rel="alternate" hreflang="es" href="http://es.example.com/" />
    E.g. Some combination of ISO 639 http://www.seoconsultants.com/meta-tags/language
    Thanks

    Found out.... ISO 693 two character language code and ISO 3166 country code groupings as defined by RFC 4646.
    http://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html

  • Bad redemption code

    I bought Adobe Photoshop Elements 11. The Redemption code does not work. Can anyone help? I did follow the instructions exactly.

    Contact sales by phone or web chat.
    Mylenium

  • Bad redemption code. how do I get the right code

    redemption code not valid, how do I
    get a valid code

    Contact whoever sold it to you and inform them of the problem.

  • Cannot install Windows Embedded Compact, bad authorization code

    Registered for Windows Embedded Compact 2013, received authorization code, downloaded installer, started installer, rejects authorization code that copied and pasted [did not type by hand]. Repeated entire process, received identical authorization code,
    again rejected. What's the trick to installing Windows Embedded Compact 2013? Thanks.

    Tried exact same process for Windows Embedded Compact 7 and had no difficulties. Apparently Microsoft has a problem with product keys for Windows Embedded Compact 2013. Case closed.

  • Feb 2015 update disks - bad info codes.

    According to the information card enclosed with the disks, version information for all of the components included in the distribution are available at: ni.com/info.  Below are the results from entering the indicated codes:
      NI Developer Suite - devsuite2015DS1 - links to document providing version information for the 2015 DS1 components (LabVIEW, LabWindowsCVI, etc.)
      NI Device Drivers - driversFeb2015 - The Info Code you entered is invalid. Please enter another code.
      NI RF Divice Drivers - RFDriversFeb2015 - The Info Code you entered is invalid. Please enter another code.

    Hi DEPutman, 
    Thank you for alerting us to the fact that these codes do not work. I am going to pass this information along to our Web Services team and we will work on getting this sorted out.
    Rachel M.
    Applications Engineer
    National Instruments

  • Minimum order value in vendor master - error message in SRM

    Hello!
    I am using minimum order value in ERP for some vendors and I am wondering if is it possible to get the same error message in SRM.
    While creating a shopping cart in SRM if the minimum order value is not reached, the following document created is a purchasing requisition.
    I would like to get the error message that the minimum order value is not reached instead of the automatic creation of a purchase requisition.
    Is it possible?
    Thanks in advance!
    Best regards,
    Karin

    Hi Karin, if you need to show an error message during Shopping Cart creation you willl need to implement badi BBP_DOC_CHECK_BADI, and maybe create an RFC Function Module to check in ECC ir the minimum order value was reached or not and show the error message.
    In order to control the following document you will need to implement badi BBP_TARGET_OBJTYPE.
    Find bellow a sample BBP_TARGET_OBJTYPE - Code Approach.
    Hope This Help.
    Celeste

  • Is BAdI the right tool for us?

    Hello,
    we are building a custom component which generates postings that are later dispatched to FI.
    The component's customizing defines Posting Activities in different variants/versions that create those postings.
    Every Posting-Activity-Variant is implemented by a dedicated class, all implementing a common Posting-Activity interface.
    Usually I would use the BAdI-technique to register the classes for each Posting-Activity-Variant using BAdI-Filters.
    However, in this case I have a certain aversion to BAdI-usage:
    100s Posting-Activity-Variants, means 100s BAdI-Implementations and Filter-Definitions
    *additionally* to the customizing of all these Posting-Activity-Variants
    There is customizing for every Posting-Activity-Variant, it is very tempting to add a classname-column and be done with it.
    The customizing would be concise & understandable, I don't have to deep-dive into SE80/SE19 to check registered BAdI-classes and their filter-values to guess which BAdI would be called. I immediately see if the Posting-Activity-Variant is bound to an implementing class.
    We use OO extensively and defined interfaces irrespective of any BAdI-usage, so we don't really benefit from the BAdI's OO-approach.
    Furthermore we would actually hide the BAdI-mechanism since BAdI-references are not normal pass-around OO-references.
    So from a design perspective it doesn't matter if we use BAdI or customizing, it's hidden in some Factory anyways.
    We lose the static-registration and where-used functionality of BAdI-classes,
    but I think that would be a price I am willing to pay to get a manageable & concise customizing.
    We would work-around that with a dedicated report that lists all used classes etc.
    If using an old-school classname-column in the customizing, we would build a report that checks that customizing for sanity and checks the classes for the presence of certain interfaces/constructors/etc. Things which would otherwise be statically handled by the BAdI itself of course..
    So what do you think, would you really *always* use the BAdI-technique to register classes?
    Thanks for any advice.

    Hi Kai,
    First: thank you Custodio de Oliveira for noticing this high-quality question.
    Kai: To be honest, I think you've answered your own question already. Not that there's something wrong in checking your reasoning with the community (on the contrary: we're all likely to learn something from it).
    But I can imagine this not being a forum question but a blog post describing the case and the design decision made. That would make an excellent blog post, from which (again) many people would learn something. It's the kind of content that's IMHO underrepresented on SCN at the moment.
    So, instead of answering (which really isn't necessary: as Custodio already said, whatever you go with, I'm sure you'll be fine), I'd like you to rewrite this into a blog post. Let the community chime in using the comments and see what comes out of it.
    For the record, I'd go with BAdi's. I don't think it's much extra work (implementing a class might be, but defining a BAdi implementation using a filter surely isn't), and you stay in the code realm, instead of breaking out of it (I always find that using class/function module columns in customizing makes it hard to understand the big application picture).
    But I'm surely interested in what other developers have to say. And that's another advantage of the blog format: more people will likely notice it.
    So: please give it a go! (Only if you're comfortable with it of course)
    Thanks, Fred

  • Use of SAVE_TEXT in customer exits / BADI for purchase order

    Hi All,
    I am trying to save some long text by using SAVE_TEXT function module in a badi implementation for purchase order header text. The same is working fine if i try to update the PO header text via a report. But if i try using badi (the code is written in a PAI event for the BADI), then though the text transfer and save is successful during the code excution, but for the first time when i add any text its not visible in ME22N tcode. Since its an online event. But when i double click on that editor and the sap script editor gets opened. then i press back button, the text is appearing on the same small screen edtor . after this any number of time i edit or delete text, the save_text function module works fine.
    My issue is why for the first time always i have to double click on the editor to open the sap script editor. I have also included commit_text in this case after save_text FM.
    the requirement here goes like this. in one tab for PO header the user will enter some number (This is a customizing screen implemented through badi.) and the corresponsing discription should appear when user clicks on text tab in po header screen (me21n / me22n).
    Kindly help.
    Thanks
    Mamata

    Hi  mamata rath
    I have solve the problem which similar to yours.  the code which is as the following
    DATA: textline TYPE tdline,
            name TYPE c LENGTH 70,
            glines TYPE TABLE OF tline,
            gline  LIKE LINE OF glines,
            ls_header TYPE thead.
         CONCATENATE ch_eban-banfn ch_eban-bnfpo INTO name.
             ls_header-tdobject = 'EBAN'.
             ls_header-tdname = name.
             ls_header-tdid = 'B01'.
             ls_header-tdspras = sy-langu.
             CALL FUNCTION 'SAVE_TEXT'
               EXPORTING
    *           CLIENT                = SY-MANDT
                 header                = ls_header
    *           INSERT                = ' '
    *           SAVEMODE_DIRECT       = ' '
    *           OWNER_SPECIFIED       = ' '
    *           LOCAL_CAT             = ' '
    *         IMPORTING
    *           FUNCTION              =
    *           NEWHEADER             =
               tables
                 lines                 = glines
               EXCEPTIONS
                 ID                    = 1
                 LANGUAGE              = 2
                 NAME                  = 3
                 OBJECT                = 4
                 OTHERS                = 5
              IF sy-subrc = 0.
                  CALL FUNCTION 'COMMIT_TEXT'
                    EXPORTING
                      OBJECT                = 'EBAN'
                      NAME                  = name
    *                ID                    = '*'
    *                LANGUAGE              = '*'
    *                SAVEMODE_DIRECT       = ' '
    *                KEEP                  = ' '
    *                LOCAL_CAT             = ' '
    *              IMPORTING
    *                COMMIT_COUNT          =
    *              TABLES
    *                T_OBJECT              =
    *                T_NAME                =
    *                T_ID                  =
    *                T_LANGUAGE            =
              ENDIF.

Maybe you are looking for

  • Combine sales orders of different division

    Hi all, I have issue where two sales orders are of different division and i want  to combine the both sales order into one delivery document and make one invoice ,but delivery its not allowing me to do so,though copying requirements 051 exits,so SD e

  • AFCS SDK Navigator doesn't do anything.

    Hey guys, I haven't worked with AFCS since the rename.  I decided to grab the latest source code.  After installing the AFCS SDK Navigator, I try to run it.  It seems to start, but nothing shows up on the screen.  It's quite annoying.  Any ideas?

  • Help with my caller display through my broadband t...

    hello I currently have number's including landlines showing up as 004401209xxxxxx when people try to call even tho i have them set up in the phone book.  Is this a common fault and if so how can I fix it please help really bugging me now!!!  I have c

  • Nano Video Update ????

    Has anyone heard or seen any info for any updates to allow the Nano to play Video...

  • Object Status button in Status tab of Item

    Hi All How can i configure to see Object status button in Status tab of item in the Sales order data. Please list down the steps. Right now i dont have Object status button. Thanks in advance Sonali