Application Development 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: 

vrm_set_values

Former Member
0 Kudos

Hello,

I have to use FM vrm_set_values (list box) on table control. I have a itab which holds the values (adr2-tel_numbers). I have field on table control with the same name(adr2-tel_number).

I have to display in the list those numbers on some set condition.

Some one help me on this please.

Regards

Kesi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

I am not using any PROCESS ON VALUE-REQUEST. I have requirement something as follows...

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

PBO

loop at tab_cntl

module xy_z

endloop.

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

module xy_z

-

-

-

here i need to set the field on table control to take up the values in the list box.

regards

Kesi

20 REPLIES 20

Former Member
0 Kudos

hi rahul,

i think no need to use the FM in ur case ,

make the field as dropdown in the attributes, values will be automatically populated intho the field

0 Kudos

name = 'FMBW_S_SCREEN-VALTYPE'.

LOOP AT u_t_valtype INTO l_f_valtype.

value-key = l_f_valtype-valtype.

value-text = l_f_valtype-text15.

append value to list.

ENDLOOP.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

Former Member
0 Kudos

vrm_set_values is a FM. So how i go about it!!

regards

Kesi

0 Kudos

Hi,

Pl take a look at RSDEMO_DROPDOWN_LISTBOX.

Regards,

Suresh Datti

Former Member
0 Kudos

Hi

You have to arrange your field to displya list box by screen painter and in logic flow in the POV process:

PROCESS ON VALUE-REQUEST

FIELD ADR2-TEL_NUMBER MODULE F4_LIST_BOX.

MODULE F4_LIST_BOX.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

REFRESH LIST.

NAME = 'ADR2-TEL_NUMBER'.

MOVE: '0123456789' TO VALUE-KEY,

'0123456789' TO VALUE-TEXT.

APPEND VALUE TO LIST.

MOVE: '9876543210' TO VALUE-KEY,

'987654321' TO VALUE-TEXT.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

VALUES = LIST.

ENDMODULE.

Max

Former Member
0 Kudos

Hello,

I am not using any PROCESS ON VALUE-REQUEST. I have requirement something as follows...

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

PBO

loop at tab_cntl

module xy_z

endloop.

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

module xy_z

-

-

-

here i need to set the field on table control to take up the values in the list box.

regards

Kesi

0 Kudos

Hi

But where is the field with listbox? Is it a field of table control? or Do you only get out the values for list box from table control?

Anyway you can insert the module to load data to list box to PBO too.

PBO

MODULE F4_LIST_BOX.

loop at tab_cntl

module xy_z

endloop.

Max

Message was edited by: max bianchi

0 Kudos

Hello Max,

Its been suggested that i only have to use the FM vrm_set_values. Any suggestions as to how to go about??

regards

Kesi

0 Kudos

Hi Kesi

It's true you need only to use vrm_set_values.

But the problem is where?

You have only two chances:

- PBO process;

- POV process;

You don't want or can't use POV process, OK manage it in PBO:

loop at tab_cntl

module xy_z

endloop.

Try to insert my code to run vrm_set_values in your module XY_Z. I think it'll work.

But I can't understand where your field with listbox is.

Max

Max

Message was edited by: max bianchi

0 Kudos

Ok, I just wrote a little test program. If the values of the listbox are to be consistant for all rows of the table control, then you can do something like this.

This program uses an internal table with one field named as ITAB-FIELD. I created the control using the wizard, I set the attribute of the field for "ListBox", in the PBO, of the screen you need to build your values and call the function module.



report  zrich_0001.

type-pools: vrm.

data: begin of itab occurs 0,
      field(10) type c,
      end of itab.

data: ivrm_values type vrm_values.
data: xvrm_values like line of ivrm_values.
data: name type vrm_id.

start-of-selection.


  call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module status_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

  name = 'ITAB-FIELD'.

  xvrm_values-key = '1234567890'.
  xvrm_values-text = '1234567890'.
  append xvrm_values to ivrm_values.

  xvrm_values-key = '0987654321'.
  xvrm_values-text = '0987654321'.
  append xvrm_values to ivrm_values.

  call function 'VRM_SET_VALUES'
    exporting
      id     = name
      values = ivrm_values.

