Application Development 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: 

A query in module pool

Former Member
0 Kudos

hi all,

I have a query in module pool, my problem is

lets say i have two fields in a screen.

out of which one is a date field and other one is a field which has got F4 help.

When i pick some values from the F4 help i have to populate the date field simaultaneously.

EG: when i pick value 1 from F4 help then i have to pass

the date value to screen as soon as i pick.

Can anybody help me out..

Regards,

Krishnakumar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

The F4 help is a DDIC search help or custom search help in POH event?

9 REPLIES 9

Former Member
0 Kudos

The F4 help is a DDIC search help or custom search help in POH event?

Former Member
0 Kudos

its better to use custom help in POV event for the other field. Similarly populate date field within POV.

former_member188685
Active Contributor
0 Kudos

hi,

check these demo's

<b>DEMO_DYNPRO_F4_HELP_DICTIONARY

DEMO_DYNPRO_F4_HELP_DYNPRO

DEMO_DYNPRO_F4_HELP_MODULE

DEMO_SELECTION_SCREEN_F4 </b>

Regards

vijay

vinod_gunaware2
Active Contributor
0 Kudos

hi

I have done same requirement. just have look into below code

call function 'DYNP_GET_STEPL'

importing

povstepl = step_line

exceptions

stepl_not_found = 1

others = 2.

clear: ltab_fields.

refresh : ltab_fields.

ltab_fields-fieldname = 'ZMM_TABLE-TABNAME'.

ltab_fields-fieldvalue = t_f4_table-tabname.

ltab_fields-stepl = step_line.

append ltab_fields.

ltab_fields-fieldname = 'ZMM_TABLE-FLDNAME'.

ltab_fields-fieldvalue = t_f4_table-fieldname.

ltab_fields-stepl = step_line.

append ltab_fields.

ltab_fields-fieldname = 'ZMM_TABLE-VALUE'.

ltab_fields-fieldvalue = t_f4_table-fieldtext.

ltab_fields-stepl = step_line.

append ltab_fields.

call function 'DYNP_VALUES_UPDATE'

exporting

dyname = lc_dyname

dynumb = lc_dynumb

tables

dynpfields = ltab_fields

exceptions

others = 8.

commit work and wait.

regards

vinod

vinod_gunaware2
Active Contributor
0 Kudos

<b>DYNP_VALUES_READ Reads a screen field DYNP_VALUES_UPDATE Updates a screen field </b>

REPORT ZVV.

tables tcurt.

DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.

PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency

P_LTEXT LIKE TCURT-LTEXT, "Long Text

P_KTEXT LIKE TCURT-KTEXT. "Short Text

*----


*--- Example of updating value of another field on the screen -


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.

CLEAR: DYFIELDS[], DYFIELDS.

*--- select currency

CALL FUNCTION 'HELP_VALUES_GET'

EXPORTING

fieldname = 'WAERS'

tabname = 'TCURT'

IMPORTING

SELECT_VALUE = P_WAERS.

*--- get long text for the selected currency

SELECT SINGLE LTEXT FROM TCURT

INTO DYFIELDS-FIELDVALUE

WHERE SPRAS = SY-LANGU

AND WAERS = P_WAERS.

IF SY-SUBRC <> 0.

CLEAR DYFIELDS-FIELDVALUE.

ENDIF.

*--- update another field

DYFIELDS-FIELDNAME = 'P_LTEXT'.

APPEND DYFIELDS.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

tables

dynpfields = DYFIELDS .

*----


*--- Example of reading value of another field -


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.

*--- read another field

CLEAR: DYFIELDS[], DYFIELDS.

DYFIELDS-FIELDNAME = 'P_WAERS'.

APPEND DYFIELDS.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = DYFIELDS .

READ TABLE DYFIELDS INDEX 1.

*--- get short text and update current field

SELECT SINGLE KTEXT FROM TCURT

INTO P_KTEXT

WHERE SPRAS EQ SY-LANGU

AND WAERS EQ DYFIELDS-FIELDVALUE.

