Calculated attribute: Concatenated String not possible ?

Hi,
whats the syntax to make a concatenated String view in a calculated attribute of an analytical view ?
For Example in metasyntax:
<CONST> = 'EDF'
CHANNEL_DESCRIPTION  = 'Internet'
<CONST> || CHANNEL_DESCRIPTION  =  'EDF Internet'
Is this possible ?
How ?
ThanXs
Martin

Hi,
You can use the "+" operator to concat two strings.This will call the CONCAT function of NewDB Engine to concatenate the strings.
(String1 + String2 in a Calc Attribute)
Rgds,
Murali

Similar Messages

  • How are calculable attributes influence on a performance

    Hi WD Experts
    I have recently faced with a small dilemma. Is it a good idea to use calculated attributes everywhere where it's possible? For example, I have a view with table. I can implement almost all logic in the view based on calculated attributes which will return values for icons, values for controls' visibility, values for textual labels in the table and so on.
    How does the approach influence on a overall performance of my UI when user interacts with such controls? Here I suppose that each calculated attribute itself does not take any valuable time.
    Thanx
    Sergei

    Roberto,
    They are recalculated on every access. Whenever UI should be rendered, they are recalculated.
    Some calculation are extremely cheap and do not impact performance:
    1.
    return element.getIsInProcessed() ? WDVisibility.VISIBLE : WDVisibility.BLANK;
    2.
    switch ( element.getSeverity() ) {
      case -1: return WDTextViewSemanticColor.DIMINISHED;
      case 0:  return WDTextViewSemanticColor.POSITIVE;
      case 1:  return WDTextViewSemanticColor.CRITICAL;
      case 2:  return WDTextViewSemanticColor.NEGATIVE;
      default: throw new IllegalArgumentException();
    3.
    final private static String[] STATE_ID2STATE_NAME = {"stopped", "starting", "running", "stopping"};
    return STATE_ID2STATE_NAME[ element.getState() ];
    On other hand, you have some large number of calculated attributes, that depends on the same condition, then it is better to create 1..1 non-singleton value sub-node, define all attributes here and populate them at once using supply function. Also you will not win a lot in terms of performance, the code will be far more maintanable while related calculations are not scattered across several methods.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net
    Message was edited by:
            Valery Silaev

  • Account assignment not possible - item not yet calculated

    Dear SAP Gurus,
    While creating the Shipment Cost Document I am receiving following error.
    Account assignment not possible - item not yet calculated
    Message no. VY081
    When I double click on the Item to enter the conditions the screen goes blank at the item level. Kindly let me know if there is anything missing.
    Thanks and Rgards,
    Shehryar

    Hi,
    Please check below config.
    LETransportationShipment CostsShipment Cost DocumentShipment Cost Types and Item Categories.
    Hope it helps you
    Rgds,
    Kris.

  • Activity price calculation without activity not possible.

    Hi,
    I got the following error when I execute KSII ;
    Activity price calculation without activity not possible.
    Message no. KP230
    Diagnosis
    A program error occurred during activity price calculation. The SAP System could not determine the activity price for activity type 250902 in cost center 25093015 because only costs were entered, not activity quantities. The SAP System calculates the activity price by dividing the costs by the activity quantity.
    System Response
    The SAP System sets the activity price to zero.
    Procedure
    Inform your system administrator.
    Please advice why the error occured?

    Hi SAP Genes,
    I am finding an error in One of our Product line "HPI India" where our Cost of Sales Accounting actual COGS cost is very less in comparison with the standard as in the past.as it is marked, as expected as we set it up in the begining of the Year we use Standard Cost we use Aug-July FY, only we are facing this error for this FY 11-12.
    Please take a look at the COGS for HPI. which is marked in Blue all these cost are Highlited,  The actual COGS cost is very less in comparison with the standard as in the past.
    And for rest of the Product Line item is working fine,
    Please suggest me the cause, i am attaching the Analysis sheet as well for your guidance.
    Regards,
    Vijay

  • Why i am not able to see calculated Attribute in Context

    Hi all,
      I am not able to see <b>calculated Attiribute</b> in Context...our NWDS version is 2.0.16..Could anyone tell me the reason...

    Hi
    if you have not created value attibute?
    Create a value attribute by right clicking the context.Right click the newly created value attribute there you can see the calculated attribute property
    Regards,
    Arun

  • The following error text was processed in the system IDS : Access via 'NULL' object reference not possible.

    Hi all ,
    Im getting the below error , actually recently i created my own custom table zstudent, later i wrote select query to fetch data from the same and dump at internal table and then bind this to the table node.
    But im getting below error, even i removed the select query still same error is occuring.
    Error when processing your request
      What has happened?
    The URL http://********00.*****b.com:8000/sap/bc/webdynpro/sap/zdemo_student/ was not called due to an error.
    Note
    The following error text was processed in the system IDS : Access via 'NULL' object reference not possible.
    The error occurred on the application server axsids00_IDS_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: WDDOINIT of program /1BCWDY/YUSM2Q74A826Y0JY1I4V==CP
    Method: IF_WDR_COMPONENT_DELEGATE~WD_DO_INIT of program /1BCWDY/YUSM2Q74A826Y0JY1I4V==CP
    Method: DO_INIT of program CL_WDR_DELEGATING_COMPONENT===CP
    Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
    Method: INIT_CONTROLLER of program CL_WDR_COMPONENT==============CP
    Method: INIT of program CL_WDR_CONTROLLER=============CP
    Method: INIT of program CL_WDR_CLIENT_COMPONENT=======CP
    Method: INIT of program CL_WDR_CLIENT_APPLICATION=====CP
    Method: IF_WDR_RUNTIME~CREATE of program CL_WDR_MAIN_TASK==============CP
    Method: HANDLE_REQUEST of program CL_WDR_CLIENT_ABSTRACT_HTTP===CP

    Thanks Rama,
    Acutally i accidentally commented the lo_nd_student = wd_context ....etc
    this line was commented .
    i have one small requirement to fetch data from local customised table and fill the same to internal table and bind that to table node.
    my table node is student having attributes as name , city and number , all are of type strings.
    now i created one custom table zstudent having ID - char of length 10,
    name of type string
    city of type string
    num of type string
    i have inserted records
    but when i use select query to fill data from this zstudent to my internal table of type lt_student type wd_this->elements_student ,
    im getting same above error.

  • Using Javascript to create concatenated string from checkbox fields to one text field

    Hi. I have a PDF form that I am trying to have output to a spreadsheet that matches my database schema. Here is the dilemna:
    * I have a set of checkboxes for available languages (LANGUAGE_ENGLISH, LANGUAGE_SPANISH, etc.) When they export to spreadsheet, the value is TRUE.
    * I need to take values from checked boxes and create a single string in a text field called LANGUAGE_DISPLAY (so my UI will not need to do the concatenation). If LANGUAGE_ENGLISH is TRUE (checked), append "English, " to LANGUAGE_DISPLAY, else append "". Then, if LANGUAGE_SPANISH is TRUE (checked), append "Spanish, " to LANGUAGE_DISPLAY, else append "". And on and on
    In the LANGUAGE_DISPLAY text field properties, I am inserting a Custom Calculation script to try to achieve this, but am not getting any results. I tried teh following even trying to pull the checkboxes default values and string them together:
    box1 = this.getField("LANGUAGE_ENGLISH").value.toSrting();
    box2 = this.getField("LANGUAGE_FARSI").value.toSrting();
    box3 = this.getField("LANGUAGE_MANDARIN").value.toSrting();
    event.value = box1 + ', ' + box2 + ', ' + box3;
    I also played with this to get the desired strings output...but to no avail:
    if ( LANGUAGE_ENGLISH.rawValue == true )
    box1.rawValue = "English, ";
    if ( LANGUAGE_FARSI.rawValue == true )
    box1.rawValue = "Farsi, ";
    if ( LANGUAGE_HEBREW.rawValue == true )
    box1.rawValue = "Hebrew, ";
    event.value = box1 + box2 + box3;
    Then I tried to simplify to see one field output so used this script...still no results:
    event.value = "";
    var f = this.getField("LANGUAGE_ENGLISH");
    if ( f.isBoxChecked() == true) {
    event.value = "English";
    Couple questions:
    1) Am I on the right track with any of these scripts?
    2) Is there something else I need to do to get the script to run before running the Create Spreadsheet with Data Files comman in Acrobat to get my csv file output? Maybe there needs to be some event to get the checkbox values read by that field in order to calculate/create the string.
    Appreciate any help you can provide.

    LiveCycle Designer has shipped with all Acrobat Professional versions since the "Professional" version was introduced with version 6.
    You do not let us know want results you get in the field or the JavaScript console.
    Using:
    box1 = this.getField("LANGUAGE_ENGLISH").value.toString();
    box2 = this.getField("LANGUAGE_FARSI").value.toString();
    box3 = this.getField("LANGUAGE_MANDARIN").value.toString();
    event.value = box1 + ', ' + box2 + ', ' + box3;
    returns "Off, Off, Off", when no box is checked and returns "Yes" for the appropriate box being checked when the default value is used for the creation of the check box. So if one would make the 'Export Value' of the box from the default value of 'Yes" to the appropriate language, one would get a more desirable result. But for each unchecked box the value would appear as "Off". So one needs to change the 'Off' value to a null string. But one is still left with the separator when there is an unchecked option.
    Using the following document level function:
    // Concatenate 3 strings with separators where needed
    function fillin(s1, s2, s3, sep) {
    Purpose: concatenate up to 3 strings with an optional separator
    inputs:
    s1: required input string text or empty string
    s2: required input string text or empty string
    s3: required input string text or empty string
    sep: optional separator sting
    returns:
    sResult concatenated string
    // variable to determine how to concatenate the strings
    var test = 0; // all strings null
    var sResult; // re slut string to return
    // force any number string to a character string for input variables
    s1 = s1.toString();
    s2 = s2.toString();
    s3 = s3.toString();
    if(sep.toString() == undefined) sep = ''; // if sep is undefined force to null
    assign a binary value for each string present
    so the computed value of the strings will indicate which strings are present
    when converted to a binary value
    if (s1 != "") test += 1; // string 1 present add binary value: 001
    if (s2 != "") test += 2; // string 2 present add binary value: 010
    if (s3 != "") test += 4; // string 3 present add binary value: 100
    /* return appropriate string combination based on
    calculated test value as a binary value
    switch (test.toString(2)) {
    case "0": // no non-empty strings passed - binary 0
    sResult = "";
    break;
    case "1": // only string 1 present - binary 1
    sResult = s1;
    break;
    case "10": // only string 2 present - binary 10
    sResult = s2;
    break;
    case "11": // string 1 and 2 present - binary 10 + 1
    sResult = s1 + sep + s2;
    break;
    case "100": // only string 3 present - binary 100
    sResult = s3;
    break;
    case "101": // string 1 and 3 - binary 100 + 001
    sResult = s1 + sep + s3;
    break;
    case "110": // string 2 and 3 - binary 100 + 010
    sResult = s2 + sep + s3;
    break;
    case "111": // all 3 strings - binary 100 + 010 + 001
    sResult = s1 + sep + s2 + sep + s3;
    break;
    default: // any missed combinations
    sResult = "";
    break;
    return sResult;
    And the following cleaned up custom calculation script:
    box1 = this.getField("LANGUAGE_ENGLISH").value;
    box2 = this.getField("LANGUAGE_FARSI").value;
    box3 = this.getField("LANGUAGE_MANDARIN").value;
    if (box1 == 'Off') box1 = '';
    if (box2 == 'Off') box2 = '';
    if (box3 == 'Off') box3 = '';
    event.value = fillin(box1, box2, box3, ', ');
    One will get the list of languages with the optional separator for 2 or more language selections.

  • Calculated attributes in WDA

    Hi people,
    I'm new in WebDynpro for Abap. Is it possible to declare a calculated attribute like in WebDynpro for Java? I can't find a attribute-property for doing that.
    Is this concept not available in WDA?
    Regards,
    Thomas

    Hi,
    in WD4Java you have the possibility to declare an attribute as "calculated". The framework generates then 2 methodes, a getter and a setter method, which the application developer can use to put in his coding.
    A use case can be the following: You have a Inputfield with a simple value help (i.e. from the domain of the data element). The value you can see, after the selection is the key (of the key-value list). Now I want to show near the inputfield the value of the selected key. In this case I can declare (in WD4Java) a calculated attribute which i bind to a TextView element near the Input field. The getter methode of the attribute (implemented by the application developer) determines the value of the selected key.
    If this wasn't clear enough, visit this [link|http://help.sap.com/erp2005_ehp_03/helpdata/EN/7f/a0384162316532e10000000a1550b0/frameset.htm], where the concept of calculated attributes is described in detail.
    Regards,
    Thomas

  • SetAttribute at calculated attribute at prev next binding

    I use JDev version 10.1.2.1.0 (Build 1913). I try to set attribute at calculated attribute.. that all row divide some page using prev next binding. The result was disorder. I think i must set attribute repeat every i click prev next button.. but i don't know where i must overwrite method form prev next binding.. or any other solution... please give me advice.. thank you

    Dimitar, thank you for your response.
    If I am trying to insert a new row (not update an existing one), I believe I need to create a Managed Property bomEditChild under the Managed Bean bomCRUD, and then set the binding of the af:InputText to +#{bomCRUD.bomEditChild}+ as seen below:
    <af:popup id="p1" ... >
    <af:dialog id="d2" dialogListener="#{DialogListenerCollection.editDialogListener}" title="BOM Edit">
    <af:inputText label="Child" id="it1" binding="#{BomCRUD.bomEditChild}"/>
    </af:popup>
    From adfc-config.xml
    <managed-bean id="__11">
    <managed-bean-name id="__9">BomCRUD</managed-bean-name>
    <managed-bean-class id="__12">erp.view.framework.BomCRUD</managed-bean-class>
    <managed-bean-scope id="__10">request</managed-bean-scope>
    <managed-property id="__2">
    <property-name id="__3">bomEditChild</property-name>
    <property-class>oracle.adf.view.rich.component.rich.input.RichInputText</property-class>
    <value id="__1"></value>
    </managed-property>
    </managed-bean>
    However, when I print the value of the String Child variable of the createChildren class, I get the following:
    System.out.println("Child: " + Child); // output command gets me the text below
    +Child: RichInputText[UIXEditableFacesBeanImpl, id=it1]+
    The createChildren method is detailed below in the pages definition file and implemented in the AppModuleImpl class.
    <methodAction id="createChildren" ...>
    <NamedData NDName="Child" NDValue="#{BomCRUD.bomEditChild}" NDType="java.lang.String"/>
    </methodAction>
    It appears the value being passed into my createChildren class is the container ID, not the value entered into the container by the customer. The output is the same whether I declare bomEditChild as a Managed Property under the Managed Bean bomCRUD or not. I am still unsure how to grab the value of the inputted text and/or if the managed property is updating before the createChildren method is being called via the editDialogListener.
    Any further ideas?

  • Calculated attribute?

    Hi,
    Wat is the actual use of this and also giv me some sample for this..when and wher we use it?
    **Helpful answers will be appreciated...
    GS

    Hi
    The values of context attributes are normally saved in node elements of a controller context at runtime, and with data binding are displayed in the UI using a generic formatting mechanism (for Dictionary-based types).
    In many cases, saved context data should be transferred identically, instead it should be converted before the display. A typical example is displaying an address text based on name and gender. Using the two context attributes Name=’Maier’ and Gender=’male’, the standardized address text 'Dear Mr. Maier!’ should be displayed in the user interface. This text can be saved by defining an additional value attribute Address in the controller context. In multiple context nodes, each individual node element would then have the additional context attribute called Address, where the name would be saved redundantly as part of the address.
    Calculated context attributes are a more elegant way of handling the example. These are not saved specially in the context, they are calculated (read) where necessary by the controller instead. “Where necessary” can mean that UI elements should display the content of a calculated attribute, or that the value is accessed by the program in the controller coding. The calculation method is called automatically by the Web Dynpro runtime environment. A calculated context attribute is calculated in an automatically generated access method using signature
    <CalcAttrType> get<NodeName><CalcAttrName>(<NodeName>Element element).
    For a calculated context attribute called FullNameCalc of type String in node UserData in the context of the FormView view, this results in access method
    java.lang.String getUserDataFullNameCalc(
    IPrivateFormView.IUserDataElement element).
    The calculation method is called automatically where necessary by the Web Dynpro runtime environment. It passes a reference to the node element to which the calculated context attribute refers. If this method were defined in a multiple node with cardinality 0..n, for example, then the access method would be called for each node element that is available in the node at runtime. In this way, the full name of a customer could be displayed in a third table column, consisting of first and last names. The access method would be called for each row (each node element) in the table.
    It is expected that the access method for calculating a calculated context attribute is based on the same node element’s other attributes.
    Within the generated access method for a context attribute, the context attribute to be calculated should not be accessed, as this results in the access method being called recursively. A recursion termination occurs only if you implement a recursion condition.
    According to the Web Dynpro naming convention, calculated context attributes should contain the ending Calc for Calculated in the name, such as SalutationCalc or TotalPriceCalc. This makes the application coding easier to read with respect to the components from the calculated context attributes.
    Regards
    Kalyan

  • UCCX 8 - DOC[variable] usage not possible ???

    Hi all,
    I'm actually busy developping some scripts and I'm able to upload prompts, documents, and everything standalone. Now I will need to compile everything in a script and ideally I would need to put some parameters as DOCument filename...
    If I try with a Document like :
    Name : myDocument
    Type : Document
    Value : DOC["FileStored.xml"]
    It works perfectly.
    If I try the following like :
    Name : myVariable
    Type : String
    Value : "FileStored.xml"
    Name : myDocument2
    Type : Document
    Value : DOC[myVariable]
    It seems not to work.
    My main goal is to be able to go and pick the right XML file depending of some conditions I might put in my script... If not possible it will need to put many "if" to determine which file I need instead of concatenating the right file name based on my conditions ...
    Any tip on how to do this?
    Thanks in advance
    Regards
    Christophe

    Hi Christophe
    My approach to this has been as follows:
    String, parameter, sDocumentFilename
    So sDocumentFilename is a simple String, and made a parameter enterable in the web UI. You would set this to "myfile.xml" or whatever is appropriate.
    THen in the script:
    set docWhatever = DOC[sDocumentFilename]
    This correctly sets docWhatever to DOC[myfile.xml]
    Presumably it's some hidden magic of the Document object/set step that makes it work like this rather than using the variable name of the string in the variable definition for the Document. If I understand what you are asking correctly :-)
    Regards
    Aaron
    Please rate helpful posts..

  • Not possible to output CFTREEITEM in a CFC function?

    Hi there,
    I am parsing a sorted list of strings (in the form of a/b/c/,
    a/b/c, /a/c/d etc.) and trying to make a treeview out of it.
    I have the CFFORM and CFTREE tag in the top function and the
    code that generate CFTREEITEM in a subfunction, but I got the
    following error:
    Context validation error for tag cftreeitem.
    The tag must be nested inside a cftree tag.
    It seems that ColdFusion doesn't recognize that calling code
    is already nested inside a CFTREE tag in the top function. I
    extract the code generating CFTREEITEMs to a sub function because
    it is called multiple times from different context, it would be a
    lot of hassle and quite stupid to "inline" it.
    If what I am trying is, for whatever reason, not possible,
    would it be possible then to have the sub function generate the
    code into a string and somehow dynamically evaluate that?
    Any hints or tips will be greatly appreciated!
    Billy

    Hi there,
    I am parsing a sorted list of strings (in the form of a/b/c/,
    a/b/c, /a/c/d etc.) and trying to make a treeview out of it.
    I have the CFFORM and CFTREE tag in the top function and the
    code that generate CFTREEITEM in a subfunction, but I got the
    following error:
    Context validation error for tag cftreeitem.
    The tag must be nested inside a cftree tag.
    It seems that ColdFusion doesn't recognize that calling code
    is already nested inside a CFTREE tag in the top function. I
    extract the code generating CFTREEITEMs to a sub function because
    it is called multiple times from different context, it would be a
    lot of hassle and quite stupid to "inline" it.
    If what I am trying is, for whatever reason, not possible,
    would it be possible then to have the sub function generate the
    code into a string and somehow dynamically evaluate that?
    Any hints or tips will be greatly appreciated!
    Billy

  • SSFCOMPOSER - 154 - No output request open. End not possible.

    Hi Experts,
    I'm trying to print multiple smartforms using FMs SSF_OPEN and SSF_CLOSE. Inside the main program RBDAPP01 (Inbound processing for IDOCS) there is a loop at the IDOCS to be processed. Deep within the processing, we have a custom FM being called which prints smartforms. Since there is a loop at the calling main program, I have organized the code in the custom FM such that the first IDOC calls SSF_OPEN and the last IDOC calls SSF_CLOSE, so that all IDOCS in between will be able to print their smartforms. Here is the call stack:
    8
    SAPLZCUSTOM                   
    ZCUSTOMPROGRAM                             
    113
    FUNCTION                     
    ZCUSTOMPROGRAM                                         
    7
    SAPLPPC1                               
    ZCUSTOMPROGRAM     
    136
    FUNCTION                     
    KK2A_GET_DATA_FROM_IDOC                                     
    7
    SAPLPPC1                               
    LPPC1U01                               
    1
    FUNCTION                     
    KK2A_GET_DATA_FROM_IDOC                                     
    6
    SAPLBD20                               
    LBD20F0A                               
    454
    FORM                         
    IDOCS_PASS_TO_APPLICATION                                   
    5
    SAPLBD20                               
    LBD20F0B                               
    69
    FORM                         
    IDOCS_PROCESS                                               
    4
    SAPLBD20                               
    LBD20U05                               
    260
    FUNCTION                     
    IDOC_INPUT                                                  
    3
    SAPLEDIR                               
    LEDIRU02                               
    182
    FUNCTION                     
    IDOC_START_INBOUND                                          
    2
    SAPLBD12                               
    LBD12U04                               
    37
    FUNCTION                     
    APPLICATION_IDOC_POST_IMMEDIAT                              
    1
    RBDAPP01                               
    RBDAPP01                               
    388
    EVENT                        
    START-OF-SELECTION                                          
    The problem is:
    1. When I only have 1 IDOC being processed, SSF_OPEN and SSF_CLOSE happens in the custom FM at the same time. This creates a successful spool.
    2. Whereas, when I have 2 or more IDOCS, SSF_OPEN happens in the first IDOC, but then it goes back to the calling program, and then when the last IDOC is encountered SSF_CLOSE is called. The FM SSF_CLOSE in this scenario calls the exception INTERNAL_ERROR (sy-subrc = 2).
    The system message is SSFCOMPOSER - 154 - No output request open. End not possible.
    Why is this happening? Is it because that other programs (calling programs) may have affected the status of SSF_OPEN? It seems that the SSF_OPEN is no longer open.
    Thanks in Advanced,
    Jack

    No, it will not hold the smartform open, but you don't need to hold it open in order for printout to be accumulated in one spool. Spool system does the accumulation automatically, provided the spool requests that are to be added to an existing spool request are:
    - generated in the same transaction and
    - have the same attributes (such as user, title, output device, client from which the request was issued, number of copies, priority, cover sheet setting, archive mode, and ABAP session number).
    Important is: where do OUTPUT_OPTIONS like printer come from currently? Is print parameters popup displayed on first Idoc for user to choose printer and options? Or do you use USER_SETTINGS = 'X' to simply take over defaults from user master? If the print options dialog is displayed, it needs to be controlled as well so it's displayed only once.
    Assuming print options come from the user in dialog, the logic without explicit open/close could look somewhat like this:
    On first idoc:
    - call SSF_OPEN  importing  JOB_OUTPUT_OPTIONS to display print options dialog; move-corresponding JOB_OUTPUT_OPTIONS to global OUTPUT_OPTIONS;
    - set OUTPUT_OPTIONS-TDNEWID = 'X' and clear  OUTPUT_OPTIONS-TDFINAL, to ensure new spool will be started (overriding user choices for these parameters!);
    - if the user has set OUTPUT_OPTIONS-TDIMMED = 'X' save it globally and clear it;
    - set CONTROL_PARAMETERS-NO_OPEN = 'X';
    On subsequent idoc:
    - clear OUTPUT_OPTIONS-TDNEWID;
    - clear CONTROL_PARAMETERS-NO_OPEN;
    On last idoc:
    - set OUTPUT_OPTIONS-TDFINAL = 'X' (this is not absolutely necessary, but prevents further appending to the spool);
    - restore OUTPUT_OPTIONS-TDIMMED from the value saved on first idoc;
    Calling Smartform:
    - set CONTROL_PARAMETERS-NO_DIALOG = 'X';
    - call smartform passing OUTPUT_OPTIONS and CONTROL_PARAMETERS;
    The logic is somewhat complicated; I'd wrap it in a class (singleton, which would be de-instantiated after last idoc) to avoid global data and code other than simple method call(s) in FM.
    Even if you decide to refactor the logic, it would still be important to understand, I think, why the current logic does not work (where and why smartform gets closed)... Maybe there are some nasty "surprises" somewhere, and your current algorithm should work.
    cheers
    Janis

  • Access via 'NULL' object reference not possible   - GET_RANGE_TABLE_OF_SEL_

    Hi Guru's,
       i am new for WebDynpro programming.I am trying to use select-options tutorial.
    System showing select options and table binding on screen when i test the application.
    I have using search button to get the value which user will i/p.for that onaction method created, i have writen the code to get the values which user will input.
    Method  given below is of componentcontroler
    method wddoinit .
      data: lt_range_table type ref to data,
            rt_range_table type ref to data,
            read_only type abap_bool,
            lt_range_table1 type ref to data.
      data: lr_componentcontroller type ref to ig_componentcontroller,
            l_ref_cmp_usage type ref to if_wd_component_usage.
    create the used component
      l_ref_cmp_usage = wd_this->wd_cpuse_select_options( ).
      if l_ref_cmp_usage->has_active_component( ) is initial.
        l_ref_cmp_usage->create_component( ).
      endif.
      wd_this->m_wd_select_options = wd_this->wd_cpifc_select_options( ).
      wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
      wd_this->m_handler->set_global_options(
                              i_display_btn_cancel  = abap_false
                              i_display_btn_check   = abap_false
                              i_display_btn_reset   = abap_false
                              i_display_btn_execute = abap_false ).
      lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'S_CARR_ID' ).
      wd_this->m_handler->add_selection_field( i_id = 'CARRID'
      it_result = lt_range_table i_read_only = read_only ).
      call method wd_this->m_handler->add_horizontal_divider
        exporting
          i_id = 'LINE'.
    endmethod.
    Method  given below is of VIEW.
    method ONACTIONSEARCH .
      DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA: RT_CARRID TYPE REF TO DATA.
      DATA: ISFLIGHT TYPE TABLE OF SFLIGHT.
      DATA: WSFLIGHT TYPE SFLIGHT.
      FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.
    Retrieve the data from the select option
      RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
    Assign it to a field symbol
      ASSIGN RT_CARRID->* TO <FS_CARRID>.
      CLEAR ISFLIGHT. REFRESH ISFLIGHT.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE ISFLIGHT FROM SFLIGHT
                           WHERE CARRID IN <FS_CARRID>.
      NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( NAME = `FLIGHTS` ).
      NODE_FLIGHTS->BIND_ELEMENTS( ISFLIGHT ).
    endmethod.
    while executing appln. error is trigger on line given below
    RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
    Err: The following error text was processed in the system BCD : Access via 'NULL' object reference not possible.
    please help me out on this issue.
    Thanks and Regards
    Vinayak Sapkal

    hi ,
    The attribute M_HANDLER is an attirbute of component controller (as told by your post) and so you cannot access it as you have done it.
    You will have to access it as .
    WD_COMP_CONTROLLER->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD(I_ID = 'S_CARR_ID' ).
    Try doing it.
    Or else , if you have created a similar attribute in your view itself , then it is "INITIAL" and hence you are getting the dump.
    You will have to assign the view attribute "M_HANDLER" with the value of your component controller attribute "M_HANDLER" ,because all the initializations are done in WDDOINIT of comp controller and on component controller atribute "M_HANDLER".
    Thanks,
    aditya.

  • BDC transaction "The function is not possible"

    Dear Experts,
    I have made a BDC transaction program according to recording from SHDB in order to have batch transaction for FB50.
    However, when I run the program. It shows an error "The function is not possible". But when I press the "Save" button manually, the function passed and result is saved. Just do not know what happens.
    report YFB50 no standard page heading line-size 255.
    include bdcrecx1.
    type-pools : TRUXS.
    data : rawdata type TRUXS_T_TEXT_DATA.
    parameters: sfile TYPE localfile default 'C:\fb50.txt'.
    parameters: plant like BKPF-BUKRS default '1000'.
    data: pfile type string.
    data: post_date(8) type c.
    data: record_count(2) type c.
    data: v_HKONT(19) type c.
    data: v_SHKZG(19) type c.
    data: v_WRBTR(19) type c.
    data: v_SGTXT(19) type c.
    data: v_KOSTL(19) type c.
    ***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
    *   If it is nessesary to change the data section use the rules:
    *   1.) Each definition of a field exists of two lines
    *   2.) The first line shows exactly the comment
    *       '* data element: ' followed with the data element
    *       which describes the field.
    *       If you don't have a data element use the
    *       comment without a data element name
    *   3.) The second line shows the fieldname of the
    *       structure, the fieldname must consist of
    *       a fieldname and optional the character '_' and
    *       three numbers and the field length in brackets
    *   4.) Each field must be type C.
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record occurs 0,
    * data element: HKONT
            HKONT(010),
    * data element: SHKZG
            SHKZG(007),
    * data element: WRBTR
            WRBTR(017),
    * data element: SGTXT
            SGTXT(050),
    * data element: KOSTL
            KOSTL(010),
          end of record.
    *** End generated data section ***
    start-of-selection.
    pfile = sfile.
    concatenate sy-datum+6(2) sy-datum+4(2) sy-datum+0(4) into post_date.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
         FILENAME                = pfile
    TABLES
         DATA_TAB                = rawdata
    EXCEPTIONS
         CONVERSION_ERROR        = 1
         FILE_OPEN_ERROR         = 2
         FILE_READ_ERROR         = 3
         INVALID_TYPE            = 4
         NO_BATCH                = 5
         UNKNOWN_ERROR           = 6
         INVALID_TABLE_WIDTH     = 7
         GUI_REFUSE_FILETRANSFER = 8
         CUSTOMER_ERROR          = 9
         OTHERS                  = 10.
    IF SY-SUBRC <> 0.
         WRITE:/ 'SY-SUBRC:', SY-SUBRC.
    ENDIF.
    CALL FUNCTION 'TEXT_CONVERT_CSV_TO_SAP'
    EXPORTING
         I_FIELD_SEPERATOR = ';'
         I_TAB_RAW_DATA = rawdata
    TABLES
         I_TAB_CONVERTED_DATA = record
    EXCEPTIONS
         CONVERSION_FAILED = 1
         OTHERS = 2.
    perform bdc_dynpro      using 'SAPMF05A' '1001'.
    *Input header information
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *Document Date
    perform bdc_field       using 'ACGL_HEAD-BLDAT'
                                  post_date.
    *Posting Date
    perform bdc_field       using 'ACGL_HEAD-BUDAT'
                                  post_date.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/ECCDE'.
    perform bdc_dynpro      using 'SAPLACHD' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    *Company Code
    perform bdc_field       using 'BKPF-BUKRS'
                                  plant.
    perform bdc_dynpro      using 'SAPMF05A' '1001'.
    *Input header information
    perform bdc_field       using 'BDC_OKCODE'
                                  '/BU'.
    *Document Date
    perform bdc_field       using 'ACGL_HEAD-BLDAT'
                                  post_date.
    *Posting Date
    perform bdc_field       using 'ACGL_HEAD-BUDAT'
                                  post_date.
    *Input item text
    loop at record.
    *write sy-tabix to record_count.
    *concatenate 'ACGL_ITEM-HKONT(' record_count ')' into v_HKONT.
    *concatenate 'ACGL_ITEM-SHKZG(' record_count ')' into v_SHKZG.
    *concatenate 'ACGL_ITEM-WRBTR(' record_count ')' into v_WRBTR.
    *concatenate 'ACGL_ITEM-SGTXT(' record_count ')' into v_SGTXT.
    *concatenate 'ACGL_ITEM-KOSTL(' record_count ')' into v_KOSTL.
    perform bdc_field       using v_HKONT
                                  record-HKONT.
    perform bdc_field       using v_SHKZG
                                  record-SHKZG.
    perform bdc_field       using v_WRBTR
                                  record-WRBTR.
    perform bdc_field       using v_SGTXT
                                  record-SGTXT.
    perform bdc_field       using v_KOSTL
                                  record-KOSTL.
    endloop.
    perform bdc_transaction using 'FB50'.
    Here is my input:
    206090203;H;41.74;abc;MISHK
    206090203;H;14.36;abc;FACHK
    206100100;S;41.74;def;MISHK
    206070100;S;14.36;def;FACHK
    Regards,
    Cato

    Make your LOOP.... ENDLOOP... Like this
    LOOP AT RECORD.
    perform bdc_dynpro      using 'SAPMF05A' '1001'.
    *Input header information
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *Document Date
    perform bdc_field       using 'ACGL_HEAD-BLDAT'
                                  post_date.
    *Posting Date
    perform bdc_field       using 'ACGL_HEAD-BUDAT'
                                  post_date.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/ECCDE'.
    perform bdc_dynpro      using 'SAPLACHD' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    *Company Code
    perform bdc_field       using 'BKPF-BUKRS'
                                  plant.
    perform bdc_dynpro      using 'SAPMF05A' '1001'.
    *Input header information
    perform bdc_field       using 'BDC_OKCODE'
                                  '/BU'.
    *Document Date
    perform bdc_field       using 'ACGL_HEAD-BLDAT'
                                  post_date.
    *Posting Date
    perform bdc_field       using 'ACGL_HEAD-BUDAT'
                                  post_date.
    *Input item text
    **loop at record.
    *write sy-tabix to record_count.
    *concatenate 'ACGL_ITEM-HKONT(' record_count ')' into v_HKONT.
    *concatenate 'ACGL_ITEM-SHKZG(' record_count ')' into v_SHKZG.
    *concatenate 'ACGL_ITEM-WRBTR(' record_count ')' into v_WRBTR.
    *concatenate 'ACGL_ITEM-SGTXT(' record_count ')' into v_SGTXT.
    *concatenate 'ACGL_ITEM-KOSTL(' record_count ')' into v_KOSTL.
    perform bdc_field       using v_HKONT
                                  record-HKONT.
    perform bdc_field       using v_SHKZG
                                  record-SHKZG.
    perform bdc_field       using v_WRBTR
                                  record-WRBTR.
    perform bdc_field       using v_SGTXT
                                  record-SGTXT.
    perform bdc_field       using v_KOSTL
                                  record-KOSTL.
    **endloop.
    perform bdc_transaction using 'FB50'.
    ENDLOOP.
    Now should work fine..

Maybe you are looking for

  • CreateInsert And Commit Programmtically

    dear all how i can programmtic CreateInsert action And Commit  action into one commandButton. h

  • Apple, please fix OS X responsiveness!

    Hi everybody, lets face it: OS X responsiveness needs to be improved. I'm not ranting about overall OS X performance, I've been using macs for many years on many machines alongside Windows, Linux and other systems, and for most purposes, I preferred

  • Periodic crashes are cryptically documented by mcelog [solved]

    i have been experiencing crashes about every 16-20 hours on a box with latest x86_64 build.   booting with "nomce" does not affect the crash frequency.  /var/log/kernel.log calls this explicitly a "hardware error" but i have checked hard disks (3 rai

  • Youtube Comment Typing Lag, Help Please.

    Ok so this problem seems to only be happening on firefox, ( I tried google chrome and it was working fine ). I'll try to comment on a video and i type fast, and it takes forever for the characters i type to show up, can someone help me please, thanks

  • Nikon D70s images turn green

    i found a very strange behaviour in A3 - when "reprocessing" old Nikon D70s Raw files, they turn green'ish. both the preview as well as the thumbnails. this happens with every D70s Nef file. once i quit and restart A3, they are rendered correctly. th