Node - Dynamic Attributes

Hi,
I have a node 'CONF' with attribute ATNAM01. I used a ZSTRUC to create this node. Here my requirement is that based on user inputs I will execute a FM, I will get no of entries in my itab. I need to assign attributes based on itab entries to 'CONF' node dynamically ....
Ex: ATNAM01, ATNAM02....ATNAMNN.
Is it possible? How? Any code/link!
Regards,
Sateesh...

Hi sateesh,
        Is your problem statement is some thing like this .Based on data in attribute ATNM01  you need to perform correpsonding treatment .
DATA:
    node_check                          TYPE REF TO if_wd_context_node,
    elem_check                          TYPE REF TO if_wd_context_element,
    stru_check                          TYPE if_start_ior=>element_check ,
    item_check_attribute                LIKE stru_check-check_attribute.
element = wd_context->get_lead_selection( ).
index = wdevent->get_string( 'INDEX' ).
navigate from <CONTEXT> to <CHECK> via lead selection
  node_check = wd_context->get_child_node( name =  if_start_ior=>wdctx_check ).
get element via lead selection
  elem_check = node_check->get_element(  ).
get single attribute
  elem_check->get_attribute(
    EXPORTING
      name =  `CHECK_ATTRIBUTE`
    IMPORTING
      value = item_check_attribute ).
if index EQ 2.
elem_check->set_attribute( name = 'CHECK_ATTRIBUTE' value = Abap_true ).
endif.
if index EQ 1.
elem_check->set_attribute( name = 'CHECK_ATTRIBUTE' value = Abap_false ).
endif.
endmethod.
Point I want make is based on data populated in attribute <b>check_attribute</b>
.I have identified index of attribute and accordingly performed treatment.
Hope this will help you .
If yes give points.
Cheers!
Parag

