Using BADI to populate EBAN-ADRN2 field

I have an issue that requires me to use a userexit or BADI. When Planned Orders are converted to PRs in MD14/MD15, the field EBAN-ADRN2 are not populated with a delivery address which is to be based on MRP Controller (EBAN_DISPO). So I need to use a user exit to fix this problem. So far I can seem to find any user exits for this.
So I have decided to use the BADI ME_REQ_POSTED to update the ADRN2 field in EBAN. I don't know if this is the best BADI to use. From my research I think this BADI can be only used for data checking and not updating.
I need to know whether I can proceed with using this BADI or not is there any other that I can use? I am also new to Abap Objects. I don't know how to code and what functions to use. I need some help on the coding part.
I need to solve this urgently. Please do help.

Now I am using a different BADI which is MD_PURREQ_CHANGE. There are two methods in this BADI and I am using CHANGE_BEFORE_SAVE_CONV which saves changes to the PR created From Planned Order in MD15. Here is the code that I did in this method:
  if im_plaf-dispo = 'GS1'.
    ch_eban-adrn2 = '22658'.
    ch_changed = 'X'.
  elseif im_plaf-dispo = 'PW1'.
    ch_eban-adrn2 = '22722'.
    ch_changed = 'X'.
  endif.
The method receives the PLAF table and changes the EBAN-ADRN2 field which is the delivery address.
This BADI works fine. The ADRN2 field in EBAN is successfully populated. But whhen I attempt to view the PR in ME53N, I am receiving an 'EXIT' message from the system saying 'Address doesn't exist 22658  11000221 00001'; and the process is terminated and returned to the initial SAP screen.
I would like to know if my code is correct or is there anyone who can give me an idea on why this happening.

