‎2012 Feb 08 11:17 AM
I have a piece of code, which has macro and it skips the below code, which I assume the check withing the macro has failed.Unable to trace anything so far.
* keys set within both stock types must match
relation = s2l_strel_unrelated.
DEFINE check_intsect_key.
* exit if key in intersection doesn't match
check ( intsect z s2l_stock_key_&1 ) or
( keyvals-&1 = stock_type->keyvals-&1 ).
END-OF-DEFINITION.
apply_macro_to_stock_keys check_intsect_key. --- THIS CAUSES THE BELOW CODE TO BE SKIPPED, how to identify WHY ?
* if we get were, the intersection part matches
IF only_me IS INITIAL.
IF only_st IS INITIAL.
relation = s2l_strel_equal.
ENDIF.
* 'me' is more general than stock_type
relation = s2l_strel_more_general.
ELSEIF only_st IS INITIAL.
* 'me' is more specific than stock_type
relation = s2l_strel_more_specific.
ENDIF.
ENDIF.
ENDMETHOD.<Added code tags>
Edited by: Suhas Saha on Feb 8, 2012 5:14 PM
‎2012 Feb 08 12:01 PM
Hi,
Please use search before posting question. It's not possible to debug macro.
BR
Marcin Cholewczuk
‎2012 Feb 08 12:03 PM
Hi Marcin,
I did search for the same and found info which said a macro cannot be debugged. Something else said activate system debugging, which did not work for me.
My concern is the code, how do I decipher what causes different behaviour ?
‎2012 Feb 08 12:28 PM
> Something else said activate system debugging, which did not work for me.
System debugging wont let you debug macros.
I can see that the macro contains a simple CHECK statement(not sure why it was coded this way), you can check the variable contents in debug & see why this condition fails!
BR,
Suhas
‎2012 Feb 08 12:02 PM
Hi,
we cant debug macros in sap.
Regards
sreenivas p
Edited by: sreenivas.p on Feb 8, 2012 1:06 PM
‎2012 Feb 16 9:55 AM
Made the below changes, moved the code out of the macro and debugged the same. Helps.
keys set within both stock types must match
relation = s2l_strel_unrelated.
DEFINE check_intsect_key.
exit if key in intersection doesn't match
check ( intsect z s2l_stock_key_&1 ) or
( keyvals-&1 = stock_type->keyvals-&1 ).
END-OF-DEFINITION.
*
apply_macro_to_stock_keys check_intsect_key.
check ( intsect z s2l_stock_key_matnr ) or
( keyvals-matnr = stock_type->keyvals-matnr ).
if we get were, the intersection part matches