‎2008 Aug 27 10:53 AM
Hi I had problem with RFUMSV00 program.Let me explain the requirment.
After executing the program RFUMSV00,in the selection screen there is TAB OUTPUT LIST.After you press the OUTPUT list and then if you press configure button we can able to see the out put list in teh ALV format.After disoplaying the ALV format if we go to the change layout we can find some fields in the Hidden fields list.So in the hidden field list there is fields called USER FIELD1,2,3.
So i want to change the Field name and i need to populate those values.
For this is there any way to do it.I find some of the BADI are existed but i am not sure how to implement those changes in BADI.
Can any body have an idea please help me.
Thanks.
‎2008 Aug 27 2:04 PM
The BADI that you would use is FI_TAX_BADI_014.
SE19 ->
Enter Z* - * is what you name it.
The definition name is FI_TAX_BADI_014.
Enter the filter data for your country key.
Save.
Double click on the method.
Enter in your code.
Note: I haven't used this code, and it is just a general idea. You will have to create it with proper sytax.
Loop CH_TAB_FIELDCAT.
.... When you find the field name that you want to change the description in CH_TAB_FIELDCAT-fieldname
CH_TAB_FIELDCAT-text_fieldname = 'Your Text'.
modify ch_tab_fieldcat.
endloop.
When you are ready to go, activate your BADI. You can set break-points, and watch it work.
Good luck!
Michelle
‎2008 Aug 27 3:36 PM
Hi ,
Thanks for your valuble answer.I am traying to do the same ,in the method i have return the code like this.
method IF_EX_FI_TAX_BADI_014~MODIFY_FIELDCAT.
Loop at CH_TAB_FIELDCAT .
If CH_TAB-FIELDCAT-FIELDNAME = NAME1.
CH_TAB_FIELDCAT-text_NAME1 = 'Billto Party'.
modify ch_tab_fieldcat.
ENDIF.
endmethod.
But it is giving an error
Class ZCL_IM_RFIDIT_TAX_BADI_010,Method IF_EX_FI_TAX_BADI_014~MODIFY_FIELDCAT
At "LOOP AT itab", one of the additions "INTO", "ASSIGNING", or
"TRANSPORTING NO FIELDS" is required. in the OO context.
I am poor OOPS that is my problem.
Can you please help me with this.I am very much greate full for this.
‎2008 Aug 27 4:11 PM
Try something like this:
(I didn't know what name1 was defined like)
method IF_EX_FI_TAX_BADI_014~MODIFY_FIELDCAT.
data: wa_ch_tab_fieldcat type slis_fieldcat_alv,
name1(10).
Loop at CH_TAB_FIELDCAT into wa_ch_tab_fieldcat.
If wa_ch_tab_fieldcat-fieldname = NAME1.
wa_ch_tab_fieldcat-text_fieldname = 'Billto Party'.
modify ch_tab_fieldcat from wa_ch_tab_fieldcat.
ENDIF.
endloop.
endmethod.
OOP does not allow header lines in internal tables.
Michelle
‎2008 Aug 28 10:24 AM
Hi,
Yes i got it ,but when i am trying to display in the report it is giving ABAP dump.I mean when i am transffering the USERFIELD1 from hidden fields to display field it is giving dump.An one more thing in which BADI i can write the code to populate the filed value in the perticular field.
Thanks for your response.
‎2008 Aug 28 11:36 AM
The badi is FI_TAX_BADI_014.
Can you paste the short dump here?
‎2008 Aug 28 12:25 PM
This is the short dump it is giving.
ShrtText
Field symbol has not yet been assigned.
What happened?
Error in ABAP application program.
The current ABAP program "SAPLKKBL" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
What can you do?
Print out the error message (using the "Print" function)
and make a note of the actions and input that caused the
error.
To resolve the problem, contact your SAP system administrator.
You can use transaction ST22 (ABAP Dump Analysis) to view and administer
termination messages, especially those beyond their normal deletion
date.
is especially useful if you want to keep a particular message.
Error analysis
You attempted to access an unassigned field symbol
(data segment 105).
This error may occur for any of the following reasons:
- You address a typed field symbol before it is set using ASSIGN
- You address a field symbol that points to a line in an internal table
that has been deleted
- You address a field symbol that had previously been reset using
UNASSIGN, or that pointed to a local field that no longer exists
- You address a global function interface parameter, even
though the relevant function module is not active,
that is it is not in the list of active calls. You can get the list
of active calls from the this short dump.
‎2008 Aug 28 11:43 AM
The badi is IF_EX_FI_TAX_BADI_011. Sorry I read the question wrong.
‎2008 Sep 02 12:22 PM
Have you tried looking at SAP notes? (Only if it isn't your field symbol that is creating the short-dump.)
Are you using a field symbol in your BADI? If you are, please update with the code in your badi.
Michelle
‎2013 Mar 25 6:48 AM
Hi Michelle,
Good Morning, Thanks for your valuable inputs. Using BADI, FI_TAX_BADI_014, I am trying to change the name of User Field 1, User Field 2 for the display variants under handles 'HAN1' and 'HAN3'. But I have a small problem there please help me.
For HAN1, I am able to change the names of User Field 1 and User Field 2.
But for HAN3, when I am doing the same thing, system is showing the changed name for User Field 2 but it is not taking the changed name for User Field 1.
I debugged it a lot, in the internal table for field catalogue, it is having the changed values for both the fields under SELTEXT_L field upto the point where the function module 'REUSE_ALV_LIST_DISPALY' is used.
But finally if I am executing it it is showing me the field name as 'User Field 1' in final output list.
Attaching the screen shot also for your reference, please help me.
Please help,
Regards,
Prameet
‎2013 Mar 25 7:49 AM
Issue resolved myself, in field catalogue I have to pass the value to field REPTEXT_DDIC also, in order to populate in the output list.
Here is the sample code, friends please code it like below for all parameters like seltext_l, seltext_m, seltext_s, and reptext_ddic.
READ TABLE ch_tab_fieldcat WITH KEY fieldname = 'USER_FIELD_1'
INTO ls_fieldcat.
ls_fieldcat-seltext_l = 'Vendor Code'.
ls_fieldcat-seltext_m = 'Vendor Code'.
ls_fieldcat-seltext_s = 'Vend. Code'.
ls_fieldcat-reptext_ddic = 'Vendor Code'.
MODIFY ch_tab_fieldcat FROM ls_fieldcat INDEX sy-tabix.
clear ls_fieldcat.