2010 Feb 22 12:00 PM
Hello guys, im facing some troubles with the following code
field mara-matnr SELECT *
from mara
into table itab_mara
where matnr = mara-matnr
and matnr = mara-matkl
WHENEVER NOT FOUND SEND ERRORMESSAGE 107
WITH mara-matnr .the editor doest recognize this code in PAI., is the same with VALUES clause.
what im doing wrong ? . thank you very mch.
Hello guys, im facing some troubles with the following code
field mara-matnr SELECT *
from mara
into table itab_mara
where matnr = mara-matnr
and matnr = mara-matkl
WHENEVER NOT FOUND SEND ERRORMESSAGE 107
WITH mara-matnr .the editor doest recognize this code in PAI., is the same with VALUES clause.
what im doing wrong ? . thank you very mch.
2010 Feb 22 12:11 PM
Hi,
Please check code in where condition. Is the condition is right?
field mara-matnr SELECT *
from mara
into table itab_mara
where matnr = mara-matnr
and matnr = mara-matkl
WHENEVER NOT FOUND SEND ERRORMESSAGE 107
WITH mara-matnr .
MATNR is comparing with MATNR and also MATKL.
When you are doing the valiation make sure that use the chain and endchain stamt.
PAI
CHAIN:
MODULE VALI_DATA.
END CHAIN.
Like above do the code.
2010 Feb 22 12:13 PM
In PAI you have to write
chain.
field mara-matnr module check_material.
endchain.now dbl click on the check_material it will ask for the program name just write the select query in the program.
module check_material input.
SELECT *
from mara
into table itab_mara
where matnr = mara-matnr
and matnr = mara-matkl
WHENEVER NOT FOUND SEND ERRORMESSAGE 107
WITH mara-matnr .
endmodule.Regards
Shiba Prasad Dutta
2010 Feb 22 5:12 PM
but then , this is wrong :
http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbaa3a35c111d1829f0000e829fbfe/content.htm
2010 Feb 25 11:46 AM
i guess im going to do it like you told me , however i think i could write the select in pbo directly
2010 Feb 25 11:51 AM
Hi,
It will not work in PBO module. Do as SHIBA write This is the only way to do it
2012 Nov 14 10:20 AM
Hi José
Actually the syntax works fine, but there are as already mentioned by Thiru the problem that you compare matnr wit matkl. That doesn't make sense.
A second problem is that the editor (even when you get the correct syntax) will paint some of the words in the select statement red as if some error still exists. Don't worry about this. The dynpro will generate ok and all will work.
Ex. of correct syntax:
FIELD MARA-MATNR SELECT * FROM mara
WHERE matnr = MARA-MATNR
WHENEVER NOT FOUND SEND ERRORMESSAGE 221.
Finally you must make sure to have the messag-id addition to the program statement in top of your program. Like this:
REPORT ztest123 message-id M3.
Best regards
Thomas Madsen Nielsen
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |