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

F4 values required

Former Member
0 Likes
823

Hi Friends

I created two subsceens and called them in one Dialog program main screen.Here my requireent is in first sub screen i have entering or picking the value throw F4 help from one filed (ex country - picked the value india) . After selecting that value in the first sub screen , i want populate revelent values in second subscreen fiield is regions(ex states of india with f4 help ).How can i achive this functionality.

Regards

RK

5 REPLIES 5
Read only

venkat_o
Active Contributor
0 Likes
783

Hi Ravi, Welcome to SDN. <li>Please search before you post anything in this forum. <li>Read the first subscreen field value using DYNP_VALUES_READ in the F4 help portion written for 2nd field in another subscreen. <li>For more help on DYNP_VALUES_READ, please search the forum with term DYNP_VALUES_READ. Thanks Venkat.O

Read only

Former Member
0 Likes
783

Hi


AT SELECTION-SCREEN ON VALUE-REQUEST FOR fee-low.
  PERFORM show_fee.
*&---------------------------------------------------------------------*
*&      Form  SHOW_FEE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form SHOW_FEE .

  DATA: ltab_fields LIKE dynpread OCCURS 0 WITH HEADER LINE.

  DATA : BEGIN OF it_fee OCCURS 0,
          GROUPFEE     TYPE ZGROUP_DE,
          FEE_NUMBER TYPE ZFEE_NUMBER,
          FEE  TYPE ZFEE_NAME,
        END OF it_fee.

* Make sure the parameter name is always in CAPS
  ltab_fields-fieldname = 'CITY'.
  APPEND ltab_fields.
* Call Dynpro read FM
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname     = sy-cprog
      dynumb     = sy-dynnr
    TABLES
      dynpfields = ltab_fields
    EXCEPTIONS
      OTHERS     = 01.

  READ TABLE ltab_fields INDEX 1.

  IF ltab_fields-fieldvalue IS INITIAL.
 "   MESSAGE 'No City Selected' TYPE 'E'.
  ELSE.
    SELECT GROUPFEE FEE_NUMBER FEE
    FROM ZFICA_CATALOG
    INTO TABLE it_fee
    WHERE CITY_NAME = ltab_fields-fieldvalue.
    SORT it_fee ASCENDING.
    DELETE ADJACENT DUPLICATES FROM it_fee.
* Pass which field in the internal table should be passed in retfield
* Pass which screen field should have selected internal table field
* value in dynprofield
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        retfield        = 'FEE_NUMBER'
        dynpprog        = sy-cprog
        dynpnr          = sy-dynnr
        dynprofield     = 'FEE'
        value_org       = 'S'
      TABLES
        value_tab       = it_fee
      EXCEPTIONS
        parameter_error = 1
        no_values_found = 2
        OTHERS          = 3.
  ENDIF.

endform.                    " SHOW_FEE

I think this code will help you.

It's by city which selected,gets relevant fees in other field to the selected city

Best Regards

Yossi Rozenberg

Read only

Former Member
0 Likes
783

Hi Yossi Rozenberg

That part already done by me here actually i am getting the one popup but shouldn't come . It simply fill the values in second subscreen field and display based my selection ex ZDDC relevent bill number.

Here my code is

module GET_VALUES input. <<<<<---- this part is done in the PAI of the my screen.

DATA: ltab_fields LIKE dynpread OCCURS 0 WITH HEADER LINE.

data:fld(4) type C.

FLD = NAT_SCH."+0(4).

if nat_sch+0(4) IS NOT INITIAL AND FLD = 'ZDDC'.

DATA:REG2(3) TYPE C.

DATA:REG3(3) TYPE C.

CLEAR:it_zddc1 , it_zddc1[].

if FLD = 'ZDDC'.

reg3 = REGIO-LOW .

LOOP AT REGIO.

CONCATENATE '0' REGIO-LOW INTO REG2.

REGIO-LOW = REG2.

MODIFY REGIO.

ENDLOOP.

select zrb_refno from zrb_crhdr

into table it_zddc1

where bukrs in bukrs and

vkorg in vkorg and

spart in spart and

regio in regio and

werks = werks and

kunnr in kunnr and

prctr in prctr

.

LOOP AT REGIO.

REGIO-LOW = REG3.

MODIFY REGIO.

ENDLOOP.

ENDIF.

endif.

ltab_fields-fieldname = 'FLD'.

APPEND ltab_fields.

  • Call Dynpro read FM

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = ltab_fields

EXCEPTIONS

OTHERS = 01.

READ TABLE ltab_fields INDEX 1.

.

SET CURSOR FIELD BIL_NUMB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BILL_NUM'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'BIL_NUM'

value_org = 'S'

TABLES

value_tab = it_zddc1

EXCEPTIONS

OTHERS = 0.

Read only

Former Member
0 Likes
783

Hi,

In the PBO of the subscreen call the below fm.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = ltab_fields

EXCEPTIONS

OTHERS = 01.

then read the relevalant field in Subscreen 1 is populated by reading itab_fields internal table.

If the value is allready entered then move the value of the particular field in Subacreen 2. Don use another FM IF_F4 you will get popup if you use.

Regards,

Shanmugavel Chandrasekaran

Read only

Former Member
0 Likes
783

Hi Friends

Thnaks for response, but i have problem . i have created one module in the PBO of my main screen 1000(The reqiured field existed in the subscreen 2 .when executing first time is is showing no values found on the status bar. that is correct .After passed the my value in sub screen 1. Then it is not automatically filling the data in sub screen2 filed. it is showing one popup every time by pressing the enter after selecting values the cursor not going to the second subscreen pleas help me

REgards

Ravi