cancel
Showing results for 
Search instead for 
Did you mean: 

How can we get the values from the view?

Former Member
0 Kudos

Hi All,

my scenario is i have two fields in my view .one is parameter.and another on is select-options.how can i get the user entered values into my selection screen.?

for the select options i get the values into field-symbol.for parameter i get the value using get_attribute.

can i use like this in select statement.

WHERE SERVICE_ID = ZSD_DD_AUFNRS

AND CRE_DT IN <FS_DATE>.

Regards,

Ravi.

Accepted Solutions (1)

Accepted Solutions (1)

former_member515618
Active Participant
0 Kudos

Hi ravi,

When we define a selection option, we create a handler for the same.

Create this haldler in attributes tab say m_handler type ref to IF_WD_SELECT_OPTIONS.

When creating a select option create using this handler.

When you want to read the values, Use the method get_range_table_of_sel_field to get the values enterd.

data: r_selopt TYPE REF TO data.

field-symbols : <fs_selopt> TYPE table.

r_selopt = wd_this->m_handler->get_range_table_of_sel_field( i_id = 'S_SEL_OPT' ).

ASSIGN: r_eptype->* TO <fs_selopt>.

For this field symbol you can move into any range table and then use it in where condition of your select querry as IN range.

Hope this helps.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi Sravan,

i get values from select-option.what i m asking is,i embeded this wind_selection_screen view into one view container.i have another input field which is parameter.i have to give this value also be in select query.in where condition.in this scenario where can i add this i/p field in thew view.and how can i retrieve the user entered value.

Regards,

Ravi.

former_member515618
Active Participant
0 Kudos

Hi Ravi,

For adding a parameter field, Do the following.


  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

  lo_cmp_usage =   wd_this->wd_cpuse_select_option( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.

* get a pointer to the interface controller of the select options component
  wd_this->m_wd_select_options = wd_this->wd_cpifc_select_option( ).
  wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).

  CALL METHOD wd_this->m_handler->add_parameter_field
    EXPORTING
      i_id          = 'P_RISK_ID'
      i_description = 'Risk ID'.

To get the value entered into the parameter field, do the following.


  DATA:  r_risk_id TYPE REF TO data.

  FIELD-SYMBOLS <fs_risk_id> TYPE ANY.

  CALL METHOD wd_this->m_handler->get_value_of_parameter_field
    EXPORTING
      i_id    = 'P_RISK_ID'
    RECEIVING
      r_value = r_risk_id.

  ASSIGN r_risk_id->* TO <fs_risk_id>.

Field symbol <fs_risk_id> holds the value.

Hope this helps.

Regards,

Sravan Varagnai

Former Member
0 Kudos

Hi Sravan,

Thanks alot for giving me the detailed information.

can u plz give me the information on how to add column of cheboxes in my alv report.

2.how can i edit this.ie when user pressess any of the checkbox and he press the confirmation button a popup have to be raised with two buttons on that .and respected actions to be performed according to pop-up buttons.

Once again thanks for the before thread.

Regards,

Ravi

Former Member
0 Kudos

hI SRAVAN ,

when i use method add_parameter_field,it shows the error like below.

Method 'ADD_PARAMETER_FIELD" is unknown or PROTECTED or PRIVATE

How can i rectify this.

there is no method in "IF_WD_SELECT_OPTIONS" like above.

Regards,

Ravi

former_member515618
Active Participant
0 Kudos

Hi Ravi,

Could you paste the code you have put in.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi sravan,

in WDDOINIT

data:p_dept type zsd_dd_aufnrs,

s_dat type erdat.

data:lt_range_table TYPE REF TO DATA.

data:lr_componentcontroller TYPE REF TO IG_COMPONENTCONTROLLER,

lr_componentusage TYPE REF TO IF_WD_COMPONENT_USAGE.

  • Execution

  • Create Used Component

lr_componentusage = wd_this->wd_cpuse_select_options( ).

if LR_COMPONENTUSAGE->HAS_ACTIVE_COMPONENT( ) is initial.

lr_componentusage->create_component( ).

