03-14-2007 8:00 AM
Hi all,
I have created a BAdi as an enhancement assignment.
I am calling this Badi from a module pool porgram where iam passing 2 values corresponding to material(matnr) and plant (werks).
In the Badi method i vaildate whether the plant exists for the material given.
I am getting following error while gonig for consistency check on module pool.
Program ZSRI_TRY
The obligatory parameter "I_MATERIAL" had no value assigned to it.
Program ZSRI_TRY
Incorrect nesting: Before the statement "ENDLOOP", the structure
introduced by "TRY" must be concluded by "ENDTRY" . . . . . . . .
Program ZSRI_TRY
No open "TRY" statement.
Program ZSRI_TRY
Incorrect nesting: Before the end of the program, the structure
introduced by "IF" must be concluded by "ENDIF" . . . . . .
Please help
03-14-2007 8:09 AM
Hello,
Could you post the part of the coding of the module pool where you are calling the BADI?
Regards,
John.
03-14-2007 8:05 AM
Hi,
Check the code properly. It appears that there is something wrong with TRY -ENDTRY or IF--ENDIF words.
Regards,
Anji
03-14-2007 8:09 AM
Hello,
Could you post the part of the coding of the module pool where you are calling the BADI?
Regards,
John.
03-14-2007 9:28 AM
03-14-2007 9:18 AM
program ZSRI_TRY.
data: i_material type marc-matnr.
data: i_plant type marc-werks.
data: bd type ref to badi_check.
try.
get badi bd.
call badi bd->Z_GETDATA.
endtry.
03-14-2007 9:32 AM
Hello,
The data definition should be:
data: BD TYPE REF TO IF_EX_BADI_CHECK (if your BADI is called BADI_CHECK, which I doubt because custom BADIs should start with Z).
Before you van use any BADI you have to instantiate the object:
data:
zlv_existing type xfeld.
CALL METHOD cl_exithandler=>get_instance
EXPORTING
exit_name = 'BADI_CHECK'
null_instance_accepted = abap_true
IMPORTING
act_imp_existing = zlv_existing
CHANGING
instance = bd.
The call to the method should be: CALL BD->Z_GETDATA
exporting.....
importing....
Regards,
John.