Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

question on parameter statement

Former Member
0 Likes
1,129

I am using the following code in my program

SELECT-OPTIONS s_zbukr FOR w_payr-zbukr MODIF ID fff

DEFAULT 1000 TO 1200.

PARAMETERS:p_hbkid LIKE t012-hbkid OBLIGATORY.

right now, when you click on the drop down for the field p_hbkid, all of the house banks are displayed. what the user would like to see is for the field p_hbkid in the drop down for all of the house banks, is only the house banks associated with the values from the s_zbukr (1000 thru 1200).

I am not sure how to do this or if this is even possible.

Please let me know if this can be done.

thanks in advance for the help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,089

I have been working on my program using the VRM_SET_VALUES option and I am not able to get this to work. I have included a portion of my program where I have the code. If someone could look at this and let me know what I am doing wrong, it would sure be a big help

----


  • SELECTION SCREEN

*----


  • Paying Company code and Bank ID

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.

SELECT-OPTIONS s_zbukr FOR w_payr-zbukr MODIF ID fff.

  • DEFAULT 1000 TO 1200.

*PARAMETERS:p_hbkid LIKE t012-hbkid OBLIGATORY.

PARAMETERS:p_hbkid LIKE t012-hbkid.

SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.

----


  • AT SELECTION-SCREEN

----


  • begin of change THIXSON 11/20/08 95128

s_zbukr-sign = 'I'.

s_zbukr-option = 'EQ'.

s_zbukr-low = '1000'.

append s_zbukr.

CLEAR s_zbukr.

s_zbukr-sign = 'I'.

s_zbukr-option = 'EQ'.

s_zbukr-low = '1100'.

append s_zbukr.

CLEAR s_zbukr.

AT SELECTION-SCREEN OUTPUT.

perform z_get_banks USING 'P_HBKID'

CHANGING it_t012.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_hbkid.

*******************************************************************

  • this is the same code as above. I have been trying it in

  • different palces so see if I could get it to work

  • perform z_get_banks USING 'P_HBKID'

  • CHANGING it_t012.

*******************************************************************

FORM z_get_banks USING p_name TYPE c

CHANGING p_t_t012 TYPE ty_t_t012.

*Local Variable Delcrations

DATA : l_t_t012_list TYPE vrm_values,

l_key_id(4) TYPE n.

*Work Area Delarations

DATA: wa_t012_list TYPE vrm_value,

wa_t012 TYPE ty_t012.

SELECT bukrs hbkid banks bankl

FROM T012 into TABLE p_t_t012

WHERE bukrs IN s_zbukr.

IF sy-subrc NE 0.

STOP.

ENDIF.

*Preparing house bank code Value Table.

IF sy-subrc = 0.

LOOP AT p_t_t012 INTO wa_t012.

CLEAR: wa_t012_list.

l_key_id = l_key_id + 1.

wa_t012_list-key = l_key_id.

wa_t012_list-text = wa_t012-hbkid.

APPEND wa_t012_list TO l_t_t012_list.

CLEAR wa_t012.

ENDLOOP.

ENDIF.

*

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = p_name

values = l_t_t012_list " values table

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc NE 0.

*MESSAGE e000 WITH 'No value found for request'(001).

ENDIF.

ENDFORM. "z_gt_banks

9 REPLIES 9
Read only

Former Member
0 Likes
1,089

In ur code , first populate 1 internal table with values of hbkib for all values enterd for select-option.

then use the Fm F4IF_FIELD_VALUE_REQUEST to get the values in the F4 help for the parameter.

Read only

Former Member
0 Likes
1,089

you need to make the custome code ready for the filed in at selection screen event

for the house banks .

select field into table itab

where s_zbukr between '1000' and '2000' . --> u can set the range here or sel-low and sel high values with 1000 and 2000 or whatever .

this can be done ..

Read only

Former Member
0 Likes
1,089

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_hkbid.

select the data which you want to show in the drop down list on the selection screen depending on s_zbukr

w_vrm_id = 'P_HKBID'

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = w_vrm_id

values = t_hkbid_values " values table

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc NE 0.

MESSAGE e000 WITH 'No value found for request'(001).

ENDIF.

Read only

Former Member
0 Likes
1,089

Hi

Use at selection-screen on value request for p_hkbid.