endif.

  • Get pointer to interface controller of select options

wd_this->M_WD_SELECT_OPTIONS = wd_this->wd_cpifc_select_options( ).

  • initialize selction screen

wd_this->M_HANDLER = wd_this->M_WD_SELECT_OPTIONS->init_selection_screen( ).

CALL METHOD wd_this->m_handler->add_parameter_field

EXPORTING

i_id = 'P_DEPT'

i_description = 'DEPARTMENT'.

  • Create Range Table for: Date

CALL METHOD WD_THIS->M_HANDLER->CREATE_RANGE_TABLE

EXPORTING

I_TYPENAME = 'DATS'

RECEIVING

RT_RANGE_TABLE = lt_range_table.

  • Add Selection Field for: Date

CALL METHOD WD_THIS->M_HANDLER->ADD_SELECTION_FIELD

EXPORTING

I_ID = 'S_DAT'

IT_RESULT = lt_range_table.

  • I_TOOLTIP = 'Select Date'.

-


IN ACTIONMETHOD

data:lt_date type REF TO DATA,

lt_dept TYPE REF TO ANY.

FIELD-SYMBOLS:<fs_date> TYPE table,

<fs_dept> TYPE any.

  • Retrieve Date from Select Options

CALL METHOD WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD

EXPORTING

I_ID = 's_dat'

RECEIVING

RT_RANGE_TABLE = lt_date.

  • assign Date Field Symbol

ASSIGN lt_date->* to <fs_date> .

CALL METHOD wd_this->m_handler->get_value_of_parameter_field

EXPORTING

i_id = 'P_dept'

RECEIVING

r_value = LT_DEPT.

ASSIGN lt_dept->* TO <fs_dept> .

Regards,

Ravi

former_member515618
Active Participant
0 Kudos

Hi Ravi,

The only mistake i could find is in the below lines of code. Instead of 'P_dept' pass 'P_DEPT' to i_id.

CALL METHOD wd_this->m_handler->get_value_of_parameter_field

EXPORTING

i_id = 'P_dept'

RECEIVING

r_value = LT_DEPT.

ASSIGN lt_dept->* TO <fs_dept> .

Let me know if the issue still persists.

Also confirm if WD_THIS->M_HANDLER is of type IF_WD_SELECT_OPTIONS.

Regards,

Sravan Varagani

Former Member
0 Kudos

HI SRAVAN,

i m getting the error in WDDOINIT Method.

METHOD 'ADD_PARAMETER_FIELD' is unknown or PROTECTED or PRIVATE.

THIS IS ERROR

REGARDS,

RAVI

former_member515618
Active Participant
0 Kudos

Hi Ravi,

Could you please confirm the type way M_HANDLER is declated in Attributes tab.

It should be M_HANDLER type ref to IF_WD_SELECT_OPTIONS.

and when calling the method ADD_PARAMETER_FIELD do it through Pattern.

Click on pattern, Select ABAP Object Patterns and click ok.

On the next popup give the following.

Instance WD_THIS->M_HANDLER

Class/Interface IF_WD_SELECT_OPTIONS

Method ADD_PARAMETER_FIELD (Do a F4 here and select)

and click ok.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi Sravan,

i tried this also.but there is no method like "ADD_PARAMETER_FIELD" in this class.can u plz check it once.it is the only problem i am getting here.

Thanks & Regards

Ravi

former_member515618
Active Participant
0 Kudos

Hi Ravi,

I copied the same piece of code you used pasted and executed the same in my application.

Surprizingly it works absolutely fine. I get bothe the parameter for department and a selectoption for date.

I have some questions for you.

1. How is m_handler declared in your application.

2. How is m_wd_select_options declared

3. Are you working on ECC5.0?

4. Why are you declaring

DATA:p_dept TYPE zsd_dd_aufnrs,

s_dat TYPE erdat.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi sravan,

1.M_HANDLER TYPE REF TO IF_WD_SELECT_OPTIONS,

2.m_wd_select_options TYPE REF TO IWCI_WDR_SELECT_OPTIONS.

3.I M WORKING ON ECC 6.0

