on 12-10-2013 8:17 PM
Hi Experts,
I am not able to get the values into the table from a dynamic node. I searched a lot but couldn't find any solution.
I am doing this way:
*accessing the data from attribute for table content
lt_restab = wd_this->GT_DYN_TBL.
**--assign reference of internal table to field symbols.
ASSIGN lt_restab->* TO <lt_dyn_tbl>.
refresh <lt_dyn_tbl>.
lv_dyn_node_name = 'NODE_DYN_FORM_TAB'.
lo_nd_dyn_node = wd_context->get_child_node( name = lv_dyn_node_name ).
lo_nd_dyn_node->get_static_attributes_table( IMPORTING table = <lt_dyn_tbl> ).
It is throwing dump:
Error Text
OBJECT_NOT_STRUCTURED
Invalid operand type for the MOVE-CORRESPONDING statement.
Because im using filed catalog to build dynamic structure(GT_DYN_TBL). It is adding line as first field. but my node doesnot have that.
please help me find right solution.
Thanks
Thanks All for replying. I found the solution. The Culprit was the Dynamic node itself .
CALL METHOD lo_rootnode_info->add_new_child_node
EXPORTING
* static_element_type =
name = lv_dyn_node_name
is_mandatory = abap_false
is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_true
is_singleton = abap_false
is_initialize_lead_selection = abap_true
STATIC_ELEMENT_RTTI = lo_str
* is_static = abap_true
attributes = lt_attribute
RECEIVING
child_node_info = lo_node_info.
I was not passing, static_element_rtti. While debugging I find out, it was expecting
it .
Regards
Monazza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi fatima,
i am not understand the requirement completely.
are u trying to use dynamic fieldcatlog in alv?
if yes observe this code once.
TYPE-POOLS : SLIS.
*&---------------------------------------------------------------------*
*& ALV Function Declarations
*&---------------------------------------------------------------------*
* Field Catalog Declarations
T_FCAT TYPE SLIS_T_FIELDCAT_ALV,
W_FCAT TYPE SLIS_FIELDCAT_ALV,
* Layout Declarations
W_LAYO TYPE SLIS_LAYOUT_ALV.
*&---------------------------------------------------------------------*
*& Global Variable Declarations
*&---------------------------------------------------------------------*
DATA : G_DATE TYPE SPMON,
G_VAR(2) TYPE N ,
G_MTEXT TYPE STRING,
G_MONTH TYPE CHAR2,
G_YEAR TYPE CHAR4,
G_MONTH1 TYPE CHAR2,
G_YEAR1 TYPE CHAR4,
G_YEARD TYPE CHAR2,
G_MOND TYPE CHAR2.
*&---------------------------------------------------------------------*
*& Selection-Screen Declarations
*&---------------------------------------------------------------------*
SELECT-OPTIONS : S_DATE FOR G_DATE.
*&---------------------------------------------------------------------*
*& Initialization Declarations
*&---------------------------------------------------------------------*
INITIALIZATION.
* Clearing Work areas
CLEAR : W_LAYO,
W_FCAT.
* Refreshing Internal Tables
REFRESH : T_FCAT.
*&---------------------------------------------------------------------*
*& Start-of-Selection Declarations
*&---------------------------------------------------------------------*
START-OF-SELECTION.
G_MONTH = S_DATE-LOW+4(2).
G_YEAR = S_DATE-LOW+0(6).
G_MONTH1 = S_DATE-HIGH+4(2).
G_YEAR1 = S_DATE-HIGH+0(6).
G_YEARD = G_YEAR1 - G_YEAR.
G_VAR = G_MONTH.
IF G_YEARD >= 1.
G_MOND = ( G_MONTH1 + ( 12 * G_YEARD ) ) - G_MONTH.
ADD 1 TO G_MOND.
ELSE.
G_MOND = G_MONTH1 - G_MONTH.
ADD 1 TO G_MOND.
ENDIF.
DO G_MOND TIMES.
CASE G_VAR.
WHEN '1'.
G_MTEXT = 'January'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '2'.
G_MTEXT = 'february'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '3'.
G_MTEXT = 'March'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '4'.
G_MTEXT = 'April'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '5'.
G_MTEXT = 'May'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '6'.
G_MTEXT = 'June'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '7'.
G_MTEXT = 'July'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '8'.
G_MTEXT = 'August'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '9'.
G_MTEXT = 'September'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '10'.
G_MTEXT = 'October'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '11'.
G_MTEXT = 'November'.
ADD 1 TO G_VAR.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WHEN '12'.
G_MTEXT = 'December'.
G_VAR = 1.
CONCATENATE G_MTEXT G_YEAR INTO W_FCAT-SELTEXT_M SEPARATED BY SPACE.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
ADD 1 TO G_YEAR.
ENDCASE.
ENDDO.
* Populating the Layout Fields
W_LAYO-ZEBRA = 'X'.
W_LAYO-COLWIDTH_OPTIMIZE = 'X'.
* Calling the Function Module for Displaying the Report in ALV Format
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
IS_LAYOUT = W_LAYO
IT_FIELDCAT = T_FCAT
TABLES
T_OUTTAB = T_KNA1.
is code is used to design fieldcatlogs dynamically,
if u give 02-2013 to 05-2013 in sel screen
the o/p fieldcat is like feb13, mar13, apr13, may13.
and changes for different values of input
Thanks and regards,
Prasanth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Prasanth ,
Really appreciated your help.
I am not using ALV. My node cardinality is 0.. n. So I want to read my dynamic node as table. For saving data at the back end. But is it throwing dump at this statement.
lo_nd_dyn_node->get_static_attributes_table( IMPORTING table = <lt_dyn_tbl> ).
Thanks
Monazza
HI Monazza,
Refer the Below link
Regards.
Nishant Bansal
Hi All,
May be my question is not clear.
My problem is, I am not able to access the data in the dynamic node.As we read the normal static node as table operation, my goal is same for dynamic node.
But, it is throwing dump at lo_nd_dyn_node->get_static_attributes_table( IMPORTING table = <lt_dyn_tbl> ).
Since, i don't know what would be my table type, therefore I used field symbol of type standard table.
There is so much about creating dynamic node, but how do we access(read elements) of he dynamic node??? In my case my dynamic node is table.
Please, experts help me find the right solution.
Regards
Monazza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please refer the below link
How to get data from a dynamic node in Webdynpro ABAP
Here there are 3 methods
Create the methods as it is, in your component and you can just pass the node name to retrieve the data.
Hope this resolves your issue.
Regards,
Rama
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.