‎2006 Jan 12 12:14 AM
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
‎2006 Jan 12 12:41 AM
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
‎2006 Jan 12 12:20 AM
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
‎2006 Jan 12 12:32 AM
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.
‎2006 Jan 12 12:24 AM
‎2006 Jan 12 12:27 AM
Hi,
Pl take a look at RSDEMO_DROPDOWN_LISTBOX.
Regards,
Suresh Datti
‎2006 Jan 12 12:28 AM
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
‎2006 Jan 12 12:41 AM
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
‎2006 Jan 12 12:44 AM
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
‎2006 Jan 12 12:51 AM
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
‎2006 Jan 12 1:07 AM
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
‎2006 Jan 12 1:12 AM
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
‎2006 Jan 12 1:37 AM
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
‎2006 Jan 12 1:47 AM
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
‎2006 Jan 12 1:52 AM
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
‎2006 Jan 12 2:17 AM
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
‎2006 Jan 12 10:12 AM
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
‎2006 Jan 12 10:39 AM
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
‎2006 Jan 12 1:14 PM
hello Max,
Sorry I got the requirement wrong. Indeed i need the same values in the list box. So we do it!!
regards
kesi
‎2006 Jan 12 1:26 PM
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
‎2006 Jan 12 2:08 PM
‎2006 Jan 12 12:46 AM
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