4.Instead give the ID as same as DATA ELEMENT ,just i create same type and i passed this to ID.

Regards,Ravi

Former Member
0 Kudos

Hi sravan,

Generate an object for self defined functions

DATA: lo_self_functions TYPE REF TO if_salv_wd_function_settings,

  • Generate an object for button 'Confirm'

lr_button TYPE REF TO cl_salv_wd_uie_button,

lo_self_function TYPE REF TO cl_salv_wd_function,

l_text type string.

*----


  • Set Self-defined functions

*----


  • 'Confirm' Button

lo_self_functions ?= l_value..

lo_self_function = lo_self_functions->create_function( 'CONFIRM' ).

CREATE OBJECT lr_button.

CLEAR l_text.

l_text = 'Confirm'.

lr_button->set_text( l_text ).

lr_button->set_image_source( '' ).

lr_button->set_image_first( 'X' ).

lo_self_function->set_editor( lr_button ).

in this scenario i m getting hte error.

Lr_button is not type compatiblewith formal parameters "VALUE"

PLZ RESOLVE THIS.

REGARDS,

RAVI

former_member515618
Active Participant
0 Kudos

Hi ravi,

I guess you typed your querry in wrong thread. For clarity please paste the same in the right one.

Any ways, the decleration for button is incorrect.

lr_button TYPE REF TO cl_salv_wd_fe_button and not cl_salv_wd_uie_button.

Reward points to valid posts please

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi sravan,

1.M_HANDLER TYPE REF TO IF_WD_SELECT_OPTIONS,

2.m_wd_select_options TYPE REF TO IWCI_WDR_SELECT_OPTIONS.

3.I M WORKING ON ECC 6.0

4.Instead give the ID as same as DATA ELEMENT ,just i create same type and i passed this to ID.

Regards,Ravi

former_member515618
Active Participant
0 Kudos

Hi Ravi,

Do the following first to create a parameter field on the screen. Let me know if you have success this time. If yes then shall tell you how to get the values. If no let me know the error message that is comming up.

Step 1.

Click on Code Wizard, Select Instantiate Used Component, From F4 select SELECT_OPTION and click OK.


DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage =   wd_this->wd_cpuse_select_option( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
  lo_cmp_usage->create_component( ).
ENDIF.

Step 2.

Initialize the selection screen

Click on code wizard, select 'Method call in used controller', give the following values in the input fields and click ok.

Component Name WDR_SELECT_OPTIONS

Component Use SELECT_OPTION

Controller Name INTERFACECONTROLLER

Method Name INIT_SELECTION_SCREEN

The below piece of code is generated.


DATA lo_interfacecontroller TYPE REF TO iwci_wdr_select_options .
lo_interfacecontroller =   wd_this->wd_cpifc_select_option( ).

  DATA lo_r_helper_class TYPE REF TO if_wd_select_options.
  lo_r_helper_class = lo_interfacecontroller->init_selection_screen(
  ).

Step3.

Click on pattern, 'ABAP Objects Patterns', Select Call method, give the following inputs and click ok.

Instance LO_R_HELPER_CLASS

Class/Interface IF_WD_SELECT_OPTIONS

Method ADD_PARAMETER_FIELD

The below code is generated. Pass the import parameters accordingly.


  DATA p_objnr TYPE REF TO data.
  CREATE DATA p_objnr TYPE j_objnr.

  CALL METHOD lo_r_helper_class->add_parameter_field
    EXPORTING
      i_id                  = 'P_RISKID'
      i_description         = 'Risk Id'
      i_is_auto_description = abap_true
      i_value               = p_objnr.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi Sravan ,

when i m giving the method name in ABAP object patterns (add_parameter_field),it shows error that the method does not exit.

Regards,Ravi

former_member515618
Active Participant
0 Kudos

Hi ravi,

Let me know the Service pack on which you are currently working on?? I doubt if it is shipped to you atall.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi Sravan ,

Service Pack of us id STACK 6.

Let me know if anything

Regards,

Ravi.

former_member515618
Active Participant
0 Kudos

Hi Ravi,

Go to se24, give class 'IF_WD_SELECT_OPTIONS' and check if the method ADD_PARAMETER_FIELD exists atall.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi sravan,

there is no method like ADD_PARAMETER_FIELD in IF_WD_SELECT_OPTIONS.

Sravan,one more thing when user cliks on check box of any row that row must be selected,and after he click on button(Confirmation) a pop-up will raise and ask him to confirm,when he press YES ,the required field is going to be updated in the database.after that i want to refresh ALV Report,by deleting the confirmed row.thsi is the scenario.

In this,

1.how to connect check box and confirmation button on toolbar of ALV.(Ii.e whenever he select checkbox of particular row only he has to click button).

2.how to refresh ALV table AFTER Confirmation.

Regards,

Ravi

Former Member
0 Kudos

Hi Sravan,

when i am using the below code to generate self defined functions i m getting a error .

*Generate an object for self defined functions

DATA: lo_self_functions TYPE REF TO if_salv_wd_function_settings,

*Generate an object for button 'Confirm'

lr_button TYPE REF TO cl_salv_wd_fe_button,

lo_self_function TYPE REF TO cl_salv_wd_function,

l_text type string.

*----


*Set Self-defined functions

*----


*'Confirm' Button

lo_self_functions ?= l_value..

lo_self_function = lo_self_functions->create_function( 'CONFIRM' ).

CREATE OBJECT lr_button.

CLEAR l_text.

l_text = 'Confirm'.

lr_button->set_text( l_text ).

lr_button->set_image_source( '' ).

lr_button->set_image_first( 'X' ).

lo_self_function->set_editor( lr_button ).

Error when processing your request

What has happened?

The URL http://cgslsvr3.cgsl.com:8020/sap/bc/webdynpro/sap/zsdr_cash_work_list/ was not called due to an error.

Note

The following error text was processed in the system CGD : WebDynpro Exception: IDs Can Only Contain Characters of Syntactical Character Set

The error occurred on the application server cgslsvr3_CGD_20 and in the work process 0 .

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: RAISE of program CX_WD_GENERAL=================CP

Method: CONSTRUCTOR of program CL_WDR_VIEW_ELEMENT===========CP

Method: CONSTRUCTOR of program CL_WD_TOOLBAR_BUTTON==========CP

Method: NEW_TOOLBAR_BUTTON of program CL_WD_TOOLBAR_BUTTON==========CP

Method: IF_SALV_WD_COMP_TABLE_UI~CREATE_TOOLBAR_ITEM of program CL_SALV_WD_C_TABLE_V_TABLE====CP

Method: IF_SALV_WD_COMP_TABLE_UI~CREATE_TOOLBAR_ITEMS of program CL_SALV_WD_C_TABLE_V_TABLE====CP

Method: IF_SALV_WD_COMP_TABLE_UI~UPDATE_TOOLBAR_ITEMS of program CL_SALV_WD_C_TABLE_V_TABLE====CP

Method: IF_SALV_WD_COMP_TABLE_UI~UPDATE_TOOLBAR of program CL_SALV_WD_C_TABLE_V_TABLE====CP

Method: IF_SALV_WD_COMP_TABLE_UI~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

What can I do?

If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system CGD in transaction ST22.

If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server cgslsvr3_CGD_20 in transaction SM21.

If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server cgslsvr3_CGD_20 . In some situations, you may also need to analyze the trace files of other work processes.

If you do not yet have a user ID, contact your system administrator.

Error code: ICF-IE-http -c: 110 -u: CT-0024 -l: E -s: CGD -i: cgslsvr3_CGD_20 -w: 0 -d: 20080414 -t: 105835 -v: RABAX_STATE -e: UNCAUGHT_EXCEPTION

HTTP 500 - Internal Server Error

Your SAP Internet Communication Framework Team

How can i resolve it?

Regards,

Ravi

Answers (2)

Answers (2)

Former Member
0 Kudos

I am getting error

Former Member
0 Kudos

hi ravi.....

this link is a tutorial....

[link|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bf20e84f-0901-0010-fe9e-91d100013a59 ]

---regards,

alex b justin