How to read XKOMV-EDATU, XKOMV-KBETR fields inside java

How do get the 
XKOMV-EDATU date and pass it to ItemUserExit.java for database read and filtering.
a. The code in ItemUserExit has to filter ZCPI2-ZSPMON for this date XKOMV-EDATU, the delivery date.
This does not work. prItem.getPricingTimestamp returns the current date always, NOT delivery date.
What is the method call that will grab this date.?
b. How do I have to pass this XKOMV-EDATU date to ItemUserExit.java for database read / filtering.
c. The field XKOMV-KBETR has to be read based on the KSCHL = ‘ZCP1’ and / or KSCHL =’PR00’.
These are abap structures. But I am not sure how to read this value inside java.
How would I extract the structure XKOMV-KBETR(the rate) for KBETR(conditionType)=’PR00’ .
Please note that I get an error mandatory condition PR00 is missing. (see attached error message ).
d. “CPIW_A” set up in ItemUserExit.java :: itemUserExitAccess.addItemAttributeBinding("CPIW_A", ZVALUE_CPIW_A );
is NOT available at PricingUserExits.java with the code:
prItem.getItemAttributeBinding("CPIW_A") ,
though they are registered in the method
“determineRelevantAttributesForValueFormula” as per the help html pages.
I had attached the code.
Can you scan thru the code and give feedback.
Can I call you in the morning.
Thanks.
TK
PS:
I get an error “PR00” mandatory condition is missing from the log file.
======
OP="ChangeDocument" ID="34800003" STATUS="200" />objectIds[1]=07F9101FD1D0AD4686B2411E3EFB2DF1&messageTypes[1]=E&messages[1]=Pricing error: Mandatory condition PR00 is missing&areas[1]=SPE&numbers[1]=801&args1[1]=PR00&args2[1]=&args3[1]=&args4[1]=Nov 11, 2005 12:41:37... ...p.sxe.socket.server.rfc.RFCConnection JCO.ServerThread-3 Info: response time of command C
However, I get the response header as:
availableItemConditionTypeNames[1]=PR00&availableItemConditionTypeNames[2]=VA00&availableItemConditionTypeNames[3]=ZA00&availableItemConditionTypeNames[4]=ZOUT&availableItemConditionTypeNames[5]=ZCRT&availableItemConditionTypeNames[6]=K004&availableItemConditionTypeNames[7]=RA01&availableItemConditionTypeNames[8]=RB00&availableItemConditionTypeNames[9]=ZB00&availableH
CODE:
ItemUserExit.java snippet:
          qrypair2[0]  = new sys_query_pair("ZCPI", <b>"200501"</b>, sys_query_pair.GREATER); //
          projection = new String[] { "ZCPI" } ;
          sorting = new String[] { "ZCPI" } ;           res resultSet = database.db_read_first_row("ZCPI2", qrypair2, projection, sorting);
