2010 Oct 14 5:54 AM
Hi,
How to return all the column values using the F4IF_INT_TABLE_VALUE_REQUEST?
For example : if the row has 3 columns then after selecting the particular row, the RETURN_TAB internal table should contain all the three column values.
Regards,
Raghu
2010 Oct 14 6:02 AM
Hello Raghu
I assume you are getting a single value in return tab. Make sure that this filed is key filed of your F4 help internal table.
Make use of this field value to read internal table, you will get the remaining values.
2010 Oct 14 6:05 AM
2010 Oct 14 6:11 AM
Hi Raghu
You can make use of RECORDPOS field in return table, which gives line number of the internal table which is selected.
2010 Oct 14 6:17 AM
Even I though the same. but it always returning 1. I dont know where i made the mistake. Can you send the sample code you used?
2010 Oct 14 6:35 AM
Hi,
Try the following...
DATA : it_fields like help_value occurs 1 with header line.
data: begin of w_vbap,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
werks like vbap-werks,
end of w_vbap.
data: i_vbap like w_vbap occurs 0 with header line,
w_fields type help_value,
i_dfies type table of dfies,
i_return_tab type table of ddshretval with header line,
i_field type dfies.
select vbeln posnr werks
from vbap into table i_vbap up to 5 rows.
if sy-subrc = 0.
sort i_vbap by vbeln.
endif.
clear it_fields[] , it_fields.
it_fields-tabname = c_vbap.
it_fields-fieldname = 'VBELN'.
it_fields-selectflag = c_on.
append it_fields.
it_fields-tabname = c_vbap.
it_fields-fieldname = 'POSNR'.
it_fields-selectflag = space.
append it_fields.
it_fields-tabname = c_vbap.
it_fields-fieldname = 'WERKS'.
it_fields-selectflag = space.
append it_fields.
loop at it_fields into w_fields.
i_field-tabname = w_fields-tabname.
i_field-fieldname = w_fields-fieldname.
i_field-keyflag = w_fields-selectflag.
append i_field to i_dfies.
endloop.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'VBELN'
window_title = 'Select'
tables
value_tab = i_vbap
field_tab = i_dfies
return_tab = i_return_tab
exceptions
parameter_error = 1
no_values_found = 2
others = 3
.
read table i_return_tab into w_return_tab index 1.
if sy-subrc = 0.
endif.
Regards,
Srini.
2010 Oct 14 6:44 AM
2010 Oct 14 7:17 AM
hi Raghu ,
This is piece of code in working condition .
try to find out what is issue in your code.
SELECT matnr matkl
FROM mara
INTO TABLE it_matkl
FOR ALL ENTRIES IN it_matnr
WHERE matnr = it_matnr-matnr.
IF it_matkl IS NOT INITIAL.
SELECT matkl wgbez
FROM t023t
INTO TABLE it_desc
FOR ALL ENTRIES IN it_matkl
WHERE matkl = it_matkl-matkl.
ENDIF.
LOOP AT it_mat INTO wa_mat.
READ TABLE it_matkl INTO wa_matkl WITH KEY matnr = wa_mat-matnr.
IF sy-subrc = 0.
MOVE wa_matkl-matkl TO wa_mat-matkl.
MODIFY it_mat FROM wa_mat TRANSPORTING matkl.
READ TABLE it_desc INTO wa_desc WITH KEY matkl = wa_mat-matkl.
MOVE wa_desc-wgbez TO wa_mat-wgbez.
MODIFY it_mat FROM wa_mat TRANSPORTING wgbez.
ENDIF.
ENDLOOP.
SORT it_mat ASCENDING BY matnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
window_title = text-006 "'Article Number'
value_org = 'S'
TABLES
value_tab = it_mat[]
return_tab = it_f4[].
CLEAR wa_f4.
READ TABLE it_f4 INTO wa_f4 INDEX 1.
IF sy-subrc = 0.
so_matnr-low = wa_f4-fieldval.
ENDIF.
CLEAR: wa_f4,it_f4[].
2010 Oct 14 7:44 AM
Hi,
I just want to know whether the RETURN_TAB internal table will contain all the column values? or it will contain only material number? I want to get the all the column values of the internal table.
2010 Oct 14 8:15 AM
Hi Raghu
I tried but recordpos give coloumn number and not the line no.
I have work around solution. Try following code. First coloumn is sr no. You can read your entry based on line no.
Then can play around how to hide this particular column.
types: begin of ty_matnr,
lineno type CSCP_COMP_LVL,
matnr type mara-matnr,
spart type mara-spart,
mtart type mara-mtart,
end of ty_matnr.
data: t_mara type standard table of ty_matnr,
wa_mara type ty_matnr,
RETURN_TAB type standard table of DDSHRETVAL.
select matnr spart mtart from mara into CORRESPONDING FIELDS OF table
t_mara where spart = 'PM'.
if sy-subrc = 0.
loop at t_mara into wa_mara.
wa_mara-lineno = SY-TABIX.
modify t_mara from wa_mara index sy-tabix transporting lineno .
endloop.
endif.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'WA_MARA'
RETFIELD = 'LINENO'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = sy-dynnr
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = 'X'
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
VALUE_TAB = t_mara
FIELD_TAB = fiELD_TAB
RETURN_TAB = RETURN_TAB
DYNPFLD_MAPPING = DYNPFLD_MAPPING
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF SY-SUBRC = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
2010 Oct 14 9:48 AM
hi Raghu,
It will only give u fieldvalue that means MATNR value (in my example).
You wont get the column value .
Thanks and Regards,
Gaurav.
2010 Oct 14 10:33 AM
hi,
For example your internal table have 4 columns, then the return internal table should contain all the four 4 column values
2010 Oct 14 10:41 AM
2010 Oct 14 10:54 AM
2010 Oct 14 10:56 AM
2010 Oct 14 10:58 AM
2010 Oct 14 10:58 AM
2010 Oct 14 11:02 AM
Hi Raghu
Its not working is ok.. But if you can elaboarate the exact issue in the given code we can help you out..
2010 Oct 14 11:56 AM
2010 Oct 14 12:24 PM
2010 Nov 04 6:15 AM