cancel
Showing results for 
Search instead for 
Did you mean: 

Passing select options internal table to BAPI attributes...

Former Member
0 Kudos

Hello Web Dynpro Gurus,

When I get the values from select options into interna table, how can I pass the same to the attribtues of the importing/exporting nodes of the BAPI by reading the context.

Please help .

Regards,

Jainam.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI jainam,

After you read the attributes from the context you will have to transfer the same into Bapi structure.

In Your case you want to transfer select options data into Bapi.

I have done it as follows:

*Declaration

FIELD-SYMBOLS: <FS_KUNNR> TYPE TABLE.

DATA: LT_RANGE_TAB8 TYPE REF TO DATA.

  • To get select option values in table

LT_RANGE_TAB8 = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'KUNNR' ).

*to assign the values to Filed symbols

ASSIGN LT_RANGE_TABLE8->* TO <FS_KUNNR>.

*if field symbol is assigned tranfer to table

if <FS_KUNNR> IS ASSIGNED.

MOVE <FS_KUNNR> TO LINT_KUNNR.

endif.

Here LINT_KUNNR is the range table which is to be supplied to bapi.

Hope this helps you.

Best Regards,

Navin Fernandes.

Former Member
0 Kudos

Hello,

The code in bold below sets attributes of my node one by one for the select option node atttributes i.e. SIGN, OPTION, LOW and HIGH.

Instead of that how can I set all attributes of node which is of type select-options in one shot.

method ONACTIONSEARCH .

DATA: S_WAERS TYPE REF TO DATA.

FIELD-SYMBOLS: <FS_WAERS> TYPE TABLE.

  • Retrieve the data from the select option

S_WAERS = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'WAERS' ).

  • Assign it to a field symbol

ASSIGN S_WAERS->* TO <FS_WAERS>.

data:

Node_Rep_Curr type ref to If_Wd_Context_Node,

Elem_Rep_Curr type ref to If_Wd_Context_Element,

Stru_Rep_Curr type If_Select_View=>Element_Rep_Curr .

  • navigate from <CONTEXT> to <REP_CURR> via lead selection

Node_Rep_Curr = wd_Context->get_Child_Node( Name = IF_SELECT_VIEW=>wdctx_Rep_Curr ).

  • get element via lead selection

Elem_Rep_Curr = Node_Rep_Curr->get_Element( ).

  • get all declared attributes

Elem_Rep_Curr->get_Static_Attributes(

importing

Static_Attributes = Stru_Rep_Curr ).

Node_Rep_Curr->set_attribute(

Exporting

name = 'SIGN'

value = 'I' ).{code}

endmethod.

Edited by: Jainam Shah on Feb 5, 2010 2:55 PM

Answers (0)