Similar Messages

  • CRM Pricing - BADI to Populate pricing conditions fields

    Hello All,
    We have CRM 5.0 installed in our customer.
    We are facing problems when we tried to replicate the pricing  from R/3.
    Basically, all Brazilian formulas we have in R/3 are Z. We tried to replicate them in JAVA (IPC) with no success. At this time, it is imposible for us to move to the standard because of the decision of the business.
    We are trying to find one BADI where we can populate all the pricing conditions retrieved via RFC from R/3. Unfortunatelly we don't have good luck with this.
    Our idea is to use this BADI to call R/3 and retrieve the conditions needed, and then populate the CRM pricing fields..
    Could you please help us? Do you have any other idea to solve this issue?
    This is very critical for us.
    Thanks in advance.
    Martin

    Hi Ntk,
    Thanks for your reply.
    I tried to search in se18. I found one BADI that runs when users enter new materials or changes the quantity of the sales order.
    This one  does not help us too much, because when you go to conditions tab (into CRMD_ORDER or via ICWEB) all conditions are redetermined with the pricing determined in IPC.
    We want to fill the conditions of the sales orders or the sales quotations at running time. In the BADI we would use the function module RFC SD_SALESDOCUMENT_CREATE (in simulation mode) in R/3 and retrieve all conditions fields and then populate the pricing conditions in CRM.
    Do you know any BADI with this behaviour? Or another similar?
    THANKS!

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings,
    I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections.  When the user makes a selection, I would like to have the text field (called "Hospital_Address") below the drop down box populate with the corresponding address for the selection.  I have the "Hospital_Address" text field configured for multiple lines and would like the address to have a line break between the street address and the city/state/zip.
    For example, if the user selected "Hospital 1", the text field would display:
    123 Main St
    Anytown, CA 12345
    Any help or examples you can provide would be greatly appreciated.

    You have the element names within the object within brackets.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    // some debugging code to see location names;
    console.show();console.clear():
    for(I in Location) {
    console.println(I);
    // end debugging code;
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;
    This is not a beginners task but requires a fair amount of knowledge about the structure of objects, defining strings, and structure of arrays.
    Are you sure you have all the field names correctly spelled and capitalized?
    Do you get any error in the JavaScript console?
    Just trying the line that defines the "Location", I get the following error:
    SyntaxError: invalid property id
    1:Console:Exec
    undefined
    All the form field in a PDF are processed by using JavaScript and any error in any script will stop JavaScript processing.
    It might help to have a link to the problem form.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;

  • Virtual KF using BADI

    Dear all,
    My requirement is to create a virtual KF using BADI to populate a keyfigure ZWKDAY value in the bex query.
    Condition -  I need to read 0calday from the cube and find it whether its a workday or not.
    If its working day then my KF ZWKDAY should have value 1 else 0.
    I created a BADI ZCL_IM_TEST_VIRTUAL for this.
    I defined attributes as
    P_KYF_RB_WKDC     Instance Attribute     Public     Type     I
    P_CHA_0CALDAY     Instance Attribute     Public     Type     I
    *METHOD IF_EX_RSR_OLAP_BADI~DEFINE .
      DATA: l_s_chanm   TYPE rrke_s_chanm,
            l_kyfnm     TYPE rsd_kyfnm.
      FIELD-SYMBOLS:
            <l_s_chanm> TYPE rrke_s_chanm.
    CASE i_s_rkb1d-infocube.
       WHEN 'RB_RT_C01'.
        characteristic Calendar day
         l_s_chanm-chanm = '0calday'.
         l_s_chanm-mode  = rrke_c_mode-read. " rrke_c_mode-read / rrke_c_mode-no_selection
         APPEND l_s_chanm TO c_t_chanm.
        key figure DETERMINE WORKDAY
         l_kyfnm = 'RB_WKDC'.
         APPEND l_kyfnm TO c_t_kyfnm.
    ENDCASE.
    ENDMETHOD. 
    METHOD IF_EX_RSR_OLAP_BADI~COMPUTE .
      FIELD-SYMBOLS:
      <fs_wkdc> type any,
      <fs_0calday> type any.
      Data: lv_workday(1) type C,
            lv_calday type sy-datum,
            l_flag   type char1 .
      Assign component P_CHA_0CALDAY of structure c_s_data to <fs_0calday>.
      Assign component P_kyf_RB_wkdc of structure c_s_data to <fs_wkdc>.
    <fs_0calday> = sy-datum.
      CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
        EXPORTING
        CORRECT_OPTION                     = '+'
          DATE                               =         <fs_0calday>
          FACTORY_CALENDAR_ID                = '01'
       IMPORTING
         WORKINGDAY_INDICATOR               =  l_flag
      EXCEPTIONS
        CALENDAR_BUFFER_NOT_LOADABLE       = 1
      if l_flag = '+'.
          <fs_wkdc> = 0.
      else.
          <fs_wkdc> = 1.
      endif.         
    When I execute my query in RSRT transactionI am getting the following error.
    "The function call of DATE_CONVERT_TO_FACTORYDATE failed; a field may have been assigned to the parameter DATE whose type is not compacitable".
    When I tried to debug the code I found the type of <fs_0calday> is structure of c_s_data but I dont know how to solve this error. Any help on this is appreciated.....
    Regards..
    Bala

    Hi,
    Instead of assigning type as any to your field symbol <fs_0calday>.
    You will have to assign the same type as type of type of export parameter DATE of FM DATE_CONVERT_TO_FACTORYDATE.
    Just change the attribute type and execute your query again.
    Regards,
    Durgesh.

  • Triggering BAdI on change of customer field in ME21N

    Hello,
    How can I tell transaction ME21N that relevant field values have been changed?
    I'm using BAdI ME_PROCESS_PO_CUST to change several field values in ME21N and ME22N. The BAdI (method PROCESS_ITEM) is called whenever a field changes, which is good.
    However, the BAdI is NOT called when a customer field changes.
    Of course, I can create a PAI module to catch changes in the customer fields, but how can I notify ME21N that the BAdI has to be called?
    Thanks in advance
    Roland

    Hi!
    Apparently this does not work. However, I implemented BAdI ME_GUI_PO_CUST to create a new customer subscreen and this one works.
    Unfortunately the "old" user exit and the "new" BAdI don't work together very well...
    best regards
    Roland

  • Add Item using REST and populate People field (SharePoint 2010)

    I am trying to add an item to a list that has a People type field using REST API.  For some reason, I am getting 400 (Bad Request) error.  Can anyone show me how to add a list item and populate the user field?
    Here's the code snippet I am using -
    var url = 'https://mytestsite/_vti_bin/listdata.svc/mylist';
    var item = {};
    item.Title = 'my REST item';
    item.User = 'contoso\user1';
    var jsonObj = Sys.Serialization.JavaScriptSerializer.serialize(item);
    $.ajax({
             type: 'POST',
             url: url,
             contentType: 'application/json',
             processData: false,
             data: jsonObj,
             success: function ()
               console.log('item updated');
    Thanks!

    Hi,
    To update the People field, we will need to make a reference to the user information list.
    Here are two links will provide more information:
    http://sharepoint.stackexchange.com/questions/65650/rest-api-update-a-muli-value-user-field
    http://charliedigital.com/2011/04/23/updating-user-fields-via-listdata-svc/
    You can view the User Information list in this way:
    http://zimmergren.net/technical/sharepoints-hidden-user-list-user-information-list
    Best regards
    Patrick Liang
    TechNet Community Support

  • Adding a new field in MIRO using BADI

    Hai Experts,
    I am new to BADI. Today one requirement was there to add a field in MIRO screen for costcenter.
    As i searched in SDN i got information to use BADI MRM_ITEM_CUSTFIELDS.
    Is it right or anyother option is there to create a field.
    If it is right please give me detailed steps to create.
    Thanks in advance.

    Its my mistake in the first reply as i thought it was for MIGO transaction.
    Anyways you can use MRM_ITEM_CUSTFIELDS badi for MIRO.
    Check the documentation of this badi in SE18.
    You can get more information in Screen Exit MIRO.

  • Field restriction for ME22N using BADI

    Dear All,
    i had a requirement in which i had to restrict ME22N transaction for a particular user for a particular document type
    so i used BADI ME_PROCESS_PO_CUST now the requirement has changed and the user wants the restriction only on three fields rather than entire transaction.
    is there any provision in BADi by which i can prevent changes made to a  particular fields the fields are QUANTITY,RATE PER UNIT & PAYMENT TERMS fields,by throwing error message if changes are done and  for other fields changes should be allowed .
    my code is as below
    method IF_EX_ME_PROCESS_PO_CUST~CHECK.
    IF SY-TCODE = 'ME22N'.
      DATA: IT_MEPOHEADER  TYPE MEPOHEADER.
        IT_MEPOHEADER = IM_HEADER->GET_DATA( ).
         IF IT_MEPOHEADER-BSART = 'ZLNB' OR IT_MEPOHEADER-BSART = 'ZLUB' OR IT_MEPOHEADER-BSART = 'ZLS'
            OR IT_MEPOHEADER-BSART = 'ZLC' OR IT_MEPOHEADER-BSART = 'ZLFO' OR IT_MEPOHEADER-BSART = 'ZLLN'
              OR IT_MEPOHEADER-BSART = 'ZLDB'.
           IF SY-SUBRC = 0.
                IF SY-UNAME = 'ABAP05'  .
                        Message 'You are not authorized to use ME22N for the given  document type' type 'E'.
                 ENDIF.
             ENDIF.
          ENDIF.
         ENDIF.
    endmethod.
    can anyone plz help me
    Thanks in advance,
    Ronak

    Dear All,
    plz let me know if there is any other alternative (other than BADI) to restrict based on filteration for user , document type , and the three fields i have mentioned..
    Regards Ronak

  • Add new fields using BADI DNO_EVENT_SAVE in Solution Manager

    Hi,
    I would like to add new fields using BADI DNO_EVENT_SAVE. How can I add new fields? Thanks.

    Hi,
    This is the blog which explains how to add custom fields for CRM_DNO_MONITOR.
    /people/bruyneel.guillaume/blog/2008/06/13/service-desk-implementation-guide-part-ii
    Instead of looking or changing the BAdI, you can copy the program of CRM_DNO_MONITOR and modify it.
    Please check this thread:
    Reg : CRM_DNO_MONITOR
    Regards,
    Sanjai

  • Badi to populate location field

    Hi
    I need to write a BADI to populate location field in my service request.This is trouble ticket project i need to get the location code for the TT(trouble ticket)requestor and populate that in the service request order.
    Can anyone help me by giving a sample BADI?or how go about it
    Thanks
    Asha

    Hi Keerthi,
    Did you manage to find a solution for this?
    If so, can you share it with us?
    Thanks a lot!
    Susana Messias

  • Customer no to populate the Assignment field for Sales A/c using sort key

    Dear All,
    In 6.0, I am trying to get the Customer number to populate the Assignment field for Sales Account
    We have set the sales account to a 031 sort key - sort by customer, in FS00. When 031 is set, SAP goes to the BSEG table and looks at the KUNNR (customer) field and populates the Assignment field with what is in the KUNNR field of BSEG.
    The problem is: the customer number (KUNNR) does not contain any data in BSEG.
    The KUNNR field of all the other account lines for the document number are blank.
    Is it possible to bring the field in the General Ledger display?
    Does anyone know of a user exit or other solution?
    Thanks,
    Gov

    Hi,
    Check with SD consultant and use Copy control.

  • ESS Leave Custom fields, how to update them using BADIs

    Hi There,
    We are trying to use custom fields provided in ESS leave application, and we want to update them using BADI. As these information is not available on the screen while requesting leave request.
    I did look at PT_ABS_REQ BADI and seems i can use Post_Vio_BLOP .. but its unable to update table PTREQ_ATTABSDATA .
    Can you please suggest what can be best approach here.
    Thanks a lot.
    Rgds,

    Sudhir wrote:>
    > I did look at PT_ABS_REQ BADI and seems i can use Post_Vio_BLOP .. but its unable to update table PTREQ_ATTABSDATA .
    Did you look at using the Implict Enhancement Options available at the beginning & end of the POST_VIA_BLOP Method? Or even better, enhance the Class CL_PT_ARQ_REQ_EXIT & replace the IF_EX_PT_ABS_REQ~POST_VIA_BLOP Method with an Overwrite Exit?
    ~Suresh

  • A form field (for a client fax number) on my own web site is remembering my email address used to log into the site. The usual clearing of the remembered entry works OK, but evey time I remember the login it automatically populates this one field with my

    The form where this happens contains an email field as well as a password field, so it does have both of the fields that are on the login page. It is used to modify the details of the user of our site and is accessed by the administrators, not the users themselves. To auto fill the fax field (which is named _fax) with my email address is very strange. If I log in as a different admin user then the email address I use to login appears in the field. The password field is also appears on the form and is being populated, presumably with my password. How can Firefox get it wrong and put an entry in a field with a different name, and why that field and not other empty fields on the form?
    == This happened ==
    Every time Firefox opened

    First be sure login and password are OK. Sometimes the address starts wit "http://..." and sometime starts with "ftp://...". Try both normal FTP access and Scure FTP access (SFTP). At the end, contact the site's provider.

  • How to populate the address field in real time from backend?

    Hi Guys,
    I want to populate the address field in srm portal when creating Shopping Cart. I got the data by using some BADI functions. Now the problem is I am not getting the structure/table where I should add that address so that it can reflect in the address field of shopping cart.
    Can anyone help me out?
    Regards,
    Virendra Kedia

    Joe - Work backwards from the value generated during the execution of the trigger. You have the value there so you could save it into a package variable right then (create a package with a variable and assign the value to the variable). Then create a process on the page (after the DML process) to assign the value of your package variable to a page item. Then in the branch back to page 1, pass the item. (Or without messing with the branch, the process could simply assign the package variable directly the the page 1 item -- :P1_ITEM := my_package.my_var; ).
    An alternative would be to use the "returning into" feature of DML to capture the PK of the created record into an item. Then the next page process could use the PK to fetch the new row and get the dbname value for passing to page 1.
    Another option would be to update session state directly in the trigger.
    Scott

  • BADI to populate Asset Master Class valu in Account Assignment Item Detail?

    Hi All,
    In Shopping Cart  - COST ASSIGNMENT - Account Assignment Item Details   Tab 
    we have
    Create New Asset Master Record    section  and the field
    Choose an Asset Master Class 
    I need to populate this field (Choose an Asset Master Class) with my own value.
    What BADI I can use to populate value on this field? Any ideas?
    Thanks in advance.

    Hi,
    As i told you there is no badi to do this.
    1-What you can do is to create a CUF in the accounting tab to store your asset category.
    You will then have to
    2- hide the standard field but let the standard populate it with a default value from the org structure
    3- add in the SRM iMG the cuf field for the accounting data.
    4- code bbp_doc_change_badi to populate your CUF field
    5- code bbp_driver_determine in order to call the FM to create the asset
    6- create 1 FM in ECC to create the asset (copy of bapi_fixedasset_create1)
    Hope this helps,
    Kind regards,
    Yann
    Edited by: Yann Bouillut on Apr 15, 2009 5:23 PM

Maybe you are looking for

  • What are the roles need to add for webservice user in SAP ECC 6.0

    Dear SDNS, Can you please help me to understand , what are the roles needed to add while creating a webservice user in ABAP STACK. Really appreciate your immediate help and response. Thanks and Regards. Suraj

  • Safari showing text as boxes with A in them after upgrade to OSX lion

    Hi, After upgrading to OSX Lion and the new Safari that comes with it 6.0. It is showing a lot of the charachters on some websites as a box with a capital A in them. These are then pastered all over the site. If i go to other browsers it is fine. Als

  • Purchased song doesn't work

    I just bought the new Linkin Park album but one of the songs doesn't work when I choose to play it. It doesn't load up to play, doesn't show the album artwork, and never starts to play. Plus when I listened to the album all the way through, track by

  • Setting Java ZWT.headless variable

    I am creating graphics on the fly with the Oracle JVM in the database. I need to set the headless environment variable. I found the command: -Djava.awt.headless=true I can not find where this needs to be run. Can this environment variable be set from

  • In cannot open MS Outlook 2010 email hyperlinks to a Firefox window. Am I missing something?

    Whenever I try to click on a hyperlink within a 2010 Outlook email I get this error: General failure. The URL was: "######". An error occurred in sending the command to the application. Not much to go on I know, but I'm reading that my default web br