Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV issue

Former Member
0 Likes
1,103

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,067

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.

9 REPLIES 9
Read only

Former Member
0 Likes
1,068

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.

Read only

0 Likes
1,067

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?

Read only

0 Likes
1,067

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

Read only

0 Likes
1,067

I have already defined

CB9 = Division

still i get short dump

Read only

0 Likes
1,067

what does the dump say?

if u provide all the details, the better will be ur chances of getting the solutions!!!

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,067

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

Read only

0 Likes
1,067

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,067

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

Read only

Former Member
0 Likes
1,067

Thanks a lot guys ...problem solved