Skip to Content
0
Former Member
Nov 07, 2014 at 12:40 PM

expert routine problem

72 Views

Hello All,

I am having a requirement where i have to write an expert routine to load the data from Infocube to write optimized DSO.I have written below code in the expert routine and when i started loading the data i am getting GETWA_NOT_ASSIGNED error and load is getting failed.Please can some one look in to this code and give me your valuable suggestions.

TYPES : BEGIN OF INT_VISTEX,

SALESORG TYPE /BI0/OISALESORG,

DISTR_CHAN TYPE /BI0/OIDISTR_CHAN,

CLAIM TYPE /BI0/OICLAIM,

/BIC/ZOCVCLTYP TYPE /BIC/OIZOCVCLTYP,

/BIC/ZOCVCLITM TYPE /BIC/OIZOCVCLITM,

MATL_TYPE TYPE /BI0/OIMATL_TYPE,

MATERIAL TYPE /BI0/OIMATERIAL,

CUSTOMER TYPE /BI0/OICUSTOMER,

/BIC/ZOCVIDENT TYPE /BIC/OIZOCVIDENT,

/BIC/ZOCLMREF TYPE /BIC/OIZOCLMREF,

CUST_SALES TYPE /BI0/OICUST_SALES,

G_UVV9LD TYPE /BI0/OIG_UVV9LD,

AMOUNT TYPE /BI0/OIAMOUNT,

VOLUME TYPE /BI0/OIVOLUME,

END OF INT_VISTEX.

DATA: TEMP_INT_VISTEX TYPE INT_VISTEX,

WA_INT_CLAIM TYPE STANDARD TABLE OF /BI0/PCLAIM,

WA_INT_MATERIAL TYPE STANDARD TABLE OF /BI0/PMATERIAL,

WA_INT_CUSTOMER TYPE STANDARD TABLE OF /BI0/PCUSTOMER,

WA_INT_VISTEX TYPE STANDARD TABLE OF INT_VISTEX,

OBJVERS TYPE RSOBJVERS.

DATA: source_pkg LIKE LINE OF SOURCE_PACKAGE[],

result_pkg LIKE LINE OF RESULT_PACKAGE[].

IF ( WA_INT_CLAIM IS INITIAL ).

SELECT * FROM /BI0/PCLAIM INTO TABLE WA_INT_CLAIM WHERE OBJVERS = 'A'.

ENDIF.


IF ( WA_INT_MATERIAL[] IS INITIAL ).

SELECT * FROM /BI0/PMATERIAL INTO TABLE WA_INT_MATERIAL WHERE OBJVERS = 'A'.

ENDIF.

IF ( WA_INT_CUSTOMER[] IS INITIAL ).

SELECT * FROM /BI0/PCUSTOMER INTO TABLE WA_INT_CUSTOMER WHERE OBJVERS = 'A'.

ENDIF.

IF NOT SOURCE_PACKAGE[] IS INITIAL.

CLEAR :TEMP_INT_VISTEX.

LOOP AT SOURCE_PACKAGE[] INTO <SOURCE_FIELDS>.


READ TABLE WA_INT_CLAIM Transporting no fields

With key CLAIM = <source_fields>-CLAIM.

IF sy-subrc NE 0.

DELETE source_package index sy-tabix.

ENDIF.

READ TABLE WA_INT_MATERIAL Transporting no fields

With key MATERIAL = <source_fields>-MATERIAL.

IF sy-subrc NE 0.

DELETE source_package index sy-tabix.

ENDIF.

READ TABLE WA_INT_CUSTOMER Transporting no fields

With key CUSTOMER = <source_fields>-CUSTOMER.

IF sy-subrc NE 0.

DELETE source_package index sy-tabix.

ENDIF.

CLEAR : RESULT_PACKAGE[],

WA_INT_VISTEX.

TEMP_INT_VISTEX-SALESORG = <SOURCE_FIELDS>-SALESORG.

TEMP_INT_VISTEX-DISTR_CHAN = <SOURCE_FIELDS>-DISTR_CHAN.

TEMP_INT_VISTEX-CLAIM = <SOURCE_FIELDS>-CLAIM.

TEMP_INT_VISTEX-/BIC/ZOCVCLTYP = <SOURCE_FIELDS>-/BIC/ZOCVCLTYP.

TEMP_INT_VISTEX-/BIC/ZOCVCLITM = <SOURCE_FIELDS>-/BIC/ZOCVCLITM.

TEMP_INT_VISTEX-MATL_TYPE = <SOURCE_FIELDS>-MATL_TYPE.

TEMP_INT_VISTEX-MATERIAL = <SOURCE_FIELDS>-MATERIAL.

TEMP_INT_VISTEX-CUSTOMER = <SOURCE_FIELDS>-CUSTOMER.

TEMP_INT_VISTEX-/BIC/ZOCVIDENT = <SOURCE_FIELDS>-/BIC/ZOCVIDENT.

TEMP_INT_VISTEX-/BIC/ZOCLMREF = <SOURCE_FIELDS>-/BIC/ZOCLMREF.

TEMP_INT_VISTEX-G_UVV9LD = <SOURCE_FIELDS>-G_UVV9LD.

TEMP_INT_VISTEX-AMOUNT = <SOURCE_FIELDS>-AMOUNT.

TEMP_INT_VISTEX-VOLUME = <SOURCE_FIELDS>-VOLUME.

TEMP_INT_VISTEX-CUST_SALES = <SOURCE_FIELDS>-CUST_SALES.

COLLECT TEMP_INT_VISTEX INTO WA_INT_VISTEX.

ENDLOOP.


LOOP AT WA_INT_VISTEX INTO TEMP_INT_VISTEX.

READ TABLE SOURCE_PACKAGE[] INTO source_pkg WITH KEY

CLAIM = TEMP_INT_VISTEX-CLAIM

CUSTOMER = TEMP_INT_VISTEX-CUSTOMER

MATERIAL = TEMP_INT_VISTEX-MATERIAL.


IF SY-SUBRC = 0.

CLEAR : RESULT_PKG.


RESULT_PKG-/BIC/CDDOCNUM = TEMP_INT_VISTEX-CLAIM.

RESULT_PKG-/BIC/ZOCMTMSR = 'VISTEX'.

RESULT_PKG-/BIC/CGTRANTYP = TEMP_INT_VISTEX-/BIC/ZOCVCLTYP.

RESULT_PKG-/BIC/CDREFNUM = TEMP_INT_VISTEX-/BIC/ZOCLMREF.

RESULT_PKG-/BIC/CGPRODUCT = TEMP_INT_VISTEX-MATERIAL.

RESULT_PKG-SHIP_TO = TEMP_INT_VISTEX-CUSTOMER.

RESULT_PKG-/BIC/CDITMNUM = TEMP_INT_VISTEX-/BIC/ZOCVIDENT.

RESULT_PKG-/BIC/CDDSTACT = TEMP_INT_VISTEX-CUST_SALES.

RESULT_PKG-/BIC/KGAMOUNT = TEMP_INT_VISTEX-AMOUNT.

RESULT_PKG-/BIC/KGVOLUME = TEMP_INT_VISTEX-VOLUME.

RESULT_PKG-G_UVV9LD = TEMP_INT_VISTEX-G_UVV9LD.

APPEND RESULT_PKG TO RESULT_PACKAGE.

ENDIF.

ENDLOOP.

ENDIF.