*----


regards

vinod

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check this sample code and kindly reward points by clicking the star on the left of reply,if it helps.

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT.

FIELD s_begru MODULE abc ON INPUT.

Process on value-request.

field s_begru module f4_help.

&----


*& Report ZZZ_JAYTEST1 *

*& *

&----


*& *

*& *

&----


REPORT ZZZ_JAYTEST1 .

tables kna1.

data:

begin of t_values occurs 2,

value like kna1-begru,

end of t_values,

t_return like ddshretval occurs 0 with header line.

data s_begru like kna1-begru.

call screen 9000.

&----


*& Module f4_help INPUT

&----


  • text

----


module f4_help input.

refresh t_values.

t_values = 'PAR*'.

append t_values.

t_values = 'UGG'.

append t_values.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'BEGRU'

value_org = 'S'

tables

value_tab = t_values

return_tab = t_return

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc = 0.

read table t_return index 1.

s_begru = t_return-fieldval.

*Populate the date field also here

endif.

endmodule. " f4_help INPUT

&----


*& Module abc INPUT

&----


  • text

----


module abc input.

read table t_values with key value = s_begru.

if sy-subrc ne 0.

clear s_begru.

endif.

endmodule. " abc INPUT

0 Kudos

Hi all,

The below program requires some user action like pressing the enter button.

My requirement is once you chosse some value from F4 help the value will go to the screen the sanme way simaultaneously the date value should also go to the screen.

The below program is not helping me can you please let me know if you have anyother idea.

regards,

krishna

0 Kudos

This is my code..

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

PROCESS ON VALUE-REQUEST.

FIELD ZACTFLI-CONNID MODULE VALUE_REQUEST.

PROGRAM ZTEST20 .

TABLES ZACTFLI.

DATA : DATE LIKE SY-DATUM.

DATA : BEGIN OF VAL_TAB OCCURS 0,

CONNID LIKE ZACTFLI-CONNID,

END OF VAL_TAB.

DATA : RTAB LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

&----


*& Module VALUE_REQUEST INPUT

&----


  • text

----


module VALUE_REQUEST input.

SELECT CONNID FROM ZACTFLI INTO TABLE VAL_TAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CONNID'

VALUE_ORG = 'S'

tables

value_tab = VAL_TAB

RETURN_TAB = RTAB

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

.

if sy-subrc eq 0.

read table rtab index 1.

ZACTFLI-CONNID = rtab-fieldval.

DATE = SY-DATUM.

endif.

endmodule. " VALUE_REQUEST INPUT

Former Member
0 Kudos

Hello Krishnakumar,

I would suggest u can use the following...

read the internal table retun in the RETURN_TAB which will give the value of the selected field. use the field to read the date value in the table value_tab.

use the following code then to update the field..

declare this on top

data: begin of iitab occurs 0.

include structure dynpread.

data: end of iitab.

clear iitab.

refresh iitab.

iitab-fieldname = <first field name>.

append iitab.

iitab-fieldname = <second field name>'.

append iitab.

read table iitab with key fieldname = '<first fieldname>'.

iitab-fieldvalue = update the value of the first field.

modify iitab transporting fieldvalue where fieldname = '<firsr field name>'.

read table iitab with key fieldname = '<second field name>'.

iitab-fieldvalue = <secodn field value>.

modify iitab transporting fieldvalue where fieldname = '<second field value>'.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = sy-cprog

DYNUMB = sy-dynnr

TABLES

DYNPFIELDS = iitab

  • EXCEPTIONS

  • INVALID_ABAPWORKAREA = 1

  • INVALID_DYNPROFIELD = 2

  • INVALID_DYNPRONAME = 3

  • INVALID_DYNPRONUMMER = 4

  • INVALID_REQUEST = 5

  • NO_FIELDDESCRIPTION = 6

  • UNDEFIND_ERROR = 7

  • OTHERS = 8

.

IF SY-SUBRC <> 0.

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

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

ENDIF.