Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

How can I specify header labels in FIELD_TAB in F4IF_INT_TABLE_VALUE_REQUEST

$
0
0

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


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>