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

TABLE CONTROL WITH LIST BOX

dhananjay_khamkar
Participant
0 Likes
510

Hi Experts,

Plesae help.

I have a table control and it has a list box for field matnr.

It shows mat. nos. those I want

My problem is that I want to

select different mat. no. on output screen from its list box and at the same time it should select all other values of corresponding fields.

this is my screen '1001'.

Material Number- 9500000 This is list box.

Material type- YCON

Industry Sector- M

Material Group- 01

Unit Of Measure- EA

I want to fetch data w. r. t. Material number .

This is my code. of '1001'

process before output.

MODULE STATUS_1001.

process after input.

MODULE USER_COMMAND_1001.

PROCESS ON VALUE-REQUEST.

FIELD mtab-matnr MODULE create_dropdown_box.

This is my code of main program.

DATA: MTAB LIKE MARA OCCURS 0 WITH HEADER LINE.

TYPES: BEGIN OF type_MARA,

MATNR type MARA-MATNR,

END OF type_MARA.

DATA itab_MARA TYPE STANDARD TABLE OF type_MARA.

MODULE STATUS_1001 OUTPUT.

SELECT MATNR MATKL MTART MBRSH MEINS FROM MARA

INTO CORRESPONDING FIELDS OF MTAB

ORDER BY MATNR DESCENDING.

ENDSELECT.

READ TABLE MTAB INDEX 1.

LOOP AT MTAB.

ENDLOOP.

MODULE create_dropdown_box INPUT.

SELECT matnr FROM mara

INTO CORRESPONDING FIELDS OF TABLE itab_mara

where matnr < '100000'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = itab_mara

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

any one can give me way how to solve this problem.

Thanks In Advance,

Dhanu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
448

Hi Dhananjay,

PROCESS AFTER INPUT.

FIELD mtab-matnr MODULE fill_control.

Now create module fill_control in your main program.

Here, Write select statment :

SELECT SINGLE MATKL MTART MBRSH MEINS FROM MARA

INTO CORRESPONDING FIELDS OF MTAB

WHERE MATNR = mtab-matnr.

It is working fine in my case.

Hope it also solve ur problem.

Regards,

Digesh Panchal

3 REPLIES 3
Read only

Former Member
0 Likes
448

hi

once you select and say 'ENTER' then you can handle the sy-ucomm and populate the other data.

you need to trigger some event then only you can populate.

you can use enter and handle enter ,populate the other data.

vijay

Read only

Former Member
0 Likes
449

Hi Dhananjay,

PROCESS AFTER INPUT.

FIELD mtab-matnr MODULE fill_control.

Now create module fill_control in your main program.

Here, Write select statment :

SELECT SINGLE MATKL MTART MBRSH MEINS FROM MARA

INTO CORRESPONDING FIELDS OF MTAB

WHERE MATNR = mtab-matnr.

It is working fine in my case.

Hope it also solve ur problem.

Regards,

Digesh Panchal

Read only

Former Member
0 Likes
448

Hi Dhananjay,

Pls look at <b>RSDEMO_TABLE_CONTROL</b> program.

I think this would be helpful.

Cheers,

Pramod