03-10-2011 6:01 AM
Hello,
I am trying to select the F4 values and populate in the table control 2 fields.
I have defined the it_act_code as .
types: begin of ty_value_tab,
code like zpp_code-code,
sub_code like zpp_code-sub_code,
.....
....
end of value_tab.
Data: it_act_code type standard table of ty_value_tab.
DATA: h_dselc like dselc occurs 0 with header line,
h_field_tab like dfies occurs 0 with header line,
h_field_wa LIKe dfies.
refresh h_dselc.
h_dselc-fldname = 'code'.
h_dselc-dyfldname = 'tablecontrol-field 1'.
APPEND h_dselc.
h_dselc-fldname = 'subcode'.
h_dselc-dyfldname = 'tablecontrol-field 2'.
APPEND h_dselc.
Using select query i have selected all the values in it_act_code.
Call function 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'code'
dynpprog = 'zpgm1'
dynpnr = '100'
dynprofield = 'field1'
value_org = 'S'
TABLES
value_tab = it_act_code
field_tab = h_field_tab
return_tab = it_return
DYNPFLD_MAPPING = h_dselc
EXCEPTIONS
When i execute the FM only first value is populated in the table control, i want the subcode also gets copied
in the table . I have used the DYNPFLD_MAPPING still it is not copying in the table control fields.
Should i have to mention fieldtab for this or ?.
thanks,
kevin
03-10-2011 6:07 AM
You have to also pass the fieldtab .
e.g ls_loto-fldname = 'CARRID'.
ls_loto-dyfldname = 'ABC'.
APPEND ls_loto to loto.
CLEAR ls_loto.
ls_loto-fldname = 'CONNID'.
ls_loto-dyfldname = 'ABCD'.
APPEND ls_loto to loto.
03-10-2011 8:32 AM
Hello Sandeep,
I have provided the following still it is not populating , now F4 popup is not coming up.
h_field_wa-fieldname = 'CODE'.
h_field_wa-lfieldname = 'CODE'.
move h_field_wa to h_field_tab.
APPEND h_field_tab.
clear h_field_wa.
h_field_wa-fieldname = 'SUBACT_CODE'.
h_field_wa-lfieldname = 'SUBACT_CODE'.
move h_field_wa to h_field_tab.
Regards,
kevin
03-10-2011 8:47 AM
Are you moving the fields to control table fields .
e.g.
READ TABLE lt_return INDEX 1.
WRITE lt_return-fieldval TO p_loekz.
03-10-2011 8:55 AM
Now the F4 popup is not coming up . Can you explain
in the fieldtab , it should give the value_tab fieldname or ? .
thanks
kevin
03-10-2011 8:59 AM
03-10-2011 9:19 AM
refresh h_field_tab.
h_field_wa-fieldname = 'it_act_code-code'.
h_field_wa-lfieldname = 'it_act_code -code'.
move h_field_wa to h_field_tab.
APPEND h_field_tab.
clear h_field_wa.
h_field_wa-fieldname = 'it_act_code -sub_code'.
h_field_wa-lfieldname = 'it_act_code -sub_code '.
move h_field_wa to h_field_tab.
APPEND h_field_tab.
clear h_field_wa.
if it_act_code[] is not initial.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'code'
dynpprog = 'pgm1'
dynpnr = '100'
dynprofield = 'field1'
value_org = 'S'
TABLES
value_tab = it_act_code
field_tab = h_field_tab
return_tab = it_return
DYNPFLD_MAPPING = h_dselc
EXCEPTIONS
parameter_error = 1
no_values_found = 2
others = 3.
read table it_return into ls_return index 1.
Now it is giving dump , assign_length_0