Problem in implimenting BADI CRM_ORDER_AUTH_CHECK

Hi All
The requirement for BADI is to maintain authorization for own transactions.the users who is involved in transactions should only be authorized to see the transactions.Other users who are not involved in partner function like "Assigned to" & "Account responsible " should not be able to see the transactions like Activity .Lead , Opportunity ,Sales orders.& Service orders.
I Have implemented Badi CRM_ORDER_AUTH_CHECK 
but its giving problem while creating a lead.
this the code
METHOD if_ex_crm_order_auth_check~crm_order_add_auth_check.
******************For the Import Parameter****************************
DATA: wa_header_guid TYPE crmt_object_guid.
DATA: wa_mode TYPE crmt_mode.
DATA: wa_process_type TYPE crmt_process_type.
DATA: wa_orgman_wrk TYPE crmt_orgman_wrk.
************Local Variable********************************************
  DATA: username TYPE xubname.
  DATA: person_number TYPE ad_persnum.
  DATA: partner TYPE bu_partner ,
        partner2 TYPE bu_partner ,
        partner1 TYPE bu_partner ,
        flag(1) ,
        flag1(1).
  DATA: curent_user TYPE sy-uname .
  DATA: wa_username TYPE bapibname ,
        partner_order TYPE crmt_partner_external_wrkt ,
        wa_partner_order LIKE LINE OF partner_order ,
        order_guid TYPE crmt_object_guid_tab ,
        wa_order_guid LIKE LINE OF order_guid ,
        auth_check_flag TYPE crmt_boolean VALUE 'X' .
  DATA: org TYPE  crmt_orgman_wrkt .
  DATA: wa_org LIKE LINE OF org .
  DATA: ls_message   TYPE bapiret2,
        ls_applog    TYPE crmt_bsp_applog_tab,
        lt_messages  TYPE bapiret2_t,
        wa_messages  TYPE bapiret2,
        wa_applog    TYPE crmt_bsp_applog,
        count TYPE i ,
        object_key   TYPE crmt_bsp_objectkey.
  DATA:  del_message  TYPE STANDARD TABLE OF   bapiret2,
         wa_del       TYPE bapiret2,
         ref_object TYPE crmt_object_guid .
  DATA: y_lv_log_handle TYPE balloghndl,
        y_i_header_guid TYPE crmt_object_guid_tab.
  curent_user = sy-uname .
  MOVE iv_header_guid TO wa_order_guid .
  APPEND wa_order_guid TO order_guid .
  wa_username-bapibname = curent_user.
  MOVE iv_header_guid TO ref_object.
  CALL FUNCTION 'COM_BPUS_BUPA_FOR_USER_GET'
    EXPORTING
      is_username           = wa_username
    IMPORTING
      ev_businesspartner    = partner1
    EXCEPTIONS
      no_central_person     = 1
      no_business_partner   = 2
      no_id                 = 3
      no_user               = 4
      no_alias              = 5
      alias_and_user_differ = 6
      internal_error        = 7
      OTHERS                = 8.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
      input  = partner1
    IMPORTING
      output = partner1.
  CASE iv_process_type .
    WHEN 'YLD'.
      IF iv_mode EQ 'C' .
        CALL FUNCTION 'CRM_ORDER_READ'
          EXPORTING
            it_header_guid       = order_guid
            iv_no_auth_check     = auth_check_flag
          IMPORTING
            et_orgman            = org
            et_partner           = partner_order
          CHANGING
            cv_log_handle        = y_lv_log_handle
          EXCEPTIONS
            document_not_found   = 1
            error_occurred       = 2
            document_locked      = 3
            no_change_authority  = 4
            no_display_authority = 5
            no_change_allowed    = 6
            OTHERS               = 7.
        IF sy-subrc EQ 0 AND partner_order IS NOT INITIAL.
          LOOP AT partner_order INTO wa_partner_order WHERE partner_fct = '00000014' OR partner_fct = '00000012'.
            MOVE wa_partner_order-partner_no TO partner2 .
            IF partner2 EQ partner1 .
              flag = 'X' .
            ENDIF .
            flag1 = 'X' .
          ENDLOOP.
          IF flag NE 'X' and flag1 eq 'X' .
            AUTHORITY-CHECK OBJECT 'CRM_ORD_OE'  ID 'SALES_ORG'  FIELD is_orgman_wrk-sales_org .
            IF sy-subrc NE 0 .
              RAISE no_authority .
            ENDIF.
          ELSE.
            RAISE no_authority .
Please help ASAP

Hi Amiya,
I am working on a same Scenario.
*The users who is involved in transactions should only be authorized to see the transactions
and other users who are not involved in PARTNER FUNCTION should not see the transactions*
So, can u help me out in this.
Thanks & Regards,
Esaki

Similar Messages

  • Finding implimented badi

    Hi Gui's,
    Badi has been implimented for tr code FINT.How to find implimented Badi for that one.
    Please any one suggest me.
    Thanks
    santhosh

    Hi ,
    go to t-code Se15>expand the enhacement tab>-->enter package under Badi's tab and
                                                                         -->enter Badi name and execute
                                                         execute you will get the list of Badi's and implementations under badi
    Prabhudas

  • Claims  Error " Please Impliment BADI for Approver and Approver Group"

    Hi all,
    We have configured all the Eligibility criteria for an employee to create an
    Advance and claim request through ESS.
    while raising a claim or Advance request it is
    showing the message request validation sucess full
    but when we are sending the request it is throwing the error.
    " Please Impliment BADI for Approver and Approver Group"
    we have configured the
    1. Privileges Group
    2.Approver Group
    3.Map Privileges Groups to Approver Groups
    still Issue is there?
    Warm Regards
    Hari Sankar M

    Hi All,
    We have Implemented Badi to determine Approver and Approver Group.
    while executing the Application its throwing a new error
    "Incorrect Status Movement(New:New to In-Process:Approved) for Claim"
    We have put a break point inside the Badi but it is not getting called?
    Regards
    Hari Sankar M

  • Error message problem in ORDER_SAVE badi.

    I have used a error message using MESSAGE statement in ORDER_SAVE badi. The problem is when I press the save button and if the condision fails it shows error message. After if you press enter it shows the order is saved.
    It is strange. Please help.

    Can you give some more information?
    1. Which method of the badi are you using?
    2. Do you raise the exception error_occured in this method?
    In general, if you use change_before_update method and raise the exception if you do not want to save the order, the order would not be saved. This exception should be raised every time the method is executed if you do not want to save the current order.
    See the standard implementation class CL_IM_CRM_BUS20001_UPLOAD.
    Hope this helps. If not, post the code, so that I can check.
    Prakash

  • New video problems after replacing bad cap

    We are attempting to repair our first gen IMac G5 after it started having a problem with randomly shutting down. After much online research, and everything pointing towards bad capacitors, we opened up the machine and sure enough there was a bulging cap. We did the LED tests as well (fine), and ran hardware test (which also pointed to a problem on the logic board). After ringing the local Apple tech and confirming that they would only replace the whole board, not individual capacitors, we found a repair shop locally that was willing to solder on a new cap for us.
    So we've put the whole machine back together today, and again the LEDs light fine. However, now, the video is totally messed up! It starts up as far as the login screen but it'd be impossible to log in as the screen is so badly scrambled.
    Now we're trying to decide what the culprit is--incorrect reassembly? Accidental damage to the video cable during disassembly/assembly? Static electricity zapped the board at some point? Replacement cap not good enough (it's got a much higher uF and voltage rating but that seems to not be critical)?
    Any pointers on how to proceed? We're loathe to throw in the towel just yet!

    Don't throw in the towel, take it back to your local tech and have her replace the cap with one of the proper rating.

  • MAC PRO USB Problem - Traced to bad Apple Keyboard Extension Cable

    I found a fix to a problem synching to my itunes Library on my early 2008 MAC PRO.   The Apple supplied USB extension cable for the keyboard was defective.
    The symptoms were hangs in itunes and finder synching to iPods and transferring data to USB hard drives. The iPods and hard drives never lost power and no errors/log entries were made. The transfers simply stalled and would not continue. itunes and finder would hang until the drive or ipod was removed. These devices were installed directly to USB ports on the MAC PRO. No other USB devices were connected except for the aluminum keyboard and mighty mouse; the mouse was connected to the keyboard. The keyboard was connected using the USB extension cable that shipped with the MAC PRO.
    Hardware diagnostics were all clear. The keyboard and mouse never had any connection problems. Only itunes syncs and hard drive copies would fail; these would occur at random times. I had an open ticket with Apple to have the logic board replaced as it was diagnosed to be a hardware/USB problem.
    Removal or replacement of the extension cable on the keyboard (which was connected to a different USB port and NOT in the USB chain with the ipod and hard drives) permanently fixed the problem. I cancelled the Apple HW replacement.
    I have noted several posts with others having problems with USB ports and devices. I wonder if Apple has an unknown problem with bad keyboard extension cables.

    I think you may be onto something there. I'm just a few weeks into my second Mac Pro and again it's having the same USB problems which led Apple to give me a replacement machine previously. I went through several weeks of considerable testing with Apple Engineers prior to that - an Apple Care application to collect data from my machine, Apple Developer USB prober and two clean installs. The latest machine initially showed no sign of the problem then it started again - 2 iPods "can not be read or written to" part way through sync, Aperture quitting importing from USB SD card reader, USB drives dismounting etc. So I pulled out the Aluminium keyboard and, lo and behold, the iPods managed to get all the way through synching without errors. I really like the alu keyboard so it's a huge shame that it might be the cause of all my problems so far - and the Mac Pro is otherwise a beautiful computer.
    But is this really a hardware problem of the internal USB cards and power management or supply?

  • Long Text problem in a BADI

    Hi Everyone,
    I am implementing BADI "WORKORDER_UPDATE". The requirement is there should be no changes made on the IW32 transaction. I have successfully implemented the BADI and it is now giving an error when we try to change anything on the order in IW32.
    The problem is with the longtext. There is a field TXCHG which I used to see if there are any changes being made to the long text. When someone changes the lontext and tries to save it, it gives an error but still retains the changed longtext. The code works fine with all other changes(I mean it gives an error when they try to change anything in IW32 and will not retain the changes). But this does not happen in the case of long text. It gives an error but still has the changed long text as part of the order.
    Any suggestions on how to proceeed? I am using instance  Before_Update in this BADI.
    Thanks
    Kumar.

    Do u mean after giving the Error message, even if u come out without saving it is keeping the changes?
    If the answer to the above question is no then try the following procedure:
    Read the long text using READ_TEXT (function module) by passing the TDID, TDOBJECT, TDSPRAS, TDNAME (u can get these details by going through the menu edit-> go to header). 
    Store that in an internal table and then append all the lines of this internal table into a string Variable and assign this variable's text to the field in which long text is being displayed.
    This should work bcoz , in the database only the original Long text is stored and we are retrieving it and displaying back in the relevant field.
    Please reply if it works.....

  • Problem in ME22n - BADI.

    HI Experts,
    I have a requirement to make in transaction ME22n.I have used BADI - ME_PROCESS_PO_CUST.
    After selecting the Purchase Order Type(MEPO_TOPLINE-BSART) for only a list of specific types and clicking on the
    Check box -- Delivery Complete (MEPOITEM-ELIKZ) in the Item ->Delivery tab, It should trigger a popup.
    I am able to trigger this well, But the problem is If I save the changes made and then change the PO type to some other specified in my list of choices. The popup is still triggered.
    I have coded with conditional If for checkbox ='X' and taking the field  MEPOHEADER-BSART and then proceeded.
    Please help me to solve this.
    Regards,
    Gopinath

    the code is:
    DATA : w_mepoheader TYPE mepoheader.
      CLEAR: g_po_type_flag,
             g_po_ebeln.
      w_mepoheader = im_header->get_data( ).
      CASE w_mepoheader-bsart.
        WHEN 'ZNB'.
          g_po_type_flag = 'X'.
          g_po_ebeln = w_mepoheader-ebeln.
        WHEN 'NB'.
          g_po_type_flag = 'X'.
          g_po_ebeln = w_mepoheader-ebeln.
        WHEN 'ZPO3'.
          g_po_type_flag = 'X'.
          g_po_ebeln = w_mepoheader-ebeln.
        WHEN 'ZPO4'.
          g_po_type_flag = 'X'.
          g_po_ebeln = w_mepoheader-ebeln.
        WHEN 'ZPO5'.
          g_po_type_flag = 'X'.
          g_po_ebeln = w_mepoheader-ebeln.
        WHEN 'ZUB1'.
          g_po_type_flag = 'X'.
          g_po_ebeln = w_mepoheader-ebeln.
      ENDCASE.
      DATA: w_returncode(1)  TYPE c,
            w_mepoitem       TYPE mepoitem,
            l_flag           TYPE c,
            notify_type      TYPE c LENGTH 5 VALUE 'L2',
            w_bdcdata        TYPE bdcdata,
            w_bdcdata_tab    TYPE TABLE OF bdcdata,
            w_options        TYPE ctu_params.
      w_mepoitem = im_item->get_data( ).
      IF g_po_type_flag = 'X'.
        IF w_mepoitem-elikz = 'X'.
          l_flag = 'X'.
        ENDIF.
      ENDIF.
      IF l_flag = 'X'.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = 'Clorox '
            text_question         = 'Do you want to create a Vendor Quality Notification?'(001)
            text_button_1         = 'Yes'(002)
            icon_button_1         = 'ICON_OKAY'
            text_button_2         = 'No'(003)
            icon_button_2         = 'ICON_CANCEL'
            default_button        = '1'
            display_cancel_button = ''
            popup_type            = 'NO_ICON'
          IMPORTING
            answer                = w_returncode.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.

  • Facing a problem to impliment a concept in Bex3.5

    Hi All,
      I have implimented a concept in BEX7.0, but I am finding difficult to implement it in BEX3.5.
    The problem is:
      I have defined an exception in BEX7.0 like, if one of my keyfig value is matching the condition defined in exceptions it is affecting one more keyfigure(i.e., applying colors on that).
      Now I want to impliment this in 3.5.
    can anyone please tell me how to do this.
    Thanks.
    Vinay

    vvv

  • Problems with a BADI

    Hello everyone, I have a problem, there is a BADI which is used by a BSP application and also by an application in R3, this BADI has an error message sentence that works in R3 but dont work in BSP (DUMP), is there some variable (like sy-batch) that distinguishes whether the BADI is used by R3 or BSP?
    Thanks for your help
    PD: Sry for my bad english

    Hello,
    This can easily be done by implementing the interface IF_BSP_APPLICATION.
    This will give you back information about the runtime of the BSP, in case you use this in R3 it will return nothing because there is no active BSP runtime.
    More info on :
    [http://help.sap.com/saphelp_nw04/helpdata/en/2a/31b97e35a111d5992100508b6b8b11/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/2a/31b97e35a111d5992100508b6b8b11/content.htm]
    Success.
    Wim

  • Problem with custom_logic badi and it_param - ujk_large_string 1024

    Hi experts,
    I have a Problem triggering a script with custom logic badi.
    I try to implement a data and comment copy package for alle dimensions with source and target.
    Target is pushed in one string to IT_PARAM table of type UJK_T_SCRIPT_LOGIC_HASHTABLE.
    My Problem is now that the UJK_LARGE_STRING with 1024 characters is too small and many of the Dimension are cutted off.
    Do you know a solution or a Workaround for this Problem ? Requirement ist only one prompt/selection Screen.
    Thanks in advance and best regards
    heinrich

    Hi Heinrich,
    Split one parameter into many parameters.
    If you need more help then please share a screen shot of your script logic.
    Andy

  • Problem after Implementing BADI

    Hi all,
    I implemented BADI MB_MIGO_BADI  it was working fine, but it was deleted
    and again trying to implement second time it is showing the message
    Implementation ZTEST_MIGO migrated (see long
    for instructions) and choose enhancement spot and i implemented the BADI but
    this time it is not triggering.
    what might  be the problem any help?
    Thanks
    Satish.

    Dear Satish,
    Once u implement  a BADI in ECC it will automatically generates the Enchament Spot. Here u deleted ur BADI implementation. Ur BADI got deleted and the enhancement for tht not get deleted. Thts y its showing error when  u r creating the second time. So implement ur badi inside the Enhancement Spot using SE19.
    With Regards,
    Sumodh.P

  • Week 25 17" w/ Problems Sleeping and Bad Speaker

    I bought a 17" MacBook Pro two weeks ago to replace my 17" 1st generation powerbook. The good: fast booting, quick Safari & iphoto, great glossy display (I like it, some won't), larger hard drive. The bad: my left speaker is distorted, it won't stay asleep when traveling in my Brenthaven case.
    There are lots of posts about bad speakers and I definitely received one. There are some posts about the sleeping problem, so something is definitely wrong. I checked all the obvious culprits for waking and zapped PRAM and PMU so it is off to AppleCare. I am disappointed that a $2,500 + laptop is going into service so soon. Overall my experience with Apple is they will definitly take care of it, but I will have to put up with being without a laptop for awhile.
    If you are thinking of buying one I don't know if I would suggest waiting or not. Overall I love the machine, but the constant waking is unacceptable since it depletes the battery. Unfortunately it still seems to be a bit of a crap shoot whether you get a flawless 17" or a troubled one.

    remember
    alternating MacWrite and the System disk in a single
    floppy anyone)
    ... me
    Believe me there is no alternative to Mac OS X (for me). I was lost to the Windows world for more than 12 years in between ...
    The migration from PowerPC to Intel is a big step. My MBP works just fine besides the "hot" and the "whine" issue. And apparently the solutions are around the corner.
    The "EARLY ADAPTORS" have to pay more to get less. Whatever it is - cameras, cars, computers - it's better to wait at least 6 months to get the bugs out. Maybe I will be wiser the next time
    Martin
    MBP 15 inch   Mac OS X (10.4.7)  

  • Matshita DVD-R UJ-85J DVD burning problems - drive going bad? replacement?

    I purchased a couple spindles of TDK DVD+R DL discs from Newegg last week; got them yesterday and stuck one in my iMac to start burning some of this stuff I've got backed up (using Toast 10), and ran into a problem... it failed almost immediately with a "medium error."
    I tried Disk Utility and it quit in a similar fashion on several discs, never actually burning anything to them.
    I've stuck with TDK in the past because they seemed to be the most compatible, but now I was thinking that maybe they changed something in the manufacturing process that caused them to not work anymore.
    Fortunately, I have access to a pretty new MacBook and tried using the discs in there, and they worked just fine with the same data and the same version of Toast.
    About an hour ago, I pulled out a stack of TDK single-layer DVDs I bought a few months ago (and that worked with no issues in my iMac at that time), and slipped one into my iMac to burn a smaller set of files, and it failed in exactly the same way as the DL discs did yesterday.
    Since then, I've been searching everywhere for information on this (including firmware updates and a place to buy a replacement drive) and found very little.
    What I did find suggests that the drive might be going bad (or at the very least choked with dust).
    I can't find anything solid on what drive I could buy to replace it myself, though.
    And I'm not very optimistic about taking it to the Genius Bar, as I don't have AppleCare and it sounds like they would just put in an equally failure-prone Matshita drive that'll be dead within a year.
    I'll try cleaning it as soon as I can locate one of those brush discs and see if that helps.
    I've also noticed that it will occasionally stop mounting discs until after a restart.

    I have a 24" iMac, Approx 2 Years Old, Mine was having the same problems as yours, I had Memorex DL DVD + R and half the time it would spit them back out and the other half it would fail at 50%, when before it would read and write fine. So I figured it was hardware when i was having the same problem on the boot camp side. So two days ago I took it in to the apple store in plano, they looked at it, said they'd put a new drive in, And it was free thanks to the apple care plan I had with it. Just picked it up a few hours ago and I just burned a DL DVD and it worked. So my suggestion is visit your apple store and maybe they'll replace it, ive heard amounts as high as $450 for replacements without the protection plan, maybe you could go firewire/usb external drive?
    By the way, I can't remember what drive I had on my machine, wanna say it started with an "O", but they replaced it with a Pioneer, very quiet and seems fast.
    Good Luck

  • Upgrade problems and really bad customer service

    Hi all,
    I have recently had our exhance upgraded to allow me to get ADSL 2+, so after lots and lots of phone calls as nobody seems to know what anyone is doing in the call center, I finally got through to someone who said I would have to upgrade my package so that when the order went though I would be plugged into the new equipment.  Great I thought, so i went ahead and the order was made, activation date was a week later so I just waited, looking forward to my new speeds.  Activation day came and passed, so phoned them up only for the first person to tell me I had to wait another 48hrs but would not give me any explanation.  I wasnt happy with this so I rang again an hour later, obviously got a different person and he said he had phoned the wholesale department and the issue was that they had a problem with there order system which had now just been sorted and that I would be switched on in 48 hours.
    I waited 36hours, then thought I would just ring up make sure everything was on track as I had a bad feeling at this point.  This time the operator put me on hold for 10 mins whilst he phoned the relevant people.  He came back and told me that the exchange equipment was all full and that they couldnt upgrade me just yet until they get a free slot.  I did point out that this was totally different information I had been given several times before, also I bet if i was a new customrer I would get connected on time (even though there are no slots).  Again he said I would just have to sit and wait.
    I find this attitude to be atrocious, telling a customer they have to sit and wait and maybe it will get done, maybe it wont.  As well as constantly getting different information.  Im sure If I rang up again now I would get a different story again.  Can anyone please advise me on what to do next, Im tired of ringing up and getting different information all the time, If I didnt have 10 months left on my contract I would just leave, even though there must be some breach of contract here, Im just not sure.
    Thanks

    I have asked a moderator to provide assistance, they will post an invite on this thread.
    They are the only BT employees on this forum, and are a UK based team of people, who take personal ownership of your problem.
    Once you get a reply, make sure that you are logged into the forum, then click on their name, you will see a screen like this. Click on the link as shown below.
    Please do not send them a personal message, as they may not be on duty for a long time, and your message will not be tracked properly.
    For your own security, do not post any personal details, on this forum. That includes any tracking number you are give.
    They will respond either by phone or e-mail within 5-6 working days.
    Please use the tracked e-mail, to reply, not via the forum. Thanks
    This is the form you should see when you click on the link. If you do not see this form, then you have selected the wrong link.
    When you submit the form, you will receive an enquiry number, so please keep a note of it
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

Maybe you are looking for

  • XI 3.0 Installation Problem: no central managment server running

    Hi, I am totally new to BO our company just purchased the application and I have installed XI 3.0 on one of our server. I have setup the DB and the installation finished successfully. However I can't find CMS anywhere on the server. It seems like all

  • Problem with Premiere Elements 11 uploading mp4 files

    I tried to upload a video footage for editing. The video was taken using a GoPro camera and the output is mP4. The footage playback on Premiere Elements 11 was choppy and stalled often. I asked someone else with the same program and he experienced th

  • Macbook Won't Turn On - HELP!

    Last night I went to restart my Macbook and it took forever to shut down. Once it shut down, it stayed that way and never restarted. It is fully charged (it barely ever gets unplugged). I tried unplugging it, holding down the start button, and nothin

  • PDF Software causing problems in sending some PDF files but not all?

    I have been having problems sending some emails with PDF attatchments, they are being returned more and more frequently.  I've spoken to our server host and his answer is as follows saying that the problem is we are using "cheap PDF software" which i

  • Order of loading Master Data - Fact or Fiction

    I understand that for loading Master Data for InfoCube 0FIAA_C01 (or any other) you should load starting from the lowest level. That means for every characteristic in the cube you have to check and see if any of the InfoObjects have Master Data attri