This website is not affiliated with, sponsored by, or approved by SAP AG.

build fieldcatalog semi-automatically

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: thx4allthefish, Snowy, Gothmog, YuriT

build fieldcatalog semi-automatically

Postby Jkeri » Fri May 25, 2012 7:50 am

I am tryign to build a field catalog semi-automatically and keep getting a short dump. I've researched this method and its somewhat confusing.

Here is my code.
Code: Select all
~~~~~~~~~~~~~~~~~~~~~~~~~~~ this is where I store the data that is to be displayed in the ALV grid
Types:   Begin Of Gty_detail_total,
                      Dt_desc               Type C    Length 20,
                     End Of Gty_detail_total.
  Data: Gt_detail_total Type Table Of Gty_detail_total,
              Gs_detail_total Like Line Of Gt_detail_total.

Data: Go_container                Type Ref To Cl_gui_custom_container, " top grid
                   Go_alv_grid                  Type Ref To Cl_gui_alv_grid, "top grid
                    Sla                                   Type Lvc_s_layo,
                    Gt_fieldcat                     Type Lvc_t_fcat,  " Top grid
                    Gs_fieldcat                     Type Lvc_s_fcat,  " Top grid
                    Ls_fieldcat                       Type Lvc_s_fcat,  "Top grid
                    W_column_hdg              Type C Length 30,
                    W_column_hdg1             Type C Length 40,
                    W_column_hdg15            Type C Length 15,
                    W_current_screen            Type Sy-dynnr,
                    Lw_print                              Type Lvc_s_prnt.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This is my logic to create the catalog

PERFORM x5100_build_fieldcat.

Form X5010_build_fieldcat .
gs_detail_total-dt_desc = 'DT_DESC'.
append gs_detail_total to gt_detail_total.

Call Function 'LVC_FIELDCATALOG_MERGE'
          EXPORTING
             i_structure_name   = 'GS_DETAIL_TOTAL'
           CHANGING
             ct_fieldcat                = gt_fieldcat2[]
           EXCEPTIONS
             inconsitant_interface = 1
             program_error             = 2
             OTHERS                          = 3.


Loop at gt_fieldcat2 into ls_fieldcat2.
   Case ls_fieldcat2-fieldname.
            WHEN 'Dt_DESC' .
               ls_fieldcat2-coltext = 'NewDt'.
               MODIFY GT_FIELDCAT2 FROM LS_FIELDCAT2.


   endcase.
   Endloop.
   Endform.

Last edited by Gothmog on Fri May 25, 2012 9:54 am, edited 1 time in total.
Reason: code tags
Jkeri
 
Posts: 59
Joined: Thu Jul 21, 2011 12:44 pm

Re: build fieldcatalog semi-automatically

Postby Gothmog » Fri May 25, 2012 9:56 am

Telling us what the dump is and when it occurs may help...
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1467
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: build fieldcatalog semi-automatically

Postby Jkeri » Fri May 25, 2012 10:15 am

'exception condition "NO_FIELDCATALOG_AVAILABLE" raised'

According the the debugger, its occuring during a call to the FUNCTION LVC_FIELDCATALOG_MERGE.


This program is a simple one . All I want to it to do is to generate the fieldcatalog for me and display one field in the ALV grid.
Jkeri
 
Posts: 59
Joined: Thu Jul 21, 2011 12:44 pm

Re: build fieldcatalog semi-automatically

Postby quelquepart » Sat May 26, 2012 3:58 am

Hello,

the parameter i_structure_name is for DDIC structure.
instead, you must use program/table name parameters.

++
http://quelquepart.biz
quelquepart
 
Posts: 15
Joined: Wed Feb 22, 2012 6:02 am
Location: France


Return to ABAP

Who is online

Users browsing this forum: No registered users and 19 guests




This website is not affiliated with, sponsored by, or approved by SAP AG.