on ‎2006 May 05 8:23 PM
Hi Everyone,
I have a drop down box in which i need to display the values from two diffrent fields from two different tables.Say i have 4 values for field x in ztable1 and 2 values for field y in ztable2.I want to display field x and field y values from ztable1 and ztable2 under a particular field in table cotrol as an input i.e it should show 6 values.
Any help would be greatly appreciated and rewarded.
Request clarification before answering.
Hi suchitra,
I guess the data type for both these fields are same..
Use a internal table with header line of type field1/field2...
populate the values from field1 of table1..
select field1 into table itab from table 1.
then
populate the values from field2 of table2..
select field2 into itab from table 2.
append itab.
endselect.
Use this internal table to poulate the dropdown box..
eg:
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = itab.
Regards,
Tanveer.
<b>Please mark helpful answers</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Iam sending the code .Please take a moment to go through it.
data : begin of I_test occurs 0,
Kostl like ztest-kostl,
aufnr like ztest-aufnr,
End of I_test.
"""I am confused how to read from zfix and zfix1 into internal table .I have kostl in table zfix and aufnr in table zfix1 i.e the select query.
select kostl from zfix into table i_kostl.
loop at i_test.
value-key = i_test-kostl."" Iam nost sure how to mention two values i.e i_test-kostl and i_test-aufnr""
*valUe-text = 'test'.
append value to list.
endloop.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'ztest-kostl'"" i am also not sure how to update date base table z test
VALUES = LIST
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
waiting for your replies
Suchitra,
1. CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = <this is the parameter or screen field name e.g. p_field>
(why to update a databadse table?)
2. Declare your I_TEST with a fleid: field(80) type c.
3. Select from zfix,zfix1 etc wherever you want from.
2 separate selects.
4. Populate those values in I_TEST.
Hi suchitra,
here is the code for reading all the records in to one internal table.
=================================================
data : begin of I_test occurs 0,
Kostl like ztest-kostl,
aufnr like ztest-aufnr,
End of I_test.
data: I_test1 like I_test occurs 0 with header line.
select kostl from zfix into table I_kostl.
select aufnr from zfix1 into table I_kostl1.
Loop at I_kostl1.
move I_kostl1-aufnr to i_kostl-aufnr.
append i_kostl.
clear i_kostl.
Endloop.
====================================================
I am not sure about the field passing in value-key but i think it should be OK if you pass just i_test-kostl.
Hope this helps..
Regards,
Vicky
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.