Issue while setting GR indicator in PO change BADI
I am working on SRM 7.0 extended classic .
There is a scnario where in the PO is created using created shopping cart number via report BBP_SC_TRANSFER_GROUPED during this report execution the implementation for BBP_PO_CHANGE method of the BBP_DOC_CHANGE_BADI BADI is getting executed.
( In the BBP_PO_CHANGE method I am setting good reciept indicator field ( GR_IND )at item level based on some conditions .
I have written the below code
data: it_item1 type table of BBP_PDS_PO_ITEM_D, ls_item_i TYPE bbp_pds_po_item_icu, ls_item TYPE bbp_po_item_badi. data v_indicator type ZNONGR_INDICATOR. if IT_ITEM is not INITIAL. * refresh et_item. loop at IT_ITEM into ls_item_i. clear: v_indicator, ls_item. select SINGLE NON_GRINDICATOR from ZNON_GRINDICATOR into v_indicator where PRODUCT_CATEGORY eq ls_item_i-CATEGORY_ID. if sy-subrc eq 0. if v_indicator is not INITIAL. clear ls_item_i-GR_IND. else. ls_item_i-GR_IND = 'X'. endif. MOVE-CORRESPONDING ls_item_i TO ls_item. APPEND ls_item TO et_item. CLEAR ls_item_i. endif. endloop. endif.
I am getting out put error as 'Please clear the price or set the "Invoice expected" indicator' .
If I comment the part of the code below
if v_indicator is not INITIAL. clear ls_item_i-GR_IND. else. ls_item_i-GR_IND = 'X'. endif.
This error is not comming. Please suggest where I went wrong.
Thanks & Regards,