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

How to fill another parameter automatically on selection screen?

Former Member
0 Likes
5,602

Hello Friends,

I have two parameters on selection screen.

Date

ID

When I do F4 for Date parameter, By calling following function it gives me date and ID value


  CALL FUNCTION 'F4_ZAHLLAUF'
   EXPORTING
     F1TYP               = 'D'
     F1NME               = ' '
     F2NME               = 'F110V-LAUFI'
     DISPLAY_LAUFK       = 'X'
     EXPLAIN_LAUFK       = ' '
   IMPORTING
     LAUFD               = v_laufd
     LAUFI               = v_laufi.

All I need is when I do F4, It should automatic fill the ID parameter.

Note : Date parameter filled automatically by doing F4.

Please give me an example.

Regards,

RH

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,823

Hi

U need to use the fm DYNP_VALUES_UPDATE in order to update ther field V_LAUFI

PARAMETERS: V_LAUFD TYPE F110V-LAUFD,
            V_LAUFI TYPE F110V-LAUFI.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR V_LAUFD.

  DATA: DYNAME     LIKE  D020S-PROG,
        DYNUMB     LIKE  D020S-DNUM,
        DYNPFIELDS TYPE  TABLE OF DYNPREAD WITH HEADER LINE.

  CALL FUNCTION 'F4_ZAHLLAUF'
       EXPORTING
            F1TYP         = 'D'
            F1NME         = ' '
            F2NME         = 'F110V-LAUFI'
            DISPLAY_LAUFK = 'X'
            EXPLAIN_LAUFK = ' '
       IMPORTING
            LAUFD         = V_LAUFD
            LAUFI         = V_LAUFI.

  DYNAME = SY-REPID.
  DYNUMB = SY-DYNNR.
  DYNPFIELDS-FIELDNAME  = 'V_LAUFI'.
  DYNPFIELDS-FIELDVALUE = V_LAUFI.
  APPEND DYNPFIELDS.

  CALL FUNCTION 'DYNP_VALUES_UPDATE'
       EXPORTING
            DYNAME     = DYNAME
            DYNUMB     = DYNUMB
       TABLES
            DYNPFIELDS = DYNPFIELDS.

Max

15 REPLIES 15
Read only

Former Member
0 Likes
2,823

Hi.

Assign the value to another parameter in the event

AT SELECTION-SCREEN OUTPUT.

Read only

Former Member
0 Likes
2,823

CALL FUNCTION 'F4_ZAHLLAUF'

EXPORTING

F1TYP = 'D'

F1NME = ' '

F2NME = 'F110V-LAUFI'

DISPLAY_LAUFK = 'X'

EXPLAIN_LAUFK = ' '

IMPORTING

LAUFD = v_laufd

LAUFI = v_laufi.

if sy-subrc eq 0.

date-low = v_laufd.

id-low = va_laufi.

endif.

Read only

Former Member
0 Likes
2,823

Hi Ronny,

See the below example.

Say two parameters.

1. Plant

2. Material type C.

Now say u enter Plant 0820. and if u press F4 in Material Field, F4 has to show all the material of Plant 0820.

If your question is as above here is the answer for that.

Else come out of Loop.

get all the material Using select query with respect to plant into one internal table.

Now using At Selection Screen on value-request for material.

call FM f4if_int_table_value_request.

Pass the internal table here.

Now if you press F4 for Material, u will get only those values corresponding to Plant.

Hope useful to U.

Regards,

Priya.

Read only

Former Member
0 Likes
2,823

Hello,

When you press F4 and selects the data for that field then immediately move the ID field to the parameter of the id.

Read only

Former Member
0 Likes
2,824

Hi

U need to use the fm DYNP_VALUES_UPDATE in order to update ther field V_LAUFI

PARAMETERS: V_LAUFD TYPE F110V-LAUFD,
            V_LAUFI TYPE F110V-LAUFI.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR V_LAUFD.

  DATA: DYNAME     LIKE  D020S-PROG,
        DYNUMB     LIKE  D020S-DNUM,
        DYNPFIELDS TYPE  TABLE OF DYNPREAD WITH HEADER LINE.

  CALL FUNCTION 'F4_ZAHLLAUF'
       EXPORTING
            F1TYP         = 'D'
            F1NME         = ' '
            F2NME         = 'F110V-LAUFI'
            DISPLAY_LAUFK = 'X'
            EXPLAIN_LAUFK = ' '
       IMPORTING
            LAUFD         = V_LAUFD
            LAUFI         = V_LAUFI.

  DYNAME = SY-REPID.
  DYNUMB = SY-DYNNR.
  DYNPFIELDS-FIELDNAME  = 'V_LAUFI'.
  DYNPFIELDS-FIELDVALUE = V_LAUFI.
  APPEND DYNPFIELDS.

  CALL FUNCTION 'DYNP_VALUES_UPDATE'
       EXPORTING
            DYNAME     = DYNAME
            DYNUMB     = DYNUMB
       TABLES
            DYNPFIELDS = DYNPFIELDS.

Max

Read only

JozsefSzikszai
Active Contributor
0 Likes
2,823

you have to mention both field names in the function call (I assume these are v_laufd and v_laufi):

CALL FUNCTION 'F4_ZAHLLAUF'
   EXPORTING
     F1TYP               = 'D'
     F1NME               = 'V_LAUFD'
     F2NME               = 'V_LUFI'
     DISPLAY_LAUFK       = 'X'
     EXPLAIN_LAUFK       = ' '
   IMPORTING
     LAUFD               = v_laufd
     LAUFI               = v_laufi.

