‎2008 Jun 10 3:13 PM
Hi All,
Can anyone please explain with sample code how to get values from the table control list box and save it the internal table.
regards,
karthik
‎2008 Jun 30 10:15 AM
&----
*& Report ZTABLEC
*&
&----
*&
*&
&----
REPORT ZTABLEC.
tables : mara.
data : it like mara occurs 0 with header line.
data : begin of it1 occurs 0 ,
matnr like mara-matnr ,
end of it1 .
data: OK_CODE type SY-UCOMM .
data :STATUS like zaiod3-status .
controls : t1 type tableview using screen 1000.
call screen 1000.
&----
*& Module STATUS_1000 OUTPUT
&----
text
----
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
select * from mara into table it up to 10 rows.
ENDMODULE. " STATUS_1000 OUTPUT
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
MODULE USER_COMMAND_1000 INPUT.
IF SY-UCOMM = 'SAVE'.
IT-MATNR.
append it .
modify MARA from it.
ENDIF.
ENDMODULE. " USER_COMMAND_1000 INPUT
&----
*& Module create_dropdown_box INPUT
&----
text
----
MODULE create_dropdown_box INPUT.
SELECT matnr FROM mara
INTO CORRESPONDING FIELDS OF TABLE it1.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MATNR'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT1
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " create_dropdown_box INPUT
IN PAI & PBO SECTION...
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
loop at it with control t1.
endloop.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1000.
loop at it.
endloop.
MODULE USER_COMMAND_1000.
PROCESS ON VALUE-REQUEST.
FIELD mara-matnr MODULE create_dropdown_box.
FOR LAYOUT SECTION .......................
CREATE A TABLE CONTROL SELECT A FIELD OF TABLE CONTROL ON WHICH YOU WANT TO CREATE A LIST BOX
DOUBLE click on that open a tool box click the drop down list box select the list box .
save check activate
regards
Aniruddh Singh
‎2008 Jun 30 10:36 AM
Hi....
Here ur requirement is not clear..
But.... to get list box for one table control field...
In the field attributes of table control field to which you want to set the list box....
there u can select LISTBOX for drop down.
then ur field will appears.. list box.... when you click icon within the field... you can get all the possible values... for that field from check table..
If it is the custom field in the domain u hav to give the required values... to get...
And...
So it is the not an issue to you to get those values into one internal table..
Please get back to me.. if any further clarification do u need...
Thanks,
Naveen.I
‎2008 Jul 01 7:38 AM
‎2008 Jul 01 7:40 AM
‎2008 Jul 01 10:00 AM