‎2013 Feb 02 1:57 PM
Hi All,
I am creating a module pool program. i have two fields in the screen and need to have F4 help only for the first field.
the hitlist of the F4 help will have two fields(the fields which are in the screen). when the user selects the data
from hitlist then the first field of hitlist should be populated to the first field of the screen and second field of the
hitlist should be populated to the second field of the screen. I can use the function module
"F4IF_INT_TABLE_VALUE_REQUEST" to display the hitlist( hitlist containing both the fields in the screen)
of the first field and populate the first field, but how can i automatically populate the second field with the data from
the hitlist of the 1st fields F4 help.
Thanks in advance.
Mohanarangan.
‎2013 Feb 02 4:12 PM
Consider you have two fields field1 and field2 in the screen.
On F4 of field1 you have a pop up having two fields which u got using "F4IF_INT_TABLE_VALUE_REQUEST" function module.
you must have passed data using some internal table into the VALUE_TAB of the below code.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD =
TABLES
VALUE_TAB = it_f4_values.
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Lets name the internal table as it_F4_values which has two fields.
it_F4_values internal table:
Field1 field2
AU Australia
IN India
**************************************************
so now write in ur code.
AT SELECTION SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'FIELD1'.
lv_field1_value = FIELD1.
" if the internal table contains unique values go for read statement...
READ TABLE it_f4_values into wa_f4_values with table key field1 = lv_field1_value.
FIELD2 = wa_f4_values-field2.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
So in the output if you select AU in field1 then australia will come in field2 automatically.
Try this and let us know if this solution is useful.
Thanks and regards,
Bharathi
‎2013 Feb 02 7:20 PM
Hi
you have to create 2 elementary search help in se11. both search help are same structure.
in these 2 search helps, 2 fields are present which is your module pool input field.
jst example, one is matnr and another is mtart. these 2 fields are also present in module pool screen.
ZS1-> search help where matnr is only export parameter.
ZS2-> search help where mtart is only export parameter.
in module pool, double click on matnr (Screen field). open a pop up where you assign ZS1 in search help field.
double click on mtart (Screen field). open a pop up where you assign ZS2 in search help field.
Hope your problem will be solved......follow this. if any problem then let me know.....
‎2013 Feb 03 8:52 AM
Hi Mohanarangan ,
When you use FM F4IF_INT_TABLE_VALUE_REQUEST there is an EXPORTING field DYNPROFIELD ,
this field is the dynpro field which is to be populated with the value clicked by the user from the hit list popped up.
So you can see that it can be provided with only one value(i.e you first field for which you have written POH).
Now to solve your query I can suggest you with doing IMPLICIT ENHANCEMENT on the program
LSDSDF01 ( Which is an INCLUDE program inside SAPLSDSD ).
This program comes into action as soon as the user clicks the value from the hit list proposed.
Now add code in LSDSDF01 at below shown point .
And append one more row in table dynpfields for the SECOND field.
You can try the same in debugger mode , its works fine in debugging mode.
While appending row provide the value FIELDNAME as that of Second Field and FIELDVALUE you need to fetch according to First field and provide it here.
This may help you out.