07-25-2008 11:42 AM
Hi all,
Could you any one of you please tell me. I am finding a strange error. I am modifying the existing customized report by adding two columns in the output. First i have done same changes in a local object (i.e i have copied the entire code and changed things . They are using FM: reuse_alv_fieldcat_merge.
and they are passing a structure to that FM its a globally defined structure. instead of adding fields to the global structure i have added as below
DATA:BEGIN OF it_summa OCCURS 1000.
INCLUDE STRUCTURE /nyh/fi_skuld_summa.
DaTA: busab like lfb1-busab,
brsch like lfa1-brsch.
DATA:END OF it_summa.
and since they are using FM : fieldcat_merge I have appended the fields at the end like this at the end of this form
FORM create_field_catalogue.
REFRESH it_fcat.
p_d1x = p_d1 + 1.
p_d2x = p_d2 + 1.
p_d3x = p_d3 + 1.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = '/NYH/FI_SKULD_SUMMA'
CHANGING
ct_fieldcat = it_fcat.
LOOP AT it_fcat INTO wa_fcat.
IF wa_fcat-fieldname = 'LIFNR'.
wa_fcat-scrtext_l = 'Vendor'.
wa_fcat-scrtext_m = 'Vendor'.
wa_fcat-scrtext_s = 'Vendor'.
wa_fcat-reptext = 'Vendor'.
wa_fcat-col_pos = 1.
wa_fcat-outputlen = 10.
wa_fcat-key = 'X'.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'NAME1'.
wa_fcat-scrtext_l = 'Name'.
wa_fcat-scrtext_m = 'Name'.
wa_fcat-scrtext_s = 'Name'.
wa_fcat-reptext = 'Name'.
wa_fcat-col_pos = 2.
wa_fcat-outputlen = 25.
wa_fcat-emphasize = 'X'.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'TELF1'.
wa_fcat-scrtext_l = 'Phone'.
wa_fcat-scrtext_m = 'Phone'.
wa_fcat-scrtext_s = 'Phone'.
wa_fcat-reptext = 'Phone'.
wa_fcat-col_pos = 5.
wa_fcat-outputlen = 10.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'SORTL'.
wa_fcat-scrtext_l = 'ID'.
wa_fcat-scrtext_m = 'ID'.
wa_fcat-scrtext_s = 'ID'.
wa_fcat-reptext = 'ID'.
wa_fcat-col_pos = 6.
wa_fcat-outputlen = 10.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'WAERS'.
wa_fcat-col_pos = 7.
wa_fcat-outputlen = 7.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'SKULD'.
wa_fcat-col_pos = 8.
wa_fcat-outputlen = 15.
wa_fcat-do_sum = 'X'.
wa_fcat-scrtext_l = 'Amount'.
wa_fcat-scrtext_m = 'Amount'.
wa_fcat-scrtext_s = 'Amount'.
wa_fcat-reptext = 'Amount'.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'TBIL1'.
CLEAR wa_fcat-scrtext_l.
WRITE '<' TO wa_fcat-scrtext_l(1).
WRITE p_d1 TO wa_fcat-scrtext_l+1(5).
WRITE 'days' TO wa_fcat-scrtext_l+6(5).
CONDENSE wa_fcat-scrtext_l.
wa_fcat-scrtext_m = wa_fcat-scrtext_l.
wa_fcat-scrtext_s = wa_fcat-scrtext_l.
wa_fcat-reptext = wa_fcat-scrtext_l.
wa_fcat-col_pos = 12.
wa_fcat-outputlen = 15.
wa_fcat-do_sum = 'X'.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'TBIL2'.
CLEAR wa_fcat-scrtext_l.
WRITE p_d1x TO wa_fcat-scrtext_l(5).
WRITE '-' TO wa_fcat-scrtext_l+5(1).
WRITE p_d2 TO wa_fcat-scrtext_l+6(5).
WRITE 'days' TO wa_fcat-scrtext_l+12(5).
CONDENSE wa_fcat-scrtext_l.
wa_fcat-scrtext_m = wa_fcat-scrtext_l.
wa_fcat-scrtext_s = wa_fcat-scrtext_l.
wa_fcat-reptext = wa_fcat-scrtext_l.
wa_fcat-col_pos = 13.
wa_fcat-outputlen = 15.
wa_fcat-do_sum = 'X'.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'TBIL3'.
CLEAR wa_fcat-scrtext_l.
WRITE p_d2x TO wa_fcat-scrtext_l(5).
WRITE '-' TO wa_fcat-scrtext_l+5(1).
WRITE p_d3 TO wa_fcat-scrtext_l+6(5).
WRITE 'days' TO wa_fcat-scrtext_l+12(5).
CONDENSE wa_fcat-scrtext_l.
wa_fcat-scrtext_m = wa_fcat-scrtext_l.
wa_fcat-scrtext_s = wa_fcat-scrtext_l.
wa_fcat-reptext = wa_fcat-scrtext_l.
wa_fcat-col_pos = 14.
wa_fcat-outputlen = 15.
wa_fcat-do_sum = 'X'.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'TBIL4'.
CLEAR wa_fcat-scrtext_l.
WRITE '>' TO wa_fcat-scrtext_l(1).
WRITE p_d3x TO wa_fcat-scrtext_l+1(5).
WRITE 'days' TO wa_fcat-scrtext_l+6(5).
CONDENSE wa_fcat-scrtext_l.
wa_fcat-scrtext_m = wa_fcat-scrtext_l.
wa_fcat-scrtext_s = wa_fcat-scrtext_l.
wa_fcat-reptext = wa_fcat-scrtext_l.
wa_fcat-col_pos = 15.
wa_fcat-outputlen = 15.
wa_fcat-do_sum = 'X'.
MODIFY it_fcat FROM wa_fcat.
ELSEIF wa_fcat-fieldname = 'DMBTR'.
DELETE it_fcat.
ELSE.
wa_fcat-no_out = 'X'.
MODIFY it_fcat FROM wa_fcat.
ENDIF.
ENDLOOP.
clear wa_fcat.
wa_fcat-fieldname = 'BUSAB'.
wa_fcat-tabname = '1'.
wa_fcat-ref_field = 'BUSAB'.
wa_fcat-ref_table = 'LFB1'.
wa_fcat-col_pos = '3'.
wa_fcat-scrtext_l = 'Accounting Clerk'.
wa_fcat-scrtext_m = 'Accounting Clerk'.
wa_fcat-scrtext_s = 'Accounting Clerk'.
wa_fcat-reptext = 'Accounting Clerk'.
wa_fcat-outputlen = 2.
wa_fcat-emphasize = 'X'.
Append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-fieldname = 'BRSCH'.
wa_fcat-tabname = '1'.
wa_fcat-ref_field = 'BRSCH'.
wa_fcat-ref_table = 'LFA1'.
wa_fcat-col_pos = '4'.
wa_fcat-scrtext_l = 'Industry Key'.
wa_fcat-scrtext_m = 'Industry Key'.
wa_fcat-scrtext_s = 'Industry Key'.
wa_fcat-reptext = 'Industry Key'.
wa_fcat-outputlen = 4.
wa_fcat-emphasize = 'X'.
Append wa_fcat to it_fcat.
clear wa_fcat.
ENDFORM. " create_field_catalogue
now the same code is working in local object. but when it is save under some request its not working .
Could you any please check out my code
Thanks in advance.....
Regards
Vardhan
07-25-2008 11:45 AM
07-25-2008 11:50 AM
Hi,
After changing the fieldcatlog also i am getting the old report .
I am not getting the updated report with new fieldcatlog ..
Thanks and regards
Vardhan
07-25-2008 11:50 AM
Hi,
On which system your working .
is it a SCM or normal system.
INCLUDE STRUCTURE /nyh/fi_skuld_summa.
this structure exist in your system ?
Regards,
Sandeep
07-25-2008 11:53 AM
In real time system its a client dependent structure ...
which is in my system.
07-25-2008 11:50 AM
show the error details and Give the Coding also.
The error may be related to Fieldcatalog.
07-25-2008 11:51 AM
07-25-2008 11:53 AM
now the same code is working in local object. but when it is save under some request its not working .
How you created the reqest , By coping it to new program or Same program you assing the Transportable package and checked it.
can you please let me know.
Don't send it. But what is the error. you can give that
07-25-2008 11:54 AM
I am not getting any error. I am getting old report without the updated fields .but as a local object i am getting the updated report ? could tell me why
Edited by: Vishnuvardhan . G Reddy on Jul 25, 2008 12:56 PM
07-25-2008 11:57 AM
Hi,
DATA:BEGIN OF it_summa OCCURS 1000.
INCLUDE STRUCTURE /nyh/fi_skuld_summa.
DaTA: busab like lfb1-busab,
brsch like lfa1-brsch.
DATA:END OF it_summa.
the structure /nyh/fi_skuld_summa if u have defined in se11 then go to se11 and add two fields there only then u again use this structure in fieldcatalog merge...
I hope this will help..
Thanks & Regards
Ashu Singh
07-25-2008 12:15 PM
Hi,
If i try to modify the structure then again it will be a problem know. If the same structure is using in different places..
07-25-2008 12:20 PM
You can use APPEND STRUCTURE that will not cause any problem.
Append will be added at the end. so there will not be any problem or else create the fieldcatalog using reuse_merge and then transfer it to LVC.
07-25-2008 12:28 PM
hi,
thanks for replying could you please tell me how to use reuse_merge with example or send me example till now i haven't used that FM
Thanks in advance
Vardhan
07-25-2008 12:35 PM
07-25-2008 11:58 AM
Can you cross check if you are passing the same it_fcat to your ALV FM..? Also try to regenerate the total program again
santhosh
07-25-2008 12:26 PM
This code will Tranfer the Reuse fieldcatlog to LVC fieldcatalog.
in this case no need to enhance the standard structure. you populate the reuse fieldcatalog. and then transfer to LVC one.
REPORT ZTEST_FIELDCATLOG.
type-pools: slis.
DATA: it_fieldcat type SLIS_T_FIELDCAT_ALV,
it_lvcfcat type lvc_t_fcat.
include ztest_top.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'IT_DATA'
I_INCLNAME = 'ZTEST_TOP'
CHANGING
ct_fieldcat = it_fieldcat
* EXCEPTIONS
* INCONSISTENT_INTERFACE = 1
* PROGRAM_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.
CALL FUNCTION 'LVC_TRANSFER_FROM_SLIS'
EXPORTING
it_fieldcat_alv = it_fieldcat
* IT_SORT_ALV =
* IT_FILTER_ALV =
* IS_LAYOUT_ALV =
IMPORTING
ET_FIELDCAT_LVC = it_lvcfcat
* ET_SORT_LVC =
* ET_FILTER_LVC =
* ES_LAYOUT_LVC =
tables
it_data = it_data
* EXCEPTIONS
* IT_DATA_MISSING = 1
* OTHERS = 2
.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
BREAK-POINT.
Top include
*&---------------------------------------------------------------------*
*& Include ZTEST_TOP
*&---------------------------------------------------------------------*
data: begin of it_data occurs 0,
vbeln like vbak-vbeln,
matnr like mara-matnr,
end of it_data.
Regards
Vijay babu Dudla