I need to pass the XKOMV-EDATU date field in the above bolded date field.  I think this field is available thru the API for IPricingItemUserExit  inside the overwriteConditionValue method's parameter .
METHOD
overwriteConditionValue:
     public BigDecimal overwriteConditionValue(IPricingItemUserExit      prItem,
                                                         ILastPrice                lastPrice,
                                                         IPricingConditionUserExit prCondition,
                                                         int                       valueFormNo) {
          String sold2party = "", strCPIW_A = "", strCPIW_B = "";
          BigDecimal condValue = prCondition.getConditionValue().getValue();
          BigDecimal netValue  = prItem.getNetValue().getValue();
          String prod = (prItem.getProduct()!=null)? prItem.getProduct().toString(): "NULL";
          SAPTimestamp  priceTstamp = prCondition.getConditionFindingTimestamp(); //prItem.getDefaultConditionAccessTimestamp();  //getPricingTimestamp();
          String strTstamp = priceTstamp.formatYYYYMMDD();
          //KOMP-EDATU ??
          logInfo("valueFormNo: " + valueFormNo +  " Condition Table type:"  + prCondition.getConditionTypeName() +
                     ", condVal:" + condValue + ", netValue:" + netValue + ", KOMP-EDATU:" + strTstamp );
          switch (valueFormNo) {
               case 601:
                         try{
                           sold2party = prItem.getHeaderAttributeBinding("SOLD_TO_PARTY").getValue().getValue();
                           IAttributeBinding iamCPIW_B  = prItem.getItemAttributeBinding("CPIW_B");
                           IAttributeBinding iamCPIW_A  = prItem.getItemAttributeBinding("CPIW_A");
                           if( iamCPIW_A !=null) strCPIW_A = iamCPIW_A.getValue().getValue();
                           if( iamCPIW_B !=null) strCPIW_B = iamCPIW_B.getValue().getValue();
                         }catch(Exception e) {
                              logInfo("EXCEPTION @ GetAttributeBinding exception : " + e.getMessage());
                         logInfo("sold2party: " + sold2party + " strCPIW_A, strCPIW_B: " + strCPIW_A + ", " + strCPIW_B);
                         String CPIW_A = null, CPIW_B = null, BASE_PRICE = null;
                         logInfo("overwriteConditionValue " +
                               "_CPIW_A: " + _CPIW_A + ", _CPIW_B: " + _CPIW_B + ", _BASE_PRICE: " + _BASE_PRICE );
                         double l_cpiw_a, l_cpiw_b, l_base;
                         if( _CPIW_A == null || _CPIW_B == null || _BASE_PRICE == null) {
                              logInfo("overwriteConditionValue *tk* static _CPIW_A.... NULL. returning 999999L" );
                              return BigDecimal.valueOf( 0L );
                         }else{
                              l_cpiw_a = Double.valueOf(_CPIW_A).doubleValue();
                              l_cpiw_b = Double.valueOf(_CPIW_B).doubleValue();
                              l_base   = Double.valueOf(_BASE_PRICE).doubleValue();
                              logInfo("overwriteConditionValue *tk* ???? using STATIC Class Variables" );
                         logInfo("overwriteConditionValue " +
                               "cpiw_a: " + l_cpiw_a + ", l_cpiw_b: " + l_cpiw_b + ", l_base: " + l_base );
                         double fraction = (l_cpiw_a - l_cpiw_b)/l_cpiw_b;
                         logInfo("overwriteConditionValue " +
                                   "*tk* double fraction: " + fraction );                                               
                         double result = l_base * fraction;
                         logInfo("overwriteConditionValue " +
                                   "*tk* double calculated Result: " + result );                       
                         BigDecimal retValue = BigDecimal.valueOf (Math.round(result));
                         condValue = retValue;
                         try{
                              prCondition.setConditionRate(retValue , "USD");     
                         }catch(Exception convEx){
                              logInfo("overwriteConditionValue " +
                                                       "*tk* converstion Rate Exception " + retValue );
                         prItem.setObjectForUserExits("XKOMV_KBETR_C", retValue);
                         logInfo("overwriteConditionValue: 601 conditionRate Return Value: " + retValue );
                         return retValue;
               case 602:
                         /* Forecasted CPI-W value = ( ( D * ( ( A – B ) / B ) )  – ( D + C ) ) */
                    double A = Double.valueOf( PricingUserExits.ZCPI2_ZCPI ).doubleValue();
                    double B = Double.valueOf( PricingUserExits._CPIW_B ).doubleValue();
                    double C=0, D=0;
                    BigDecimal bdC = (BigDecimal)prItem.getObjectForUserExits("XKOMV_KBETR_C");
                    C = bdC.doubleValue();
                    D = C * 0.8;  // just for calculation verification.
                    // C = Double.valueOf( PricingUserExits.XKMOV_KBETR_C ).doubleValue();
                    // D = Double.valueOf( PricingUserExits.XKMOV_KBETR_D ).doubleValue();
                    logInfo("overwriteConditionValue " +
                                                       "*tk* A, B, C, D: " + A + ", " + B + ", " + C + ", " + D);
                    double res1 =  A - B ;
                           res1 =  res1 /B ;
                           res1 =  D * res1;
                    double res2 =  D + C ;
                    double CPI_W ;
                           CPI_W = res1 - res2; //– res2;
                    BigDecimal retn =  new BigDecimal(CPI_W) ;
                   logInfo("overwriteConditionValue *tk* case 602 returning - " + retn );
                    return retn; // new BigDecimal(99999L);
               default:
                    throw new FormulaNotImplementedException(prItem, "value formula", valueFormNo);

Java != javascript.
You can not call java directly from javascript.
The lifecycle:
Request received
Java/JSP runs produces an HTML page
Java stops running
Javascript runs on page when page is loaded.
The only way to call java code again is to submit a request and get the result back in a response. Traditionally the response is a new JSP page to replace the old one.
Using AJAX the response can be just information that you then alter the current page with.
The first example given by skp71 will probably NOT be what you are after. The java code is executed when you load the page, NOT when you push the button which is most probably what you are after.
AJAX is a solution, as is loading a new page.
Cheers,
evnafets

Similar Messages

  • How to read a data from USB port using JAVA

    hi all,
    i need to know how to read a data from USB port using java. any API are available for java ?.........please give your valuable ideas !!!!!!!!!
    Advance Thanks!!

    You can do this. Please use this link
    [http://www.google.co.in/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=uHu&q=java+read+data+from+usb+port&btnG=Search&meta=&aq=f&oq=]
    What research did you do of your own? Have you done some testing application and tried yourself??

  • How To read/write file on remote server in java

    Hi All,
    How To read/write file on remote server in java? I mean using URL - http://www.xyz.com can I right file to that perticular server.
    Thanks in advance

    If your server support a means of uploading files you can.
    A popular means is [http://en.wikipedia.org/wiki/WebDAV]
    However, by default web server don't allow you upload files, its usually something you need to configure or install.
    I suggest you have a look at your web servers documentation.

  • How to read value of OVS Input field on pressinf of F4

    In my case I have to read value from context node as I am skipping the phase 1 of  on OVS PHASE MODEL
    but not sure how to read the value from context element
    METHOD on_ovs .
      DATA: lo_nd TYPE REF TO if_wd_context_node,
            lo_el TYPE REF TO if_wd_context_element,
            lo_el_parent TYPE REF TO if_wd_context_element.
      lo_el = wdevent->get_context_element( name = 'OVS_CONTEXT_ELEMENT' ).
      lo_el_parent = lo_el->get_node( )->get_parent_element( ).
      DATA: criteria TYPE string.
      DATA text TYPE string.
      lo_el->get_attribute( EXPORTING name = 'ATTR_TEXT' IMPORTING value = text ).
      DATA: ls_search_input  TYPE cl_grac_feeder_role_search=>lty_stru_input,
            lt_select_list   TYPE STANDARD TABLE OF cl_grac_feeder_role_search=>lty_stru_list,
            ls_text          TYPE wdr_name_value,
            lt_label_texts   TYPE wdr_name_value_list,
            lt_column_texts  TYPE wdr_name_value_list,
            lv_window_title  TYPE string,
            lv_table_header  TYPE string.
      FIELD-SYMBOLS: <ls_query_params> TYPE cl_grac_feeder_role_search=>lty_stru_input,
                     <ls_selection>    TYPE cl_grac_feeder_role_search=>lty_stru_list.
      CASE ovs_callback_object->phase_indicator.
        WHEN if_wd_ovs=>co_phase_0.  "configuration phase, may be omitted
      in this phase you have the possibility to define the texts,
      if you do not want to use the defaults (DDIC-texts)
         lt_label_texts =  wd_this->get_ovs_label_texts( criteria ).
         lt_column_texts = wd_this->get_ovs_column_texts( criteria ).
         lv_window_title = wd_this->get_ovs_window_title( criteria ).
         lv_table_header = wd_this->get_ovs_table_header( criteria ).
         lv_window_title = wd_assist->get_text( `003` ).
         lv_table_header = wd_assist->get_text( `004` ).
          CASE text.
            WHEN 'SYSTEM'.
              ls_text-name = `CONNECTORID`.
              ls_text-value = `System`.
              INSERT ls_text INTO TABLE lt_label_texts.
              lv_window_title = ls_text-value.
              lv_table_header = ls_text-value.
              lt_column_texts = lt_label_texts.
            when 'PERMISSION' .
              return.
            when 'ACTION'.
              RETURN.
          ENDCASE.
          ovs_callback_object->set_configuration(
                    label_texts  = lt_label_texts
                    column_texts = lt_column_texts
                    window_title = lv_window_title
                    table_header = lv_table_header ).
        WHEN if_wd_ovs=>co_phase_1.  "set search structure and defaults
      In this phase you can set the structure and default values
      of the search structure. If this phase is omitted, the search
      fields will not be displayed, but the selection table is
      displayed directly.
      Read values of the original context (not necessary, but you
      may set these as the defaults). A reference to the context
      element is available in the callback object.
         ovs_callback_object->context_element->get_static_attributes(
             IMPORTING static_attributes = ls_search_input ).
        pass the values to the OVS component
         ovs_callback_object->set_input_structure(
             input = ls_search_input ).
          CASE text.
            WHEN 'SYSTEM'.
          DATA: l_conn TYPE grac_s_grfncgrpconlk.
              ovs_callback_object->set_input_structure( EXPORTING input = l_conn ).
          ENDCASE.
        WHEN if_wd_ovs=>co_phase_2.
      If phase 1 is implemented, use the field input for the
      selection of the table.
      If phase 1 is omitted, use values from your own context.
         IF ovs_callback_object->query_parameters IS NOT BOUND.
    TODO exception handling
         ENDIF.
         ASSIGN ovs_callback_object->query_parameters->*
                                 TO <ls_query_params>.
         IF NOT <ls_query_params> IS ASSIGNED.
    TODO exception handling
         ENDIF.
        call business logic for a table of possible values
        lt_select_list = ???
         DATA: l_data TYPE grac_t_bproc.
         DATA: ls_data TYPE REF TO data.
         DATA: l_stru TYPE REF TO cl_abap_tabledescr.
         l_stru ?= cl_abap_tabledescr=>describe_by_name( 'GRAC_T_BPROC' ).
         CREATE DATA ls_data TYPE HANDLE l_stru.
         wd_this->get_ovs_selection_list( EXPORTING iv_criteria = criteria IMPORTING rt_list = l_data ).
         "ASSIGN l_data->* to <lt_list>.
         ovs_callback_object->set_output_table( output = l_data ).
          "ovs_callback_object->set_output_table( output = lt_select_list ).
          FIELD-SYMBOLS: <fs_query_params> TYPE cl_grac_feeder_role_search=>lty_stru_input1,
          <fs_selection>    TYPE cl_grac_feeder_role_search=>lty_stru_list.
          DATA lv_connector_grp TYPE grfn_connectorgrp.
          IF ovs_callback_object->query_parameters IS NOT BOUND.
    TODO exception handling
          ENDIF.
          ASSIGN ovs_callback_object->query_parameters->*
          TO <fs_query_params>.
          IF NOT <fs_query_params> IS ASSIGNED.
    TODO exception handling
          ELSE.
            lv_connector_grp =  <fs_query_params>-field1.
          ENDIF.
         IF lv_connector_grp IS INITIAL.
           lv_connector_grp = '*'.
         ENDIF.
          CASE text.
            WHEN 'SYSTEM'.
              DATA: lt_system_list TYPE grac_t_grfncgrpconlk.
              FIELD-SYMBOLS: <ls_system> LIKE LINE OF lt_system_list.
              cl_grfn_cci_ts_configuration=>get_group_connectors(
                EXPORTING
                  iv_connector_grp    = lv_connector_grp
                 iv_no_authority_chk = ABAP_FALSE
                IMPORTING
                  rt_connectors       = lt_system_list
              ovs_callback_object->set_output_table( output = lt_system_list ).
              WHEN 'ACTION'.
                data lt_action_output TYPE TABLE OF cl_grac_feeder_role_search=>t_action_list.
                ovs_callback_object->set_output_table( output = lt_action_output ).
              WHEN 'PERMISSION'.
                DATA: lt_perm TYPE TABLE OF cl_grac_feeder_role_search=>t_permission_list.
          ovs_callback_object->set_output_table( OUTPUT = lt_perm ).
          ENDCASE.
        WHEN if_wd_ovs=>co_phase_3.
          FIELD-SYMBOLS <system> TYPE grac_s_grfncgrpconlk.
          CASE text.
            WHEN 'SYSTEM'.
              ASSIGN ovs_callback_object->selection->* TO <system>.
              IF <system> IS ASSIGNED.
                ovs_callback_object->context_element->set_attribute(
                name  = 'INPUT1_SYSTEM'
                value = <system>-connector ).
                wd_this->mv_connectorid = <system>-connector.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDMETHOD.

    Hi,
    It depends how you are setting your parameter also as there are different types of parameters in portal. The best is to use the page level parameters..
    Please read the developers gide Section 8.3 for more details....
    The link is :-
    http://download-east.oracle.com/docs/cd/B14099_19/portal.1014/b14135/pdg_pdk_plsql.htm#CHDGAHCF
    Guneet

  • How to read Email address from TO field

    Hi,
    I am try to read email from outlook using JACOB api. now i can able to read all email from outlook.
    my problem is while i am read TO field for Mail , its return the display name instead of email address.
    please any one tell me how to read email address from TO,CC and BCC field.
    Thanks in advance,
    With Regards,
    Ganesh Kumar.L

    Hi all,
    I am solved my problem,
    First i am getting the Recipients object from mail item object,
    and recipient object i can get all my required details.
    Thanks,
    by
    ganesh

  • How to read the value of a field belonging to a different context node in GET_I method during runtime

    I want the read the value of a field,'LCSTATUS' belonging to context node 'BTADMINH' in the GET_I method of the field, 'ZZFLD000008' belonging to context node,'ZBTACTIVITYH'.
    In the context node class of context node 'ZBTACTIVITYH',I have created an instance attribute,GR_OWNER type ref to context class.
    I get the following error in the line - lv_act_status = Lr_entity->if_bol_bo_property_access~GET_PROPERTY_AS_STRING( 'LCSTATUS' ).
    'An exception (CX_CRM_CIC_PARAMETER_ERROR) occurred Message no. TPDA430'
    I have used the below code.
    method GET_I_ZZFLD000008.
         DATA: current TYPE REF TO if_bol_bo_property_access,
               lv_act_status TYPE string.
         DATA:lr_entity TYPE REF TO cl_crm_bol_entity,
               lr_current TYPE REF TO if_bol_bo_property_access,
              lr_parent TYPE REF TO cl_crm_bol_entity.
         rv_disabled = 'TRUE'.
         if iterator is bound.
           current = iterator->get_current( ).
         else.
           current = collection_wrapper->get_current( ).
         endif.
    CHECK gr_owner IS BOUND.
    lr_entity ?= gr_owner->btadminh->collection_wrapper->get_current( ).
    CHECK  lr_entity  IS BOUND.
    lv_act_status = Lr_entity->if_bol_bo_property_access~GET_PROPERTY_AS_STRING( 'LCSTATUS' ). "error states that lcstatus can't be used here.
       TRY.
             IF current->is_property_readonly(
                           'ZZFLD000008' ) = abap_false. "#EC NOTEXT
               rv_disabled = 'FALSE'.
             ENDIF.
         CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
               cx_crm_genil_model_error.
           RETURN.
       ENDTRY.
    endmethod.

    Hi,
    LCSTATUS is not an attribute of the BTADMINH structure. It is read using the relation to the status object
    BTADMINH-> BTHeaderStatusSet-> BTStatusHCurrent-> ACT_STATUS.
    Try reading the ACT_STATUS of object BTStatus as given below.
            data: coll   type ref to if_bol_entity_col.
           data: entity type ref to cl_crm_bol_entity,
                         lv_act_status TYPE string.
           entity ?= current.                                                               "BTADMINH entity.
           coll = entity->get_related_entities(
                    iv_relation_name = 'BTHeaderStatusSet' ).    "#EC NOTEXT
           current = coll->get_current( ).
            entity ?= current.
           coll = entity->get_related_entities(
                    iv_relation_name = 'BTStatusHCurrent' ).     "#EC NOTEXT
           current = coll->get_current( ).
            try.
           lv_act_status = current->if_bol_bo_property_access~GET_PROPERTY_AS_STRING(  'ACT_STATUS' ).
             catch cx_crm_cic_parameter_error.
           endtry.
    Regards JP

  • How to read the hard disk serial number using java this is urgent

    Please do let me know any knows how to read the hard disk unique number provided by manufactruer using java library

    I don't know; I think the fate of the free worldrests upon the answer.
    Well, as long as the non-free world stays unharmed,
    it can't be so bad ...I think the "Axis of Evil" constitutes a group of countries that are just "misunderstood".

  • How to read and create TDM Files in a Java Applicatio​n?

    Hi,
    I want to read and write TDM-Files in a Java-Application.
    I found the TDMHeaderWriter for Java, that can write TDM-Files, but the reading part is still missing.
    Perhaps anyone knows an equivalent in Java to the TDM C DLL and the TDM C Header DLL?
    Thanks Verena

    Cool 
    Can you please give me feedback on this project if you have finished it?
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • How to read the contents of Input Field created via Screen Painter?

    Hi All,
    I have a module program / dialog program, on my second screen, I created an input/outbox field via screen painter of course,
    now in my PAI, how can I read the contents of the input/outbox field?
    Let's say the name of my input/outbox field is: P_WEKRS.  Note: Get Parameter and Set Parameter is ticked.
    PROCESS AFTER INPUT.
      LOOP WITH CONTROL TC_DATA.
        MODULE MODIFY_DATA.
      ENDLOOP.
    I want to get the value of the input/outbox field before my loop in table control?  I thought that it will work like normal parameter in non-dialog programs.
    Any helpful inputs will be appreciated/rewarded.
    Thanks.
    Jaime

    Hi, Jaime
    Do the following Change in you Follow Logic
    PROCESS AFTER INPUT.
    MODULE read_or_change_value. " Add this
    LOOP WITH CONTROL TC_DATA.
      MODULE MODIFY_DATA.
    ENDLOOP.
    Add the Bellow Module code in you Driver Program.
    MODULE read_or_change_value.
    DATA: P_WEKRS like " the Field on Screen. Must be the same name as on SCREEN. and Type must be same too.
    " Here you will find the Value in that Variable or if you will change the Value here you will find it change on Screen
    END MODULE.
    Please Reply if any Issue..
    Best Regards,
    Faisal

  • IPC: How to read the Condition Rate(KBETR) in Java checkRequirement method.

    Hi Experts,
    As part of an IPC development, we need to read the Condition Type Rate (KBETR) in a Requirement Formula. The condition rate is the rate for the current record of the pricing procedure, e.g. Condition Type ZAB1.
    I can successfully read the condition rate in a Value formula using this piece of code:
    public BigDecimal overwriteConditionValue(IPricingItemUserExit pricingItem,IPricingConditionUserExit pricingCondition) {
                      BigDecimal ZConditionRate = pricingCondition.getConditionRate().getValue();
    In a Value Formula "IPricingConditionUserExit pricingCondition" is a input parameter of the overwriteConditionValue() method. However in a Requirement formula the standard method checkRequirement(IConditionFindingManagerUserExit item, IStep step, IAccess access) does not have any parameter which can give me the rate.
    I wrote the following logic in the requirement class, but line 2 is not executed.
    1. public boolean checkRequirement(IConditionFindingManagerUserExit item, IStep step, IAccess access) {
         2.  IPricingConditionUserExit pricingHeader = (IPricingConditionUserExit) item;
         3.  BigDecimal ZConditionRate = pricingHeader.getConditionRate().getValue();
    Please suggest how we can retrieve the condition rate in a requirement formula class using teh standard methods & classes.

    Hi,
    I have to set the condition rate as percentage in one of my codition value formula routine which i am developing based on java.
    I have overwritten  the method overwriteConditionValue() in my pricing routine which is 927. My logic is below.
    When I open my quotation using crmd_order, condition rate is not being displayed with % for unit condition rate coulmn in my pricing conditions.
    If I try to change my quotation for ex: Agrred price: xworke, then 927 formula is called and condition rate is displayed as %.
    So condition rate value is displayed perfectly , but when my quotation is in display mode condition rate value is coming as USA, but it should be % irrespective of my quotation is in display mode or change mode. I have attached the two screen shots for quotation display mode and change mode.
    Can some body throw insight what is wrong in my pricing routine logic in setting % condition rate rather than USD for the Condition rate value.
    public BigDecimal overwriteConditionValue(IPricingItemUserExit pricingItem,
      IPricingConditionUserExit pricingCondition) {
      BigDecimal condValue = null;
      BigDecimal discountValue = null;
      try{ 
        BigDecimal xworkg = pricingItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_G).getValue();
        userexitlogger.writeLogDebug(" 927 formula, Date=["+new Date()+"] , xworkg=["+xworkg+"]");
        BigDecimal xworke = pricingItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_E).getValue();
        userexitlogger.writeLogDebug(" 927 formula, Date=["+new Date()+"],  xworke=["+xworke+"]");
        pricingCondition.setCalculationType(PricingCustomizingConstants.CalculationType.PERCENTAGE); 
        if (xworkg.compareTo(PricingTransactiondataConstants.ZERO) != 0) {   
        condValue =  xworkg.subtract(xworke);
        pricingCondition.setConditionValue(condValue); 
        // Calculate percentage with 3-decimal-precision (as does ABAP-Version by multiplying with 100.000 instead of 100)
        pricingCondition.setConditionRate(condValue.multiply(PricingTransactiondataConstants.HUNDRED).divide(xworkg,
          3, BigDecimal.ROUND_HALF_UP), "%");
        pricingCondition.setPricingUnit(new BigDecimal(0), null);
        else {
        pricingCondition.setConditionRate(PricingTransactiondataConstants.ZERO, "%");
        pricingCondition.setPricingUnit(new BigDecimal(0), null);
      catch (Exception ex) {
        //pricingCondition.setInactive(PricingCustomizingConstants.InactiveFlag.INACTIVE_DUE_TO_ERROR);
        userexitlogger.writeLogError("Error Occured in 927 formula, reason code=["+ex.getMessage()+"]");
        return null;
      //return condValue;
      return null;
    Thanks
    Srikar

  • How to read the data in a field that has data type as VARILRAW

    Hello friends
    I have created a table with one of the field to accept a huge variable lenght field of type 'VARILRAW'.
    I have written a short Function to accept the data from an external program.
    Is there a way to see the data that Ihave entered in this field?
    ALso another problem that I am seeing is that when I send this string back tothe application, I noticed that instead of the data that I have sent, it has stored just a huge strong of letter As (AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA).
    If you can please answer these two questions, I would really appreciate it.
    Thanks
    Ram

    Hi Ram,
    Check if it help
    http://help.sap.com/saphelp_nw70/helpdata/en/cf/21f2e5446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_46c/helpdata/en/9d/ab1b0f055b11d2806500c04fadbaa1/frameset.htm
    Regards,
    Atish

  • How to read the value of a field of an IDoc

    Hi my requirement is " read the LIFNR value from inbound idoc Then i should go for validation".

    Hi,
    Please check the code below:
      LOOP AT idoc_data INTO wa_idocdata
                        WHERE docnum EQ gwa_edidc-docnum.
        CASE wa_edidd-segnam.
          WHEN 'E1EDL20'.
            wa_e1edl20 = wa_edidd-sdata.
            APPEND wa_e1edl20 TO it_e1edl20.
            CLEAR wa_e1edl20.
    READ TABLE it_e1edl20 INTO wa_e1edl20 INDEX SY-INDEX.
    if sy-subrc eq 0.
    processing......
    endif.
    Regards
    Kannaiah

  • How to read messages in message pool from a java file

    Hi All,
    I want to read a message that is defined in a message pool of a webdynpro component.
    This reading should be done from a java file present in the "src" folder.
    How can I get the handle to the IWDComponent?
    Or is there any other way?
    Or is there any way of reading localized messages in a java file of a webdynpro component?
    Can you kindly guide me out of this issue?
    Thanks and regards
    RB

    Hello,
    my approach is more simple: how can I read within component A the message pool of another webdynpro component B ? Component A has a usage relation to component B .
    I tried this within component A:
    <b>this.wdThis.wdGetBInterface().wdGetAPI().getComponent().getTextAccessor().getText("ANY_TEXT");</b>
    I got the exeption:
    <b>java.lang.UnsupportedOperationException: Embedded Components are black boxes. You should not access parts which are not in their interface</b>.
    Is there any way to share message pools ?
    Thanks
    Kerstin

  • How to read characters from a text file in java program ?

    Sir,
    I have to read the characters m to z listed in a text file .
    I must compare the character read from the file.
    And if any of the characters between m to z is matched i have to replace it with a hexadecimal value.
    Any help or suggesstions in this regard would be very useful.
    Thanking you,
    khurram

    Hai,
    The requirement is like this
    There is an input file, the contents of the file are as follows, you can assume any name for the file.
    #Character mappings for Japanese Shift-JIS character set
    #ASCII character Mapped Shift-JIS character
    m 227,128,133 #Half width katakana letter small m
    n 227,128,134 #Half width katakana letter small n
    o 227,129,129
    p 227,129,130
    q 227,129,131
    r 227,129,132
    s 227,129,133
    t 227,129,134
    u 227,129,135
    v 227,129,136
    w 227,129,137
    x 227,129,138
    y 227,129,139
    z 227,129,142
    The contents of the above file are to be read as input.
    On encountering any character between m to z, i have to do a replacement with a hexadecimal code point value for the multibyte representation in the second column in the input file.
    I have the code to get the unicode codepoint value from the multibyte representation, but not from a file.
    So if you could please tell me how to get the characters in the second column, it would be very useful for me.
    The character # is used to represent the beginning of a comment in the input file.
    And comment lines are to be ignored while reading the file.
    Say i have a string str="message";
    then i should replace the m with the unicode code point value.
    Thanking you,
    khurram

  • How to read a .csv file(excel format) using Java.

    Hi Everybody,
    I need to read a .csv file(excel) and store all the columns and rows in 2d arrays. Then I can do the rest of the coding myself. I would like it if somebody could post their code to read .csv files over here. The .csv file can have different number of columns and different number of rows every time it is ran. The .csv file is in excel format, so I don't know if that affects the code or not. I would also appreciate it if the classes imported are posted too. I would also like to know if there is a way I can recognize how many rows and columns the .csv file has. I need this urgently so I would be very grateful to anybody who has the solution. Thanks.
    Sincerely Taufiq.

    I used this
    BufferedReader in = new BufferedReader (new FileReader ("test.csv"));
    // and                
    StringTokenizer parser = new StringTokenizer (str, ", ");
                    while (parser.hasMoreTokens () == true)
                    { //crap }works like a charm!

Maybe you are looking for