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

Problem with F4 help for parameter on selection screen.

Former Member
0 Likes
3,769

Hi all,

i am makin F4 help for paramete on selection screen and i am able to see the pop-up window when i press F4 but problem is that i am not able to see the entries on Pop-up screen?

regards

Hi all,

i am makin F4 help for paramete on selection screen and i am able to see the pop-up window when i press F4 but problem is that i am not able to see the entries on Pop-up screen?

regards

12 REPLIES 12
Read only

Former Member
0 Likes
2,414

please see my code and tell me where i m wrong...

code.

PARAMETERS : p_stat(1) type c.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_stat.

PERFORM f4_help.

FORM F4_HELP .

lwa_stat-stat = 'S'.

APPEND lwa_stat to lt_stat.

clear : lwa_stat.

lwa_stat-stat = 'E'.

APPEND lwa_stat to lt_stat.

clear : lwa_stat.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'P_STAT'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'P_STAT'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = lt_stat.

IF SY-SUBRC <> 0.

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

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

ENDIF.

ENDFORM. " F4_HELP

regards.

Read only

Former Member
0 Likes
2,414

Hi ,

give it in at selection screen and call the fn module 'F4IF_INT_TABLE_VALUE_REQUEST'

eg)

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_test.

then populate the f4 values in internal table and pass it to 'F4IF_INT_TABLE_VALUE_REQUEST'

Read only

Former Member
0 Likes
2,414

hi,

parameter : p_stat1(1) type c.

data : begin of t_stat,

p_stat(1) type c,

end of t_stat.

data : it_stat type table of t_stat ,

lwa_stat type t_stat.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_stat1.

lwa_stat-stat = 'S'.

APPEND lwa_stat to lt_stat.

clear : lwa_stat.

lwa_stat-stat = 'E'.

APPEND lwa_stat to lt_stat.

clear : lwa_stat.

rest all is same.

thanks

shivraj

Edited by: ShivrajSinha on Feb 10, 2010 5:49 AM

Edited by: ShivrajSinha on Feb 10, 2010 5:51 AM

Read only

Former Member
0 Likes
2,414

In Fn Module give

RETFIELD = 'internal table field name'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'internal table field name'

Read only

Former Member
0 Likes
2,414

Use 'F4IF_INT_TABLE_VALUE_REQUEST' for F4 HELP.

Get all the entries that need to be displayed in the f4 help into an internal table and pass this to value_tab in 'F4IF_INT_TABLE_VALUE_REQUEST'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'FIELD NAME'

  • window_title = text-c01

value_org = 'S'

multiple_choice = 'X'

callback_program = sy-cprog

TABLES

value_tab = it_table

return_tab = it_return_tab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Now loop on the it_return_tab and pass this FIELD VAL to the selection screen optioon.(here parameter)

IF sy-subrc IS INITIAL.

IF it_return_tab[] IS INITIAL.

EXIT.

ELSE.

SORT it_return_tab BY fieldval DESCENDING.

LOOP AT it_return_tab.

field-low = it_return_tab-fieldval. " field is the select option here.in ur case it is the parameter name

field_class-option = 'EQ'.

field-sign = 'I'.

field-high = space.

APPEND field.

ENDLOOP.

ENDIF.

SORT field BY low.

Read only

Former Member
0 Likes
2,414

hi look to the following eg

DATA:BEGIN OF IT_SHIFT OCCURS 0,

KAPTPROG LIKE TC37A-KAPTPROG,

END OF IT_SHIFT.

PARAMETERS : P_SHIFT LIKE TC37A-KAPTPROG .

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SHIFT.

PERFORM SHIFT_CHECK.

FORM SHIFT_CHECK .

SELECT KAPTPROG

FROM TC37A

INTO IT_SHIFT

WHERE SCHGRUP = '42'.

APPEND IT_SHIFT.

CLEAR IT_SHIFT.

ENDSELECT.

SORT IT_SHIFT BY KAPTPROG.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'KAPTPROG'

DYNPPROG = PROGNAME

DYNPNR = DYNNUM

DYNPROFIELD = 'KAPTPROG'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_SHIFT

RETURN_TAB = RETURN_TAB

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

IF SY-SUBRC = 0.

READ TABLE RETURN_TAB INDEX 1.

P_SHIFT = RETURN_TAB-FIELDVAL.

ELSE.

P_SHIFT = SPACE.

ENDIF.

ENDFORM. " SHIFT_CHECK

Note: you have missed RETURN_TAB-FIELDVAL.

Edited by: sathish subburaj on Feb 10, 2010 6:05 AM

Read only

Former Member
0 Likes
2,414

Hi all,

thanx for reply....still didn't get the required reply...

i wrote the code :

PARAMETERS : p_stat(1) type c.

TYPES : BEGIN OF gst_stat,

