Updating Custom Table Only in Debug Mode

Hi All!
I have been encountering issues in updating a custom table. It would work successfully only in debug mode otherwise it won't update an entry in the table.
This is the piece of code that would update an entry in the table specifically used in a user exit. The functionality of this code is to automatically remove a transportation block:
SELECT SINGLE *
INTO wa_zblock
FROM zblock
WHERE zzblknum EQ c_tr01
AND vbeln EQ p_lvbeln
AND zzprocessed EQ space.
IF sy-subrc EQ 0.
DO.
CALL FUNCTION 'ENQUEUE_E_TABLES'
EXPORTING
MODE_RSTABLE = 'S'
TABNAME = c_lzblock
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
IF sy-subrc EQ 0.
wa_zblock-zzprocessed = c_x.
wa_zblock-zzapproveby = sy-uname.
wa_zblock-zzapproveon = sy-datum.
MODIFY zblock FROM wa_zblock.
if sy-subrc EQ 0.
COMMIT WORK AND WAIT.
endif.
EXIT.
ENDIF.
ENDDO.
CALL FUNCTION 'DEQUEUE_E_TABLES'
EXPORTING
MODE_RSTABLE = 'S'
TABNAME = c_lzblock.
ENDIF.
How can I make this update the custom table successful in undebugged mode? Please let me know your thoughts on this.
Thanks!

I also suggest you to lock only the entry that will be updated (and not the whole table!) : you will have then far less problems of conflict with updating this table.
For that, you have to create a lock object on your table (via SE11 - for example EZ_MY_TABLE). This will create 2 function modules named ENQUEUE_E<name of your lock object> (in my example ENQUEUE_EZ_MY_TABLE) and DEQUEUE_E<...>.
You can then call those FM like this :
CALL FUNCTION 'ENQUEUE_EZ_MY_TABLE'
  EXPORTING
    MODE_RSTABLE = 'S'
    KEYFIELD1 = ld_keyfield1  " Here are the key values for the entry that you have to update
    KEYFIELD2 = ld_keyfield2
  EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2
    OTHERS = 3.
Best regards,
Samuel

