Table update in user exit ZXM08U16

I'm trying to put in a check and update table when an invoice is processed in MIRO. So far i have
IF ?????-ebeln CP '92*' AND
   ?????-SHKZG EQ 'S'.
  SELECT SINGLE *
         FROM  zmmvendorstop
         WHERE lifnr     EQ ?????-lifnr
         AND   stop_date EQ '00000000'.
  IF sy-subrc EQ 0.
    zmmvendorstop-stop_date = sy-datum.
    zmmvendorstop-work_days = sy-datum - zmmvendorstop-start_date.
    MODIFY zmmvendorstop.
  ENDIF.
ENDIF.
I'm struggling on where to get the information to do the check from, so if anyone could help fill in the question marks it would be a great help.
Thanks

Hi,
It is available in the structre E_TDRSEG-TBTKZ (Credit/debit indicator) and E_TDRSEG-ebeln(PO number).. this is tables paramter. Lifnr is also available in the structure.
Regards,
Nagaraj

Similar Messages

  • Update the database table inside an user exit.

    Hi Experts,
    I have a issue where i have to update a custom table in an User exit.
    I am using Lock object for ENQUE/DEQUE.
    I have tried to use statements like UPDATE/MODIFY inside the user exit.
    But the problem is that it's not updating the database table at the same time.
    I know if i use COMMIT WORK it can update at the same time but it's not advisable to use COMMIT inside a work.and also it gives a short dump.
    The real issue is that this custom table is read for batch creation at the same time for different users.
    Now if it the program does not update the database table at the same time then other users also read the same data and create the same Batch number..
    While requirement is to create a different/unique batch numbers.
    Program is updating the table but it's taking time..so in between other users are creating the same batch number.
    Please guide me what would be the best solution for this.
    Regards,
    Amit Kumar Singh

    Thanks for your quick reply.
    My actually requirement is like that.
    I have to create a Process Order using tcode COR1.
    After passing some input value it goes inside an User Exit.
    There one Custom table is maintained which stores some fields like month,year,numeric key field,etc.
    The new batch number is created using the combination of these table fields.
    Once a new batch number is created it increment the numeric key field number by one.
    Issue is we have to update this new numeric field value into the database field so that other users can read a diffrent numeric field value.hence it will create a new/different batch number.
    Here i am not able to update the database table inside this User Exit.
    Table is geeting updated but after some time and out of this User Exit.
    Please suggest what's required in that case?
    Regards,
    Amit Kumar Singh
    Edited by: Amit  Singh on Feb 3, 2009 11:33 AM

  • Making parmanent changes to a internal table inside a user exit

    Hi All,
    I am having a User exit to which I am passing a structure as importing parameter.
    The user exit is not exporting the same structure, but is exporting some other values.
    My problem is that I want to make parmanent changes in the structure I am passing to the user exit.
    Currently what is happening:
    I am passing the structure to the user exit. It has got 6 rows. Inside the user exit I am making some changes to a particular field of all the rows. Till the program control is inside the user exit the changes in the structure are visible. As soon as the control come out of the user exit, the values for the field are switched to teh old values(values before passing to teh user exit).
    My question is, is there any method to make changes to a internal table inside a user exit and these changes are visible outside it when the program control come out of the user exit. (This is when the internal table to which the change is made in not exported by the user exit)

    Hi Dear,
    Your changes done in import parameters will not reflect outside exit. You can only change the values of export parameters...
    If you have very urgent requirement then make changes in SAP''s Standard code.
    For your problem you can write to SAP. In many cases SAP provides the solution.
    Award Points If Useful.

  • Updating custom field in table EKKO within user exit when PO is saved

    I am trying to update a custom field in table EKKO when a PO is saved.  I am using FM EXIT_SAPMM06E_013, within enhancement MM06E005.  Since EKKO is not a table that can be updated with this user exit, I am using a technic that I read about on SDN where I assign a field symbol to the calling program variable and then am able to access data within EKKO table.  But when I pass this data back into the field symbol, for some reason this field is not getting saved when the PO is saved.  In debug mode, it looks like this field is getting updated, but when I look in the table after the PO is saved, it is not there.  My code sample is below.  What I am doing wrong?
    data:
      CHAR(50) VALUE '(SAPLMEPO)EKKO-ZHDRCSTCENTER',
      g_zhdrcstcenter like ekko-zhdrcstcenter,
      FIELD-SYMBOLS <F1> type any.
    if i_ekko-ekorg = '5401'.
      ASSIGN (char) to <F1>.
      g_zhdrcstcenter = <F1>.
      move '0000113322' to g_zhdrcstcenter.
      <F1> = g_zhdrcstcenter.
    endif.
    Thanks!
    Sarah Smyth.

    Firstly, have you investigated using EXIT_SAPMM06E_008 to set any custom fields you have added in the EKKO_CI / CI_EKKODB structure?.. that might work more easily.
    In terms of doing an assign back into a calling program's memory, it can work but it's probably worth setting a break point in your code then stepping through watching the values in EKKO - sometimes you can find subsequent code that re-writes an earlier copy of values back into the structure, thereby preventing you doing your change...  SAP does warn this method is for "internal use".  Also check in your debugger that it's SAPLMEPO and not SAPMM06E you need.

  • Update in user exit.

    Hi all,
    I have code in the User exit - EXIT_RFEBBU10_001 - which will be triggered by the transaction code FF.5.
    My code is to update the Standard Database table FEBEP
    My code  is. 
    Update FEBEP
               SET FWAER = ''
                   FWBTR = '0.00'
                where KUKEY = i_febep-kukey AND
                      ESNUM = i_febep-esnum.
    But this is not updating the database table with FWBTR as 0.00 and FWEAR as nothing, but SY-SUBRC is 0 while debugging.
    I used the same code in a seperate executable program that time it is updating the table, but inside the User Exit it is not doing.
    Please tell me how to solve this...
    Points assured
    Regards,
    Prabhu

    Hello Prabhu,
    I'm sorry to say that your whole approach is incorrect i.e. everything you are doing in this user-exit from start to finish is incorrect and it is against SAP Best Practice!
    Firstly, you are trying to modify (update) a SAP standard database table - which is not recommended in the first place but then again I see you are trying to change a database full with highly sensitive information (The Electronic Bank Statement Line Item table)!!! Not only you may land up in big trouble personally for doing this but also I don't think your client's system auditors will be too pleased about that. So, Never Do This
    Then, you are wondering if you could use a Commit Work statement in your user-exit - which is again not recommended. Let the system take care of that after it leaves your exit and before completing the transaction. So, again, Never Do This
    Now, to solve your issue, you should be first reading the documentation of SAP Enhancement FEB00001 because your user-exit function module is linked to this enhancement. This is well documented and shows you how to code this exit. I think if you require any changes in the line items you should make changes in the export parameter E_FEBEP because SAP allows you to change E_FEBEP and finally don't forget to set the export parameter E_UPDATE = 'X' after you have changed data in any structure or table parameters to confirm changes back to SAP.
    Hope this helps.
    Cheers,
    Sougata.

  • Table updation using function exit in CC01

    In CC01 transaction , Using screen exit i have provided a field for input in the screen . the fields added are in the table AENR .
    But when I Save the transaction, the customised fields are cleared.
    How do I get these fields to be updated in the table ?
    How to use the function exit(provided with the screen exit) in order to update the fields in the table .
    Thanks,
    Amit

    Infact you have to create it:
    - Trx SE11 show table AENR
    - Go to the end of the structure of AENR you should see the structure CI_AENR, do a doubleclick and create it;
    - After creating it, insert your new fields
    In enhancement:
    - Create the screen 100 using structure AENR
    - You have to implement 2 user-exit:
    1) To import the data from std to screen-exit
    EXIT_SAPMC29C_001
    Here insert the code:
    MOVE USERDATA TO AENR
    2) To export the data from screen-exit to std program:
    EXIT_SAPMC29C_002
    Here insert the code:
    MOVE AENR TO USERDATA.
    Max

  • Delivery text updation using user exits

    Hii All
    Our client has a requirment where we need to update text in delivery header when we save the delivery.
    The delivery text needs to be updated when we save the delivery.
    Can anyone help me in letting me know steps to be followed to do the same.
    Thanks & Regards,
    Gaurav Manocha

    First of all identify the text id associated with your delivery. Once you identify the text id, change the text id in the sample program below. You can have this logic coded within your MV50AFZ1 user exit
    data: w_txt_hdr  LIKE thead,
          i_text  LIKE tline  OCCURS 0 WITH HEADER LINE,
                         i_text-tdformat = '* '.
                         i_text-tdline = 'sample'.
                   append i_text.
                  w_txt_hdr-tdobject = 'VBBK'.
                  w_txt_hdr-tdname   = likp-vbeln.
                  w_txt_hdr-tdid     = '0008'. "text id
                  w_txt_hdr-tdspras  = sy-langu.
                 CALL FUNCTION 'SAVE_TEXT'
                       EXPORTING
                            client          = sy-mandt
                            header          = w_txt_hdr
                            savemode_direct = 'X'
                       TABLES
                            lines           = i_text
                       EXCEPTIONS
                            id              = 1
                            language        = 2
                            name            = 3
                            object          = 4
                            OTHERS          = 5.
                  IF sy-subrc <> 0.
                  ENDIF.

  • Adding entries to Custom table from IDOC User-Exit

    Hi All,
       I need to add an entry into a Ztable, based on the entries in the IDOC.. The user-exit available to me is EXIT_SAPLVEDF_002.  But it is called a number of times... Is there any way to update the Ztable getting the data from different segments?..
    Please help..
    Regards.
    Asha

    The table INT_EDIDD type EDIDD conatined the interface tables of the FM contain all the segmanent data, you can read that and populate the Z table respectively ...
    Thanks,
    Adi.

  • Using a variable not in the Export,Import, table Parameters in USER EXIT

    Hi all,
       During the Invoice Creation, I need to add an entry in the VBFS table, so that it will be displayed in the system log.  In the FM 'RV_INVOICE_CREATE', the structure corresponding to it is XVBFS.  There is a user-exit   CALL CUSTOMER-FUNCTION '002', in this FM 'RV_INVOICE_CREATE'.  But the import, export or Table Parameters does not have XVBFS.
      How can I use XVBFS inside the User exit?..
    Please help.
    Regards,
    Asha

    Hi,
    I dont know whether this will help u...
    write this in user exit...to access variables/tables of main program..
    FIELD-SYMBOLS: <komv>.
    ASSIGN ('(SAPLMEPO)TKOMV[]') TO <komv>.
    where.. SAPLMEPO is the main program...and TKOMV[] is a internal table in SAPLMEPO.
    regards
    Sukriti....

  • What is the name of the table for finding user exit !

    What is the table name to find the user exit !

    Hi,
    Goto to the table tstc and enter the transaction code for
    which u want to find out the User-Exits. Check out the
    program name from the result. Goto SE38 and dee that
    program in display mode. Then search for the string Call
    Cutomer-Funtion. All the result of search are the user
    exits defined there for that transaction.
    SAP user exits (enhancement names that we see in SMOD transaction) are all stored in the table MODSAP. The field NAME contains the enhancement name and the field MEMBER contains the name of the function module that will be called if the customer enhancement exists and is active. The customer enhancement projects are stored in the table MODACT. There, the NAME field is the name of the project and MEMBER is the name of SAP enhancement (that from the MODSAP).
    So, if you are in some include, you can use where-used-list to get to the function module name. Then you find the SAP enhancement name from the MODSAP by supplying the function module. And finally, you find the customer enhancement projects by querying the MODACT with the SAP enhancement in the field MEMBER.
    cheers,
    vasavi.
    kindly reward if helpful.

  • Table maintenance view -user exit

    Hello, as you all know, there is a program generated behind the table maintenance view. I want to add certain validation on the values entered in the table maintenance.
    I know that modifying the program is not the best practice.
    Is there any user exit which will permit me to do this?
    thx.

    Hi Antish,
        Try to go with the table events. For this goto the Table Maintenance Generator Screen --> Environment --> Modification --> Events. Here you can handle some events according to your requirement. Validations can be done only in this way.
    Regards,
    Swapna.

  • Inbound idoc values when updated from user exit not saved

    I'm trying to process some user exits of an inbound idoc from WE19.
    The values get correctly populated to IDOC_DATA internal tables of IDOC_INPUT_ORDRSP function module in debug kode
    but when the new idoc is generated from WE19 , those segment values (populated by exit) are not shown/saved.
    The user exit is EXIT_SAPLEINM_007.
    Is it not possible to populate segment values of inbound idocs from using user exits. If yes , then during testing using WE19 , every time a new idoc is created it should display those values into the concerned segments. Please help.

    Hello,
    yes is possible it ...
    I think the problem is:
    or
    you have something wrong when to append the new line on internal table
    or
    the exit used is not correct: read the documentation on EXIT_SAPLEINM_0**

  • How to put bin information to table T_QMAT thru user exit for stock remove?

    Hi,
    I have already use stock removal strategy 'F' and checked the flag 'User exit active', but the value in table T_QMAT filled by the standard system not include all vendors. So I need to use stock removal strategy " " and set up the table T_QMAT by the user exit.
    Do you know what is the user exit and the ABAP coding to put bin information to table T_QMAT for stock removal?
    Best Regards,
    Chris.

    Hi Chris,
    You can use the exit: EXIT_SAPLL03A_005 to populate t_qmat table based on your requirements. As you have already mentioned, it is important to check the flag: User exit active in SPRO, but bear in mind the stock removal strategy has to be BLANK. If you use F, then standard SAP auto-populates the T_QMAT table.
    Regards,
    Narendra.

  • Tables related to User Exits & Enhancements

    Hi,
    Could you please let me know about the database tables related to enhancements & user exits?
    Actually I need to documnet the information about all the enhancements & also find a way to retrieve the related code. Could you please help on this?
    Thanks..

    u can find all enahnacements using the below code...
    *& Report  ZUSEREXIT_FIND                                              *
    report  zuserexit_find no standard page heading.
    *&  Enter the transaction code that you want to search through in order
    *&  to find which Standard SAP User Exits exits.
    *& Tables
    tables : tstc,     "SAP Transaction Codes
             tadir,    "Directory of Repository Objects
             modsapt,  "SAP Enhancements - Short Texts
             modact,   "Modifications
             trdir,    "System table TRDIR
             tfdir,    "Function Module
             enlfdir,  "Additional Attributes for Function Modules
             tstct.    "Transaction Code Texts
    *& Variables
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    *& Selection Screen Parameters
    selection-screen begin of block a01 with frame title text-001.
    selection-screen skip.
    parameters : p_tcode like tstc-tcode obligatory.
    selection-screen skip.
    selection-screen end of block a01.
    *& Start of main program
    start-of-selection.
    Validate Transaction Code
      select single * from tstc
        where tcode eq p_tcode.
    Find Repository Objects for transaction code
      if sy-subrc eq 0.
        select single * from tadir
           where pgmid    = 'R3TR'
            and object   = 'PROG'
             and obj_name = tstc-pgmna.
        move : tadir-devclass to v_devclass.
        if sy-subrc ne 0.
          select single * from trdir
             where name = tstc-pgmna.
          if trdir-subc eq 'F'.
            select single * from tfdir
              where pname = tstc-pgmna.
            select single * from enlfdir
              where funcname = tfdir-funcname.
            select single * from tadir
              where pgmid    = 'R3TR'
                and object   = 'FUGR'
                and obj_name = enlfdir-area.
            move : tadir-devclass to v_devclass.
          endif.
        endif.
    Find SAP Modifactions
        select * from tadir
          into table jtab
          where pgmid    = 'R3TR'
            and object   = 'SMOD'
            and devclass = v_devclass.
        select single * from tstct
          where sprsl eq sy-langu
            and tcode eq p_tcode.
        format color col_positive intensified off.
        write:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        skip.
        if not jtab[] is initial.
          write:/(95) sy-uline.
          format color col_heading intensified on.
          write:/1 sy-vline,
          2 'Exit Name',
          21 sy-vline ,
          22 'Description',
          95 sy-vline.
          write:/(95) sy-uline.
          loop at jtab.
            select single * from modsapt
            where sprsl = sy-langu and
            name = jtab-obj_name.
            format color col_normal intensified off.
            write:/1 sy-vline,
            2 jtab-obj_name hotspot on,
            21 sy-vline ,
            22 modsapt-modtext,
            95 sy-vline.
          endloop.
          write:/(95) sy-uline.
          describe table jtab.
          skip.
          format color col_total intensified on.
          write:/ 'No of Exits:' , sy-tfill.
        else.
          format color col_negative intensified on.
          write:/(95) 'No User Exit exists'.
        endif.
      else.
        format color col_negative intensified on.
        write:/(95) 'Transaction Code Does Not Exist'.
      endif.
    Take the user to SMOD for the Exit that was selected.
    at line-selection.
      get cursor field field1.
      check field1(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first screen.

  • Fedicus table FM or User exit

    Hi,
    is there any function module which deals with fedicus table..(FI EDI Control for Calling Customer Functions per Segment)
    itz very very urgent for me.

    Hi Srini,
    Please check this user exits/FM in enhancement FEDI0005 (transaction CMOD).
    <b>EXIT_SAPLIEDP_202
    EXIT_SAPLIEDP_201</b>
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward points if helpful.

Maybe you are looking for