‎2007 Mar 30 10:33 PM
Here's the background on what we're trying to do. There's an FM report that you can run using trx SE38. The program is called RFFMEPGAX and it displays an ALV list of FM posted line items. The issue is that the report can display the vendor number but not the vendor name. SAP suggested that we use the BADI associated with the report - FMRP_RFFMEPGAX_EXIT. This BADI supposedly will allow additional fields to be included in the resulting ALV display that is not in the current default structure. To do this, ABAP code will have to be written in the BADI's methods that will incorporate the new field that we want (field NAME1 from table LFA1).
anybody who had seen this before has a solution
‎2007 Mar 31 8:56 PM
Hello Dishant
Unfortunately I do not have any FM data available on our IDES system (ECC 5.0) to test the report. However, looking at the available methods of interface IF_EX_FMRP_RFFMEPGAX_EXIT you can either change a single item entry (method CHANGE_LIST_LINE) or the entire item entries (method CHANGE_LIST_TABLE).
Method CHANGE_LIST_LINE has a single CHANGING parameter C_F_LINE_ITEM of line type IFMREPGAX. Assuming that the vendor can be found in field IFMREPGAX-LIFNR you could add the following coding to the method:
method IF_EX_FMRP_RFFMEPGAX_EXIT~CHANGE_LIST_LINE.
DATA:
ls_lfa1 TYPE lfa1.
CALL FUNCTION 'VENDOR_READ'
EXPORTING
i_bukrs = space
i_lifnr = c_f_line_item-lifnr
IMPORTING
e_lfa1 = ls_lfa1
EXCEPTIONS
not_found = 1
others = 2.
IF ( syst-subrc = 0 ).
c_f_line_item-name1 = ls_lfa1-nam1.
ENDIF.
endmethod.The layout of the ALV list has to be adjusted in order to display the NAME1 column.
Regards
Uwe
‎2007 Apr 02 6:55 PM
I already tried something similar to what you indicated and was able to include the NAME1 info in the internal table and ALV field catalog (g_t_fieldcat). I've also added it to the IFMREPGAX structure. But what happens is that when routine FFMEPGAX_CHECK_NEEDED_TABLEF01 is executed, the field is deleted from the catalog because it's not in the IFMREP1AX structure. I thought putting the code in the BADI will prevent that from happening but it's still doing it. Any ideas?
‎2007 Apr 02 10:04 PM
Hello Dishant
Have you tried to <i>unmark </i>flag <b>Variant fields only</b> (bottom of selection screen, fieldgroup Layout). If you look at routine <b>check_needed_tables</b> there is the following IF statement:
[code]FORM check_needed_tables CHANGING
c_flg_asset_read TYPE boole-boole
c_flg_master_data TYPE boole-boole
c_flg_master_data_bseg TYPE boole-boole
c_flg_bank_data TYPE boole-boole
c_flg_head_eban TYPE boole-boole
c_flg_head_ekpo TYPE boole-boole
c_flg_head_kblk TYPE boole-boole
c_flg_head_bkpf TYPE boole-boole
c_flg_head_vbkpf TYPE boole-boole
c_flg_head_ekko TYPE boole-boole
c_flg_co_data TYPE boole-boole
c_flg_co_texts TYPE boole-boole.
DATA: l_t_fieldcat TYPE slis_t_fieldcat_alv,
l_f_fieldcat TYPE slis_fieldcat_alv.
DATA: l_t_fields_1ax TYPE TABLE OF dfies WITH HEADER LINE.
PERFORM read_variant_fieldcat CHANGING l_t_fieldcat.
"$Comment: If p_fixvar = ' ' then the ELSE branch is executed
Only layoutfields (p_fixvar) or
background processing
IF NOT p_fixvar IS INITIAL OR
NOT sy-batch IS INITIAL.
...
Fields will be empty -> delete from field catalogue
Don't delete the fields of IFMREP1AX (filled by LDB)
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = 'IFMREP1AX'
TABLES
dfies_tab = l_t_fields_1ax
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.
...
ELSE.
No layout entered/no default layout or
p_fixvar initial -> read all
MOVE:
'X' TO c_flg_asset_read,
'X' TO c_flg_master_data,
'X' TO c_flg_master_data_bseg,
'X' TO c_flg_bank_data,
'X' TO c_flg_head_eban,
'X' TO c_flg_head_ekpo,
'X' TO c_flg_head_kblk,
'X' TO c_flg_head_bkpf,
'X' TO c_flg_head_vbkpf,
'X' TO c_flg_head_ekko,
'X' TO c_flg_co_data,
'X' TO c_flg_co_texts.
ENDIF.[/code]
Regards
Uwe
‎2007 Apr 04 10:27 PM
I am not very familiar with ALV grids and am not quite sure what unmarking the Flag variant field will do or how it will stop the deletion of the ZNAME field from the field catalog.
Could u elaborate a litle bit.