Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the column title for custom F4 help(internal table)

chngkhengkim
Participant
0 Kudos

Hi Experts,

As per title, how do I change the column title for custom F4 help.

This F4 help is build by internal table.

Now the column title is F0001 & F0002, I want to change the F0001 & F0002 to something else.

Please help.

Below is my code.

TYPES: BEGIN OF gty_number,
           num  TYPE char4,
           text TYPE char30,
        END OF gty_number.

DATA: gtt_number TYPE STANDARD TABLE OF gty_number.
DATA: gwa_number  TYPE gty_number.

SELECT-OPTIONS: s_number FOR gwa_number NO INTERVALS..

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_number-low.
   PERFORM f_number_f4.

************************************************************************
* FORM f_number_f4                                               *
* Build F4 search help for number                                      *
************************************************************************
FORM f_number_f4.

   DATA: ltt_fieldtab TYPE STANDARD TABLE OF dfies,
         lwa_fieldtab TYPE dfies.

   FREE: gtt_number, ltt_fieldtab.

   gwa_number-num    = '01'.
   gwa_number-text   = 'Diagnosis in progress'.
   APPEND gwa_number TO gtt_number.

   gwa_number-num    = '02'.
   gwa_number-text   = 'Estimated approval pending'.
   APPEND gwa_number TO gtt_number.

   gwa_number-num    = '03'.
   gwa_number-text   = 'Waiting for spare part'.
   APPEND gwa_number TO gtt_number.

   gwa_number-num    = '04'.
   gwa_number-text   = 'Ready for repair'.
   APPEND gwa_number TO gtt_number.

   gwa_number-num    = '05'.
   gwa_number-text   = 'On going repair'.
   APPEND gwa_number TO gtt_number.


   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
     EXPORTING
       retfield     = 'NUM'
       dynpprog     = sy-repid
       dynpnr       = sy-dynnr
       dynprofield  = 'S_NUMBER'
       window_title = 'Number'
       value_org    = 'S'
     TABLES
       value_tab    = gtt_number.

   CLEAR gwa_number.

ENDFORM.                    "f_number_f4


Warm regards

Ice

1 ACCEPTED SOLUTION

nabheetscn
Active Contributor

HI Ice

THere is an additional tables parameter in fields_tab please fill it and pass it. Just read documentation and search on SCN for the same

nabheet

7 REPLIES 7

nabheetscn
Active Contributor

HI Ice

THere is an additional tables parameter in fields_tab please fill it and pass it. Just read documentation and search on SCN for the same

nabheet

0 Kudos

Hi Nabheet,

It is not working, the content is not correct.

here is the code.

  lwa_fieldtab-tabname   = 'GTT_NUMBER'.
   lwa_fieldtab-fieldname = 'NUM'.
   lwa_fieldtab-intlen    = 100.
   lwa_fieldtab-outputlen = 100.
   lwa_fieldtab-position   = 1.
   lwa_fieldtab-scrtext_m = 'Number'.
   APPEND lwa_fieldtab TO ltt_fieldtab.

   lwa_fieldtab-tabname   = 'GTT_number'.
   lwa_fieldtab-fieldname = 'TEXT'.
   lwa_fieldtab-intlen    = 100.
   lwa_fieldtab-outputlen = 100.
   lwa_fieldtab-position   = 2.
   lwa_fieldtab-scrtext_m = 'Description'.
   APPEND lwa_fieldtab TO ltt_fieldtab.


   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
     EXPORTING
       retfield     = 'NUM'
       dynpprog     = sy-repid
       dynpnr       = sy-dynnr
       dynprofield  = 'S_NUMBER'
       window_title = 'Number'
       value_org    = 'S'
     TABLES
       field_tab    = ltt_fieldtab
       value_tab    = gtt_number.


Output:

What I want is:

Warm regards

Ice

Message was edited by: Ice White

Hi Ice

Change the code as shown below

 

lwa_fieldtab-fieldname = 'NUM'.
lwa_fieldtab-intlen =
4.
lwa_fieldtab-outputlen =
4.
lwa_fieldtab-scrtext_m =
'Number'.
APPEND lwa_fieldtab TO ltt_fieldtab.

lwa_fieldtab-fieldname =
'TEXT'.
lwa_fieldtab-intlen =
60.
lwa_fieldtab-outputlen =
60.
lwa_fieldtab-OFFSET =
4.
lwa_fieldtab-scrtext_m =
'Description'.
APPEND lwa_fieldtab TO ltt_fieldtab.


CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield =
'NUM'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield =
'S_NUMBER'
window_title =
'Number'
value_org =
'S'
TABLES
field_tab = ltt_fieldtab
value_tab = gtt_number.

0 Kudos

Hi nabheet,

Yes its working now, may I know what's the problem ?

Warm regards

Ice

0 Kudos

Basically since you are using local type the function module was not able to determine the offset of the next field. Which we passed to it that second column will start from this postion

Nabheet

0 Kudos

All right thank a lot !

Ice

0 Kudos

Thanks a lot your answer is very useful to me.