2013 Dec 05 3:53 AM
I have my complete code below my question. If you drop it into a test report and run it you can see what I am looking for.
I am using the above mentioned FM in conjunction with DDIF_FIELDINFO_GET.
If you click on the first parameter, you are given a few columns. As the code is written, for Plant and Storage Location the colums are named for their Heading name. Instead I want the long name of that field. So right now it says Plnt and SLoc. I want the long names of Plant or Storage Location. If you go into the data element and then go into Field Labels you'll see that Heading Label is what is being displayed.
The more I thought about it, I really want to be able to make the column headings that pop up anything I want to call it.
Can this be done? For example, when they choose the Helper button, when the screen pops up with the choices I want to be able to call the column for plant anything I want like Master Plant or something like that. Anything I want for that matter. At the very least I want the top of that column to display the long display label instead of the abbreviated Heading display label.
Here is the code I have now that you can paste into your testing app and run to see what I mean:
Thanks to all of you for your help too.
*&---------------------------------------------------------------------*
*& Report MyTest
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_MyTest.
TABLES: T001L.
parameters: P_PLANT LIKE T001L-WERKS,
P_SLOC LIKE T001L-LGORT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PLANT.
PERFORM f_valuerequest_plant.
FORM f_valuerequest_plant.
DATA: BEGIN OF t_data OCCURS 1,
data(20),
END OF t_data.
data h_field_wa LIKE dfies.
data h_field_tab LIKE dfies occurs 0 with header line.
data h_dselc like dselc occurs 0 with header line.
SELECT * FROM T001L.
t_data = T001L-WERKS.
APPEND t_data.
t_data = T001L-LGORT.
APPEND t_data.
t_data = T001L-LGOBE.
APPEND T_data.
ENDSELECT.
PERFORM f_fieldinfo_get USING 'T001L'
'WERKS'
CHANGING h_field_wa.
APPEND h_field_wa TO h_field_tab.
PERFORM f_fieldinfo_get USING 'T001L'
'LGORT'
CHANGING h_field_wa.
APPEND h_field_wa TO h_field_tab.
PERFORM f_fieldinfo_get USING 'T001L'
'LGOBE'
CHANGING h_field_wa.
APPEND h_field_wa TO h_field_tab.
h_dselc-fldname = 'WERKS'.
h_dselc-dyfldname = 'P_PLANT'.
APPEND h_dselc.
h_dselc-fldname = 'LGORT'.
h_dselc-dyfldname = 'P_SLOC'.
APPEND h_dselc.
DATA: ld_repid LIKE sy-repid.
ld_repid = sy-repid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'P_PLANT'
dynpprog = ld_repid
dynpnr = '1000'
dynprofield = 'P_PLANT'
* multiple_choice = ''
* value_org = 'S'
TABLES
value_tab = t_data "first table
field_tab = h_field_tab "second table
* return_tab = return_tab
DYNPFLD_MAPPING = h_dselc "third table
EXCEPTIONS
OTHERS = 0.
ENDFORM. " f_valuerequest_plant
FORM f_fieldinfo_get USING fu_tabname
fu_fieldname
CHANGING fwa_field_tab.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = fu_tabname
FIELDNAME = fu_fieldname
LFIELDNAME = fu_fieldname
IMPORTING
DFIES_WA = fwa_field_tab
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 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.
ENDFORM. " f_fieldinfo_get
2013 Dec 05 6:46 AM
Hii Richard,
here is your modified code with your desired output.Check it out.
I have brought just little changes and it's working.
TABLES: T001L.
parameters: P_PLANT LIKE T001L-WERKS,
P_SLOC LIKE T001L-LGORT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PLANT.
PERFORM f_valuerequest_plant.
FORM f_valuerequest_plant.
DATA: BEGIN OF t_data OCCURS 1,
data(20),
END OF t_data.
data h_field_wa LIKE dfies.
data h_field_tab LIKE dfies occurs 0 with header line.
data h_dselc like dselc occurs 0 with header line.
SELECT * FROM T001L.
t_data = T001L-WERKS.
APPEND t_data.
t_data = T001L-LGORT.
APPEND t_data.
t_data = T001L-LGOBE.
APPEND T_data.
ENDSELECT.
refresh h_field_tab.
PERFORM f_fieldinfo_get USING 'T001L'
'WERKS'
CHANGING h_field_wa.
h_field_wa-reptext = 'Plant'.
h_field_wa-scrtext_l = 'Plant'.
APPEND h_field_wa TO h_field_tab.
CLEAR h_field_wa.
PERFORM f_fieldinfo_get USING 'T001L'
'LGORT'
CHANGING h_field_wa.
h_field_wa-reptext = 'Storage Location'.
h_field_wa-outputlen = 20.
h_field_wa-scrtext_l = 'Storage Location'.
APPEND h_field_wa TO h_field_tab.
CLEAR h_field_wa.
PERFORM f_fieldinfo_get USING 'T001L'
'LGOBE'
CHANGING h_field_wa.
APPEND h_field_wa TO h_field_tab.
h_dselc-fldname = 'WERKS'.
h_dselc-dyfldname = 'P_PLANT'.
APPEND h_dselc.
h_dselc-fldname = 'LGORT'.
h_dselc-dyfldname = 'P_SLOC'.
APPEND h_dselc.
DATA: ld_repid LIKE sy-repid.
ld_repid = sy-repid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'P_PLANT'
dynpprog = ld_repid
dynpnr = '1000'
dynprofield = 'P_PLANT'
* multiple_choice = ''
* value_org = 'S'
TABLES
value_tab = t_data "first table
field_tab = h_field_tab "second table
* return_tab = return_tab
DYNPFLD_MAPPING = h_dselc "third table
EXCEPTIONS
OTHERS = 0.
ENDFORM. " f_valuerequest_plant
FORM f_fieldinfo_get USING fu_tabname
fu_fieldname
CHANGING fwa_field_tab.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = fu_tabname
FIELDNAME = fu_fieldname
LFIELDNAME = fu_fieldname
IMPORTING
DFIES_WA = fwa_field_tab
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 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.
ENDFORM. " f_fieldinfo_get
regards
Syed
2013 Dec 05 4:01 AM
HI,
In the field Catalog, set the field ddictxt = 'L' .
Regards,
Josh
2013 Dec 05 5:20 AM
Just add the below mentioned code after
PERFORM f_fieldinfo_get USING 'T001L'
'WERKS'
CHANGING h_field_wa.
h_field_wa-FIELDTEXT = 'MASTER PLANT'.
h_field_wa-REPTEXT = 'MASTER PLANT'.
h_field_wa-SCRTEXT_S = 'MASTER PLANT'.
h_field_wa-SCRTEXT_M = 'MASTER PLANT'.
h_field_wa-SCRTEXT_L = 'MASTER PLANT'.
2013 Dec 05 5:55 AM
Hi Richard,
Fill the text you want in
h_field_wa-fieldtext "Short Description of Repository Objects
h_field_wa-reptext "Heading
h_field_wa-scrtext_s "Short Field Label
h_field_wa-scrtext_m "Medium Field Label
h_field_wa-scrtext_l "Long Field Label
for both plant and storage location in the subroutine f_fieldinfo_get.
This will give the text in heading you want on press of F4.
Please like if helpful.
Regards,
Sheetal.
2013 Dec 05 6:46 AM
Hii Richard,
here is your modified code with your desired output.Check it out.
I have brought just little changes and it's working.
TABLES: T001L.
parameters: P_PLANT LIKE T001L-WERKS,
P_SLOC LIKE T001L-LGORT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PLANT.
PERFORM f_valuerequest_plant.
FORM f_valuerequest_plant.
DATA: BEGIN OF t_data OCCURS 1,
data(20),
END OF t_data.
data h_field_wa LIKE dfies.
data h_field_tab LIKE dfies occurs 0 with header line.
data h_dselc like dselc occurs 0 with header line.
SELECT * FROM T001L.
t_data = T001L-WERKS.
APPEND t_data.
t_data = T001L-LGORT.
APPEND t_data.
t_data = T001L-LGOBE.
APPEND T_data.
ENDSELECT.
refresh h_field_tab.
PERFORM f_fieldinfo_get USING 'T001L'
'WERKS'
CHANGING h_field_wa.
h_field_wa-reptext = 'Plant'.
h_field_wa-scrtext_l = 'Plant'.
APPEND h_field_wa TO h_field_tab.
CLEAR h_field_wa.
PERFORM f_fieldinfo_get USING 'T001L'
'LGORT'
CHANGING h_field_wa.
h_field_wa-reptext = 'Storage Location'.
h_field_wa-outputlen = 20.
h_field_wa-scrtext_l = 'Storage Location'.
APPEND h_field_wa TO h_field_tab.
CLEAR h_field_wa.
PERFORM f_fieldinfo_get USING 'T001L'
'LGOBE'
CHANGING h_field_wa.
APPEND h_field_wa TO h_field_tab.
h_dselc-fldname = 'WERKS'.
h_dselc-dyfldname = 'P_PLANT'.
APPEND h_dselc.
h_dselc-fldname = 'LGORT'.
h_dselc-dyfldname = 'P_SLOC'.
APPEND h_dselc.
DATA: ld_repid LIKE sy-repid.
ld_repid = sy-repid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'P_PLANT'
dynpprog = ld_repid
dynpnr = '1000'
dynprofield = 'P_PLANT'
* multiple_choice = ''
* value_org = 'S'
TABLES
value_tab = t_data "first table
field_tab = h_field_tab "second table
* return_tab = return_tab
DYNPFLD_MAPPING = h_dselc "third table
EXCEPTIONS
OTHERS = 0.
ENDFORM. " f_valuerequest_plant
FORM f_fieldinfo_get USING fu_tabname
fu_fieldname
CHANGING fwa_field_tab.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = fu_tabname
FIELDNAME = fu_fieldname
LFIELDNAME = fu_fieldname
IMPORTING
DFIES_WA = fwa_field_tab
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 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.
ENDFORM. " f_fieldinfo_get
regards
Syed
2013 Dec 05 4:24 PM
Thank you all so much. You guys all had correct version of the answer. In fact the one that controls what is used to control what is shown at the top of the column is the REPTEXT. Simply changing that in the FIELD_TAB internal table will change what is shown to the user.f
This leads me to another question about the 'DDIF_FIELDINFO_GET' module which was a large part of my confusion yesterday. I am going to ask it in another thread though so that others who have questions can maybe find it later.
Thanks again to you all for you help. This works great now.
(now if any of you know how to specify the width of each colum on the pop up help...feel free to let me know!!...As it stands now it cust parts of my column heading labels off and you have to drag the column wider).