endmodule.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module user_command_0100 input.

endmodule.                 " USER_COMMAND_0100  INPUT

*&SPWIZARD: DECLARATION OF TABLECONTROL 'ITABCON' ITSELF
controls: itabcon type tableview using screen 0100.

*&SPWIZARD: OUTPUT MODULE FOR TC 'ITABCON'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR
module itabcon_change_tc_attr output.
  describe table itab lines itabcon-lines.
endmodule.                    "ITABCON_CHANGE_TC_ATTR OUTPUT

Regards,

Rich Heilman

0 Kudos

hello Rich,

what values does list box itab-field contains of. Does it contain the following values

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

xvrm_values-key = '1234567890'.

xvrm_values-text = '1234567890'.

append xvrm_values to ivrm_values.

xvrm_values-key = '0987654321'.

xvrm_values-text = '0987654321'.

append xvrm_values to ivrm_values.

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

itab-field

1234567890

0987654321

My requirement is something like this...

PBO

loop at table control.

Set up the list box drop down for the linked telphonje numbers field ( adr2-tel_number) usingFM vrm_set_values. This will made up from all the numbers for the customer that are valid for counting. The potential numbers are found on ADR2 via the ADRNR number on kna1.

Endloop.

So i am bit confused as what

xvrm_values-key = '1234567890'. and

xvrm_values-text = '1234567890'. are doing and what will be for my requirement.

regards

Kesi

0 Kudos

Hi

xvrm_values-key is the key of your value, so the value

xvrm_values-text is the description of your value.

The listbox show the description, not the value. But your value is telephone number so if you want to display it you can insert it as key and text.

So you have to read the address tables to find out the telephone number and transfer it to fm vrm_set_values.

Max

0 Kudos

So the listbox is to change for each record of the table control? Is this right? Say you have 10 customers in the table control, each record is for one customer, now the listbox field in record one is to hold 3 phone numbers that are tied to that customer, record 2 is to hold 3 different numbers tied to that customer in record 2. Is this your requirement?

Never done that before.....

Regards,

Rich Heilman

0 Kudos

I've been messing with this for a while now, I can't see to get it to change the values per record in the table control. Is using the standard F4 drop down out of the question? I know that I have been able to build that depending on another value in the record of a table control. No problem there. The listbox is a little tricky, not sure if it can be done. I've never seen this anywhere else in R/3.

Regards,

Rich Heilman

0 Kudos

Hello Rich,

what you understood is exactly what i require. For a first record r the list box should display the numbers linked to it and for the 2nd record the numbers linked to it.

I can not use the F4 as the suggeston was to use FM VRM_SET_Values.

Any suggestions as to how to do it.

regards

kesi

0 Kudos

Hi Kesi

I'm sorry but you can't do it, because the data are displayed by list box are the same for all lines of your table control.

You can't create different values ranges for the same input/output field.

If you have to do that you can't use list box.

You can use fm F4IF_INT_TABLE_VALUE_REQUEST to create an own search help showing tha hits in order the customer.

Max

0 Kudos

hello Max,

Sorry I got the requirement wrong. Indeed i need the same values in the list box. So we do it!!

regards

kesi

0 Kudos

Hi

Yes use abap codes just written in previous answers, anyway it should be like this:

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

REFRESH LIST.

NAME = 'ADR2-TEL_NUMBER'.

  • Find out the telephone number:

SELECT TEL_NUMBER FROM ADR2 INTO VALUE-KEY WHERE ADDRNUMBER = KNA1-ADRNR

VALUE-TEXT = VALUE-KEY.

APPEND VALUE TO LIST.

ENDSELECT.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

VALUES = LIST.

Max

0 Kudos

Ok, so the values need to be the same for every record in the table. Then please follow the examples given by Max and myself. Please make sure to award points for any helpful answers and mark you post as solved when solved completely. Thanks.

Regarsds,

Rich Heilman

Former Member
0 Kudos

Hello Max,

I did not get your point. Can you explain me a bit more. I fyou can give me bit of code to understand better it will be of great help.

Regards,

kesi