2008 Jan 02 3:56 AM
Hi All,
I would like to check for 2 conditions & if either one of the conditions are OK, then proceed with the further section of code.
Conditions
1. IF EKPO-MATNR NE SPACE.
2. IF MARC-DISMM IN ('PD', 'P1').
The node on which i am querying is EKPO & hence can manage the 1st condition as it is a straight check. But not sure how i can manage the 2nd condition, as i need to read the EKPO-MATNR & then for this i need to check in MARC table for DISMM field.
Hope my problem is clear, await inputs.
Vivek
2008 Jan 02 4:27 AM
Hi vivek ,
first check for EKPO condition ,
then if this condition is ok ,
then set the flag.
if the flag is initial
then check for dismm field.
READ EKPO.
IF EKPO-MATNR NE SPACE.
Proceed.
Flag = X.
ENDIF.
IF FLAG IS INITIAL.
READ TABLE MARC WITH MATNR = EKPO-MATNR.
IF MARC-DISMM IN ('PD', 'P1').
Proceed.
ENDIF.
ENDIF.
reward if helpful.
Thanks.
Ramya
Dear All,
Thank you for your inputs, managed to resolve the issue with use of RANGE (as suggested by Ms. Ramya) & also SELECT statement.
Keep the good work going.
Edited by: Vivek on Jan 2, 2008 6:39 PM
2008 Jan 02 4:27 AM
Hi vivek ,
first check for EKPO condition ,
then if this condition is ok ,
then set the flag.
if the flag is initial
then check for dismm field.
READ EKPO.
IF EKPO-MATNR NE SPACE.
Proceed.
Flag = X.
ENDIF.
IF FLAG IS INITIAL.
READ TABLE MARC WITH MATNR = EKPO-MATNR.
IF MARC-DISMM IN ('PD', 'P1').
Proceed.
ENDIF.
ENDIF.
reward if helpful.
Thanks.
Ramya
2008 Jan 02 5:10 AM
HiRamya
Thanks for your valuable suggestion. I have tried the below code based on your advice, but system prompts the message when i do syntax check
"." expected after "MARC".
Can you let me know how i can resolve the issue?
TABLES: MARC.
*Check if item is relevant for MRP
IF EKPO-MATNR <> SPACE.
READ TABLE MARC WITH MATNR = EKPO-MATNR
AND WERKS = EKPO-WERKS.
IF MARC-DISMM IN ('PD', 'P1').
Proceed.
ENDIF.
ENDIF.
Note for Others: Thanks for your inputs, but i have not joined MARC with EKPO & hence cannot do a search as mentioned in your posts.
Vivek
2008 Jan 02 5:14 AM
Friend,
Use like below....
IF MARC-DISMM eq 'PD' or marc-dismm eq 'P1'.
2008 Jan 02 6:19 AM
Hi vivek,
create a range for PD , PI
ranges r_range for dismm.
r_range-sign = 'I'.
r_range-option = 'EQ'.
r_range-low = 'PD'.
append r_range.
clear r_range.
r_range-sign = 'I'.
r_range-option = 'EQ'.
r_range-low = 'PI'.
append r_range.
clear r_range.
then
check if marc-dismm in r_range.
proceed.
let me know .
thanks.
ramya
2008 Jan 02 6:22 AM
i think you missed
read table marc with key matnr = ekpo-matnr.
try this .
2008 Jan 02 7:28 AM
Hi Ramya,
I get the error as below
1. Tried as per your last post
Code:
READ TABLE MARC WITH KEY MATNR = EKPO-MATNR
AND MARC-WERKS = EKPO-WERKS.
Syntax Error:
Field "MATNR" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
2. Also tried with MARC-MATNR
Code
READ TABLE MARC WITH KEY MARC-MATNR = EKPO-MATNR
AND MARC-WERKS = EKPO-WERKS.
Syntax Error
"." expected after "MARC-MATNR".
2008 Jan 02 7:42 AM
Hi vivek,
1. Remove the AND
READ TABLE MARC WITH KEY MARC-MATNR = EKPO-MATNR MARC-WERKS = EKPO-WERKS
regards,
amit m.
2008 Jan 02 8:11 AM
Mr. Amit,
System still prompts the syntax error as below:
"." expected after "MARC-MATNR".
This is the code which i have entered, let me know what i need to rectify:
TABLES: MARC.
ranges r_range for marc-dismm.
r_range-sign = 'I'.
r_range-option = 'EQ'.
r_range-low = 'PD'.
append r_range.
clear r_range.
r_range-sign = 'I'.
r_range-option = 'EQ'.
r_range-low = 'PI'.
append r_range.
clear r_range.
*Check if item is relevant for MRP
IF EKPO-MATNR <> SPACE.
READ TABLE MARC WITH KEY MARC-MATNR = EKPO-MATNR
MARC-WERKS = EKPO-WERKS.
CHECK IF MARC-DISMM IN r_range.
Proceed.
2008 Jan 02 9:00 AM
write like this..
if ekpo-matnr eq space.
READ TABLE MARC WITH KEY MARC-MATNR = EKPO-MATNR MARC-WERKS = EKPO-WERKS.
Edited by: Ramu on Jan 2, 2008 10:01 AM
2008 Jan 02 9:23 AM
Mr. Ramu,
I have entered the READ statement as mentioned by you, but the system prompts the syntax error as below
"." expected after "MARC-MATNR".
Any alternative solution for my problem?
Vivek
2008 Jan 02 9:32 AM
Friend,
I'm sorry, i didn't notice that...you have declard MARC with TABLES keyword....
It is not possible here to use READ TABLE option...as for i know....
2008 Jan 02 9:42 AM
Dear All,
Thank you for your inputs, managed to resolve the issue with use of RANGE (as suggested by Ms. Ramya) & also SELECT statement.
Keep the good work going.
Edited by: Vivek on Jan 2, 2008 6:39 PM
2008 Jan 02 4:46 AM
read EKPO-MATNR.
IF MATNR EQ SPACE.
Proceed with the code...
ELSEIF MARC-DISMM IN ('PD', 'P1').
Proceed with the code...
ENDIF.
Reward points if useful.........
2008 Jan 02 5:02 AM
Hi vivek,
try like this,
IF ekpo-matnr NE space AND ( marc-dismm EQ 'PD' OR
marc-dismm EQ 'P1' ).
ENDIF.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |