‎2020 Feb 28 5:48 AM
Input Parameters for House bank and Account ID business want description.
Table - T012T
House bank - HBKID + Text1
Account ID + Text1
Suppose there is Account ID input parameter and at runtime for search help we want the account Id data plus description of it which means two fields in one input parameter
‎2020 Feb 28 6:22 AM
Hi Nidhi,
If I have understood your question correctly. You would like to get F4 help for two fields 1) House bank (HBKID) and Account ID (HKTID). For both the fields you would like to have T012T-TEXT1 along with HBKID or HKTID.
If so follow the below steps for your requirement, ( I have shown for HBKID, follow the same approach for other filed too)
SELECT HBKID,
TEXT1,
FROM T012T
INTO TABLE @DATA(lt_houbk_f4).
IF NOT lt_houbk_f4[] IS INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'HBKID'
dynpprog = sy-repid
dynpnr = '1000'
dynprofield = 'S_HBKID' ( Considering this Select option name )
value_org = 'S'
TABLES
value_tab = lt_houbk_f4
return_tab = lt_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF lt_return[] IS NOT INITIAL.
READ lt_return INTO DATA(ls_return) INDEX 1.
IF sy-subrc = 0.
s_auskt-low = ls_return-fieldval.
ENDIF.
ENDIF.
ENDIF.
‎2020 Feb 28 6:22 AM
Hi Nidhi,
If I have understood your question correctly. You would like to get F4 help for two fields 1) House bank (HBKID) and Account ID (HKTID). For both the fields you would like to have T012T-TEXT1 along with HBKID or HKTID.
If so follow the below steps for your requirement, ( I have shown for HBKID, follow the same approach for other filed too)
SELECT HBKID,
TEXT1,
FROM T012T
INTO TABLE @DATA(lt_houbk_f4).
IF NOT lt_houbk_f4[] IS INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'HBKID'
dynpprog = sy-repid
dynpnr = '1000'
dynprofield = 'S_HBKID' ( Considering this Select option name )
value_org = 'S'
TABLES
value_tab = lt_houbk_f4
return_tab = lt_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF lt_return[] IS NOT INITIAL.
READ lt_return INTO DATA(ls_return) INDEX 1.
IF sy-subrc = 0.
s_auskt-low = ls_return-fieldval.
ENDIF.
ENDIF.
ENDIF.
‎2020 Feb 28 6:25 AM
but what if the two fields are from two different tables?
‎2020 Feb 28 6:45 AM
If you check Table T012T, the used search help for field H_T012K for field HKTID with the possible input parameters BUKRS, HBKID and HKTID does this already for you giving also the TEXT1 as output.
So, in case you have created a Z-Report, you need to use the above search help to help choose the right account id.
1. As a PARAMETER:
PARAMETERS pa_acc TYPE hktid MATCHCODE OBJECT H_T012K.2. As a SELECT-OPTIONS:
TABLES t012t.
SELECT-OPTIONS so_acc FOR t012t-hktid.
3. If you need the BUKRS and HBKID also automatically filled by the choice of the account:
TABLES t012t.
SELECT-OPTIONS so_buk for t012t-bukrs. " NO-EXTENSION NO INTERVALS "NO-DISPLAY.
SELECT-OPTIONS so_bnk for t012t-hbkid. " NO-EXTENSION NO INTERVALS "NO-DISPLAY.
SELECT-OPTIONS so_acc for t012t-hktid. " NO-EXTENSION NO INTERVALS.
You can make the select-options for BUKRS and HBKID either non-visible (option NO-DISPLAY), or with reduced select-options (NO-EXTENSION, NO INTERVALS) or only readable if you dont want the user to mess around with invalid combinations of the three, see the following for coding:
INITIALIZATION.
LOOP AT SCREEN.
IF screen-name CP 'SO_BNK*'
OR screen-name CP 'SO_BUK*'
screen-input = '0'.
MODIFY SCREEN.
EXIT.
ENDIF.
ENDLOOP. Search help H_T012K:

Let me know if this already solves your problem, of whether you have a different setup.
‎2020 Feb 28 6:48 AM
First, prepare an internal table with data from both tables. And the use the FM F4IF_INT_TABLE_VALUE_REQUEST for F4 help.
‎2020 Feb 28 7:19 AM
What means "two fields in one input parameter"?
The key of table T012T is company, bank, account (and language of course), why do you ignore the company as the codes are company-dependent?
‎2020 Feb 28 7:23 AM
Same answer as Michael, but saying it simply with code and without explanation. NB: if you prefer to do it in a complex way, use F4IF_INT_TABLE_VALUE_REQUEST.
PARAMETERS bukrs TYPE t012t-bukrs.
PARAMETERS hbkid TYPE t012t-hbkid.
PARAMETERS hktid TYPE t012t-hktid.Nothing else.
Run it, press F4 no HKTID field, choose and the selected line will fill all input fields :
