Skip to Content
0
Former Member
Jul 30, 2007 at 11:58 AM

hI

22 Views

Hi,

Iam getting the error at the bold letters.

First error is it is asking KNA1 is Unknown.

Second error is it is asking "KUNNR LAND1 NAME1 ORT01 TELF1" is not expected.

TYPES:

BEGIN OF TY_KNA1,

KUNNR TYPE KNA1-KUNNR,

LAND1 TYPE KNA1-LAND1,

NAME1 TYPE KNA1-NAME1,

ORT01 TYPE KNA1-ORT01,

TELF1 TYPE KNA1-TELF1,

END OF TY_KNA1.

DATA:

ST_KNA1 TYPE TY_KNA1.

&----


*& Module USER_COMMAND_9001 INPUT

&----


  • text

----


MODULE USER_COMMAND_9001 INPUT.

CASE SY-UCOMM.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'INSERT'.

<b>MOVE-CORRESPONDING ST_KNA1 TO KNA1.</b>

INSERT KNA1.

IF SY-SUBRC EQ 0.

MESSAGE S000(0) WITH 'CUSTOMER RECORD INSERTED'.

ELSE.

MESSAGE E000(0) WITH 'CUSTOMER RECORD NOT INSERTED'.

ENDIF.

CLEAR ST_KNA1.

WHEN 'DISPLAY'.

<b>SELECT SINGLE * KUNNR LAND1 NAME1 ORT01 TELF1 FROM KNA1 INTO ST_KNA1

WHERE KUNNR EQ ST_KNA1-KUNNR.

IF SY-SUBRC NE 0.</b>MESSAGE I000(0) WITH ' INVALID CUSTOMER NUMBER'.

ENDIF.

ENDCASE.

ENDMODULE. " USER_COMMAND_9001 INPUT