UPDATE FIELDS USING BADI INVOICE_UPDATE

I have a requirement to change item level fields based on some condition during transaction MIRO, but the BADI INVOICE_UPDATE does not have any exporting parameters and thus not allow changing the fields. So is there any other way to do it? Appreciate your help.
Thank you,
Rohit
Edited by: Julius Bussche on Mar 19, 2009 9:24 PM
Please dont use CAPS-LOCK. It is generally interpreted as SHOUTING

Hi,
you could try to do something via field-symbols (but be careful):
e.g.
CONSTANTS: c_ydrseg(18) TYPE c VALUE '(SAPLMR1M)YDRSEG[]'.
  DATA: wa_drseg TYPE mmcr_drseg.
  CLEAR wa_drseg.
  FIELD-SYMBOLS: <fs_ydrseg> TYPE table.
  ASSIGN (c_ydrseg) TO <fs_ydrseg>.
  CLEAR lt_drseg.
  REFRESH lt_drseg.
  lt_drseg[] = <fs_ydrseg>.
  IF NOT <fs_ydrseg>[] IS INITIAL.
    LOOP AT lt_drseg INTO wa_drseg.
  * do something with EREKZ
    ENDIF.
  ENDIF.
Best regards

Similar Messages

  • 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

  • Read from database (Access) and update fields using MS ADODB

    Hello,
    I am trying to get records from database using MS ADODB._connection & ADODB._Recordset objects (from LabVIEW 6)
    I can:
    1. open connection (with ADODB._connection)
    2. write into tables (with ADODB._command)
    I can not: gets records and update fields using ADODB._connection & ADODB._Recordset.
    I do not know:
    1. how to connect between the connection that was opened and the recordset object
    2. where I can write the SQL text as input to the recordset
    Attached is DataBase.llb with DB_read.vi that display my steps.
    Thanks.
    Attachments:
    DataBase.llb ‏40 KB

    Try this one, after updating the names for database and the table you want.
    Let me know if it's working.
    p.s.: if you have problems, it could be a different adodb version ... but the sequence of methods is the same
    Attachments:
    EditdatabaseMe.vi ‏57 KB

  • 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

  • To update field using BAPI

    Hello experts,
    I have added one field using append structure in table MARC. I want to updated this field usnign BAPI_MATERIAL_SAVEDATA. can anybody tell me the procedure to do that?
    Thanks in advance.

    Hello,
    Check the documentation of the function module BAPI_MATERIAL_SAVEDATA. There is a parameter in the FM - EXTENSIONIN where in new fields added to the table can be used to be updated.
    The documentation of that parameters tells you how this can be achieved.
    Create 2 structures of the type BAPI_TE_MARA and BAPI_TE_MARAX
    Now assign the field structure of the workarea of type BAPIPAREX. Assume gs_extensionin is of type BAPIPAREX and gs_bapi_te_mara is of type BAPI_TE_MARA (this should have the fields that have been added in the table)
    gs_extensionin-structure = 'BAPI_TE_MARA'.
    gs_extensionin-valuepart+0(18) = gs_bapi_te_mara-matnr.
    gs_extensionin-valuepart+18(length of the new field) = ga_bapi_te_mara-<new field added in the structure>.
    append gs_extensionin to gt_extensionin.
    gs_extensioninx-structure = 'BAPI_TE_MARAX'.
    gs_extensioninx-valuepart+0(18) = gs_bapi_te_mara-matnr.
    gs_extensioninx-valuepart+18(1) = 'X'..
    append gs_extensioninx to gt_extensioninx.
    Now pass these tables gt_extensionin and gt_extensionx to the parameters extensionin and extensioninx of the function module BAPI_MATERIAL_SAVEDATA.
    Also try searching SDN using Extending BAPI's
    Hope this will help in solving your query.
    Regards,
    Sachin

  • Problem with decimal fields using BADI For PD Infotypes

    Hi,
    I'm implementing BADI  HRBAS00INFTY.
    For reading the fields of infotype , I'm using the substring
    of the field NEW_INNNN-VDATA .
    I have a problem with fields of type DEC.
    In field NEW_INNNN-VDATA it looks like this :  '####'
    I believe that the possible reason for this is conversion from DEC to CHAR
    But I don't know how to fix it.
    Thank you .
    Message was edited by: Alon Lozinsky

    Hi Alon,
    We had same issue. Use following code.
    data: hri1011_str type hri1011.
    move new_innnn-vdata to hri1011_str.
    HRI1011_STR fields will have decimal values.
    Let me know if you still have any issues. If solution works, kindly do Point Recognition.
    -Bharat

  • Updating field using trigger

    I have a very basic table with four fields, DateReturned DueDate, daysoverdue and days. I am trying to use the following code to calculate the difference between the two dates and enter the result into days overdue. After this calculation I want to transfer only the positive values into the days field.
    Calculation 1 - based on When-Button-Pressed
    update test1 set daysoverdue = RETURNDATE - DUEDATE;
    I can get this to work using the formula option in Property Palette - is there any way I can use an if statement. I only really want to calculate days overdue if the return date is after due date so that I have positive values only - this would avoid the need for calculation two.
    Calculation two - - based on When-Button-Pressed
    update test1 set days = RETURNDATE - DUEDATE
    where daysoverdue >0;
    When I compile and press the button - my application crashes. I can run the code via SQLPlus and it works.
    What I would really like to do is the run the code automatically then the records are called up into the form. Any ideas and suggestions welcome. My PC that I am using is old and is a W2K machine with 256mb Ram and Approx 600Mhz processor.
    This is my first application I am developing so if I have left out information - sorry.

    my small advice is , pls do not write any
    insert , update or delete in forms
    if you want to do that pls call a database procedure
    for ex
    pls call a foll procedure in when-button-pressed
    trigger
    dp_update_overdue;
    and write the foll script in your oracle database
    create or replace procedure dp_update_overdue
    is
    begin
    update test1
    set daysoverdue = returndate- duedate
    where returndate > duedate;
    commit;
    end;
    bye
    pasupathy

  • UDF update field using Query

    Hi All,
    I have a udf field in OITM which we use to flag whether an item is obsolete or not, so Y or N is populated in all item records.
    I am trying to copy this field and its contents to be displayed in the Stock Data Tab (OITW) using a UDF but cannot get the query to work to automatically populate this new UDF?
    Any advice on the structure of the query or if I should try anything else would greatly received.
    Thanks, Richard

    Hi Richard......
    Try this......
    Select $[OITM.U_UDF.0]
    Replace UDF with your UDF Code and apply this FMS in the UDF at OITW area and then press Shift+F2
    Regards,
    Rahul

  • MIRO BADI 'INVOICE_UPDATE'

    I am using BADI 'INVOICE_UPDATE' to update a flag 'ZLSPR' in header data on SAVE in MIRO transaction. but the method 'CHANGE_AT_SAVE' in this BADI only has import parameters. No export parameters. Can anyone advice:
    1) if I can use this method to change values?
    2) is there anyother badi available for this transaction.
    Thank you.

    Hi,
       Can you pls help me as my requirment is also same.I have to change the "Base Line Date" i.e. ZFBDT field of BSIK which is there in the Importing Parameters of method "CHANGE_AT_SAVE". Can i change the importing parameters..
    If you get any alternate solution for the same, pls suggest me
    Regards,
    Rushikesh

  • Update field RBKP-RBSTAT on SAVE in MIRO transaction

    Hi!
    I am using BADI 'INVOICE_UPDATE' to update a flag 'RBSTAT' in header data (Table RBKP) on SAVE in MIRO transaction. but the method 'CHANGE_AT_SAVE' in this BADI only has import parameters. No export parameters. Can anyone advice:
    Is there anyother BADI available for this transaction.
    Thank you.

    Hi,
    Invoice update badi cannot be used to change any values while posting MIRO transaction, its used only to perform checks during doc entry.
    Refer to OSS Note: 392342 for more info.
    badi INVOICE_UPDATE doesn't change any data. But you can use badi MRM_PAYMENT_TERMS for updating ZLSPR.
    Check it once.

  • HR Master Data Enhancement using BAdi RSU5_SAPI_BADI.

    Hi Experts,
       I am trying to use first time BAdi 'RSU5_SAPI_BADI' instead of RSAP0001 for enhancing HR Master data.  I have enhanced the structure and I have created implemention method for BAdi and activated fine. Then I am not sure about the next step, I did search SDN but this point is not clear. Where is the link between these two things between Structure and the method, how is it called to populate the data. Because When I run RSA3, it shows my new field with blanks.  So I am missing some thing that integrates. IF some one has implemented this please let me know. Your help is appreciated.
    Thanks!
    Moorthy
    I was able to populate the new fields only when I use the structure in one place ie in BAdI. I mean, two fields were populating using user exit and I was trying two fields using BAdI for the same structure. When I tried all fields from BAdI only then it worked. So is my assumtion correct that we should either use user exit or BAdI for the same structure?
    Message was edited by:
            Moorthy

    Created one method for each datasource and is working fine.

  • Update Behavior using Multiple tables

    I'm trying to use the Update behavior from Dreamweaver MX2004
    to update fields from diferent joined tables. The search form works
    OK as I joined the tables and I get great results (see SQL Query
    below). When I try to create link to a detail page from the master
    page and I use the same recordset as below and I use the update
    behavior, I can only choose a table at the time to update fields
    using only one key. If I choose only one table and pass one key
    field is OK but I need to update all three joined tables. Is there
    a way to do something like this in the Link field in the master
    page calling the detail page? Is there is a correct way to pass the
    three keys from the master page to the detail page? I'm using ASP
    and standard SQL. The environment is Windows for testing and SQL
    server.
    Detail Page Parameters (not sure if this could be done):
    details_Admin_Skill_Resource.asp?resourceSkillMapID=
    <%=(Recordset1.Fields.Item("resourceSkillMapID").Value)%>?<%=(Recordset1.Fields.Item("skil lID").Value)%>?<%=(Recordset1.Fields.Item("resourceId").Value)%>
    I'm also inserting hidden fileds in the detail form. Any
    Ideas how to update several tables in DW MX2004 with the update
    behavior?
    This is the query in the recordset and it is working OK as it
    produces results from the search page. What modifications I need to
    do to this recordset in the update page?
    Thank you for your help!!!
    Carlos Melendez
    [email protected]
    This is what I typed in the advanced SQL box in the
    recordset.
    SELECT
    ResourceSkillMapping.resourceSkillMapID,ResourceSkillMapping.skillID,ResourceSkillMapping .competenceLevel,skill.skillname,resource.resourceName,resource.resourceLoginId,resource.r esourceId,resource.profileId,resource.resourceGroupID,resource.resourceType,resource.activ e,resource.autoAvail,resource.extension,resource.orderInRG,resource.dateInactive,resource. assignedTeamID,resource.resourceFirstName,resource.resourceLastName
    FROM ResourceSkillMapping INNER JOIN Skill ON
    ResourceSkillMapping.skillID = Skill.skillID INNER JOIN Resource ON
    ResourceSkillMapping.resourceSkillMapID =
    Resource.resourceSkillMapID
    WHERE (Resource.resourceLoginID LIKE '%Agent_asp%') AND
    (Resource.active = 1)
    Variables
    Skill_asp for skillName
    Agent_asp for resourceLoginID
    Default value of variables is 1 to display all records
    Runtime
    Request.QueryString("skillname")
    Request.QueryString("resourceLoginID")

    ITCoreTeam wrote:
    > I'm trying to use the Update behavior from Dreamweaver
    MX2004 to
    update fields
    > from diferent joined tables. The search form works OK
    as I joined the
    tables
    > and I get great results (see SQL Query below). When I
    try to create
    link to a
    > detail page from the master page and I use the same
    recordset as
    below and I
    > use the update behavior, I can only choose a table at
    the time to
    update fields
    > using only one key. If I choose only one table and pass
    one key field
    is OK but
    > I need to update all three joined tables. Is there a
    way to do
    something like
    > this in the Link field in the master page calling the
    detail page? Is
    there is
    > a correct way to pass the three keys from the master
    page to the
    detail page?
    > I'm using ASP and standard SQL. The environment is
    Windows for
    testing and SQL
    > server.
    > Detail Page Parameters:
    > details_Admin_Skill_Resource.asp?resourceSkillMapID=
    >
    >
    <%=(Recordset1.Fields.Item("resourceSkillMapID").Value)%>?<%=(Recordset1.Fields.
    >
    Item("skillID").Value)%>?<%=(Recordset1.Fields.Item("resourceId").Value)%>
    >
    > I'm also inserting hidden fileds in the detail form.
    Any Ideas how
    to update
    > several tables in DW MX2004 with the update behavior?
    >
    >
    > This is the query in the recordset and it is working OK
    as it
    produces results
    > from the search page. What modifications I need to do
    to this
    recordset in the
    > update page?
    >
    >
    > Thank you for your help!!!
    > Carlos Melendez
    > [email protected]
    >
    > This is what I typed in the advanced SQL box in the
    recordset.
    > SELECT
    >
    >
    >
    ResourceSkillMapping.resourceSkillMapID,ResourceSkillMapping.skillID,ResourceSki
    >
    llMapping.competenceLevel,skill.skillname,resource.resourceName,resource.reso
    >
    >
    >
    urceLoginId,resource.resourceId,resource.profileId,resource.resourceGroupID,reso
    >
    urce.resourceType,resource.active,resource.autoAvail,resource.extension,resou
    >
    >
    >
    rce.orderInRG,resource.dateInactive,resource.assignedTeamID,resource.resourceFir
    > stName,resource.resourceLastName
    > FROM ResourceSkillMapping INNER JOIN Skill ON
    ResourceSkillMapping.skillID =
    > Skill.skillID INNER JOIN Resource ON
    ResourceSkillMapping.resourceSkillMapID =
    >
    > Resource.resourceSkillMapID
    > WHERE (Resource.resourceLoginID LIKE '%Agent_asp%') AND
    (Resource.active = 1)
    > OR (Skill.skillName LIKE '%Skill_asp%')
    >
    > Variables
    > Skill_asp for skillName
    > Agent_asp for resourceLoginID
    >
    > Default value of variables is 1 to display all records
    >
    > Runtime
    > Request.QueryString("skillname")
    > Request.QueryString("resourceLoginID")
    >
    One solution is to create a view in SQL, that is exactly the
    same as
    your SELECT above. You then use the view name instead of the
    table name
    in your UPDATE statement. I know in the SQL world that this
    is possible,
    but I don't know if the Dreamweaver update behaviour will see
    the views
    stored on your SQL server.
    Steve

  • BADi INVOICE_UPDATE

    Hi All,
    I am using Badi INVOICE_UPDATE to change the value of 'Tax Amount' with some other value when i am going to create a Invoice for the Purchase Order. I am not able to set the flag inside the BADi which for which i need to make the changes.  So please any of have worked on the same scenario plz suggest me.
    Waiting for quick replies from your end.
    Thnks in advance.
    Santosh

    Hi ,
    You achieve this using the ABAP memory:
    From the place you want to capture the FLAG:
    export flag to memory id 'YOURID'.
    At the place you want to check the FLAG and do some operations:
    import flag from memory id 'YOURID'.
    Now when you have the FLAG value, you can check that and do the desired operations.
    Hope these option might have clarified most of your doubts.
    Regards,
    Ashish Arora

  • Updating the Payment reference - KIDNO field using INVOICE_UPDATE

    Hello All,
    I need to update the field KIDNO (present in the invoice header structure ) from transaction MRRL and MRDC transactions.
    How do you use the Badi INVOICE_UPDATE to update the field KIDNO?
    Regards,
    Sri.

    Hi,
    Combining FI Documents Using a Payment Reference Number KIDNO.
    In some countries you may be required to combine receivables, linked liabilities or cancellations in the same payment program.
    This combination is carried out by filling field KIDNO in the billing header with the following values:
    F2 billing documents (customer invoices) with the billing number
    S1 cancellations using the reference to the corresponding F2 billing document to be canceled via the VBRK-KIDNO from the F2 billing document.
    If a reference for the credit memo request exists for a billing document, then the VBRK-KIDNO value of the reference billing document is copied.
    If there is no reference, then the KIDNO is given the current billing document number.
    When the customer pays the invoice, it quotes the payment reference number, which enables the vendor to match the payment to the invoice more quickly.
    The payment reference number consists of a sequential number and a check digit. Each country has its own rules as to how the check digit is calculated.
    Regards
    R.K

  • BADI to check and update field in transaction BP through WEB UI

    Hi,
    I have this requirement to check certain data from BUT000 and based on this update the Search term field in BUT000.
    I am using Badi BUPA_GENERAL_UPDATE.
    I am also able to retrieve the current value in BUT000 using function module
      CALL FUNCTION 'BUPA_GENERAL_CALLBACK'
        TABLES
          et_but000_old = t_but000_old
          et_but000_new = t_but000_new.
    My requirement is to update a field in BUT000 in memory.
    If I was to use transaction BP in CRM then simply I can modify the value using
    ASSIGN ('(SAPLBUD0)MEM_BUT000[] into <Field_symbol>
    But the issue is that when called through the WEB UI I cannot access this memory.
    Can any one suggest me a Function Module or some method by which I can change the value of BUT000 in memory while saving.
    Awaiting your quick suggestions.
    Regards,
    Taher

    Hi Sidd,
    I figured out another way to do this.
      FIELD-SYMBOLS <fs> TYPE ANY TABLE.
      DATA : ws_bus000_i TYPE bus000___i.
      FIELD-SYMBOLS <fs2> TYPE bus000___i.
      IF sy-tcode = 'BP'.
        ASSIGN ('(SAPLBUD0)MEM_BUT000[]') TO <fs>.
        IF <fs> IS ASSIGNED.
          LOOP AT  <fs> ASSIGNING <fs2>.
            IF <fs2> IS ASSIGNED.
              IF <fs2>-partner_guid = ws_but000-partner_guid.
                <fs2>-bu_sort1 = 'BP'.
              ENDIF.
            ENDIF.
          ENDLOOP.
        ENDIF.
        UNASSIGN : <fs>, <fs2>.
      ELSEIF sy-tcode IS INITIAL.
        ASSIGN ('(SAPLBUD_MEM)gt_but000_mem[]') TO <fs>.
        IF <fs> IS ASSIGNED.
          LOOP AT  <fs> ASSIGNING <fs2>.
            IF <fs2> IS ASSIGNED.
              IF <fs2>-partner_guid = ws_but000-partner_guid.
                <fs2>-bu_sort1 = 'WEB UI'.
              ENDIF.
            ENDIF.
          ENDLOOP.
        ENDIF.
        UNASSIGN : <fs>, <fs2>.
      ENDIF.
    on debugging I could figure out the program containing the data in the memory.
    Before the save I accessed this program and updated the parameter as required.
    Also For transaction BP this program is not available but there is another program so there is an if else based on the sy-tcode.
    I need to check for other BP transactions as well but as of now this seems good.
    Kindly suggest.
    Taher.

Maybe you are looking for