no need for dynpro update and such things, just check what the standard is doing

Read only

0 Likes
2,823

Hi Guy

The problem is the event AT SELECTION-SCREEN ON VALUE-REQUEST <FIELD>.

After leaving the event all values of all other input/output fields of selection-screen (except <FIELD>) will be lost: so if it needs to update other input/output fields in this event, the fm DYNP_VALUES_UPDATE has to be used just I've explained in my previuos answer.

Max

Read only

0 Likes
2,821

woud you please give it a try with the following example:

PARAMETERS : p_laufd TYPE reguh-laufd,
             p_laufi TYPE reguh-laufi.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_laufd.

  CALL FUNCTION 'F4_ZAHLLAUF'
   EXPORTING
     f1typ               = 'D'
     f1nme               = 'P_LAUFD'
     f2nme               = 'P_LAUFI'
*   DISPLAY_LAUFK       = 'X'
*   EXPLAIN_LAUFK       = ' '
   IMPORTING
     laufd               = p_laufd
     laufi               = p_laufi.
* TABLES
*   LAUFK               =.

(pls. note the difference: in importing parameters f1nme and f2nme the names of the dynpro fields have to be mentioned)

Read only

0 Likes
2,821

Hi Eric

Your solution can't work, see my answers

Max

Read only

0 Likes
2,821

Max is right Eric.

I already tried like u did but its not working.

anyway i got ans.

Thanks Max,

Thanks All.

Read only

0 Likes
2,821

interesting... if I try than it works

can you copy the code here?

Again, again, again: the importing parameters (f1nme and f2nme) of the FM has to get the names of the two selection screen fields for the payment run and date, the DYNP_VALUE_UPDATE FM will be called inside the F4_ZAHLLAUF FM in this case

modified source code of Max:

PARAMETERS: V_LAUFD TYPE F110V-LAUFD,
            V_LAUFI TYPE F110V-LAUFI.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR V_LAUFD.

*  DATA: DYNAME     LIKE  D020S-PROG,
*        DYNUMB     LIKE  D020S-DNUM,
*        DYNPFIELDS TYPE  TABLE OF DYNPREAD WITH HEADER LINE.

  CALL FUNCTION 'F4_ZAHLLAUF'
       EXPORTING
            F1TYP         = 'D'
            F1NME         = 'V_LAUFD'
            F2NME         = 'V_LAUFI'
            DISPLAY_LAUFK = 'X'
            EXPLAIN_LAUFK = ' '
       IMPORTING
            LAUFD         = V_LAUFD
            LAUFI         = V_LAUFI.

*  DYNAME = SY-REPID.
*  DYNUMB = SY-DYNNR.
*  DYNPFIELDS-FIELDNAME  = 'V_LAUFI'.
*  DYNPFIELDS-FIELDVALUE = V_LAUFI.
*  APPEND DYNPFIELDS.
*
*  CALL FUNCTION 'DYNP_VALUES_UPDATE'
*       EXPORTING
*            DYNAME     = DYNAME
*            DYNUMB     = DYNUMB
*       TABLES
*            DYNPFIELDS = DYNPFIELDS.

Read only

0 Likes
2,821

Hi

I'm sorry Eric is right, that works:

PARAMETERS : V_laufd TYPE reguh-laufd,
             V_laufi TYPE reguh-laufi.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR V_laufd.

  CALL FUNCTION 'F4_ZAHLLAUF'
    EXPORTING
      f1typ         = 'D'
      f1nme         = 'V_LAUFD'
      f2nme         = 'V_LAUFI'
      DISPLAY_LAUFK = 'X'
      EXPLAIN_LAUFK = ' '
    IMPORTING
      laufd         = V_laufd
      laufi         = V_laufi.

Where is the trick?

Just into the fm F4_ZAHLLAUF, here the fm DYNP_VALUES_UPDATE is called in order to update both fields.

Max

Read only

0 Likes
2,821

>

>


>       f1nme         = 'V_LAUFD'
>       f2nme         = 'V_LAUFI'
>

>

> Where is the trick?

>

> Just into the fm F4_ZAHLLAUF, here the fm DYNP_VALUES_UPDATE is called in order to update both fields.

>

> Max

I left only the "tricky" change from the FM call - you can note the difference (I told earlier these are importing parameters, but no, they are exporting ones.)

Read only

0 Likes
2,821

Hi,

I just found this thread, because I have the same problem. I inserted the solution but it doesn't work sufficient.

When I choose F4 in the field LAUFD it succesfully shows all the payment runs. If I choose one of them only the field LAUFD will be updated. The field LAUFI remains empty. Here my listing:

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: p_laufd LIKE f110v-laufd OBLIGATORY,

p_laufi LIKE f110v-laufi OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

----


  • At Selection-Screen *

----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_laufd.

CALL FUNCTION 'F4_ZAHLLAUF'

EXPORTING

f1typ = 'D'

f1nme = 'F110V-LAUFD'

f2nme = 'F110V-LAUFI'

display_laufk = 'X'

explain_laufk = ' '

IMPORTING

laufd = p_laufd

laufi = p_laufi.

What is wrong on it?

Thanks

Uwe

Read only

0 Likes
2,821

Hi,

got the solution. For my request it as necessary to use the function DYNP_VALUES_UPDATE. Now it works.

Thank to all.

Uwe