Application Development 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: 

problem in the select query

Former Member
0 Kudos

Hi.

here i have to make the code in exit_saplv56u_004 in include zxv56u11.

there are tables defined in itself.

i have written like this,but not sure about the table updation and the declaration part:

here i am writing this code in exit_sap

TABLES:VTTP,VTTK,LIKP,KNA1.

TABLES:ZOTC_SHPMNT_RTE.

DATA:x_vttp type vttpvb,

x_vttk type vttkvb,

X_LIKP TYPE LIKP,

X_KNA1 TYPE KNA1,

X_ZOTC_SHPMNT_RTE TYPE ZOTC_SHPMNT_RTE,

t_temp type vttk, feels that declaration iswrong

x_temp type vttk. this table andwork area will be used to finally update vttk table feilds

READ TABLE I_XVTTK INTO X_VTTK INDEX 1.

READ TABLE I_XVTTP INTO X_VTTP INDEX 1.

CLEAR X_LIKP.

SELECT SINGLE * FROM LIKP

INTO X_LIKP

WHERE VBELN = X_VTTP-VBELN.

IF SY-SUBRC = 0.

CLEAR X_KNA1.

SELECT SINGLE * FROM KNA1 i jus need 2-3 feilds so howcan i avoid the performance prob

INTO X_KNA1

WHERE KUNNR = X_LIKP-KUNNR.

IF SY-SUBRC = 0.

CLEAR X_TEMP.

SELECT SINGLE * FROM ZOTC_SHPMNT_RTE INTO table t_TEMP

WHERE SHTYP = X_VTTK-SHTYP

AND LAND1 = X_KNA1-LAND1

AND BLAND = X_KNA1-REGIO

AND ZONE1 = X_KNA1-LZONE.

IF SY-SUBRC = 0.

  • IF T_TEMP[] IS INITIAL.

READ TABLE T_TEMP INTO X_TEMP. i want to create a temp internal table

ELSE.

SELECT SINGLE * FROM ZOTC_SHPMNT_RTE INTO TABLE t_TEMP

WHERE SHTYP = X_VTTK-SHTYP

AND LAND1 = X_KNA1-LAND1

AND BLAND = X_KNA1-REGIO.

IF SY-SUBRC = 0.

READ TABLE T_TEMP INTO X_TEMP.

IF SY-SUBRC = 0.

MODIFY vttk FROM t_TEMP. here i want to modify the feilds like vttk-route and vttk-tdlnr

ENDIF.

ENDIF.

ENDIF.

endif.

endif.

1 REPLY 1

Former Member
0 Kudos

First declare a types structure with this 3 variables u want...

now declare a work area(X_KNA1) of this types structure.

And

SELECT SINGLE LAND1 REGIO LZONE FROM KNA1

INTO X_KNA1

WHERE KUNNR = X_LIKP-KUNNR.