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 Help at selection screen

Former Member
0 Likes
1,457

Hi,

Can any one tell me,

I am having two input paramters.

one is material type other is process order.

When i enter the material type ..

then i will enter f4 for processs order,then i need to select process order for that material type ....but here i am not able to capture the value of material type ...when i enter into

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_aufnr-low.

so can any one tell how this can be solved........material type will be blank when i enter into at selection-screen....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,408

Hi,

Check the below code.

tables: t001k.

  • For Identification Number

DATA: BEGIN OF it_bwkey OCCURS 0,

bwkey LIKE t001k-bwkey,

END OF it_bwkey.

data: v_bukrs(4).

  • For Run date

DATA: BEGIN OF it_bukrs OCCURS 0,

bukrs LIKE t001k-bukrs,

END OF it_bukrs.

DATA it_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE.

SELECTION-SCREEN: BEGIN OF BLOCK main WITH FRAME TITLE text-001.

SELECTION-SCREEN SKIP.

PARAMETERS: p_bukrs(4) TYPE c.

SELECT-OPTIONS s_bwkey FOR t001k-bwkey NO INTERVALS.

SELECTION-SCREEN END OF BLOCK main.

*----


  • Validation Section

*----


INITIALIZATION.

SELECT DISTINCT bukrs FROM t001k INTO TABLE it_bukrs.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BUKRS'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'P_BUKRS'

value_org = 'S'

TABLES

value_tab = it_bukrs

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.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bwkey-low.

TABLES: t130r.

DATA: BEGIN OF dynpfields OCCURS 0. "Hilfsstruktur zum auslesen des

INCLUDE STRUCTURE dynpread. "Feldwertes vom Dynpro bei >F4<

DATA: END OF dynpfields.

DATA : sy_repid LIKE sy-repid,

sy_dynnr LIKE sy-dynnr.

CLEAR dynpfields.

REFRESH dynpfields.

dynpfields-fieldname = 'P_BUKRS'.

APPEND dynpfields.

    • Lesen des akt. Wertes von Dynpro

sy_repid = sy-repid.

sy_dynnr = sy-dynnr.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy_repid

dynumb = sy_dynnr

TABLES

dynpfields = dynpfields

EXCEPTIONS

OTHERS = 01.

IF sy-subrc = 0.

READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.

IF sy-subrc = 0.

v_bukrs = dynpfields-fieldvalue.

ENDIF.

ENDIF.

SELECT bwkey FROM t001k

INTO TABLE it_bwkey

WHERE bukrs = v_bukrs.

DELETE ADJACENT DUPLICATES FROM it_bwkey.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BWKEY'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_BWKEY'

value_org = 'S'

TABLES

value_tab = it_bwkey

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.

10 REPLIES 10
Read only

Former Member
0 Likes
1,408

Use the following function module

DYNP_VALUES_READ

to read the value of the screen field using which you need to determine the F4 help for it.

Regards

Arun

Read only

Former Member
0 Likes
1,408

hi,

Check out this related thread

Regards,

Santosh

Read only

Former Member
0 Likes
1,408

YOu can make use of the Function Module DYNP_VALUES_READ to read the value of a screen field,

check the demo: DEMO_DYNPRO_F4_HELP_MODULE

Read only

rahul_kamble2
Participant
0 Likes
1,408

Hi ,

Try Function Module 'DYNP_VALUES_READ' (Read screen field values before PAI field transport)

you will be able to capture the values of fields other than you are entering.

Regards,

Rahul

Read only

Former Member
0 Likes
1,408

REPORT DEMO_DYNPRO_F4_HELP_MODULE.

TYPES: BEGIN OF VALUES,

CARRID TYPE SPFLI-CARRID,

CONNID TYPE SPFLI-CONNID,

END OF VALUES.

DATA: CARRIER(3) TYPE C,

CONNECTION(4) TYPE C.

DATA: PROGNAME LIKE SY-REPID,

DYNNUM LIKE SY-DYNNR,

DYNPRO_VALUES TYPE TABLE OF DYNPREAD,

FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,

VALUES_TAB TYPE TABLE OF VALUES.

CALL SCREEN 100.

MODULE INIT OUTPUT.

PROGNAME = SY-REPID.

DYNNUM = SY-DYNNR.

CLEAR: FIELD_VALUE, DYNPRO_VALUES.

FIELD_VALUE-FIELDNAME = 'CARRIER'.

APPEND FIELD_VALUE TO DYNPRO_VALUES.

ENDMODULE.

MODULE CANCEL INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE VALUE_CONNECTION INPUT.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = PROGNAME

DYNUMB = DYNNUM

TRANSLATE_TO_UPPER = 'X'

TABLES

DYNPFIELDS = DYNPRO_VALUES.

READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.

SELECT CARRID CONNID

FROM SPFLI

INTO CORRESPONDING FIELDS OF TABLE VALUES_TAB

WHERE CARRID = FIELD_VALUE-FIELDVALUE.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'CONNID'

DYNPPROG = PROGNAME

DYNPNR = DYNNUM

DYNPROFIELD = 'CONNECTION'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = VALUES_TAB.

ENDMODULE.

The screen flow logic is as follows:

PROCESS BEFORE OUTPUT.

MODULE INIT.

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

PROCESS ON VALUE-REQUEST.

FIELD CONNECTION MODULE VALUE_CONNECTION.

For the Flight number field, the POV module VALUE_CONNECTION is called. The

function module DYNP_VALUE_READ transports the value of the screen field CARRIER into the program. The program then reads the corresponding values from the database table SPFLI into the internal table VALUES_TAB using a SELECT statement, and passes the internal table to F4IF_INT_TABLE_VALUE_REQUEST. This displays the internal table as input help, and places the user’s selection into the screen field CONNECTION.

