‎2009 Aug 18 3:42 PM
Dear all,
I have the code as below for the ALV list.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: POS TYPE I.
DEFINE CATALOG.
POS = POS + 1.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COL_POS = POS.
LS_FIELDCAT-QFIELDNAME = &1.
LS_FIELDCAT-QTABNAME = &2.
LS_FIELDCAT-FIELDNAME = &3.
LS_FIELDCAT-REF_TABNAME = &4.
LS_FIELDCAT-REF_FIELDNAME = &5.
LS_FIELDCAT-REPTEXT_DDIC = &6.
LS_FIELDCAT-JUST = &7.
LS_FIELDCAT-OUTPUTLEN = &8.
LS_FIELDCAT-DO_SUM = &9.
LS_FIELDCAT-TABNAME = 'IT_BASIC'.
LS_FIELDCAT-SELTEXT_L = &6.
LS_FIELDCAT-SELTEXT_M = &6.
LS_FIELDCAT-SELTEXT_S = &6.
LS_FIELDCAT-DDICTXT = 'M'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
END-OF-DEFINITION.
CATALOG:
' ' ' ' 'SOLD_TO' 'KNA1' 'KUNNR' TEXT-CA1 'C' '10' '',
' ' ' ' 'SOLDTO_NM' 'KNA1' 'NAME1' TEXT-CA2 'L' '30' '',
' ' ' ' 'WERKS' 'RDATA' 'WERKS' TEXT-CA3 'C' '04' '',
' ' ' ' 'LGORT' 'VBAP' 'LGORT' TEXT-CA4 'C' '04' '',
' ' ' ' 'MATNR' 'RDATA' 'MATNR' TEXT-CA5 'L' '15' '',
' ' ' ' 'MEINS' 'LIPS' 'MEINS' TEXT-CA6 'R' '04' '',
'MEINS' '' 'CPQTY' 'LIPS' 'LFIMG' TEXT-CA7 'R' '17' 'X',
'MEINS' '' 'OMENG' 'LIPS' 'LFIMG' TEXT-CA8 'R' '17' 'X',
'MEINS' ' ' 'VMENG' 'LIPS' 'LFIMG' TEXT-CA9 'R' '17' 'X',
'MEINS' ' ' 'RFMNG' 'LIPS' 'LFIMG' TEXT-CB1 'R' '17' 'X',
'MEINS' ' ' 'BACKQ' 'LIPS' 'LFIMG' TEXT-CB2 'R' '17' 'X',
'MEINS' ' ' 'BACKA' 'LIPS' 'LFIMG' TEXT-CB3 'R' '17' 'X',
'MEINS' ' ' 'LABST' 'LIPS' 'LFIMG' TEXT-CB4 'R' '17' 'X',
'MEINS' ' ' 'INSME' 'LIPS' 'LFIMG' TEXT-CB5 'R' '17' 'X',
'MEINS' ' ' 'MENGE' 'LIPS' 'LFIMG' TEXT-CB6 'R' '17' 'X',
'MEINS' ' ' 'INTRA' 'LIPS' 'LFIMG' TEXT-CB7 'R' '17' 'X',
'' ' ' 'LIMIT' 'BKPF' 'DMBTR' TEXT-CB8 'R' '17' ''.
Here i need to add one more field in the ALV ,division i.e. SPART needs to be added of the material.
I need to know what could be this TEXT-CA abd TEXT-CB fields?
i do not see it defined anywhere in the program.I need to define one more for the SPART.
how can i do that ?
please help.
‎2009 Aug 18 4:05 PM
TEXT-XXX are text symbols. double click on them or in menu bar goto->text elements/symbols. it will take you tp text declarations. you can create a new text element there or directly pass some value in the macro calling.
‎2009 Aug 18 4:05 PM
TEXT-XXX are text symbols. double click on them or in menu bar goto->text elements/symbols. it will take you tp text declarations. you can create a new text element there or directly pass some value in the macro calling.
‎2009 Aug 18 4:21 PM
thanks soumya.
WHat do you think is 'SOLD_TO' and all ?
if i add one more field like below
' ' ' ' 'SPART' 'RDATA' 'SPART' TEXT-CB9 'L' '15' '',
my program goes to dump.
what could be the reason?
‎2009 Aug 18 4:27 PM
Double click on Text-CB9 and it will pop-up to create a new text. say YES. and add the text DIVISION. Activate that screen.Activate your program and run the program again. This will solve.
Thanks
Kiran
‎2009 Aug 18 4:30 PM
I have already defined
CB9 = Division
still i get short dump
‎2009 Aug 18 4:31 PM
what does the dump say?
if u provide all the details, the better will be ur chances of getting the solutions!!!
‎2009 Aug 18 4:34 PM
Hello Kiran,
If you check the values that Swati is passing to the Macro you will understand why she's getting the dump
BR,
Suhas
‎2009 Aug 18 4:35 PM
Hi,
your internal table should contain a field by the name SPART and you should pass by the same name "SPART' to LS_FIELDCAT-FIELDNAME.
Regards,
Ankur Parab
‎2009 Aug 18 4:29 PM
Hello Swati,
You have defined a Macro for populating the field cataolog (this is the 1st time i see a macro being define for Field Catalog)
The field SPART doesnot exist in the structure of RDATA b'coz of which you are getting the dump. I think you have to use LIPS instead of RDATA. Also check if the internal table 'IT_BASIC' has the field SPART.
Hope i am clear.
BR,
Suhas
‎2009 Aug 18 4:57 PM