Creation of SC or POs based on the Company Code restriction

Dear All,
I am abaper and I am new to SRM. Ours is SRM 4.0 using Extended Classic Scenario
we got one requirement that one company ex: SE04 should be blocked for further ordering of SC and POs. i.e. when creating any SC or PO they dont want to use 'SE04'.  If selected it should throw an error message "Company Code SE04 can't be used for Procurement".
I wrote code in BBP_DOC_CHECK_BADI-BBP_DOC_CHECK like this..
IF  flt_val = 'BUS2121'. "When create SC
  LOOP AT lt_item INTO ls_item WHERE be_co_code = 'SE04'
                                    AND del_ind <> 'X'.
    CLEAR ls_message.
    ls_message-msgty   = 'E'.
    ls_message-msgid   = 'BBP_PU'.
    ls_message-msgno   = '001'.
    ls_message-msgv1   = text-001.
    APPEND ls_message TO et_messages.
  ENDLOOP.
endif.
and for po also BUS2201 we done the same.
it is working fine for creation of SC and POS, but when we are chaning old SC or POs for 'SE04'  then also error is coming "Company Code SE04 can't be used for Procurement".
When I put break point in BBP_DOC_CHECK_BADI-BBP_DOC_CHECK it is not stopping there also.
Please guide me for this..
Thanks,
Kiran Madineni

I written code like this: now working for old SC and POs.
IF  flt_val = 'BUS2121'. "When create SC
    IF cs_header-created_at >= '20110110000000'.
*if sy-title = 'Shop' and ( sy-tcode = 'BBPSC01' or sy-tcode = 'BBPSC02' or sy-tcode = 'BBPSC03' ).
      IF sy-tcode = 'BBPSC01' OR sy-tcode = 'BBPSC02' OR sy-tcode = 'BBPSC03'
        OR ( sy-tcode = 'BBPSC04' AND sy-title = 'Change Shopping Cart' ).
        LOOP AT lt_item INTO ls_item WHERE be_co_code = 'SE04'
                                          AND del_ind <> 'X'.
          CLEAR ls_message.
          ls_message-msgty   = 'E'.
          ls_message-msgid   = 'BBP_PU'.
          ls_message-msgno   = '001'.
          ls_message-msgv1   = text-001.
          APPEND ls_message TO et_messages.
        ENDLOOP.
      ENDIF.
    ENDIF.
  ENDIF.
For POS BUS2201
Thanks
Kiran.