First use the function moduel Dynp_value_read to read the value from s_zbukr.

Then poulate an internal table for s_zbukr and use these values to select

hkbid and store hkbid tables in an internal table and then pass it on to the function module F4IF_INT_TABLE_VALUE_REQUEST .

Regards

Neha

Read only

Former Member
0 Likes
1,090

I have been working on my program using the VRM_SET_VALUES option and I am not able to get this to work. I have included a portion of my program where I have the code. If someone could look at this and let me know what I am doing wrong, it would sure be a big help

----


  • SELECTION SCREEN

*----


  • Paying Company code and Bank ID

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.

SELECT-OPTIONS s_zbukr FOR w_payr-zbukr MODIF ID fff.

  • DEFAULT 1000 TO 1200.

*PARAMETERS:p_hbkid LIKE t012-hbkid OBLIGATORY.

PARAMETERS:p_hbkid LIKE t012-hbkid.

SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.

----


  • AT SELECTION-SCREEN

----


  • begin of change THIXSON 11/20/08 95128

s_zbukr-sign = 'I'.

s_zbukr-option = 'EQ'.

s_zbukr-low = '1000'.

append s_zbukr.

CLEAR s_zbukr.

s_zbukr-sign = 'I'.

s_zbukr-option = 'EQ'.

s_zbukr-low = '1100'.

append s_zbukr.

CLEAR s_zbukr.

AT SELECTION-SCREEN OUTPUT.

perform z_get_banks USING 'P_HBKID'

CHANGING it_t012.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_hbkid.

*******************************************************************

  • this is the same code as above. I have been trying it in

  • different palces so see if I could get it to work

  • perform z_get_banks USING 'P_HBKID'

  • CHANGING it_t012.

*******************************************************************

FORM z_get_banks USING p_name TYPE c

CHANGING p_t_t012 TYPE ty_t_t012.

*Local Variable Delcrations

DATA : l_t_t012_list TYPE vrm_values,

l_key_id(4) TYPE n.

*Work Area Delarations

DATA: wa_t012_list TYPE vrm_value,

wa_t012 TYPE ty_t012.

SELECT bukrs hbkid banks bankl

FROM T012 into TABLE p_t_t012

WHERE bukrs IN s_zbukr.

IF sy-subrc NE 0.

STOP.

ENDIF.

*Preparing house bank code Value Table.

IF sy-subrc = 0.

LOOP AT p_t_t012 INTO wa_t012.

CLEAR: wa_t012_list.

l_key_id = l_key_id + 1.

wa_t012_list-key = l_key_id.

wa_t012_list-text = wa_t012-hbkid.

APPEND wa_t012_list TO l_t_t012_list.

CLEAR wa_t012.

ENDLOOP.

ENDIF.

*

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = p_name

values = l_t_t012_list " values table

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc NE 0.

*MESSAGE e000 WITH 'No value found for request'(001).

ENDIF.

ENDFORM. "z_gt_banks

Read only

0 Likes
1,089

Well, if you want to use the VRM_SET_VALUES, then you need to make sure the parameter field is a listbox.

PARAMETERS:p_hbkid LIKE t012-hbkid AS LISTBOX VISIBLE LENGTH 20.

Regards,

Rich Heilman

Read only

0 Likes
1,089

Rich

this worked.

I would like to have the list of banks displayed similar to when you press F4 but only the banks that are associated with the company codes that are selected. I am not sure if I have to use the F4IF_FIELD_VALUE_REQUEST option that was suggessted here or not.

Read only

0 Likes
1,089

I always use function F4IF_INT_TABLE_VALUE_REQUEST. Works good for me.

report zrich_0001 .

tables: t001.

data: begin of it001 occurs 0,
      bukrs type t001-bukrs,
      butxt type t001-butxt,
      ort01 type t001-ort01,
      land1 type t001-land1,
      end of it001.

select-options s_bukrs for t001-bukrs.

initialization.

  select bukrs butxt ort01 land1 into table it001 from t001.

  sort it001 ascending by bukrs.
  delete adjacent duplicates from it001 comparing bukrs.

at selection-screen on value-request for s_bukrs-low.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'BUKRS'
            dynprofield = 'S_BUKRS'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = it001.

start-of-selection.

Regards,

Rich Heilman

Read only

0 Likes
1,089

Rich

this worked.

thanks for the help.