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

Input Help in Dialog Modules

Former Member
0 Likes
974

HI,

I have to provide F4 help for many fields that are present in tabstrip control(with 5 tabs). I had set the option "Possible entries" in the layout. In the flow logic, I created a module for POV. How would I get the screen element name (i.e., the field) from which F4 was pressed? While debugging, I dont get the field name in SYST and SCREEN table. For each tab, I am thinking of creating of only one module in POV so that I can avoid hardcoding the field name.

You can use DEMO_DYNPRO_F4_HELP_MODULE report in IDES if required.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
926

Hi,

Have u checked the GET CURSOR FIELD

DATA: lv_cur_fld TYPE dynfnam.

GET CURSOR FIELD lv_cursor_field.

lv_cur_fld = lv_cursor_field.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = lv_ret_fld

dynpprog = sy-repid

dynpnr = sy-dynnr "gs_subscreen-screennm

dynprofield = lv_cur_fld "lv_cur_fld

value_org = 'S'

display = 'F' "TRY THIS VALUE

TABLES

value_tab = <lt_ref>

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Try this hop it helps. Here the table name have to be passed dynamically

6 REPLIES 6
Read only

Former Member
0 Likes
927

Hi,

Have u checked the GET CURSOR FIELD

DATA: lv_cur_fld TYPE dynfnam.

GET CURSOR FIELD lv_cursor_field.

lv_cur_fld = lv_cursor_field.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = lv_ret_fld

dynpprog = sy-repid

dynpnr = sy-dynnr "gs_subscreen-screennm

dynprofield = lv_cur_fld "lv_cur_fld

value_org = 'S'

display = 'F' "TRY THIS VALUE

TABLES

value_tab = <lt_ref>

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Try this hop it helps. Here the table name have to be passed dynamically

Read only

SureshRa
Active Participant
0 Likes
926

Hi Satya,

How did you call a single MODULE from POV event? In the PROCESS ON VALUE-REQUEST event, you can only use the MODULE statement as a variant of the FIELD statement. So you need to call a F4 help module for each field separately.

Can you please give your screen flow logic and let me know how you call one POV Module for all fields? If my guess is right, you would be writing as follows:


PROCESS ON VALUE-REQUEST.
FIELD field1 MODULE generic_pov_module.
FIELD field2 MODULE generic_pov_module.
FIELD field3 MODULE generic_pov_module.

and trying to figure out the source field from within the generic_pov_module. It is so funny programming practice. Please call field specific pov modules for each field. May be you could consolidate generic search help logic into a sub-routine and pass the field name from a calling module in ABAP program.

Cheers

Suresh

Read only

Former Member
0 Likes
926

Try this out it worked for me,

Will post in in 3 halves.

1. First half

MODULE help_zterm INPUT. "In POV

PERFORM help_zterm.

ENDMODULE. " HELP_ZTERM INPUT

FORM help_zterm .

DATA: BEGIN OF svbap OCCURS 12,

tabix LIKE sy-tabix,

END OF svbap.

DATA: BEGIN OF xvbap OCCURS 125.

INCLUDE STRUCTURE vbapvb.

DATA: END OF xvbap.

DATA: da_display LIKE ddrefstruc-bool.

DATA: da_value LIKE vbkd-zterm.

DATA: da_dynpro_program LIKE sy-repid.

DATA: da_dynpro_number LIKE sy-dynnr.

DATA: BEGIN OF dynpfield_zterm OCCURS 1.

INCLUDE STRUCTURE dynpread.

DATA: END OF dynpfield_zterm.

da_dynpro_program = sy-repid.

da_dynpro_number = sy-dynnr.

CLEAR dynpfield_zterm.

REFRESH dynpfield_zterm.

MOVE 'ZDEALHD-ZTERM' TO dynpfield_zterm-fieldname. u201DZDEALHD-ZTERM u2013 screen field name

APPEND dynpfield_zterm.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = da_dynpro_program

dynumb = da_dynpro_number

TABLES

dynpfields = dynpfield_zterm

EXCEPTIONS

OTHERS = 11.

IF sy-subrc <> 0.

EXIT.

ELSE.

READ TABLE dynpfield_zterm WITH KEY fieldname =

dynpfield_zterm-fieldname.

ENDIF.

LOOP AT SCREEN.

CHECK screen-name = 'ZDEALHD-ZTERM' AND

screen-input = '0'.

  • DA_DISPLAY = CHARX.

ENDLOOP.

IF dynpfield_zterm-fieldinp EQ space.

  • DA_DISPLAY = CHARX.

ENDIF.

  • Call SD Sales BAdI

DATA: da_line LIKE sy-tabix,

da_core_inactive TYPE xfeld,

wa_svbap LIKE svbap,

wa_xvbap LIKE xvbap.

  • Determining Cursor

CLEAR wa_xvbap.

GET CURSOR LINE da_line.

IF da_line GE 1.

READ TABLE svbap INTO wa_svbap INDEX da_line.

IF sy-subrc = 0.

READ TABLE xvbap INTO wa_xvbap INDEX wa_svbap-tabix.

ENDIF.

ENDIF.

Will send the second one and third one in few seconds.

Edited by: Abhijit Borkar on Jan 7, 2010 9:11 AM

Read only

0 Likes
926

this is second one,.......

IF da_core_inactive IS INITIAL.

CALL FUNCTION 'FI_F4_ZTERM' u201Dyour f4-help function

EXPORTING

i_koart = 'D'

i_zterm = zdealhd-zterm

i_xshow = da_display

IMPORTING

e_zterm = da_value.

ENDIF.

PERFORM dynp_values_update USING sy-repid u201D to update selected value in the screen field

sy-dynnr

'ZDEALHD-ZTERM'

da_value

CHANGING sy-subrc.

zdealhd-zterm = da_value. u201C Assign vale to screen field.

ENDFORM. " HELP_ZTERM

Read only

0 Likes
926

Last one ..........

FORM dynp_values_update USING us_repid

us_dynnr

us_field

us_value

CHANGING ch_subrc.

DATA: da_dynpfield_tab LIKE dynpread OCCURS 0 WITH HEADER LINE,

da_stepl LIKE sy-stepl,

da_repid LIKE d020s-prog,

da_dynnr LIKE d020s-dnum.

ch_subrc = 4.

REFRESH da_dynpfield_tab.

MOVE us_repid TO da_repid.

MOVE us_dynnr TO da_dynnr.

GET CURSOR LINE da_stepl.

MOVE da_stepl TO da_dynpfield_tab-stepl.

MOVE us_field TO da_dynpfield_tab-fieldname.

MOVE us_value TO da_dynpfield_tab-fieldvalue.

APPEND da_dynpfield_tab.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = da_repid

dynumb = da_dynnr

TABLES

dynpfields = da_dynpfield_tab

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 EQ 0.

ch_subrc = 0.

ENDIF.

ENDFORM. " DYNP_VALUES_UPDATE

Hope it helps you,

Regards,

Abhijit G. Borkar

Read only

Former Member
0 Likes
926

Get Cursor helped..