‎2008 Sep 30 6:59 PM
Hi,
Im adding few fields to the existing report. I filled all the required fields in output table but when i try to display its not showing newly added fields. Earlier it was having one structure passed to the parameters i_structure_name_item and i_tabname_item . so i just redefinded that structure with addition fields but it is not showing those fields in output.
Can you tell me, how to get display those additional fields in output.
I copied the SAP program RFBPET00 into "Z" program and changed the structure to work as mention above.
Thanks,
Amal
‎2008 Sep 30 8:43 PM
you mentioned u copied the sturctures to another structure say ZHEADER and ZITEM.
after that did you modify the program ?
gc_alv_output_header TYPE slis_tabname
VALUE 'FAGL_S_RFBPET00_LIST', "Reference Field
gc_alv_output_detail TYPE slis_tabname
VALUE 'FAGL_S_RFBPET00_LIST2', "Reference Field
did u replace 'FAGL_S_RFBPET00_LIST' with ZHEADEr ?
did u modify this line ?
DATA : gs_alv_output_header TYPE fagl_s_rfbpet00_list.
how about this line ?
DATA : gs_alv_output_detail TYPE fagl_s_rfbpet00_list2.
‎2008 Sep 30 8:07 PM
>so i just redefinded that structure with addition fields
is it Standard structure..?
you need add them to the fieldcatalog, if the structure is not exists in DD level.
‎2008 Sep 30 8:25 PM
yes, it is a standard structure..I copied all the fields from that structure and define a new structure in my program with new fields included in it.
So u mean to say that i have to pass that defined type(structure) into fieldcalog merge FM and generate the fieldcatalog for that structure?
-Amal
‎2008 Sep 30 8:39 PM
>yes, it is a standard structure..I copied all the fields from that structure and define a new structure in my >program with new fields included in it.
for Dictionary level structures only it works, so you have to create structure in SE11 or else populate the fieldcatalog manually or using the merge function.
if you want to use the function then you have to define internal table in the following way..
data: begin of itab occurs 0, "specify occurs 0
matnr like mara-matnr, "don't use type when defining
end of itab.
search the forum for sample usage of the merge function.
‎2008 Sep 30 8:43 PM
you mentioned u copied the sturctures to another structure say ZHEADER and ZITEM.
after that did you modify the program ?
gc_alv_output_header TYPE slis_tabname
VALUE 'FAGL_S_RFBPET00_LIST', "Reference Field
gc_alv_output_detail TYPE slis_tabname
VALUE 'FAGL_S_RFBPET00_LIST2', "Reference Field
did u replace 'FAGL_S_RFBPET00_LIST' with ZHEADEr ?
did u modify this line ?
DATA : gs_alv_output_header TYPE fagl_s_rfbpet00_list.
how about this line ?
DATA : gs_alv_output_detail TYPE fagl_s_rfbpet00_list2.
‎2008 Sep 30 8:56 PM
Im adding fields only to ITEM level, for EX definded structure as ITEM.
So in the below line,
gc_alv_output_detail TYPE slis_tabname
VALUE 'FAGL_S_RFBPET00_LIST2', "Reference Field
i replaced 'FAGL_S_RFBPET00_LIST2' with ITEM.
below is the code i used,
*DATA : BEGIN OF gt_alv_output_detail OCCURS 0.
INCLUDE STRUCTURE fagl_s_rfbpet00_list2.
*DATA : bewar TYPE bseg-bewar,
zzrncat TYPE bseg-zzrncat,
prctr TYPE bseg-prctr,
zzfnprd TYPE bseg-zzfnprd.
*DATA : END OF gt_alv_output_detail.
so i used GT_ALV_OUTPUT_DETAIL in place of 'FAGL_S_RFBPET00_LIST2' .
is there anything i have to do other that this?
-Amal
‎2008 Sep 30 9:05 PM
ok ok... that means.. u didnt create a database structure.. ( i assumed u created one using SE11, sorry ).
u just declared a structure programattically..
in that case, u have to use, field catalog.. either you can use, FM - reuse_alv_fieldcatalog_merge..
or create field catalog appending each field one by one..
then pass the field catalog to the Heirseq_display FM.
if you are not familiar, the easiest way is to create the structure using SE11. say ZITEM..with all those fields which u declared programmatically .
‎2008 Sep 30 9:07 PM
also, if u are using field_catalog_merge.
u shud change all this to LIKE.. instead of TYPE..
*DATA : bewar TYPE bseg-bewar,
zzrncat TYPE bseg-zzrncat,
prctr TYPE bseg-prctr,
zzfnprd TYPE bseg-zzfnprd.
TYPe wont work..
‎2008 Sep 30 11:50 PM
Hi Augustine/Vijay,
I declared the itab in top include as below,
type-pools slis.
* Alv Output Internal Table(Header)
DATA : gt_alv_output_header TYPE fagl_s_rfbpet00_list OCCURS 0 WITH HEADER LINE.
* Alv Ouput Work Area
DATA : gs_alv_output_header TYPE fagl_s_rfbpet00_list.
* Alv Output Internal Table(Detail)
DATA : BEGIN OF gt_alv_output_detail OCCURS 0.
INCLUDE STRUCTURE fagl_s_rfbpet00_list2.
DATA : bewar like bseg-bewar,
zzrncat like bseg-zzrncat,
prctr like bseg-prctr,
zzfnprd like bseg-zzfnprd.
DATA : END OF gt_alv_output_detail.
* Alv Ouput Work Area
DATA : gs_alv_output_detail LIKE LINE OF gt_alv_output_detail.
DATA:
gt_fieldcat TYPE slis_t_fieldcat_alv,
gt_fieldcat1 TYPE slis_t_fieldcat_alv,
gs_fieldcat TYPE slis_fieldcat_alv.And used merge function to get the fieldcatalog as below,
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_syrepid
i_internal_tabname = 'GT_ALV_OUTPUT_HEADER'
i_structure_name = 'FAGL_S_RFBPET00_LIST'
i_client_never_display = 'X'
* i_inclname = 'ZRFBPET00_TOP'
CHANGING
ct_fieldcat = gt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3. "#EC *
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_syrepid
i_internal_tabname = 'GT_ALV_OUTPUT_DETAIL'
* i_structure_name = 'FAGL_S_RFBPET00_LIST2'
i_client_never_display = 'X'
i_inclname = 'ZRFBPET00_TOP'
CHANGING
ct_fieldcat = gt_fieldcat1[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3. "#EC *
* IF NOT p_hs IS INITIAL.
LOOP AT gt_fieldcat1 INTO gs_fieldcat.
APPEND gs_fieldcat TO gt_fieldcat.
ENDLOOP.But im getting ABAP DUMP as "source code is longer than the internal table" for detail itab.
Can you please suggest what wil be the error?
Thanks,
Amal
‎2008 Oct 01 3:00 AM
your source code line width should not exceed more than 72 chars, make sure that it should not exceed 72 chars.
assume the code line length is more than 72
DATA : gt_alv_output_header TYPE fagl_s_rfbpet00_list OCCURS 0 WITH HEADER LINE.then change it to like this
DATA : gt_alv_output_header TYPE fagl_s_rfbpet00_list
OCCURS 0 WITH HEADER LINE.then it works.