Similar Messages

  • SRM purchasing document updated in enhancement only in Debug mode

    Hi everybody,
    I created an enhancement for a SRM include ( LBBP_SOCO_APPF0R -> Form CREATE_FOLLOW_ON_DOCUMENT) because existing BAdI are not called at necessary moment to update Shopping Cart (purchasing document) CUF items.
    ABAP code i added allows to get data from follow-on document, then i get details from parent document, i update this document with values for CUF fields, i save this document and finally i run function module BAPI_TRANSACTION_COMMIT (with or without export parameter 'WAIT').
    Nevertheless, those CUF fields are correctly updated but only when i am in debugging process flow with an external break-point.
    When i delete this debug point, CUF fields are not updated any more !
    Is anyone have an idea to solve this problem ?
    Regards.
    Laurent.

    The problem may come from the network system or something's wrong in the system Because I have run the tcode and It work properly.
    Thanks,
    Hung

  • Not Updating Customized Table when System having Performance Issue

    Hi,
    This is actually the same topic as "Not Updating Customized Table when System having Performance Issue" which is posted last December by Leonard Tan regarding the user exit EXIT_SAPLMBMB_001.
    Recently we changed the program function module z_mm_save_hide_qty to update task. However this causes more data not updated. Hence we put back the old version (without the update task).  But now it is not working as it used to be (e.g. version 1 - 10 records not updated, version 2 with update task - 20 records not updated, back to version 1 - 20 records not updated).
    I tried debugging the program, however whenever I debugged, there is nothing wrong and the data is updated correctly.
    Please advise if anyone has any idea why is this happening. Many thanks.
    Regards,
    Janet

    Hi Janet,
    you are right. This is a basic rule not to do any COMMIT or RFC calls in a user exit.
    Have a look at SAP note 92550. Here they say that exit EXIT_SAPLMBMB_001 is called in the update routine MB_POST_DOCUMENT. And this routine is already called in UPDATE TASK from  FUNCTION 'MB_UPDATE_TASKS' IN UPDATE TASK.
    SAP also tells us not to do any updates on SAP system tables like MBEW, MARD, MSEG.
    Before the exit is called, now they call 'MB_DOCUMENT_BADI' with methods MB_DOCUMENT_BEFORE_UPDATE and MB_DOCUMENT_UPDATE. Possibly you have more success implementing the BADI.
    I don't know your situation and goal so this is all I can tell you now.
    Good luck!
    Regards,
    Clemens

  • CRM_ORDER_MAINTAIN works only in debug mode

    Hi Experts,
    I am currently facing a strange issue. I am trying to add a line item to a service ticket, but the code works only in debug mode. Sample code is given below:
    lv_product_i-ref_handle = '0000000001'.
    lv_product_i-ref_guid = lv_header_guid.
    INSERT lv_product_i INTO TABLE lt_product_i.
    ls_orderadm_i-header = lv_header_guid.
    ls_orderadm_i-itm_type = 'ZSG5'.
    ls_orderadm_i-number_int = '0000000010'.
    ls_orderadm_i-ordered_prod = 'SERVICEITEM_SG5'.
    ls_orderadm_i-handle = '0000000001'.
    ls_orderadm_i-mode = 'A'.
    ls_orderadm_i-itm_proc_ident = 'SRVC'.
    INSERT ls_orderadm_i INTO TABLE lt_orderadm_i.
    ls_input_fields-ref_handle = '0000000001'.
    ls_input_fields-objectname = 'ORDERADM_I'.
    CLEAR ls_field_names.
    ls_field_names-fieldname = 'HANDLE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'HEADER'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ITM_PROC_IDENT'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ITM_TYPE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'MODE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'NUMBER_INT'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ORDERED_PROD'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
    it_product_i = lt_product_i
    CHANGING
    ct_orderadm_i = lt_orderadm_i
    ct_input_fields = lt_input_fields
    EXCEPTIONS
    error_occurred = 1
    document_locked = 2
    no_change_allowed = 3
    no_authority = 4
    OTHERS = 5.
    LOOP AT lt_orderadm_i INTO lv_tempvar.
    lv_item_guid = lv_tempvar-guid.
    ENDLOOP.
    The item guid is coming as initial and no item is being added.But if i put a breakpoint in CRM_ORDER_MAINTIAN, then the guid is being generated properly. Any pointers why the code is behaving like this or someone has faced a similar issue before?
    Thanks and Regards,
    Rohit

    Hi Rohit,
    The above said is also correct + U have to write
      CALL FUNCTION 'CRM_ORDER_SAVE'
        EXPORTING
          IT_OBJECTS_TO_SAVE = GT_OBJ_GUIDS
        IMPORTING
          ET_SAVED_OBJECTS   = GT_SAVED_OBJECTS
        EXCEPTIONS
          OTHERS             = 2.
      COMMIT WORK.

  • CRM_ORDER_MAINTIAN works only in debug mode!

    Hi Experts,
    I am currently facing a strange issue. I am trying to add a line item to a service ticket, but the code works only in debug mode. Sample code is given below:
    lv_product_i-ref_handle = '0000000001'.
    lv_product_i-ref_guid = lv_header_guid.
    INSERT lv_product_i INTO TABLE lt_product_i.
    ls_orderadm_i-header = lv_header_guid.
    ls_orderadm_i-itm_type = 'ZSG5'.
    ls_orderadm_i-number_int = '0000000010'.
    ls_orderadm_i-ordered_prod = 'SERVICEITEM_SG5'.
    ls_orderadm_i-handle = '0000000001'.
    ls_orderadm_i-mode = 'A'.
    ls_orderadm_i-itm_proc_ident = 'SRVC'.
    INSERT ls_orderadm_i INTO TABLE lt_orderadm_i.
    ls_input_fields-ref_handle = '0000000001'.
    ls_input_fields-objectname = 'ORDERADM_I'.
    CLEAR ls_field_names.
    ls_field_names-fieldname = 'HANDLE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'HEADER'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ITM_PROC_IDENT'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ITM_TYPE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'MODE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'NUMBER_INT'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ORDERED_PROD'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
    it_product_i = lt_product_i
    CHANGING
    ct_orderadm_i = lt_orderadm_i
    ct_input_fields = lt_input_fields
    EXCEPTIONS
    error_occurred = 1
    document_locked = 2
    no_change_allowed = 3
    no_authority = 4
    OTHERS = 5.
    LOOP AT lt_orderadm_i INTO lv_tempvar.
    lv_item_guid = lv_tempvar-guid.
    ENDLOOP.
    The item guid is coming as initial and no item is being added.But if i put a breakpoint in CRM_ORDER_MAINTIAN, then the guid is being generated properly. Any pointers why the code is behaving like this or someone has faced a similar issue before?
    Thanks and Regards,
    Rohit

    Well, during debugging an implicit COMMIT WORK is executed on a regular basis. This might cause the ITEM GUID to be created during debugging.
    However, normally, after CRM_ORDER_MAINTAIN, you should use the CRM_ORDER_SAVE as well. This will return a list of SAVED_OBJECTS. If all objects were saved correctly, do an explicit COMMIT WORK.
    Works fine for us.....

  • Function Module working only in debug mode

    Hi all,
    The following Function Module works only in debug mode. The purpose of this FM is to create a notification and to put it in progress status. If I put a breakpoint before "CALL FUNCTION 'BAPI_ALM_NOTIF_PUTINPROGRESS'" it works. If I execute this FM without putting a breakpoint at that place it creates the notification but doesnt put it in progress status.
    In other words, the last BAPI call doesnot work if I dont put a breakpoint before.
    Can somebody help me to find out where is the problem?
    Thanks,
    Younes
    FUNCTION ZFM_CREATE_NOTIF_IN_PROCESS.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(NOTIFTYP) TYPE  CHAR2
    *"     VALUE(NOTIFHEADER) TYPE  BAPI2080_NOTHDRI
    *"  EXPORTING
    *"     VALUE(NOTIFNUMBER) TYPE  CHAR12
    *"     VALUE(NOTIFCURSTATUS) TYPE  CHAR40
    DATA: gs_bapi2080_nothdre TYPE bapi2080_nothdre,
          gt_return TYPE TABLE OF bapiret2.
    The notification is created with a temporary number
    CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'
      EXPORTING
        notif_type         = NOTIFTYP
        notifheader        = NOTIFHEADER
      IMPORTING
        notifheader_export = gs_bapi2080_nothdre
      TABLES
        return             = gt_return.
    READ TABLE gt_return TRANSPORTING NO FIELDS WITH KEY type = 'E'.
    CHECK sy-subrc IS NOT INITIAL.
    *The notication will be saved with a number which isnt temporary
    CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
      EXPORTING
        number      = gs_bapi2080_nothdre-notif_no
      IMPORTING
        notifheader = gs_bapi2080_nothdre
      TABLES
        return      = gt_return.
    READ TABLE gt_return TRANSPORTING NO FIELDS WITH KEY type = 'E'.
    CHECK sy-subrc IS NOT INITIAL.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    The Notif is already created, it will be put in progress status
    NOTIFNUMBER = gs_bapi2080_nothdre-notif_no.
       CALL FUNCTION 'BAPI_ALM_NOTIF_PUTINPROGRESS'
            EXPORTING
              NUMBER             = NOTIFNUMBER
              LANGU              = SY-LANGU
           IMPORTING
             SYSTEMSTATUS       = NOTIFCURSTATUS
           TABLES
             RETURN             = gt_return.

    Hi Emmanuel,
    Now I get your problem: you want to wait to have the commit finished! The call to BAPI_TRANSACTION_COMMIT has an optional parameter 'WAIT' which is space by default which causes only a commit. When you set this parameter to 'X' it will do a commit work and wait.
    This should solve your problem!
    Regards,
    John.

  • Best way to update custom table

    Hello experts,
    Iu2019m writing a report program and after pulling data from a custom table Iu2019m modifying certain fields within internal table and then eventually update custom table. The way Iu2019m updating custom table is working fine. However Iu2019m concern about performance issues because Iu2019m doing update on custom table within loop.
    Here is my code for reference.
    *&      Form  update_contracts
          text
    -->  p1        text
    <--  p2        text
    FORM update_contracts .
    Update record in an internal table first
      loop at izsc_compliance into wa_zsc_compliance..
        wa_zsc_compliance-zapproval = c_accepted.
        wa_zsc_compliance-CHANGED_DT = sy-datum.
        wa_zsc_compliance-CHANGED_TM = sy-uzeit.
        wa_zsc_compliance-CHANGED_BY = sy-uname.
        modify izsc_compliance from wa_zsc_compliance index sy-tabix.
        write:/ sy-tabix, wa_zsc_compliance-vbeln_new, wa_zsc_compliance-zapproval.
        if p_test is initial.
          move wa_zsc_compliance to zsc_compliance.
          update zsc_compliance.
        endif..
      endloop.
    Write records to database
      if p_test = 'X'.
        skip.
        write:/ 'Test mode'.
      endif.
    ENDFORM.                    " update_contracts
    Iu2019m not certain if there is any better way by not doing update within loop and update custom table outside this loop.
    Many thanks in advance.

    Hi,
    Yes, there is a better way to update the custom table. That will be more performance oriented and will be a much cleaner approach. As, I am not much aware of the custom table structure which you have in your program, the best way that I can suggest is to remove the update statement from that check. I guess you are checking against the mode - test or production. Once you have done the check, put the selected entries in an internal table which is same as database table. And then in a single command - a single array operation as it is commonly called, you can update the custom table.
    Have a look at the following link
    [Overwriting Several Lines Using an Internal Table|http://help.sap.com/saphelp_bw33/helpdata/en/fc/eb3a94358411d1829f0000e829fbfe/content.htm]
    [Inserting or Changing Lines|http://help.sap.com/saphelp_bw33/helpdata/en/fc/eb3ac8358411d1829f0000e829fbfe/content.htm]
    You can also scan the forum for multiple links and references and sample examples.
    Hope this will help. The above approach will be much more performance oriented and will help to optimize. Also, check where exactly you are providing the locking feature if at applicable in your business functionality.
    Regards,
    Samantak.

  • Badi working only in Debug mode

    Hi experts,
    It's my first time with Badi, and I'm facing a issue I can't understand.
    I've activated badi ME_PROCESS_PO_CUST , and everything work's fine .
    From the method "Close" I call a Z... function which writes data on a custom table.
    I've tested  it and the system correctly update the table , but when I deactivate  the debug  in the badi's method , it looks like the badi is not implemented and the system doesn't pass trough the function. 
    Can somebody adress me to solve it ?
    Thank you in advance for any help.
    Ciao.

    Thank you for your help Sudhir , but the table update it's done by the custom function which should be called by the BAdI. My issue is that the BAdI's method works only if I set a break-point on it. If I do not put a break-point on the BAdI , the function is not called at all !!.
    Thanks again for your suggestion.

  • SetProperties method invoked only in debug mode

    Hey,
    This is a strange problem so i'll try to be clear.
    I wrote a custom tag.
    running under degub mode, runs the tag well, and all is well.
    but when i run un normal mode (not degub) it does not work.
    i found that the setProperties method is not been called after the first time.
    what i mean is: in normal run mode the setProperties method is called only once, and not every time the page refreshes.
    the strange thing is that in degub mode it runs well.
    this is my jsp code
    hope it works out well....
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%-- jsf:pagecode language="java" location="/JavaSource/pagecode/ExaminerModule/SelectStation1.java" --%><%-- /jsf:pagecode --%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
    <%@taglib uri="/tags/theoryOnline" prefix="tol"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@taglib uri="/tags/tangramTags" prefix="tngt"%>
    <%@taglib uri="/tags/tolTags" prefix="tolTags"%>
    <%@page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
    <HTML>
    <tol:theoryOnlineHeadTag>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <meta name="GENERATOR" content="IBM Software Development Platform">
         <meta http-equiv="Content-Style-Type" content="text/css">
         <LINK rel="stylesheet" type="text/css" href="../theme/styles/mm.css"
              title="Style">
         <SCRIPT>
              function initModalWindow()
                   window.dialogHeight=40;
                   window.dialogWidth=40;
                   selectStationInit();
              function selectStationInit()
                   var oMyObject = window.dialogArguments;
                   var examineeId = oMyObject.examineeId;
    //               alert ("myObj id=" +examineeId );
                   if (document.all['form1:hiddenExamineeId'].value != examineeId)
    //                    alert ("pre submit");
                        document.all['form1:hiddenExamineeId'].value = examineeId;
                        document.all['form1:button2'].click();
    //               else  document.all['form1:locateRoom'].click();
                   alert (document.body.innerHTML);
              </SCRIPT>
         <SCRIPT src="../theme/scripts/dialog.js">
              </SCRIPT>
         <TITLE>����� ����</TITLE>
         <BASE target="_self">
         <LINK rel="stylesheet" type="text/css" href="../theme/stylesheet.css"
              title="Style">
    </tol:theoryOnlineHeadTag>
    <f:view>
         <tol:theoryOnlineBodyTag>
              <BUTTON id="yesButton" onclick="closeWithTrueReturnValue()">�����</BUTTON>
              <BUTTON id="noButton" onclick="closeWithFalseReturnValue()">�����</BUTTON>
              <hx:scriptCollector id="scriptCollector1">
                   <h:form styleClass="form" id="form1" style="direction: rtl">
                        <h:inputHidden binding="#{selectStation.hiddenExamineeIdBinding}"
                             id="hiddenExamineeId" />
                        <h:inputHidden binding="#{selectStation.hiddenStationNumberBinding}" />
                        <h:inputHidden binding="#{selectStation.hiddenRoomNumberBinding}" />
                        <h:messages styleClass="messages" id="messages1"></h:messages>
                        <h:panelGrid width="50%" columns="1" style="text-align: center">
                             <h:selectOneMenu styleClass="extra-border"
                                  value="#{selectStation.roomCombuValue}">
    .                              <f:selectItems value="#{selectStation.roomsLists}" />
                             </h:selectOneMenu>
                             <hx:commandExButton type="submit" styleClass="commandExButton"
                                  value="��� ���" action="#{selectStation.locateRoom}"
                                  id="locateRoom"/>
                             <h:outputText></h:outputText>
                             <tolTags:TheoryOnlineStationsTag
                                  roomNumber="#{selectStation.roomCombuValue}">
                             </tolTags:TheoryOnlineStationsTag>
                             <hx:commandExButton type="submit" value="dodo"
                                  styleClass="commandExButton" id="button2"
                                  action="#{selectStation.initSelectStationsModal}" />
                        <hx:commandExButton value="����"  styleClass="Button1"/>
                        </h:panelGrid>
                   </h:form>
              </hx:scriptCollector>
         </tol:theoryOnlineBodyTag>
    </f:view>
    </HTML>TAG CODE
    package com.tangram.theoryonline.web.tags;
    import java.util.ArrayList;
    import java.util.Map;
    import javax.faces.application.Application;
    import javax.faces.component.UIComponent;
    import javax.faces.component.html.HtmlCommandButton;
    import com.tangram.theoryonline.datamodel.Room;
    import com.tangram.theoryonline.datamodel.Station;
    import com.tangram.theoryonline.managers.EntitiesManager;
    import com.tangram.theoryonline.web.constants.TheoryOnlineWebConstants;
    import com.tangram.web.jsf.html.tags.HtmlBaseTag;
    import com.tangram.web.jsf.html.tags.Util;
    * @author ishay
    public class TheoryOnlineStationsTag extends HtmlBaseTag {
        private String roomNumber;
        public String getComponentType() {
            return HtmlCommandButton.COMPONENT_TYPE;
        protected void setProperties(UIComponent component) {
            super.setProperties(component);
            System.out.println("SETTING myTAG");
            Application app = getFacesContext().getApplication();
            Map attributes = component.getAttributes();
            Util.addAttribute(app,component,"roomNumber",roomNumber);
            Station station=null;
            //     String s=Util.getStringProperty(component,null,"roomNumber","0");
            String s=Util.getStringProperty(component,null,"roomNumber",null)       ;       
            System.out.println("getting String binding is  " + s);
            Room room=(Room) EntitiesManager.getInstance().getRoomsMap().get(s);
            System.out.println("room from map is " + room);
            ArrayList leftList=new ArrayList();
            ArrayList rightList=new ArrayList();
            if (room ==null || room.getDecendedList()==null || s==null)
                System.out.println("NO STATIONS FOR ROOM " + room);
            else {
                System.out.println("size of total list="+room.getDecendedList().size());
                for (int i=0;i<room.getDecendedList().size();i++) {
                    station=(Station) room.getDecendedList().get(i);             
                    leftList.add(station);
                    i++;
                    if (i<room.getDecendedList().size()){
                        station=(Station) room.getDecendedList().get(i);             
                        rightList.add(station);
                    } // if
                    System.out.println("lengths are "+leftList.size()+","+rightList.size());               
                }// for
            }// else 
            attributes.put(TheoryOnlineWebConstants.ROOM_STATIONS_RIGHT_LIST,rightList);
            attributes.put(TheoryOnlineWebConstants.ROOM_STATIONS_LEFT_LIST,leftList);
        public String getRendererType() {
            return "com.tangram.theoryonline.web.tags.TheoryOnlineStationsRenderer";
        public String getRoomNumber() {
            return roomNumber;
        public void setRoomNumber(String roomNumber) {
            this.roomNumber = roomNumber;
    }the renderer
    package com.tangram.theoryonline.web.tags;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.Map;
    import javax.faces.FactoryFinder;
    import javax.faces.component.UICommand;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.context.ResponseWriter;
    import javax.faces.render.RenderKit;
    import javax.faces.render.RenderKitFactory;
    import javax.faces.render.Renderer;
    import com.tangram.theoryonline.datamodel.Station;
    import com.tangram.theoryonline.web.constants.TheoryOnlineWebConstants;
    import com.tangram.web.jsf.html.tags.Util;
    public class TheoryOnlineStationsRenderer extends Renderer {
         public void encodeBegin(FacesContext context, UIComponent component)
         throws java.io.IOException
              if (!component.isRendered()) return;
              Map attributes = component.getAttributes();
              ArrayList rightList=(ArrayList)attributes.get(TheoryOnlineWebConstants.ROOM_STATIONS_RIGHT_LIST);
              ArrayList leftList=(ArrayList)attributes.get(TheoryOnlineWebConstants.ROOM_STATIONS_LEFT_LIST);
              Station station;
              String roomNumber=(String)attributes.get("roomNumber");
              ResponseWriter writer = context.getResponseWriter();
              String clientId = component.getClientId(context);
              writer.startElement("table", component);
              writer.writeAttribute("id", clientId, "id");
              Util.writePassthroughAttributes(attributes, writer);
              writer.startElement("tbody", component);
              System.out.println("lengths from renderer are "+rightList.size()+","+leftList.size());
              int i=0;
              while (i<rightList.size() || i<leftList.size() ) {
                   writer.startElement("tr", component);
                   station=null;
                   if (i<rightList.size())
                        station=(Station)rightList.get(i);
                   if (station!=null)
                        writeColumn(component,writer,station,clientId);
                   station=null;
                   if (i<leftList.size())
                        station=(Station)leftList.get(i);
                   if (station!=null)
                        writeColumn(component,writer,station,clientId);               
                   writer.endElement("tr");               
              writer.endElement("tbody");          
              writer.endElement("table");
         private void writeColumn(UIComponent component,ResponseWriter writer ,Station station,String clientId) throws IOException {
              int status=station.getEntityStatus().getValue();
              writer.startElement("td", component);
              writer.startElement("label",component);
              writer.writeAttribute("for",clientId,null);
                   writer.startElement("input",component);
                   writer.writeAttribute("type","radio",null);
                   writer.writeAttribute("name", clientId, null);
                   writer.writeAttribute("value",station.getName(),null);
                   System.out.println(Boolean.toString(status==1));
                   if (status!=1)
                   writer.writeAttribute("disabled","disabled",null);                              
                   writer.endElement("input");
                   //if (status==2)                    writer.write("<H1>");
                   writer.write(station.getName());
    //               if (status==2)                    writer.write("</H1>");
              writer.endElement("label");     
         writer.endElement("td");
          public void decode(FacesContext context, UIComponent component)
             getButtonRenderer(context).decode(context, component);
           protected Renderer getButtonRenderer(FacesContext context)
             RenderKitFactory rkFactory =
               (RenderKitFactory)FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
             RenderKit defaultRenderKit =  // talk about other variation of this method
               rkFactory.getRenderKit(context, RenderKitFactory.HTML_BASIC_RENDER_KIT);  /** Changed from DEFAULT_RENDER_KIT, changed order of parameters **/
             return defaultRenderKit.getRenderer(UICommand.COMPONENT_FAMILY, "javax.faces.Button");
    * Created on 01/01/2006
    * Window - Preferences - Java - Code Style - Code Templates
    package com.tangram.theoryonline.web.webbeans;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.Map;
    import javax.faces.component.html.HtmlInputHidden;
    import javax.faces.context.FacesContext;
    import javax.faces.model.SelectItem;
    import com.tangram.theoryonline.constants.TheoryOnlineConstants;
    import com.tangram.theoryonline.constants.enums.LocationEntityStatusEnum;
    import com.tangram.theoryonline.datamodel.Examinee;
    import com.tangram.theoryonline.datamodel.Room;
    import com.tangram.theoryonline.datamodel.Site;
    import com.tangram.theoryonline.datamodel.Station;
    import com.tangram.theoryonline.managers.EntitiesManager;
    import com.tangram.theoryonline.security.TheoryOnlineUser;
    import com.tangram.theoryonline.web.constants.TheoryOnlineWebConstants;
    import com.tangram.web.constants.TangramWebConstants;
    public class SelectStation  extends TheoryOnlineBaseBean{
        private ArrayList  stationList;
    //    private String hiddenExamineeId;
    //    private String selectedRoom;
        private String listId="MainList";
    //    private String hiddenStationNumber;
        private HtmlInputHidden hiddenStationNumberBinding,hiddenRoomNumberBinding,hiddenExamineeIdBinding;
    //    private String hiddenRoomNumber;
        private String roomCombuValue;
    //    private HtmlSelectOneMenu roomCombu;//=new HtmlSelectOneMenu ();
        private SelectItem [] roomsLists;
        //     private HtmlSelectOneMenu roomSelect;
        public SelectStation() {
            super();          
        public String initSelectStationsModal(){
            Map examineeCache = (ExamineeCache)getValueBinding(TheoryOnlineWebConstants.EXAMINEE_MAP_SCOPE + TheoryOnlineWebConstants.EXAMINEE_MAP_KEY);
            Examinee examinee = (Examinee)examineeCache.get(getHiddenExamineeIdFromBinding());
            FacesContext facesContext = FacesContext.getCurrentInstance();
            Map session=facesContext.getExternalContext().getSessionMap();       
            TheoryOnlineUser user = (TheoryOnlineUser)session.get(TangramWebConstants.ATTRIBUTE_USER_KEY);
         //   long siteId=user.getExaminer().getSite().getId();
            int default_room=TheoryOnlineConstants.NO_STATION_PICKED_YET;
            Station station=null;
            Room room=null;
            if (examinee==null)
                System.out.println("ERROR getting examinee from map");
            else
                if (examinee.getLocation()==null)
                    System.out.println(" CODERS ERROR - get location returend null" );
            else if  (examinee.getLocation().getStationGid()!=TheoryOnlineConstants.NO_STATION_PICKED_YET){
                station=(Station) EntitiesManager.getInstance().getStationsMap().get(""+examinee.getLocation().getStationGid());
                if (station!=null && station.getRoom()!=null) {
                    room= (Room) EntitiesManager.getInstance().getRoomsMap().get(""+station.getRoom().getId());
                    if (room!=null)
                        default_room=TheoryOnlineConstants.FOUND_STATION_AND_ROOM;     
                }// if !nulls
            }// if no station picked yet.
            System.out.println("default_room="+default_room);
            System.out.println("combu value is " + roomCombuValue);
            switch (default_room) {
            case TheoryOnlineConstants.NO_STATION_PICKED_YET:
            case TheoryOnlineConstants.FOUND_STATION_NO_ROOM: {
                room=(Room) user.getExaminer().getSite().getDecendedList().get(0);
                if (room!=null) {
                    setHiddenRoomNumberFromBinding(""+room.getId());
                    hiddenStationNumberBinding.setValue("");                    
                    System.out.println("setting default room " + hiddenRoomNumberBinding.getValue());
                    roomCombuValue=(String) hiddenRoomNumberBinding.getValue();
                break;
            case TheoryOnlineConstants.FOUND_STATION_AND_ROOM: {
                hiddenRoomNumberBinding.setValue(""+room.getId());
                hiddenStationNumberBinding.setValue(""+station.getId());
                System.out.println("EXAMINEE ALREADY HAD station id=" + station.getId());
                roomCombuValue=(String) getHiddenRoomNumberBinding().getValue();
                break;
            }//case
            }// switch
            System.out.println( "room value="+roomCombuValue);
            return "";
        private void setHiddenRoomNumberFromBinding(String string) {
            hiddenRoomNumberBinding.setValue(string);
        public String locateRoom(){
            hiddenRoomNumberBinding.setValue(""+roomCombuValue);  
            System.out.println("room combo value is " +roomCombuValue);
            hiddenStationNumberBinding.setValue("");       
            return "";
        public ArrayList getStationList(long roomGid) {
            ArrayList sourceList=(ArrayList) EntitiesManager.getInstance().getRoomsMap().get(""+ roomGid);
            if (sourceList==null) {
                System.out.println("CODERS ERROR room is null");
                return null;
            ArrayList list=new ArrayList ();
            Station station=null;
            System.out.println("Building list");
            list.add(new SelectItem("AAA","1"));
            for (int i=0;i<sourceList.size();i++) {
                station=(Station)sourceList.get(i);
                SelectItem si=new SelectItem(""+station.getId(),station.getName());
                if (station.getEntityStatus()==LocationEntityStatusEnum.INACTIVE) si.setDisabled(true);
                list.add(si);           
            return list;
        public String getListId() {
            return listId;
        public void setListId(String listId) {
            this.listId = listId;
         public void setStationList(ArrayList stationList) {
            this.stationList = stationList;
        public SelectItem[] getRoomsLists() {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            Map session=facesContext.getExternalContext().getSessionMap();       
            TheoryOnlineUser user = (TheoryOnlineUser)session.get(TangramWebConstants.ATTRIBUTE_USER_KEY);
            long siteId=user.getExaminer().getSite().getId();
            Site site=(Site)EntitiesManager.getInstance().getSite(""+siteId);
            Map examineeCache = (ExamineeCache)getValueBinding(TheoryOnlineWebConstants.EXAMINEE_MAP_SCOPE + TheoryOnlineWebConstants.EXAMINEE_MAP_KEY);
            Examinee examinee = (Examinee)examineeCache.get(getHiddenExamineeIdFromBinding());
            //          String s=examinee.getLocation().getRoomDescription();
            System.out.println("inside getRoomsLists : room is ");
            roomsLists=new SelectItem[ site.getDecendedList().size()];
            Iterator itr=site.getDecendedList().iterator();
            int i=0;
            Room room;
            while (itr.hasNext()){
                room=(Room) itr.next();
                roomsLists=new SelectItem(""+room.getId(),room.getName());
    i++;
    return roomsLists;
    private String getHiddenExamineeIdFromBinding() {
    return (String) hiddenExamineeIdBinding.getValue();
    public void setRoomsLists(SelectItem[] roomsLists) {
    this.roomsLists = roomsLists;
    public String getRoomCombuValue() {
    return roomCombuValue;
    public void setRoomCombuValue(String roomCombuValue) {
    this.roomCombuValue = roomCombuValue;
    public HtmlInputHidden getHiddenExamineeIdBinding() {
    return hiddenExamineeIdBinding;
    public void setHiddenExamineeIdBinding(HtmlInputHidden hiddenExamineeIdBinding) {
    this.hiddenExamineeIdBinding = hiddenExamineeIdBinding;
    public HtmlInputHidden getHiddenRoomNumberBinding() {
    return hiddenRoomNumberBinding;
    public void setHiddenRoomNumberBinding(HtmlInputHidden hiddenRoomNumberBinding) {
    this.hiddenRoomNumberBinding = hiddenRoomNumberBinding;
    public HtmlInputHidden getHiddenStationNumberBinding() {
    return hiddenStationNumberBinding;
    public void setHiddenStationNumberBinding(
    HtmlInputHidden hiddenStationNumberBinding) {
    this.hiddenStationNumberBinding = hiddenStationNumberBinding;

    Hi Emmanuel,
    Now I get your problem: you want to wait to have the commit finished! The call to BAPI_TRANSACTION_COMMIT has an optional parameter 'WAIT' which is space by default which causes only a commit. When you set this parameter to 'X' it will do a commit work and wait.
    This should solve your problem!
    Regards,
    John.

  • Processing happens only in debug mode.

    Hi,
    I am calling an RFC enabled FM BAPI_ALM_NOTIF_DATA_MODIFY and BAPI_ALM_NOTIF_SAVE to modify the data of a notification. These function modules are called within another FM which is also a RFC called in background as a separate task. The problem here is that, the data gets modified fine only when I am in the debugging mode and execute it. But if I execute without going to the debug mode, I cannot modify the notification data. Kindly suggest why this is happening and what the solution is. Thanks

    I am not using any destination. The code is as shown:
      WAIT UP TO 5 SECONDS.
      CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
        EXPORTING
          number                 = aufnr
       IMPORTING
         es_header              = gf_header
        TABLES
         et_olist               = it_ord_notif
          return                 = it_ret
    CALL FUNCTION 'BAPI_ALM_NOTIF_GET_DETAIL'
      EXPORTING
        number                   = gf_header-notif_no
    IMPORTING
       NOTIFHEADER_EXPORT       = gf_notif_exp
            CLEAR: gf_notif_no.
            DESCRIBE TABLE it_notif_no LINES g_line.
            READ TABLE it_notif_no into gf_notif_no INDEX g_line.
            IF gf_notif_no-short_text+0(3) = 'PRB'.
             clear: gf_notif_imp, gf_notif_imp_x.
                gf_notif_imp-desstdate = gf_notif_exp-desstdate.
                gf_notif_imp-desenddate = gf_notif_exp-desenddate.
                gf_notif_imp_x-desstdate = 'X'.
                gf_notif_imp_x-desenddate = 'X'.
                CALL FUNCTION 'BAPI_ALM_NOTIF_DATA_MODIFY'
                      EXPORTING
                        number                   = gf_notif_no-notif_no
                       NOTIFHEADER              = gf_notif_imp
                       NOTIFHEADER_X            = gf_notif_imp_x
                     IMPORTING
                       NOTIFHEADER_EXPORT       = gf_notif_result
                     TABLES
               CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
      EXPORTING
        number            = gf_notif_no-notif_no
    IMPORTING
      NOTIFHEADER       = gf_qmnum_save
    TABLES
       RETURN            = it_ret2.
              endif.
                clear: gf_notif_no.
            LOOP AT it_notif_no INTO gf_notif_no.
              IF gf_notif_no-short_text+0(3) = 'PRB'.
                SELECT SINGLE objnr FROM viqmel
                                                      INTO g_objnr
                                                     WHERE qmnum = gf_notif_no-notif_no.
                SELECT SINGLE stsma INTO g_stsma FROM jsto WHERE objnr = g_objnr.
                SELECT SINGLE estat INTO g_stat FROM tj30t WHERE stsma = g_stsma AND
                  spras = 'EN'
                  AND txt04 = 'SFMR'.
                CALL FUNCTION 'STATUS_CHANGE_EXTERN'
                  EXPORTING
                    check_only          = ' '
                    client              = sy-mandt
                    objnr               = g_objnr
                    user_status         = g_stat
                    set_inact           = ' '
                    set_chgkz           = 'X'
                    no_check            = ' '
                  EXCEPTIONS
                    object_not_found    = 1
                    status_inconsistent = 2
                    status_not_allowed  = 3
                    OTHERS              = 4.
                IF sy-subrc = 0.
                ENDIF.
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.

  • Strange issue in updating custom table after upgrade ECC6.0! Please help!

    Hello everyone:
        I have some code (shown below) that deletes and updates some SAP tables and one custom table:
        DELETE T5UBV   FROM TABLE DEL_T5UBV.
      DELETE ZCHRZIP FROM TABLE DEL_ZCHRZIP.
      MODIFY ZCHRZIP FROM TABLE WRITE_ZCHRZIP.
      MODIFY T5UBV   FROM TABLE WRITE_T5UBV.
    COMMIT WORK.
    For SAP table the code above works fine but for custom table it overrides all exisiting data! It should keep some existing data in custom table ZCHRZIP and append any extra data from internal table WRITE_ZCHRZIP. This functions as designed if I run in fore ground but in background it just overrides instead of modifying and appending! This is happening only after upgrade ECC6.0. Any thoughts? Please let me know.
    Thanks.
    Mithun

    Mithun,
    Comment below code
    DELETE ZCHRZIP FROM TABLE DEL_ZCHRZIP.
    <b>Reward if it helps,</b>
    Satish

  • Updating custom table with PU12

    Hi Experts,
    I need to update the custom table with PU12. Please let me know if this is possible with PU12.
    I have used the PU12 only to retrieve the data from database and have sent the data to application server.
    Thanks
    Rashmi

    Hi
    Can you please let me know how to  update the custom table with PU12.
    Can you please let me know the User exit you have used.
    Thanks in advance.
    Regards,
    Kiran.

  • Updating Custom table when updating infotype

    HI
    A custom transaction needs to be created for maintenance of the table in future as the values could change. Whenever infotype 0015 values are changed are updated this custom table  values should need to update.Could you please suggest me..

    I also suggest you to lock only the entry that will be updated (and not the whole table!) : you will have then far less problems of conflict with updating this table.
    For that, you have to create a lock object on your table (via SE11 - for example EZ_MY_TABLE). This will create 2 function modules named ENQUEUE_E<name of your lock object> (in my example ENQUEUE_EZ_MY_TABLE) and DEQUEUE_E<...>.
    You can then call those FM like this :
    CALL FUNCTION 'ENQUEUE_EZ_MY_TABLE'
      EXPORTING
        MODE_RSTABLE = 'S'
        KEYFIELD1 = ld_keyfield1  " Here are the key values for the entry that you have to update
        KEYFIELD2 = ld_keyfield2
      EXCEPTIONS
        FOREIGN_LOCK = 1
        SYSTEM_FAILURE = 2
        OTHERS = 3.
    Best regards,
    Samuel

  • User exit/BADI for updating custom table in MB1B transaction-

    Dear All,
    When performing a material to material conversion in MB1B transaction for  batch managed materials,system is creating a new batch by copying the characteristics of issuing material/batch.The details of the new batch created are updated in standard batch tables(MCH1,MCHA,MCHA).
    The requirement is when the new batch is created,the batch details and characteristics has to be stamped in a custom table.
    Kindly suggest a user exit/BAIi available for updating the same in the custom table.
    Regards,
    Deepak

    Deepak, Exits for MB1B are
    MBCF0002            Customer function exit: Segment text in material doc. item
    MBCF0005            Material document item for goods receipt/issue slip
    MBCF0006            Customer function for WBS element
    MBCF0007            Customer function exit: Updating a reservation
    MBCF0009            Filling the storage location field
    MBCF0010            Customer exit: Create reservation BAPI_RESERVATION_CREATE1
    MBCF0011            Read from RESB and RKPF for print list in  MB26
    MB_CF001            Customer Function Exit in the Case of Updating a Mat. Doc.

  • GET_P Method for Link in table - only in display mode

    Hello,
    i created an assignmentblock to display a ztable (Simple Object).
    One column in the table is homepage.
    For this attribute i added some coding to the GET_P_Method to have a link.
    The link works fine - but i have this link now not only in display mode but also in edit mode for the table.
    As a sideeffect this column is now longer editable.
    How should i change my GET_P coding so that the link is only there in display mode. In edit mode the field should be editable (no link).
    Thank you
    Best regards
    Manfred

    Hello Manfred,
    I do not know about your system... but the usual GET_P-methods do have an importing parameter IV_DISPLAY_MODE. This tells you if you are in display or edit mode.
    Check method CL_BT115QH__DETAILS_CN00->GET_P_ORDER_REASON.
    Or even more general: GETP_XYZ in your context node class.
    The part with the IF statement should be trivial.
    cheers Carsten

Maybe you are looking for

  • ORA-01031: insufficient privileges in PL/SQL but not in SQL

    I have problem with following situation. I switched current schema to another one "ban", and selected 4 rows from "ed" alter session set current_schema=ban; SELECT * FROM ed.PS WHERE ROWNUM < 5; the output is OK, and I get 4 rows like ID_S ID_Z 10001

  • Frozen out menu ribbon in Word 2013 and cannot preview word documents in Outlook 2013

    I seem to be having a recurring problem with Word 2013 from Office Home Edition single user. When I try to put a caption on a table, the entire document page layout changes from portrait to something close to landscape and then the entire menu ribbon

  • Adobe Reader 8 silent install

    I have used Customization Wizard to development silent install. The computers that have Acrobat Reader 7 or previous version work ok but when I run the silent install package in a computer that have the 8 version yet a window to repair or remove appe

  • Urgent:why portal30 DAD can not invoke procedure through url

    My portal version is 3.0.9 I found an mod/plsql problem .I created a procedure named current_user like this : create or replace procedure current_users AS ignore boolean; BEGIN htp.htmlopen; htp.headopen; htp.title('Current Users'); htp.headclose; ht

  • Sharing Photos: Different Users, Same Computer

    So far, I've tried some suggestions found in other postings, but I still can't share some photo libraries between different users on the same computer. I started an account for my son. Sharing was enabled in both iPhoto Apps. I've tried locating the