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

Define data range of screen parameters

Former Member
0 Likes
678

On screen there are 2 parameters:

PARAMETER: p_cat TYPE table1-category DEFAULT 'C'.

PARAMETER: p_code TYPE table2-code.

As you can see p_cat is selected from all values in table1-category, say, select category from table1. But I need only part of the values, say, select category from table1 where OTYPE='D'. How can I do it?

After selecting p_cat, p_code should be selected from select table2-code where category = p_cat. How can I do it?

You may have known that I am very new to SAP and abap. Your help will be highly appreciated!

Edited by: Jackyork on Jun 15, 2010 6:49 PM

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
645

Hi,

answer for your question 1)

Check event *AT SELECTION-SCREEN ON VALUE REQUEST FOR <screen_field>.

check function module F4IF_INT_TABLE_VALUE_REQUEST

Answer to question 2)

Check function module DYNP_VALUES_READ

There are lot of examples available in SDN, please search for it.

On screen there are 2 parameters:

PARAMETER: p_cat TYPE table1-category DEFAULT 'C'.

PARAMETER: p_code TYPE table2-code.

As you can see p_cat is selected from all values in table1-category, say, select category from table1. But I need only part of the values, say, select category from table1 where OTYPE='D'. How can I do it?

After selecting p_cat, p_code should be selected from select table2-code where category = p_cat. How can I do it?

You may have known that I am very new to SAP and abap. Your help will be highly appreciated!

Edited by: Jackyork on Jun 15, 2010 6:49 PM

4 REPLIES 4
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
646

Hi,

answer for your question 1)

Check event *AT SELECTION-SCREEN ON VALUE REQUEST FOR <screen_field>.

check function module F4IF_INT_TABLE_VALUE_REQUEST

Answer to question 2)

Check function module DYNP_VALUES_READ

There are lot of examples available in SDN, please search for it.

Read only

0 Likes
645

Thanks! the 2 function modules do do the job.

Read only

0 Likes
645

Thanks! the 2 function modules do do the job.

Read only

Former Member
0 Likes
645

Use the at selection screen events for your requirements.

select cat
from   table1 
into  some variable
where otype eq 'D'.
If sy-subrc ne 0
 message 'Invalid Selection'.
endif.

To populate p_code automatically according to p_cat, then you must assign a function code using the user command keyword to make it work.

Regards

Mishra

Edited by: Rob Burbank on Jun 15, 2010 3:39 PM