Similar Messages

  • To limit the access of PM data based on the Company Code, Plant & Location

    Hi Experts,
             I have a requirement . Customer wants to Restrict the access of PM data for a user based on the company code,
    Plant & Location.
    Say user : XYZ
    Plant :1000
    CCODE:1000
    Location:0001
    So you can see data of only this Organisation structure .No other data will be visible to him.
    I know we can do it using authorisation object
    Can you Suggest me how can we do this.
    Regards,
    Amar

    Hi,
    You can achieve this by maitaing these values in user authrisations. If you want more info about the objects check SU22 t code under PM.
    For Plant              I_IWERK
    For Location       I_ILOA
    Regards,
    N.Nagaraju

  • Creation of internal table dynamically based on the Date Range entered

    Hi SAPgurus,
    I have been facing one issue i.e creation of internal table dynamically based on the date range entered in the selection screen. For example the date range I am giving as 06/2006 to 08/2006, it should display the Fieldcatelog dynamically, this part i have completed but the only issue I am facing is to populate the sales data into that fields.
    Right now my program is displaying the ALV like this.
    Ex:
    <b>CSR    District   06/2006  07/2006  08/2006  totals</b>      
    Shiva      New York                             10.00
    Shiva      new york                             30.00
    Shiva      new york                             40.00
    but it should display like this
    <b>CSR    District 06/2006 07/2006 08/2006 totals</b>
    Shiva  New York  10.00   30.00 40.00
    80.00                 
    Please help me in this scenario, how to acheive like this..
    Thanks & Regards,
    Sivaram Kandula

    Hi Sivaram,
                 I also got the same requirement . i saw rich and your code whatever you have uploaded.i have created dynamic internal table but i am facing the issue to populating the data to my dynamic internal table.
    Sivaram, can you please explain your code after this.
    *<dyn_table>
    *tab_item.
      LOOP AT tab_item.
        ASSIGN COMPONENT 1 OF STRUCTURE <dyn_wa> TO <dyn_table>.
        ASSIGN COMPONENT 2 OF STRUCTURE <dyn_wa> TO <dyn_table>.
    *    <dyn_wa> = tab_item-bztxt.
    *    <dyn_wa> = tab_item-total.
    *    APPEND <dyn_wa> TO <dyn_table>.
    **    <dyn_wa> = tab_item-total.
    **    ASSIGN tab_item-bezei  TO <dyn_wa>.
    *  APPEND <dyn_table>.
      ENDLOOP.
    how you are puting the loop at tab_item. but tab_item is already commented.
    can you send me the code after that.
    i am sending some part of my code.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
       EXPORTING
         it_fieldcatalog = gt_fCAT1
       IMPORTING
         ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
       create data new_line like line of <dyn_table>.
       assign new_line->* to <dyn_wa>.
    select vbeln
            fkart
            vkorg
            vtweg
            fkdat
            spart
            fksto
            from vbrk
            client specified
            into table gt_vbrk
            where mandt = sy-mandt
            and fkart in ('ZF5','ZFR')
            and vkorg = '1100'
            and vtweg = '20'
            and fkdat in s_fkdat
            and spart = '06'
            and fksto = ' '.
       if gt_vbrk[] is not initial.
      select  vbeln
              fkimg
              prsdt
              netwr
              matnr
              arktx
              werks
              mwsbp
              from vbrp
              client specified
              into table gt_vbrp
              for all entries in gt_vbrk
              where vbeln = gt_vbrk-vbeln
              and werks in s_werks
              and matnr in s_matnr.
      endif.
    select mnr ltx spras from t247
    into table it_t247
    where spras = 'E'.
    data: lv_month1 type vbrp-prsdt,
           name1(3) type c,
           s_month type string,
            s_month1 type string,
             s_month2 type string.
    *      lv_netwr1 type vbrp-netwr,
    *          lv_mwsbp1 type vbrp-mwsbp.
          loop at gt_vbrp into gs_vbrp.
            gs_final2-matnr = gs_vbrp-matnr.
            gs_final2-arktx = gs_vbrp-arktx.
            gs_final2-fkimg = gs_vbrp-fkimg.
           lv_month1 = gs_vbrp-prsdt.
            read table it_t247 into wa_t247 with key mnr = lv_month1+4(2).
            if sy-subrc eq 0.
            name1 =  wa_t247-ltx.
            endif.
             concatenate  name1
                       lv_month1(4) into s_month SEPARATED BY '_' .
             CONCATENATE S_MONTH 'QTY' INTO S_MONTH1 SEPARATED BY ''.
              CONCATENATE S_MONTH 'VALUE' INTO S_MONTH2 SEPARATED BY ''.
             gs_final2-month = s_month.
              lv_netwr1 = gs_vbrp-netwr.
            lv_mwsbp1 = gs_vbrp-mwsbp.
            gs_final2-MONTH_QTY = S_MONTH1.
            GS_FINAL2-MONTH_VAL = S_MONTH2.
            gs_final2-value = lv_netwr1 + lv_mwsbp1.
           append gs_final2 to gt_final2.
           clear: gs_final2. "lv_name2.
           endloop.
           if gt_final2[] is not initial.
             sort gt_final2 by matnr month ascending .
             loop at gt_final2 into gs_final2.
            gs_final2_01 = gs_final2.
         collect gs_final2_01 into gt_final2_01.
        endloop.
           endif.
       ENDIF..
    Regards
    Ankur

  • The appearance of the company code segment of G/L account is based

    Hi,
    The appearance of the company code segment of G/L account is based  on which factors influenced
    which one  account group or fieldstatuts group/posting key  which one is influenced 
    Mnay thanks
    MvNr

    Hi
    Gl account  influenced by Account group
    posting key/filed status variant can be influence at the time of document posting
    Thanks & Regards
    Phaneendra

  • PO output messages control based on the reason code

    HI,
    The requirement is to generate the PO output message based on the value of 'Reason for change' code. suppose
    Ex:generate the output if the reason code is 2.
    I know there is a way to control the message output by defining the 'fields relevant to printout of changes' in SPRO. But we are not going to use this option.
    I have to control the output based on the Reason code. Please let me know.
    Regards,
    Nishant

    Hi Nishant,
    I will give you another input. This should be your last option. As mentioned above, you need to create an implicit enhancement in the following class method and export the content of the internal table MY_TABLE which contains the current values of the versions.
    Class - CL_GRID_VIEW_MM , Method - HANDLE_ON_DATA_CHANGED
    Then you import the same in your exit.
    Regards,
    Abijith

  • Is it possible to bring a Logo on to my report based on the company number?

    I am creating Customer Statements and need to include our Company logo. Each company has a different logo. I would like to make this variable based on the company number. Is this possible. If so, How do I do it and where would I store the logos? My data is all coming from our JD Edards system and the logos would be a PC file.
    Thanks,
    Rick

    This depends on which version of Crystal you're using.  If it's Crystal XI or Crystal 2008, you can do the following:
    1.  The logos need to be in a folder that the reports have access to.  This will probably be a network folder.  All images need to be the same size.
    2.  In your report, insert an image - you'll need to select an actual image file, so I suggest that you select one of your actual logos to get the size correct.
    3.  Right-click on the image and select "Format Graphic".  Go to the Picture tab.  There should be a section that says something like "Graphic Location" that has a button in it.  Click on the button.
    4.  In the formula editor that appears, write the code that will determine which actual image file to use. 
    You can either hard-code the locations into the report or a better option would be to have a table in your database that has two fields - something liket Company_Number and Logo_Location.  You then add this table to the report and link to it from the company number.  You then use the Logo_Location field in the formula editor to tell Crystal where to get the image.  This way if an image ever changes or if you add a company you only have to update the table, you don't have to update every report that includes the company logo.
    -Dell

  • Change the company code in a sales-order

    Our client is working only with one sales org 1000 assigned to one company code 1000 but having 14 other company codes and also having different plants which are individually assinged to different company codes at the clients requirment and to only one sales organisation.
    While creating sales order in sales area (1000/10/10) system have picked 1000 company code in the sales order header table VBAK, based on this combination there are several SO's created in which  the company code picked is wrong. We need to update the sale order correctly with corresponding company code as per business requirment.
    Please suggest with a report or the process of update\ion of sales orders.
    Thank you in advence.
    Shravan.

    Shravan.
    This is not a SAP standard practice.
    So, you need to create a program to create another sales order (and choose a correct sales area).
    Leonardo Rocha

  • Use of half months in the company code configuration after  Go Live

    Hi,
    Our client has a requirement to activate the functionality of u201CUse of
    half months in the company code configuration in Asset accounting after 3 month of Go live.
    For the above purpose, we enabled the same in our Development server
    (DE5) after Go Live and we are getting some Errors at the time of Asset
    posting in F-90 and Asset Explore AW01N and even depreciation Run.
    Already we ran 3 months depreciation without enabling this
    functionality and now the client requires this in our Production server
    before running the 4 period depreciation.
    We are using the same Fiscal year variant (V3) at Depreciation area
    level for all our company codes. All other company codes enabled this
    functionality except one company code (NOPE) .
    So the client requires this Half month depreciation calculation
    Functionality in company code NOPE too.
    Please advice to resolve this issue at the earliest and its quit urgent.We are using the same depreciation key, asset class in all company codes.
    Thanks
    Man
    Error details,
    SYST: You cannot change the depreciation periods
    Message no. AA662
    Asset affected: 000016000025-0000
    Diagnosis
    Processing terminated because the number of depreciation periods in
    company code NOPE has been changed. However, you cannot change the
    number of periods in your live (productive) system.
    Procedure
    Change the depreciation periods back to the original value in company
    code NOPE. The number of depreciation periods is determined by the
    fiscal year version and the use of half-periods. At least one of these
    parameters was changed.
    If you want to change your system so that you can now work with half-
    periods, you have to use depreciation keys with time-dependent period
    control in that company code.
    If you need to make general changes to the number of periods for
    calculating depreciation per fiscal year, you will have to consult your
    system administrator

    hi
    If you refer to SAP Note 2993, it is not possible to change to/from half
    period. This is because the expired useful life are based on 12 periods
    and the system is not able to change this to 24 periods.
    To be able to change this settings under:
    Asset Accounting>Valuation>Fiscal Year>Use of Half Months in the
    Company Code.
    Company code must be in status  2 (Test company code with data transfer)
    Once you have finished your legacy data transfer you should set company
    code as productive to avoid this changes.
    Regarding error AA662,  it occurs if you change the number of period
    in the fiscal year version or the use of half-periods, after you have
    already posted to assets.
    The cause is a different value in field ANLB-PERFY which
    is the number of periods in the fiscal year.  If the number
    entered here does not correspond to the number of posting periods
    of the fiscal year used, the system raises error AA662 (except
    for none posted areas for which ANLB-PERFY = 000 or areas
    with depreciation to the date for which ANLB-PERFY = 365)
    If T093C-MONMIT = 15 (half periods), ANLB-PERYF = 012 is not
    correct. It should be 24.
    Please note that changing the PERFY value will not be sufficient because
    the expired useful life is calculated on base of PERFY. Thus PERFY has
    to be adjusted and the expired useful life also.
    Blaz.

  • No Suitable Items found for PO (error M8035) while doing MIRO against service PO for the 1st time in the Company Code

    Hi
    I am encountering the error M8035 (" No Suitable Items found for PO ") while I am doing MIRO for the 1st time against service POs (item cat - D) in a company code.
    in OMSY the period opened for the company code is : Current 06 2014 previous 05 2014
    This was done because Go Live date for the new company code is 01.06.2014.
    I am doing test in the test client now.
    I have created a vendor on today's date
    I have created a service PO on today's date (GR, GR Bsd IV, IR, Serv Bsd IV - these indicators are marked in the PO)
    I have created service entry sheet on today's date (acc assignment - K, G/L a/c was determined from the Material Group maintained in the PO)
    I have accepted the service entry sheet on 04.05.2014 (FI doc posted against the matl doc - KBS to WRX on 04.05.2014)
    I am trying to do the MIRO in the same company code on 04.05.2014.
    While I am putting the PO and its line item in MIRO item and pressing enter system shows the above info msg and nothings is appearing in MIRO item.
    I have tried to do MIRO against service entry sheet also - same things happened.
    I have tried selecting Goods Service Item+planned del cost in MIRO - nothing changed.
    I have tried posting MIRO against a non service PO (acc assgnment K, Item cat - BLANK) after doing MIGO in the same company code in the same date- PO is appearing in that case.
    FI people are able to post FB60 manually for the vendor I am using in the PO - so there is no problem in the vendor also.
    I have gone through the scn post related with the topic, unfortunately none of them solved my problem.
    Please help
    Thanks
    Sanjib...

    Can you post a screen shot for PO history ?
    Regards
    Dev

  • The tax code entered is not defined in the company code country.

    Dear sap guru's
    I am facing a problem while doing invoice or while cancelling the invoice or even during Subsequent Credit/Debit
    Tax code V0 in procedure  is invalid
       Message no. FF704
    Diagnosis
       The tax code entered is not defined in the company code country.
    System Response
    Procedure
       Check and, if necessary, correct the entry.
    Procedure for System Administration
       If it is not an input error, check and possibly change the system
       settings.
       To do this, choose Maintain entries (F5).
       1.  Check whether the required tax procedure has been allocated to the
           company code country. The Procedure field is on the detailed screen.
       2.  If you need a new tax code, you can create one yourself.
    For this i have checked the assignment of company code and tax code V0 in Tcode (OBCL)
    In FTXP the tax code is created in country IN, for the same tax procedure and the tax is a input tax.
    please suggest what could be the exact problem
    Regards
    Sujit

    Hi Sujit,
    1.Go to FTXP and create tax code V0 for country IN and procedure ZAXINN.
    2.In Txn: FV11, For the condition type- XXXX (You will get this in Txn: FTXP, against the tax type, you get the condition type OR in the PO-Item details- Invoice tab, next to field: Tax code, see the Tab-Taxes, click on it and will get the condition type) , maintain the country-IN, Tax code-V0 and the rate.
    3.Also things to be checked
    1> assign country to company code
    2> assign company code to tax code
    3> create tax code for country IN
    4.Under the following menu path, pls check if you have assigned your tax code to Company Code
    IMG>Logistics (General)>Tax on Goods Movement>India>Basic Settings>Determination of Excise Duty>Condition Based Excise Determination>Assign Tax Codes to Company Code
    Hope it clears,
    Rahul.

  • Creation of referenc BP in SD for different company code from IS-U system

    Dear Friends,
    I have two company codes called 2000 and 3000 in my IS-U system. I would like to create SD ref customer with reference to BP created in the IS-U system.
    I created SD reference customer with 2000 company code along with sales data's and assigned it to MKK role in IS-U, but for the second company code 3000, I can't assign the SD reference customer in IS-U MKK role, because the MKK role has been assigned it to the SD ref customer of company code 2000.
    Now the problem is, I need to create SD reference customer for two company codes (2000 and 3000) with two different sales org. details through IS-U.

    Try creating your SD reference customer in both the company codes (2000 & 3000) with their respective Sales Org data in XD01. Specify this reference customer while defining the parameters for automatic creation of SD customers for BP in IS-U.
    Regards,
    Rajini.

  • Budgeting at the company code level

    Hi Experts,
    My client is in Sales and Distribtuion company and they are having sales budget and procurement budget along with financial budget at the company code level down to the branches.And also they will budgeted the advertisement and sales promotion expenses based on sales value and quantity.
    And we are not using any Treasury and Cash Management,Fund Management modules but client is asking the above requirement so How we can do the same ?
    Guide me in this and I will award you the points.

    Ok

  • The company code TEST does not exist or has not been fully maintained

    Dear Experts,
    I received the following message when I tried to create a material master from Plant Maintenance module (select view based on general plant data / storage 1).
    "The company code TEST does not exist or has not been fully maintained
    Message no. M3150
    Diagnosis
    You have entered either the company code TEST or a plant assigned to this company code. However, the company code either does not exist or has not yet been configured for materials management.
    Procedure
    Ask your system administrator to configure the company code.
    Procedure for System Administration
    Carry out the following activities as required:
    Create the company code if it does not already exist.
    You do this in Customizing for Enterprise Structure in the activity Define, copy, delete, check company code.
    Make sure that a fiscal year variant is assigned to the company code.
    You do this in Customizing for Financial Accounting (Global Settings) in the activity Enter global parameters.
    Configure the company code for materials management.
    You do this in Customizing for the Material Master in the activity Maintain company codes for materials management.
    However, I've done all the above instructions, yet the message still appear.  what else should I check?
    regards,
    Abraham

    Hi,
    I've done that earlier..
    However, I've chosen the default plant 0001 instead of my own created plant, it works.  Then I tried to do it again, with my own plant, it works also..
    Anyway, thanks a lot.
    regards,
    Abraham

  • SC ERROR : Enter the company code

    Hi,
    I am using ECC6 and SRM 7, Ext. Classic
    At the time of creation Shopping Cart with FREE TEXT an error comes that is Enter the company code .
    With Product ID all process runs fine.
    And in ECC6.0 all process runs fine.
    Please help me
    Sumit

    Hi Sumit ,
    ERROR : Enter the company code
    u2022     Go to PPOMA_BBP and look for Company which user in question is assigned;
    u2022     Check the "Function" tab and see the logical systems maintained there. You can have more than one;
    u2022     Now, check the affected user and go to "Extended Attributes" tab. Here, ensure that logical systems maintained in "Product Category" attribute are the same ones assigned to the company code (step 2).
    If this is correctly maintained, check the following steps:
    u2022     Go to SPRO transaction -> SAP Supplier Relationship Management -> SRM Server -> Technical Basic Settings -> Define Backend System for Product Category;
    u2022      you have to maintain entries for Product Category, Source System and Target System.
    Source and Target Systems should be maintained as local SRM system only if you have local scenario. If you have Classic or Extended Classic Scenarios, you have to maintain the ECC system ID in both fields (Source and Target).
    Logical system maintained in "Define Backend System for Product Category" should be the same as defined in Company Function tab in PPOMA_BBP.
    Thanks & Regards
    Pradeep Kumar Dondeti

  • Add currency to the company code

    Hi Gurus,
    We have created a company code for libya using local currency as USD but not defined group currency ( Canadian Dollar) and hard currency (Libya Dollar) while creating the company code.
    Documents were posted and POs for logistics were created using USD. Now the local authorities needs to have reports in Libian currency, when we try to add group and hard curriences systems gives us a message
    "The currency type for an additional local currency cannot be changed for company code, since documents were already posted in this company code".
    So the other option is to create a new company code and transfer all documents and PO from old company code.
    My question is if we create a new company code how can we tackle exchange rates during that period
    Is there any other option instead of creating a new company code.
    Thanks for your support and will assign good points.
    Thanks

    Hello,
    Please assess the possibility to create a new Special Ledger instead of creating another company code and migrating the required data.
    In the Spl. Ledger Settings specify the Group Currency and Hard Currency as required for the original libyan company code. Carryout the rest of settings such as Installation of tables, Field movements etc.,
    Importantly, at the Activity level, specify that the ledger can be posted directly and even at subsequent posting (option '3') so that there is a possibility to transfer the Documents from FI to SPL at a later point of time as well. (This way the historic data can be moved to SPL)
    Once the ledger is created successfully, as a start-up activity, transfer the historic data to SPL using GCU1.
    Hope this info helps you.
    With Regards
    Vijay Gajavalli

