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

Process on value-request

Former Member
0 Likes
17,454

Hi,

Can anyone tell me how to use POV event in dialog programming?I have to add F4 help for 2 date fields in one of the screens.

6 REPLIES 6
Read only

Former Member
6,548

process ON VALUE-REQUEST.

FIELD LIFNR MODULE F4HELP.

inside module.

DATA : BEGIN OF T_LIFNR OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

END OF T_LIFNR.

SELECT LIFNR FROM WYT3

INTO TABLE T_LIFNR WHERE PARVW = 'OR'.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'LIFNR'

dynprofield = 'LIFNR'

dynpprog = 'SAPLCOKO1'

dynpnr = '0115'

value_org = 'S'

tables

value_tab = T_LIFNR.

Read only

0 Likes
6,548

Hi Hari,

I have implemented this logic in my program.But in the drop down box I am getting all zeros like 00.00.0000.What would be the reason?

Read only

Former Member
0 Likes
6,548

Hi Hema,

POV : This is triggered when user clicks F4 function key (for listing all possible values for the field).

You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.

PROCESS ON VALUE-REQUEST.

...

FIELD <f> MODULE <mod>.

Check the below link for sample code.

http://www.sap-basis-abap.com/abap/code-for-f4-in-dialog-program.htm

Reward if found helpfull,

Cheers,

Chaitanya.

Read only

Former Member
0 Likes
6,548

Hi,

See u want to date fields means better u can call the system variable itself..It will automatically give the search help..

If u want to display on ur own means use the following any one of the function modules..

reward IF useful

-


form searchs.

select carrier dept_code into table itab from

zdepment_e0220.

call function 'POPUP_WITH_TABLE_DISPLAY'

exporting

endpos_col = 100

endpos_row = 20

startpos_col = 60

startpos_row = 10

titletext = 'DEPARTMENT DETAILS'

importing

choise = choice

tables

valuetab = itab

exceptions

break_off = 1

others = 2.

read table itab index choice.

if sy-subrc = 0.

  • ZMCARSEM_41_01-RTYPE = ITAB_SEARCH-BSART.

test1 = itab-carrier.

endif.

endform. "SEARCHS

-


DATA : RET_TAB TYPE TABLE OF DDSHRETVAL WITH HEADER LINE.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'BUKRS'

DYNPROFIELD = 'BUKRS'

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

VALUE_ORG = 'S'

TABLES

VALUE_TAB = HELP_ITEM

RETURN_TAB = RET_TAB.

Read only

Former Member
0 Likes
6,548

Hi,

You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.

PROCESS ON VALUE-REQUEST.

...

FIELD <f> MODULE <mod>.

...

After the PROCESS ON VALUE-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F4 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. The module <mod> is defined in the ABAP program like a normal PAI module. However, the contents of the screen field <f> are not available, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. You can now program your own value lists in the module. However, this procedure is only recommended if it really is not possible to use a search help. Defining search helps is much easier than PROCESS ON VALUE-REQUEST, since the system takes over some of the standard operations, such as getting field contents from the screen. It also ensures that the F4 help has a uniform look and feel throughout the system. Furthermore, it means that you do not have to reassign input help to fields on each screen.

F4IF_FIELD_VALUE_REQUEST

Calls the input help of the ABAP Dictionary dynamically. You can pass the component names of a structure or database table of the ABAP Dictionary to the function module in the import parameters TABNAME and FIELDNAME. The function module starts the ABAP Dictionary input help for this component. All of the relevant screen fields are read. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the user’s selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.

F4IF_INT_TABLE_VALUE_REQUEST

This function module displays a value list that you created in an ABAP program. The value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the user’s selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.

There are also two function modules - DYNP_VALUES_READ and DYNP_VALUES_UPDATE - that can read the values of screen fields and return values to them during the POV event. For further information, refer to the relevant function module documentation.

Input help in dialog modules

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_CARRIER INPUT.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

TABNAME = 'DEMOF4HELP'

FIELDNAME = 'CARRIER1'

DYNPPROG = PROGNAME

DYNPNR = DYNNUM

DYNPROFIELD = 'CARRIER'.

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.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
6,548

I think there is no nedd of this event for search help on a date field.

DATA:BEGIN OF ST_HEADER,

BUDAT LIKE MKPF-BUDAT,

END OF ST_HEADER.

in the properties box of that field

give name = ST_HEADER-BUDAT

give DICT->format = dats

Program = check input field, give possible entries as 1.

this is enopugh to acheive u r thread..

any queries revert