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: 

Showing contents of own internal table in F4 hit list

Former Member
0 Kudos

Hi all,

We have a transaction with some input fields on a screen. There must be an F4 input help on these fields, but not the standard F4 input help. When the user presses F4 he should get a 'hit list' from which he can choose a value (normal F4 behaviour), but the values on the hit list should be taken from an internal table within the program.

Any idea how to do this?

Thanks in advance,

Ioana

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Iona,

There is a standard SAP function module to accomplish this. Program a AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>, where <field> is the field you want your custom input help for.

Then create your internal table and call:

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = <field of internal table to be returned>

dynpprog = <program name>

dynpnr = <screen nr>

dynprofield = <field>

value_org = 'S'

TABLES

value_tab = <your internal table>

EXCEPTIONS

OTHERS = 0.

Regards,

John.

6 REPLIES 6

Former Member
0 Kudos

Hi Iona,

There is a standard SAP function module to accomplish this. Program a AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>, where <field> is the field you want your custom input help for.

Then create your internal table and call:

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = <field of internal table to be returned>

dynpprog = <program name>

dynpnr = <screen nr>

dynprofield = <field>

value_org = 'S'

TABLES

value_tab = <your internal table>

EXCEPTIONS

OTHERS = 0.

Regards,

John.

0 Kudos

Thanks a million, John!

Problem is solved.

0 Kudos

Hi! I am new here, just finished BC400. Could you please help me with elaborating it?

If I start my program as followed:

REPORT ztestkevin_test .

TABLES: t510.

DATA: it_t510 TYPE STANDARD TABLE OF t510,

wa_t510 TYPE t510.

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

PARAMETERS: pa_molga TYPE t510-molga.

SELECT-OPTIONS: pa_trfar FOR wa_t510-trfar,

pa_trfgb FOR wa_t510-trfgb.

PARAMETERS: pa_trfgr LIKE wa_t510-trfgr.

SELECTION-SCREEN END OF BLOCK sbb_blk1.

-


I want to do a F4 against field pa_trfgr based upon what was selected in pa_molga, pa_trfar, and pa_trfgb.

I started with this...

AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_trfgr.

select * from t510 into corresponding fields of wa_t510

where molga = pa_molga,

and trfar = pa_trfar,

and trfgb = pa_trfgb.

insert wa_t510 into table it_t510.

endselect.

Not sure where to go from here. Especially in that parameter field declared above pa_trfgr like wa_t510-trfgr, i don't think that is correct.

0 Kudos

I seems to have gotten it. One question though, how do I auto initizle the keys? I mean, after i enter in values for the first 3 parameters, i have press the enter key and then the F4 will bring me back something, or else it will say no value.

TABLES: t510.

DATA: it_t510 TYPE STANDARD TABLE OF t510,

wa_t510 TYPE t510.

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

PARAMETERS: pa_molga TYPE t510-molga.

SELECT-OPTIONS: pa_trfar FOR wa_t510-trfar,

pa_trfgb FOR wa_t510-trfgb.

PARAMETERS: pa_trfgr(8) TYPE c.

SELECTION-SCREEN END OF BLOCK sbb_blk1.

***********************************************************************

AT SELECTION-SCREEN.

***********************************************************************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_trfgr.

SELECT * FROM t510 INTO CORRESPONDING FIELDS OF wa_t510

WHERE molga = pa_molga

AND trfar IN pa_trfar

AND trfgb IN pa_trfgb.

wa_t510-BETRG = wa_t510-BETRG * '0.01'.

INSERT wa_t510 INTO TABLE it_t510.

ENDSELECT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'TRFGR'

value_org = 'S'

TABLES

value_tab = it_t510

EXCEPTIONS

OTHERS = 0.

0 Kudos

I can't seem to get the 'DYNP_VALUES_READ' function call to work though. The above code works with the F4, can't seem to pick up the data with 'DYNP_VALUES_READ'

Anyone could help me?

0 Kudos

Hi,

For help on 'DYNP_VALUES_READ', please take a look at http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/frameset.htm

See if your code conforms to the code written on the above mentioned page.

Regards