Maybe you are looking for

  • Field in Alv Top-of-page

    How to pass field in Alv Top-of-page Edited by: Deepak  Mathrani on Aug 12, 2008 12:40 PM <THREAD LOCKED. Please read the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] to discover why> Edited by: Mike Pokraka on A

  • Javax.mail.MessagingException

    HI all, i am new to this area and currently i am working on email messaging application. in here i have set up an SMTP server and every thing, but finally it gives following exception javax.mail.SendFailedException: Sending failed; nested exception i

  • PeopleSoft HCM 9.1 OVM in a single VirtualBox guest machine

    Following a suggestion from Jim Marion in an earlier post in this forum, I started installing the PeopleSoft HCM 9.1 OVM using a single VirtualBox guest. The PeopleSoft OVM appliances are delivered as two separate virtual machines, one for the DB and

  • Configuring the PR Scope of List

    Dear Gurus I am trying to configure the PR scope of List. Our requirement is that the PR list displayed in ME57 should be able to show the PR item text. Believe new routines would have to be defined to be able to select in customizing. How can this b

  • Need help activating photoshop cs5 on second machine (mac)

    Hello i have adobe photoshop cs5 on my windows desktop and had installed it today on my laptop which would be my second machine, i download and get to the serial number part which i referred back to a email that activated it and put that in. Each tim