Skip to Content
0
Former Member
Mar 29, 2006 at 02:55 PM

ALV help

21 Views

Hi all,

I have 3 fields LMNGA , XMNGA, GRUND in internal table itab.

My condition is

1) if itab-xmnga is not initial and itab-grund = 1

and then i should get only XMNGA in my fieldcatalogue automatically

else.

2) I should get only LMNGA in my fieldcatalogue

but not both.

Please kindly help me.

I have the following code.

*&---------------------------------------------------------------------*
*&      Form  alv_init
*&---------------------------------------------------------------------*
FORM alv_init.
  alv_layout-max_linesize = 1023.
  alv_repid               = sy-repid.
  REFRESH:
    alv_fieldcat,
    alv_groups.

  PERFORM fill_fieldcat_manuell USING:
   'ITAB' 'PERNR' '' 'AFRU' 'PERNR' '' '' '',
   'ITAB' 'MATNR' 'Material' '' '' '10' '10' '',
   'ITAB' 'MAKTX' '' 'MAKT' 'MAKTX' '' '' '',
   'ITAB' 'AUFNR' '' 'AUFK' 'AUFNR' '' '' '',
   'ITAB' 'VORNR' '' 'AFVC' 'VORNR' '' '' '',
   'ITAB' 'ARBPL' '' 'CRHD' 'ARBPL' '' '' '',
   'ITAB' 'RUECK' '' 'AFRU' 'RUECK' '' '' '',
   'ITAB' 'BUDAT' '' 'AFRU' 'BUDAT' '' '' '',
   'ITAB' 'ERSDA' '' 'AFRU' 'ERSDA' '' '' '',
   'ITAB' 'KOSTL' '' 'CRCO' 'KOSTL' '' '' '',
   'ITAB' 'BMSCH' '' 'AFVV' 'BMSCH' '' '' '',
   'ITAB' 'LMNGA' 'Menge(Stck)' '' '' '20' '20' 'X',-->if 
Condition 2
   'ITAB' 'XMNGA' 'Menge' '' '' '20' '20' 'X',--> If condition 1.
   'ITAB' 'VGW03' 'tr' '' '' '20' '20' '',
   'ITAB' 'VGW04' 'te' '' '' '20' '20' '',
   'ITAB' 'VGW01' 'trb' '' '' '20' '20' '',
   'ITAB' 'VGW02' 'teb' '' '' '20' '20' '',
*   'ITAB' 'MZEIT' 'Maschienenzeit' '' '' '20' '20' '',
   'ITAB' 'PZEIT1' 'plan tr h' '' '' '20' '20' 'X',
   'ITAB' 'PZEIT2' 'plan te h' '' '' '20' '20' 'X',
   'ITAB' 'MZEIT1' 'plan trb h' '' '' '20' '20' 'X',
   'ITAB' 'MZEIT2' 'plan teb h' '' '' '20' '20' 'X',
   'ITAB' 'ISM03' 'ist tr h' '' '' '20' '20' 'X',
   'ITAB' 'ISM04' 'ist te h' '' '' '20' '20' 'X',
   'ITAB' 'ISM01' 'ist trb h' '' '' '20' '20' 'X',
   'ITAB' 'ISM02' 'ist teb h' '' '' '20' '20' 'X'.
*   'ITAB' 'PZEIT2' 'Ist.Personal' '' '' '20' '20' 'X',
*   'ITAB' 'MZEIT2' 'Ist.Maschienen' '' '' '20' '20' 'X'.




ENDFORM.

*&---------------------------------------------------------------------*
*&      Form  FILL_FIELDCAT_MANUELL
*&---------------------------------------------------------------------*
FORM fill_fieldcat_manuell USING tab    field    text
                                 reftab reffield
                                 len_i  len_o sum.

  CLEAR alv_fieldcat.

  alv_fieldcat-ref_tabname    = reftab.
  alv_fieldcat-ref_fieldname  = reffield.
  alv_fieldcat-reptext_ddic   = text.
  alv_fieldcat-seltext_l      = text.
  alv_fieldcat-seltext_m      = text.
*  alv_fieldcat-seltext_s      = text.
  alv_fieldcat-ddic_outputlen = len_o.
  alv_fieldcat-intlen         = len_i.
  alv_fieldcat-fieldname      = field.
  alv_fieldcat-tabname        = tab.
  alv_fieldcat-do_sum         = sum.


  APPEND alv_fieldcat.
ENDFORM.                    " FILL_FIELDCAT_MANUELL

Thanks and regards

Chandu.

Message was edited by: Sai Chand Pullepu