Skip to Content
0
Former Member
Mar 04, 2009 at 11:04 AM

Function used in web dynpro java application

24 Views

Hi

I am creating some application in web dynpro java by using ABAP function module and table. I am trying to put data to table and update data in table and delete data in table in my application by using ABAP function by using RFC. And this is the ABAP function module.

FUNCTION ZUP_DESIG12.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(DESG_CODE) TYPE  ZUP_DESIG-DESG_CODE OPTIONAL
*"     VALUE(DESG_DESC) TYPE  ZUP_DESIG-DESG_DESC OPTIONAL
*"     VALUE(DESG_ACT) TYPE  ZUP_DESIG-DESG_ACT OPTIONAL
*"     VALUE(DESG_OPT) TYPE  ZUP_DESIG-DESG_OPT OPTIONAL
*"  TABLES
*"      WA STRUCTURE  ZMSTR_DESIG
*"----------------------------------------------------------------------


DATA CNT TYPE I.
SELECT MANDT DESG_CODE DESG_DESC DESG_ACT FROM ZMSTR_DESIG
  INTO TABLE WA.
IF DESG_OPT = 'U'.
UPDATE ZMSTR_DESIG
    SET DESG_DESC = DESG_DESC
    DESG_ACT = DESG_ACT
    WHERE DESG_CODE = DESG_CODE.
MESSAGE 'Updated Successfully' TYPE 'I'.
ELSEIF DESG_OPT = 'C'.
 SELECT COUNT( * ) FROM ZMSTR_DESIG INTO CNT
   WHERE DESG_CODE = DESG_CODE.
   IF CNT > 0.
   MESSAGE 'Duplicate Designation code' TYPE 'I'.
   ELSE.

  WA-DESG_CODE = DESG_CODE.
  WA-DESG_DESC = DESG_DESC.
  WA-DESG_ACT = DESG_ACT.

  MODIFY ZMSTR_DESIG FROM WA.

   MESSAGE 'Inserted successfully' TYPE 'I'.
 ENDIF.

 ELSEIF DESG_OPT = 'D'.
   DELETE FROM ZMSTR_DESIG WHERE DESG_CODE = DESG_CODE.
   MESSAGE 'Deleted successfully' TYPE 'I'.
 ENDIF.
ENDFUNCTION.

I am not able to put data to table through my application but i am getting this error.

	java.lang.ArrayIndexOutOfBoundsException: -1

What might be the problem .

Regards,

H.V.Swathi