Similar Messages

  • Dynamic Table control with context nodes and attributes?

    Hi all
    I have node and attributes in context. i want to create table dynamically using this node and attributes, can anyone give code how to do this???
    Thanks
    Madhan.

    Hi
    Go through this [link|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80a3de18-ee00-2d10-bfb3-946d7e00fd91?quicklink=index&overridelayout=true].
    Regards
    Arun.P

  • Adding dynamic attributes to static context node

    Hi All,
    I have defined a context node LINES with several attributes. This is done staticly during developmenttime.
    During run-time node LINES is extended with several attributes dynamicly. See below:
    10     HEADER_GUID               ->
    11     DETAIL_GUID               ->
    12     EXTERNAL_ID               ->
    13     OBJECT_TYPE               ->
    14     IN_OUT_PLAN               ->
    15     TRAFFIC_LIGHT_1               ->
    16     TRAFFIC_LIGHT_2               ->
    17     TRAFFIC_LIGHT_3               ->
    18     TRAFFIC_LIGHT_4               ->
    19     _LOCATION          \TYPE=STRING     ->
    20     _ZZTOPGROUPING     \TYPE=STRING     ->
    21     _STATUS          \TYPE=STRING     ->
    22     _100000200          \TYPE=STRING     ->
    19..22 are added dynamicly.
    I have an internal table that matches de new context. This <fs_tb_tree_new> I want to bind like:
    *&- bind table
      lr_node->bind_table( new_items =  <fs_tb_tree_new>
                           set_initial_elements = abap_true ).
    In <fs_tb_tree_new> the dynamicly added attrbutes contains values e.g. (the static attributes also have values via <fs_tb_tree_new>):
                         _LOCATION   _ZZTOPGROUPING  _STATUS              _100000200                   
    5     Africa     0002     Reporting Entity     0.000
    6     Russia, CIS     0003     Identify                          0.000
    An ALV presents the values of the attribute. But.... only the values of the static part are presented, not the dynamic attributes added during runtime.
    Please advise what I forget or do wrong .
    Thanks in advance.
    John

    I solved the issue:
    If you use a combination of static attributes added with dynanic attributes (during runtime) for dynamic ALV, I advise to create a new node and bind the values to this new created node:
    Cheers, John
    wd_this->extend_context( EXPORTING im_struc_descr =  lr_cl_abap_structdescr
                               IMPORTING ex_node = lr_node_alv ).
    Method:
    *&- Create new dynamic context LINES_DYN
    Node for alv-table
      lr_node_info = wd_context->get_node_info( ).
      CALL METHOD lr_node_info->add_new_child_node
        EXPORTING
          name                  = 'LINES_NEW'
          static_element_rtti   = im_struc_descr
          is_static             = abap_true
          is_multiple           = abap_true
          is_multiple_selection = abap_false
        RECEIVING
          child_node_info       = lr_subnode_info.
    lr_node = lr_subnode_info->get_parent( ).
      lr_node = wd_context->get_child_node( 'LINES_NEW' ).
      ex_node = lr_node.
    *&- bind table for alv
      lr_node_alv->bind_table( new_items =  <fs_tb_tree_new>
                               set_initial_elements = abap_true ).

  • Removing Dynamic attributes from node

    Dear Experts,
      I have two nodes node1,node2,i created dynamic attributes for both the nodes.node1 attributes are displaying when the user enter into first screen.node2 table come when the user click action button.i want remove the second node attributes after user click the action.
    I tried with
    wdContext.<node>.getContext().reset();
    But above mthod deletes total dynamic attributes.is there any method to remove the partcular node attributes.
    It's urgent........
    I will provide the points.
    Thanks,
    Santhosh

    Hi,
    This method is suitable to ur requirement
    wdContext.node.invalidate ();
    As you are invalidating the node when you are performing an action .so that after each each time you press the action this invalidate method will be called.
    The data in the node if it is there it will be invalidated..
    Hope it helps you.
    any doubts get back to me.
    Thanks & regards,
    Lokesh.

  • How can I bind a dynamic attribute of a context node to ALV?

    Hi all,
    I'm trying to show data with Webdynpor ALV, but i met a question which blocked me. The situation is that there is a static context node and it's mapped to WD ALV, while programming I create a dynamic attribute to the context node. The dynamic column can be shown on the UI, but there is no any data in it. How can i deal with it?
    Thanks a lot!
    Edited by: Julia Zhu on Dec 3, 2009 7:48 AM

    Hi Julia,
    Welcome to SDN.
    Post it in the ABAP webdynpro forum to get quick replies. Web Dynpro ABAP
    Also search in sdn as there are chances that somebody has already posted the queries related to same issue.
    Regards,
    Swarna Munukoti.

  • How to create a node with attributes at runtime in webdynpro for ABAP?

    Hi Experts,
             How to create a node with attributes at runtime in webdynpro for ABAP? What classes or interfaces I should use? Please provide some sample code.
    I have checked IF_WD_CONTEXT_NODE_INFO and there is ADD_NEW_CHILD_NODE method. But this is not creating any node. I this this creates only a "node info" object.
    I even check IF_WD_CONTEXT_NODE but i could not find any method that creates a node with attribute.
    Please help!
    Thanks
    Gopal

    Hi
       I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
    Note
    The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
    The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
    Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
    Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
    Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
    My code is like the following:
    TYPES: BEGIN OF t_type,
                CARRID TYPE sflight-carrid,
                CONNID TYPE sflight-connid,
             END OF t_type.
      Data:  i_struc type table of t_type,
      dyn_node   type ref to if_wd_context_node,
      rootnode_info   type ref to if_wd_context_node_info,
      i_node_att type wdr_context_attr_info_map,
      wa_node_att type line of wdr_context_attr_info_map.
          wa_node_att-name = 'CARRID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
          insert wa_node_att into table i_node_att.
          wa_node_att-name = 'CONNID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
          insert wa_node_att into table i_node_att.
    clear i_struc. refresh i_struc.
      select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    rootnode_info = wd_context->get_node_info( ).
    rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
                                       attributes = i_node_att
                                       is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
    dyn_node->bind_table( i_struc ).
    l_ref_interfacecontroller->set_data( dyn_node ).
    I am trying to create a new node. That is
    CONTEXT
    - DYNFLIGHT
    CARRID
    CONNID
    As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
    Also I cannot define the structure in the ABAP dictionary because it changes based on condition
    Message was edited by: gopalkrishna baliga

  • Dynamic Attributes with UDF - NullPointerException

    Hello,
    I want to set the file name of an file receiver by means of setting dynamic attributes in an UDF.
    I use the following code and map the output to the root node of the target message (one input variable is var1)
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String myFileName = var1;
    conf.put(key, myFileName);
    return "";
    When I want to test the mapping using the test tab I get a null pointer exception:
    Exception:[java.lang.NullPointerException] in class com.sap.xi.tf
    Could the reason be, that setting dynamic attributes does not work when testing a mapping as the mapping has to be called by the IE runtime or is there any other reason?

    Hi Florain,
    I can understand, but that is how it is designed because the filename paramter can be picked up only during the runtime. But if you use other parameters like interface, sender name etc you can test it in mapping. Please go to test tab and click on parameters  tab. There you see few parameters for runtime also. You can put some value there and then you can test the mapping and you will not receive that error. You dont have filename there, so thats the reason why you are getting error. Hope in next release SAP would come up with this option.
    Regards,
    ---Satish

  • Seeburger AS2 Adapter - Dynamic Attributes

    Dear all,
    We have a scenario where, we are sending an IDOC from our SAP system via XI to one of our partner using AS2.
    We have to manipulate the file name at the receiver end using the dynamic attributes of the AS2 communication channel.
    As per the documentation and the following threads
    Re: File to AS2 File Name? we have done the necessary configuration in the communication channel. The following activites are done
    Selected the checkbox "Use dynamic attributes"
    Under the Module tab
    In Processing sequence added a new entry
    Number 1
    Module Name : localejbs/Seeburger/solution/as2
    Module Type  : Local enterprise bean
    Module Key   :  "dynfile"
    Under the Module Configuration added the following details
    Module key  :  "dynfile"
    Parameter Name : "http://seeburger.com/xi/AS2/dtAS2FileName"
    Parameter Value : "DYNFILENAME"
    However, I understand that this configuration is incomplete, as somewhere i need to pass the value to the variable "DYNFILENAME".
    As per the thred Re: File to AS2 File Name?, Mr Srinivas Reddy mentioned 5 steps, however I am not clear about the step 3 & 4.
    FYI : What I want to map as the file name is the Parter Profile in the EDIDC40 segment of the idoc and the date+time stamp
    Many thanks for the help , in advance
    Regards : Bobby Bal
    Edited by: Bobby Bal on Sep 20, 2010 9:52 PM

    Hi,
    Use the below UDF in your mapping..
    public String FileName(String a,Container container){
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://seeburger.com/xi/AS2","dtSubject");
    conf.put(key, a);
    As per your requirement, Use Concatenate function  Idoc + Date + Time .
    Pass the resultant value to the UDF and pass this to any unused Target node.
    IDOC + Time+Date --> UDF --> Target node.
    In your receiver AS2 adapter, Click on use dynamic attributes and  Subject check boxes.
    If you want to use other Dynamic attributes like dtAS2FileName, dtAS2ContentType ..
    Simply replace the dtSubject with dtAS2FileName or  dtAS2ContentType . No need to use any modules.
    Thanks
    Deepthi.

  • Rendering Dynamic Attribute in PDF

    Hi,
          I need to render a PDF dynamically.
    If I have a context node in java web dynpro with 3 attributes
    Ex: Employee - Node
          - empId - Attr1
          - empName - Attr2
          - city - Attr3
      But I can add an attribute(country) dynamically and this attribute has to be displayed in the dynamic Form as a Label/Text View pair. Is this possible? Do I need to write a Javascript for this using the form designer.
       Actually we need to add dynamic configuration. Here for all those attributes that are available at Design time. I can drag-drop in the form Designer and create a TextView/Label for these attributes. I can write a Javascript in the form to make the attributes(Lable/TextView) as visible or invisble based on the selection of the corresponding attributes in the web dynpro side.
       But I need to know how to do the same for a dynamic attribute that is created in Web dynpro at Run-time?
    Regards,
    Sherfuddin

    Hi Trikanth,
    example javascript for hiding textField:
    xfa.resolveNode("data.subPage1.subFlowed.TextField1").presence="hidden";
    I think that http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_basics.pdf can help you, especially pages 11 and 20 (To insert object reference syntax automatically).
    And as Krish wrote your form must be dynamic for this functionality.
    Michal

  • Dynamic attribute IF_WD_CONTEXT_NODE_INFO

    hi
    i want to created dynamic attribute i find IF_WD_CONTEXT_NODE_INFO for use to create dynamic attirubute .
    but I dont use ADD_ATTRIBUTE method . I dont know to use  this method . 
    how can I use ADD_ATTRIBUTE method ??
    Thanks For Reply
    Joshua .

    Hi Joshua,
    You can define new attributes for the previously created context node by calling the method add_attribute( ) from the reference to the metadata of the node.
    ex:
    data: lt_root_info type ref to if_wd_context_node_info,
            lr_flights_info type ref to if_wd_context_node_info,
            ls_attribute type wdr_context_attribute_info.
    " Get the meta data information of the root context node
    lr_root_info = wd_context->get_node_info( ).
    " Create node with name FLIGHTS without attributes
    lr_flights_info = lr_root_info->add_new_child_node
           exporting name                               = 'FLIGHTS'
                         is_mandatory                    =  abap_false
                         is_multiple                        = abap_true
                         is_mandatory_selection     = abap_false
                         is_multiple_selection         = abap_false
                         is_singleton                      = abap_true
                         is_initialize_lead_selection = abap_true
                         is_static                           = abap_false
          receiving
                        child_node_info                  = lr_flights_info.
    " Define attribute Carrid
    ls_attribute-name = 'CARRID'.
    ls_attribute-type_name = 'S_CARR_ID'.
    ls_attribute-value_help_mode = '0'.
    call method lr_flights_info->add_attribute
         exporting attribute_info = ls_attribute.
    Creating a context node and its attributes comprises a lot of manually written coding since the method add_attribute( ) has to be called once for each attribute. You can instead use the the method add_new_child_node( ) to even create related attributes by using the static_element_type / static_element_rtti / attribute parameters of this method. Try refer the documentation for more information regarding this.
    Regards,
    Uday

  • Access dynamic attributes BPM; error while activating the process in sxi

    hi everybody,
    I have to access dynamic attributs in a BPM condition. I thought I could achive this when I click the radiobutton "contextobject" in the condition editor.
    When using the value-help button on the contextobject a huge list of objects is shown for selection.
    Strange to me is that also the radionbutton "interface-variable" is checked. I can not uncheck this radiobutton. But this makes the error while activating:
    "Containerelement 'IDOC_'MyContainerelement'{XSDSIMPLE::xsd:string;SHeaderSUBJECT:ht' does not exist".
    Has anybody expirience using the dynamic attributes/contextobjekts in BPM?
    Thanks, Regards Mario

    Hi all,
    it seems to be impossible to access the attributes:
    Technical Context Object in ccBPM
    Regards Mario

  • Create a dynamic attribute for each user

    Hi All,
    I request you all to let me know how to give an approach to the following requirement.
    REQUIREMENT: I have to create a dynamic attribute in UME for each user and the read the attribute on lead selection of a table having list of Users.
                             On lead selection, the dynamic attribute value should be either true or false. Based on this value the rest of the application specific operations wil be taken care.
                              If a particular User does not have the dynamic attribute associated to it, then we need to create the same.
    Looking forwarrd for your help.
    Regards
    Dipendra

    //@@begin javadoc:UMSavePropertiesByNode()
         /** Declared method. */
      //@@end
      public boolean UMSavePropertiesByNode( )
        //@@begin UMSavePropertiesByNode()
              try {
                   if (wdContext.currentUserDataElement().getVaIUserMaint().setAttribute("com.sap.security.core.usermanagement", this.getUMPropertyName(null) + ".TableColumns", this.getPropertiesByNode())) {
                        wdContext.currentUserDataElement().getVaIUserMaint().save();
                        wdContext.currentUserDataElement().getVaIUserMaint().commit();
                        msg.reportMessage(IMessageTableUtilsComponent.UMPROPERTY__SAVE__FIELDS__SUCCESS, null, false);
              } catch (UMException ex) {
                   wdContext.currentUserDataElement().getVaIUserMaint().rollback();
                   msg.reportMessage(IMessageTableUtilsComponent.UMPROPERTY__SAVE__FIELDS__ERROR, null, false);
                   return false;
              return true;
        //@@end
      //@@begin javadoc:UMLoadFieldsProperties()
         /** Declared method. */
      //@@end
      public petrobras.com.br.classes.FieldsTable UMLoadFieldsProperties( petrobras.com.br.classes.FieldsTable fields )
        //@@begin UMLoadFieldsProperties()
              String properties[] = wdContext.currentUserDataElement().getVaIUserMaint().getAttribute("com.sap.security.core.usermanagement", this.getUMPropertyName(null) + ".TableColumns");
              if (Compare.getLenght(properties) > 0) {
                   //msg.reportWarning("[UMLoadFieldsProperties]: properties.length = " + properties.length);
                   for (int i = 0; i < properties.length; i++) {
                        int attrPos = Integer.parseInt(properties<i>.substring(properties<i>.indexOf("(") + 1, properties<i>.indexOf(")")));
                        String attrName = (String) properties<i>.substring(properties<i>.indexOf(")") + 1, properties<i>.indexOf("="));
                        int attrValue = Integer.parseInt(properties<i>.substring(properties<i>.indexOf("=") + 1, properties<i>.indexOf(";")));
                        Field item = fields.getField(attrName);
                        if (item != null) {
                             item.setPosition(attrPos);
                             item.setVisibility(WDVisibility.valueOf(attrValue));
                             fields.removeFieldByName(attrName);
                             fields.addField(item);
              return fields;
        //@@end
    regards,
    Angelo

  • Dynamic Attribute in AS2 Receiver

    Hello,
    in the Seeburger AS2 Receiver channel I have found "AS Message ID" in the last of possible Dynamic Attributes. How do I set this one, so what is the name of the dynamic configuration key. Any idea on this?

    Let me expalin you the complete thing.
    In mapping i m using this UDF for dynamic subject.
    DateFormat dfCurrentDate = new SimpleDateFormat("yyyy-MM-dd");
    DateFormat dfCurrentTime = new SimpleDateFormat("HH:mm:ss.SS");
    Date dCurrentDate = new Date();
    String strCurrentDate = dfCurrentDate.format(dCurrentDate) + "T" + dfCurrentTime.format(dCurrentDate) + "Z";
    String strSubject="Literal"+ "_" + strCurrentDate;
    // Dynamic Subject
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey keySubject = DynamicConfigurationKey.create( "http://seeburger.com/xi/common/dtSubject", "DYNSUBJECT");
    conf.put(keySubject,strSubject);
    return "";
    In receiver service I have used "localejbs/Seeburger/AttribMapper" module.
    Parameter name  http://seeburger.com/xi/common/dtSubject
    Parameter value  @http://seeburger.com/xi/common/dtSubject/DYNSUBJECT
    In moni I can see the dynamic configuration tab(neither Tab nor value)
    But in RWB comm. channel monitoring I can see in Audit log but not in SOAP document.
    Hope i have cleared you..
    Thanks
    Jaideep

  • Need Dynamic attributes for XI adapter to use in Dynamic Configuration ..!!

    Hi Friends,
    We are planning send message to different receivers through XI adapter by using Dynamic Configuration.
    Can anyone please tell me what are the dynamic attributes used for XI adapter.
    In my scenario, I want to pass the Service Number and Path prefix of XI adpater dynamically by using sender ID from Idoc payload.
    I know how to use the dynamic configuration UDF in message mapping. But I don't know the dynamic attributes which we can pass to Service Number and Path prefix of XI adpater.
    Kindly suggest ..
    Thanks
    Deepthi.

    Hi Sourabh,
    >> You need to set these attributes explicitly in the adapter configuration..
    Can you please elaborate on this like how to implement this? Do we need to use any module configuration in the adapter?
    We will use XI adapter only while sending the data directly from IE without using any feautures of AE (like adapters, modules etc). It is like directly sending data from ABAP stack without using J2EE stack. That is the reason we can't use any Modules in XI adpater and it is in disabled by default.
    When I checked in SXMB_MONI.. as you said details are found in
    - <SAP:Attribute>
      <SAP:Name>host</SAP:Name>
      <SAP:Value>10.190.25.16</SAP:Value>
      </SAP:Attribute>
    - <SAP:Attribute>
      <SAP:Name>httpDestination</SAP:Name>
      <SAP:Value />
      </SAP:Attribute>
    - <SAP:Attribute>
      <SAP:Name>path</SAP:Name>
      <SAP:Value>/rcvA/receiver</SAP:Value>
      </SAP:Attribute>
    - <SAP:Attribute>
      <SAP:Name>port</SAP:Name>
      <SAP:Value>8210</SAP:Value>
      </SAP:Attribute>
    XI adapter uses mainly three parameters Host, Port and Path.
    I want to pass any two of these values dynamically to achieve my solution. Can you please suggest your solution how we can implement it.
    -Deepthi.

  • Error in committing data while using dynamic attributes

    Hi,
    Module: Performance Management
    Page: Give Final Ratings: Main Appraiser
    Here, I have used dynamic attributes to show the competency name without segments.
    I have added this attribute through controller and i passed value to this attribute in the same ProcessRequest method.
    But, when the manager tries to complete the appraisal for his employee by pressing the continue button in the above mentioned page, the following exception is throwing.
    "This competence already exists within the assessment."
    Is this dynamic attribute will be the problem for this?
    can any one please tell me?
    Thanks in advance,
    SAN

    Hi,
    If you added the column from Extended Controller. It should be a transient attribute to the VO and I think it should not create any issues.
    Error "This competence already exists within the assessment." looks like from an FND Message , You can try to debug this issue by finding the FND Message Name corresponding to the error and search the Message Name in the seeded code.
    -Idris

Maybe you are looking for