stat(1) type c,

END OF gst_stat.

data : lt_stat TYPE TABLE OF gst_stat.

DATA : lwa_stat type gst_stat.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_stat.

PERFORM f4_help.

FORM F4_HELP .

lwa_stat-stat = 'S'.

APPEND lwa_stat to lt_stat.

clear : lwa_stat.

lwa_stat-stat = 'E'.

APPEND lwa_stat to lt_stat.

clear : lwa_stat.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'P_STAT'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'P_STAT'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = lt_stat.

IF SY-SUBRC 0.

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

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

ENDIF.

ENDFORM. " F4_HELP

please help.

Read only

Former Member
0 Likes
2,414

Hello,

If you are using the FM F4IF_INT_TABLE_VALUE_REQUEST for F4 help, make sure you are passing the values to the following parameters in the FM

RETFIELD = name of the field where data is stored in the table

DYNPROG = sy-repid

DYNPR = sy-dynnr

DYNPROFIELD = name of the parameter on the selection screen

VALUE_ORG = 'S'

VALUE_TAB = name of the internal table holding data.

Also make sure that the internal table is not empty.

Call this FM in the event At selection-screen on value-request for <name of the parameter>

Hope this helps in resolving your issue.

In your code try replacing P_STAT with STAT (name of the field in the internal table) in the RETFIELD parameter of the FM.

Regards,

Sachin

Edited by: Sachin Dargan on Feb 10, 2010 6:11 AM

Read only

Former Member
0 Likes
2,414

ALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'P_STAT' -


>change this to STAT

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'P_STAT'

beacuse u have to give the internal table field name here

Edited by: ShivrajSinha on Feb 10, 2010 6:13 AM

Read only

Former Member
0 Likes
2,414

Hi,

Change the RETFIELD = 'STAT' in the import parameter of the function module.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
  RETFIELD    = 'STAT'
  DYNPPROG    = sy-repid
  DYNPNR      = sy-dynnr
  DYNPROFIELD = 'P_STAT'
  VALUE_ORG   = 'S'
TABLES
  VALUE_TAB   = lt_stat.

If this is also not working, then you would have made some changes in the internal table structure or field name to disturb the initally written code. So you have to do the following..

1. Delete the internal table, work area declaration and Call function

2. Replace the same with new internal table name and work area name as given below.

DATA: BEGIN OF it_status OCCURS 0,
       status TYPE c,
      END OF it_status.

DATA: wa_status LIKE LINE OF it_status.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_stat.
  PERFORM f4_help.

FORM F4_HELP .

  CLEAR: it_status[], wa_status.

  wa_status-status = 'S'.
  APPEND wa_status to it_status.
  clear : wa_status.

  wa_status-status = 'E'.
  APPEND wa_status to it_status.
  clear : wa_status.


CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
  RETFIELD    = 'STATUS'
  DYNPPROG    = sy-repid
  DYNPNR      = sy-dynnr
  DYNPROFIELD = 'P_STAT'
  VALUE_ORG   = 'S'
TABLES
  VALUE_TAB   = it_status.

This is the strange error in SAP, I came accross..

Read only

Former Member
0 Likes
2,414

hi,

you have populated the required values but you have not passed the RETURN_TAB value in the function module.

so that the required values for F4 is not displayed in the parameter .

and more over in fn module change

RETFIELD = 'internal table field name'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'internal table field name'

check the above eg coding which i have given.

Edited by: sathish subburaj on Feb 10, 2010 6:22 AM

Edited by: sathish subburaj on Feb 10, 2010 6:22 AM

Read only

Former Member
0 Likes
2,414

PARAMETERS : p_stat(1) type c.

TYPES : BEGIN OF gst_stat,

stat(1) type c,

END OF gst_stat.

data : lt_stat TYPE TABLE OF gst_stat.

DATA : lwa_stat type gst_stat.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_stat.

PERFORM f4_help.

FORM F4_HELP .

lwa_stat-stat = 'S'.

APPEND lwa_stat to lt_stat.

clear : lwa_stat.

lwa_stat-stat = 'E'.

APPEND lwa_stat to lt_stat.

clear : lwa_stat.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'P_STAT'

DYNPROFIELD = 'P_STAT'

VALUE_ORG = 'S'

MULTIPLE_CHOICE = 'X'

callback_program = sy-cprog

TABLES

VALUE_TAB = lt_stat.

return_tab = it_return_tab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc IS INITIAL.

IF it_return_tab[] IS INITIAL.

EXIT.

ELSE.

REFRESH dy_class.

SORT it_return_tab BY fieldval DESCENDING.

PASS THE VALUES TO SELECT OPTION AS MENTIONED ABOVE.

ENDIF.

SORT P_STAT BY low.

ENDIF.

ENDIF.

please help.