on 09-23-2008 6:25 PM
Experts,
I need some help coding this Abap.
Scenario: I am Loading some data from DSO1 to DSO2. I have to filter out some documents in a start routine looking up a master data table.
My master data table has the following fields
Key: K_MINMAX,K_BUSAREA,0PROD_HIER
Attributes: K_MINPRC,K_MAXPRC (These are key figures).
Now my logic in the start routine should say,
When K_MINMAX = 100 AND K_BUSAREA = 2000 AND 0PROD_HIER = SOURCE_FIELDS-MATERIAL_OPRODH3 (NAVAIGATIONAL)
AND SOURCE_FIELDS-PRICE < K_MINPRC (From the master data table) AND
SOURCE_FIELDS-PRICE > K_MAXPRC (From the master data table).
Delete Data Package.
Can somebody help me code this....
Thanks
Raj
select single k_minprc k_maxprc from <your master data table> into <some local declared variables based on your master data table fields or a work area>
where k_minmax eq '100'
and k_busarea eq '2000'
and 0prod_hier eq source_fields-<the extact fieldname>.
if source_fields-price lt <variable containing k_minprc>
and source_fields-price gt<variable containing k_maxprc>.
delete data_package.
endif.
logic sounds a bit weird... a price that's smaller than the "minimum" and greater than the "maximum"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
some more refinement:
DATA: it-tab like line of /BI0/P... (master data table).
select single k_minprc k_maxprc from <your master data table> into it_tab where k_minmax eq '100'
and k_busarea eq '2000'
and 0prod_hier eq source_fields-<the extact fieldname>.
if source_fields-price lt it_tab-k_minprc
and source_fields-price gt it_tab-k_maxprc.
delete data_package.
endif.
Thanks Raf. Yes that is the business logic.
I coded as suggest by you
here is my code but I am getting an error saying that "Unable to interpret "WA2". Possible causes: Incorrect spelling or comma" Can you suggest what I am doing wrong...
Data: WA1(20) TYPE N.
Data: WA2(20) TYPE N.
select single /BIC/k_minprc /BIC/k_maxprc from /BIC/PK_MINMAX into WA1 WA2.
where k_minmax eq '100'
and k_busarea eq '2000'
and 0prod_hier eq source_fields-K_MATERL__0PRODH2.
if source_fields-K_PCLAMT <= WA1
and source_fields-K_PCLAMT >= WA2.
delete data_package.
endif.
Thanks
Raj
Hi, this code will not work as it is.
remove the period after W2 first.
We need to know th value of k_minmax, k_busarea and 0prod_hier from the source package first.
try this:
Data: tab like line of source_package.
Data: WA1(20) TYPE N.
Data: WA2(20) TYPE N.
read table source_package into tab index 1.
select single /BIC/k_minprc /BIC/k_maxprc from /BIC/PK_MINMAX into WA1 WA2
where /BIC/PK_MINMAX-k_minmax eq '100'
and /BIC/PK_MINMAX-k_busarea eq '2000'
and /BIC/PK_MINMAX-0prod_hier eq tab-K_MATERL__0PRODH2.
if source_fields-K_PCLAMT <= WA1
and source_fields-K_PCLAMT >= WA2.
delete source_package.
endif.
Raj,
Thanks for you input.
I am still having problems when I check my routine
It still gives me the error for the line in bold below..It says "Unable to interpret "WA2". Possible causes: Incorrect spelling or comma"
Data: tab like line of source_package.
Data: WA1(20) TYPE N.
Data: WA2(20) TYPE N.
read table source_package into tab index 1.
select single /BIC/k_minprc /BIC/k_maxprc from /BIC/PK_MINMAX into WA1 WA2 where /BIC/PK_MINMAX-k_minmax eq '100'
and /BIC/PK_MINMAX-k_busarea eq '2000'
and /BIC/PK_MINMAX-0prod_hier eq tab-K_MATERL__0PRODH2.
if source_fields-K_PCLAMT <= WA1
and source_fields-K_PCLAMT >= WA2.
delete source_package.
endif.
Data: tab like line of source_package.
Data: WA1(20) TYPE N.
Data: WA2(20) TYPE N.
read table source_package into tab index 1.
select single /BIC/k_maxprc from /BIC/PK_MINMAX into WA2 where /BIC/PK_MINMAX-k_minmax eq '100'
and /BIC/PK_MINMAX-k_busarea eq '2000'
and /BIC/PK_MINMAX-0prod_hier eq tab-K_MATERL__0PRODH2.
select single /BIC/k_minprc from /BIC/PK_MINMAX into WA1 where /BIC/PK_MINMAX-k_minmax eq '100'
and /BIC/PK_MINMAX-k_busarea eq '2000'
and /BIC/PK_MINMAX-0prod_hier eq tab-K_MATERL__0PRODH2.
if source_fields-K_PCLAMT <= WA1
and source_fields-K_PCLAMT >= WA2.
delete source_package.
endif.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.