cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with code

Former Member
0 Kudos

I have appended a field to the extract structure of a DataSource.

The main body of the code is as follows

TABLES: QMIH, /TPISP/YI_NONSAP.

DATA: L_S_ZOXTG20045 LIKE ZOXTG20045.

LOOP AT I_T_DATA INTO L_S_ZOXTG20045.

L_TABIX = SY-TABIX.

IF L_S_ZOXTG20045-IWERK IS INITIAL.

SELECT SINGLE AUSBS FROM QMIH

INTO L_S_ZOXTG20045-ZZBW_IMP_DATE

WHERE EQUNR = L_S_ZOXTG20045-EQUNR

AND BAUTL = L_S_ZOXTG20045-RK_MATNR.

ELSEIF L_S_ZOXTG20045-IWERK+0(2) = ‘ZZ’.

SELECT SINGLE RK_IMPLEMENT_DT FROM /TPISP/YI_NONSAP

INTO L_S_ZOXTG20045-ZZBW_IMP_DATE

WHERE EQUNR = L_S_ZOXTG20045-EQUNR

AND RK_MATNR = L_S_ZOXTG20045-RK_MATNR.

ELSE.

SELECT SINGLE AUSBS FROM QMIH

INTO L_S_ZOXTG20045-ZZBW_IMP_DATE

WHERE EQUNR = L_S_ZOXTG20045-EQUNR

AND BAUTL = L_S_ZOXTG20045-RK_MATNR.

ENDIF.

MODIFY I_T_DATA FROM L_S_ZOXTG20045 INDEX L_TABIX.

ENDLOOP.

I am getting an error when I try and activate. The details are:

Field 'ZZ' is unknown. It is neither in one of the specified tables nor defined by a DATA statement. However ZZ is meant to represent the first two characteristics of a field IWERK. I cannot see any problems could anyone assist. Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this,

use a variable with assignment L_S_ZOXTG20045-IWERK+0(2) and than use the variable in elsif.

I think this is the problem.

Regards.

Former Member
0 Kudos

Makes sense, will try and no doubt post again if it does not work!! Thanks

Former Member
0 Kudos

The problem was with the quotes that ZZ was placed in. Thanks for all the help

Answers (1)

Answers (1)

Former Member
0 Kudos

I don't know why it gives you this error, but i think you have to put another ENDIF.

Regards.

Paolo

Former Member
0 Kudos

Thanks for that. You are right. However, unfortunately we still get the error