Skip to Content
author's profile photo Former Member
Former Member

Error in my OOALV report ?

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 10:45 AM

    Hi,

    Can you give the error desc..

    Santhosh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 10: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 25, 2008 at 10:50 AM

    show the error details and Give the Coding also.

    The error may be related to Fieldcatalog.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 25, 2008 at 10: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 10: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 10: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 25, 2008 at 11:26 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.