‎2006 Jul 31 3:08 PM
I have an internal table which has three fields. for example,
Table name | filed | Value
vbap | matkl | 62
mara | matnr | 1000000023
kna1 | kvgr2 | 04
I want to find out the description of the value filed. Means what is mean by 62 for material group( matkl). IS there any function module for this? or any easy way to find out? please help me
‎2006 Jul 31 3:10 PM
Use FM DDIF_FIELDINFO_GET.
report zrich_0001.
data: idfies type table of dfies with header line.
clear idfies. refresh idfies.
call function 'DDIF_FIELDINFO_GET'
exporting
tabname = 'VBAP'
fieldname = 'MATKL'
tables
dfies_tab = idfies.
read table idfies index 1.
if sy-subrc = 0.
write:/ idfies-fieldtext.
endif.Regards,
Rich Heilman
‎2006 Jul 31 3:10 PM
Use FM DDIF_FIELDINFO_GET.
report zrich_0001.
data: idfies type table of dfies with header line.
clear idfies. refresh idfies.
call function 'DDIF_FIELDINFO_GET'
exporting
tabname = 'VBAP'
fieldname = 'MATKL'
tables
dfies_tab = idfies.
read table idfies index 1.
if sy-subrc = 0.
write:/ idfies-fieldtext.
endif.Regards,
Rich Heilman
‎2006 Jul 31 3:19 PM
This function module gives me what is VBAP-MATKL, But I need what is 62 for MATKL
‎2006 Jul 31 3:21 PM
‎2006 Jul 31 3:24 PM
for me it is not only vbap and matkl it may be any table and any filed.
‎2006 Jul 31 3:26 PM
For a given material group, you can get the description from <b>T023T</b>.
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Jul 31 3:36 PM
Maybe you can use some of this code to find the text table that you need to read, then maybe read it dynamically. Not all text tables are set up with the same fields, this would be a problem.
report zrich_0001.
data: xchecktable type dd08v-tabname .
data: xtexttable type dd08v-tabname.
data: idfies type table of dfies with header line.
parameters: p_tab type ddobjname,
p_fld type dfies-fieldname.
call function 'DDIF_FIELDINFO_GET'
exporting
tabname = p_tab
fieldname = p_fld
tables
dfies_tab = idfies.
read table idfies index 1.
if sy-subrc = 0.
xchecktable = idfies-checktable.
endif.
call function 'DDUT_TEXTTABLE_GET'
exporting
tabname = xchecktable
importing
texttable = xtexttable.
write:/ p_tab,
/ p_fld.
write:/ xchecktable.
write:/ xtexttable.
Regards,
Rich Heilman
‎2006 Jul 31 3:37 PM
There are some functions modules to get material group descriptions (like T023T_SINGLE_READ, /SAPNEA/SMAPI_MAT_GRP_GETLIST, and others), but a SELECT SINGLE from T023T seems to be the easiest and fastest approach.
‎2006 Jul 31 5:14 PM
‎2006 Jul 31 3:18 PM
I don't think there is any standard function module to get the description of the material group, you just need to get that from the master table of the material group (Text table for material group).
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Jul 31 3:18 PM
‎2006 Jul 31 3:25 PM
Hi,
*Validation for Material Group - MATKL
SELECT SINGLE matkl INTO lws_matkl FROM t023
WHERE matkl = '193891'.
IF sy-subrc <> 0.
ENDIF.
Regards,
Prakash.