Skip to Content
0
Former Member
Dec 09, 2011 at 03:34 PM

Field level routine - Error.

139 Views

Hi Team,

I am trying to write a routine for a quantity field as below.

Concept is:

Load DSO13 from DSO5 by doing a look up into DS12 for the qty field.

Transformation is between DSO5 and DS13. For every record in DSO5 check for the combination of Country, can type, market type, year and month in dso12. If there exists a matching record in dso12 add the qty field of dso5 with dso12 and populate the result.

Fields in DSO5: Country, can type, market type, year, month, salesorg,sold to, ship to, quantity

Fields in DS12: Country, can type, market type, year, month, quantity

I have written the following code:

ERROR: Unknown column name "SUM(/BIC/ZQUANTY)" until runtime, you cannot specify a field list.

DATA: rex_adj TYPE /bic/oizquanty,

source_qty type /bic/oizquanty.

SELECT SUM(/BIC/ZQUANTY) INTO source_qty FROM /bic/azedwdso500

WHERE

COUNTRY = SOURCE_FIELDS-country AND

/bic/zcantype = SOURCE_FIELDS-/bic/zcantype

AND /bic/zmkttype EQ SOURCE_FIELDS-/bic/zmkttype

AND calyear EQ SOURCE_FIELDS-calyear

AND calmonth EQ SOURCE_FIELDS-calmonth.

ENDSELECT.

SELECT SINGLE /bic/zadmts INTO rex_adj FROM /bic/azedwds1200

WHERE

/bic/zcountry = SOURCE_FIELDS-country

AND /bic/zcantype = SOURCE_FIELDS-/bic/zcantype

AND /bic/zmkttype EQ SOURCE_FIELDS-/bic/zmkttype

AND calyear EQ SOURCE_FIELDS-calyear

AND calmonth EQ SOURCE_FIELDS-calmonth.

IF Sy-SUBRC = 0.

RESULT = source_qty + rex_adj.

ENDIF.

Can you please help with your thoughts to make it work?

Regards,

Harika.