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

Selection screen

Former Member
0 Likes
691

Hi,

i have created one Z table. in a report of selection screen i have 2 parameters of Ztable. when i press F4 for first field it is giving all values of main table, but i need the possible values of Ztable only. and after entering first field value then the second parameter should display on selection screen and when i press F4 for second field it should pick the values from Z table corresponding to first field.

thanks in advance.

rgds,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
666

hi Vijay,

for the second case i.e, picking up the values in field2 based on field 1 code the required logic in

<b>AT SELECTION-SCREEN ON FIELD</b>

7 REPLIES 7
Read only

Former Member
0 Likes
667

hi Vijay,

for the second case i.e, picking up the values in field2 based on field 1 code the required logic in

<b>AT SELECTION-SCREEN ON FIELD</b>

Read only

Former Member
0 Likes
666

Hi vijay,

1.

but i need the possible values of Ztable only

A) this either u can write using

F4 functionality (fm F4IF_INT_TABLE_VALUE_REQUEST)

by selecting distinct values

b) Or there must be some another Table

where ALL THE COMBINATIONS OF FIELD1 & FIELD2

are maintained

(just like table T001L - Werks, and Lgort combination)

2. For the 2nd parameter, then,

U can make a search help,

based upon your z table (which stores all distinct combinations)

and make the field1 as IMPORTING parameter

(then F4 on 2nd field, will give only those

values, which are filtered on parameter 1 as on screen)

3. To get a taste of it, just copy paste in new program.

Report ABC.

PARAMETERS : WERKS LIKE T001L-WERKS,

LGORT LIKE T001L-LGORT.

regards,

amit m.

Read only

Former Member
0 Likes
666

Hi Vijay,

check the following code.

data: itab type table of <table>.
parameter: a like ztable-field1,
           b like ztable-field2.

 at selection-screen on value-request for b.


select * from <table> into table itab
    where field1 = a.


      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
*         DDIC_STRUCTURE         = ' '
          RETFIELD               = 'FIELD'
*         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              = itab
*         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.

hope this helps.

Regards,

kinshuk

Read only

Former Member
0 Likes
666

Hi Vijay,

Check this link.

Regards,

Arun S.

Read only

Former Member
0 Likes
666

These requirements have to be coded under the AT SELECTION SCREEN ON VALUE REQUEST ON <Field>

You can populate the an internal table with values you require by using the function module F4IF_INT_TABLE_VALUE_REQUEST

Read only

Former Member
0 Likes
666

Hi Vijay,

This question has been asked a number of times. You can use a the FM F4IF_FIELD_VALUE_REQUEST and F4IF_INT_TABLE_VALUE_REQUEST to achieve your result.

Just go through this link...It has exactly the same requirement.

<u>Related link</u>

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm

<u>Explaination</u>

<u>In the POV (at selection-screen on value-request for field1) for the first field</u>

Just call the FM 'F4IF_FIELD_VALUE_REQUEST' to fill the values in the first field.

Now call the FM 'DYNP_VALUES_READ' to read the selected value of the field.

<u>In the POV of the second field</u>

Use the select statement to select the required second field values.

Now fill the second field values using the FM

'F4IF_INT_TABLE_VALUE_REQUEST'

<b>Close the thread once the problem is solved.</b>

Regards,

SP.

Read only

Former Member
0 Likes
666

Hai Vinay

Go through the following Code

change the table Names as per your requirement

TABLES : MARD.

DATA: BEGIN OF IT_MARD OCCURS 0,

WERKS LIKE MARD-WERKS,

END OF IT_MARD.

DATA : T_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.

parameters : P_WERKS LIKE MARD-WERKS.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WERKS.

SELECT WERKS FROM MARD UP TO 10 ROWS INTO table IT_MARD.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'WERKS'

DYNPPROG = SY-REPID

DYNPNR = '1000'

DYNPROFIELD = 'P_WERKS'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_MARD

RETURN_TAB = T_RETURN

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

Thanks & regards

Sreenivasulu P