Have a look at below thread:

I hope it helps.

Best Regards,

Vibha

Please mark all the helpful answers

Read only

0 Likes
1,408

its just report with paramaters not a screen

Read only

Former Member
0 Likes
1,409

Hi,

Check the below code.

tables: t001k.

  • For Identification Number

DATA: BEGIN OF it_bwkey OCCURS 0,

bwkey LIKE t001k-bwkey,

END OF it_bwkey.

data: v_bukrs(4).

  • For Run date

DATA: BEGIN OF it_bukrs OCCURS 0,

bukrs LIKE t001k-bukrs,

END OF it_bukrs.

DATA it_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE.

SELECTION-SCREEN: BEGIN OF BLOCK main WITH FRAME TITLE text-001.

SELECTION-SCREEN SKIP.

PARAMETERS: p_bukrs(4) TYPE c.

SELECT-OPTIONS s_bwkey FOR t001k-bwkey NO INTERVALS.

SELECTION-SCREEN END OF BLOCK main.

*----


  • Validation Section

*----


INITIALIZATION.

SELECT DISTINCT bukrs FROM t001k INTO TABLE it_bukrs.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BUKRS'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'P_BUKRS'

value_org = 'S'

TABLES

value_tab = it_bukrs

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.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bwkey-low.

TABLES: t130r.

DATA: BEGIN OF dynpfields OCCURS 0. "Hilfsstruktur zum auslesen des

INCLUDE STRUCTURE dynpread. "Feldwertes vom Dynpro bei >F4<

DATA: END OF dynpfields.

DATA : sy_repid LIKE sy-repid,

sy_dynnr LIKE sy-dynnr.

CLEAR dynpfields.

REFRESH dynpfields.

dynpfields-fieldname = 'P_BUKRS'.

APPEND dynpfields.

    • Lesen des akt. Wertes von Dynpro

sy_repid = sy-repid.

sy_dynnr = sy-dynnr.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy_repid

dynumb = sy_dynnr

TABLES

dynpfields = dynpfields

EXCEPTIONS

OTHERS = 01.

IF sy-subrc = 0.

READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.

IF sy-subrc = 0.

v_bukrs = dynpfields-fieldvalue.

ENDIF.

ENDIF.

SELECT bwkey FROM t001k

INTO TABLE it_bwkey

WHERE bukrs = v_bukrs.

DELETE ADJACENT DUPLICATES FROM it_bwkey.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BWKEY'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_BWKEY'

value_org = 'S'

TABLES

value_tab = it_bwkey

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.

Read only

Former Member
0 Likes
1,408

Hi,

Please refer the example code below:


DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_WERKS-LOW.
SELECT WERKS NAME1 INTO CORRESPONDING FIELDS OF TABLE KUNNSO_ITAB FROM T001W.

DELETE ADJACENT DUPLICATES FROM KUNNSO_ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'WERKS'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_WERKS'
VALUE_ORG = 'S'
multiple_choice = 'X'
TABLES
VALUE_TAB = KUNNSO_ITAB
return_tab = return.

IF SY-SUBRC 0.
SORT return BY fieldval DESCENDING.

LOOP AT return.
S_WERKS-low = return-fieldval.
S_WERKS-option = 'EQ'.
S_WERKS-sign = 'I'.
S_WERKS-high = space.
APPEND S_WERKS.
ENDLOOP.

SORT S_WERKS BY low.
ENDIF.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
1,408

Hi,

Use this function module:

REFRESH FIELDTAB.

FIELDTAB-FIELDNAME = 'XADIR-LOW' .

APPEND FIELDTAB.

D020S-PROG = SY-REPID.

D020S-DNUM = SY-DYNNR.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = D020S-PROG

DYNUMB = D020S-DNUM

TABLES

DYNPFIELDS = FIELDTAB

EXCEPTIONS

OTHERS = 01.

READ TABLE FIELDTAB INDEX 1.

IF SY-SUBRC EQ 0.

TADIR-DEVCLASS = FIELDTAB-FIELDVALUE.

REFRESH FIELDTAB.

ENDIF.

Regards,

Fernando

Read only

Former Member
0 Likes
1,408

please go through the following code.

REPORT ZUPGRADE_BDC_ABAP1.

TYPE-POOLS VRM.

DATA : IT_DYNPREAD TYPE DYNPREAD OCCURS 0 WITH HEADER LINE,

IT_MAKTX TYPE TABLE OF MAKT WITH HEADER LINE.

DATA LV_MATNR TYPE MARA-MATNR.

DATA VRM_MANAGER TYPE VRM_VALUES.

DATA WA LIKE LINE OF VRM_MANAGER.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

PARAMETERS : P_FIELD1 TYPE MARA-MATNR,

P_FIELD2 TYPE MAKT-MAKTX AS LISTBOX VISIBLE LENGTH 20.

SELECTION-SCREEN END OF BLOCK B1.

AT SELECTION-SCREEN OUTPUT.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'P_FIELD2'

VALUES = VRM_MANAGER

  • EXCEPTIONS

  • ID_ILLEGAL_NAME = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FIELD2.

  • Reads the current matnr value

CALL FUNCTION 'GET_DYNP_VALUE'

EXPORTING

I_FIELD = 'P_FIELD1'

I_REPID = SY-CPROG

I_DYNNR = '1000'

CHANGING

O_VALUE = LV_MATNR.

SELECT * FROM MAKT

INTO TABLE IT_MAKTX

WHERE MATNR = LV_MATNR.

LOOP AT IT_MAKTX.

WA-TEXT = IT_MAKTX-MAKTX.

APPEND WA TO VRM_MANAGER.

ENDLOOP.