cancel
Showing results for 
Search instead for 
Did you mean: 

GR indicator - Badi

Former Member
0 Kudos

Hello Guru's,

A check box called GR indicator is present in the basic data section of the shopping cart,based on the total value of the SC which is maintained in a custom table the field should be input enabled and disabled.

Requirement - if the cart total value is less than the value present in the custom table the check box field is input enabled and if the value is greater than the value present in the custom table the check box

is input disabled and it should appear.

as of now it is working fine for the first time, but if the cart's total value is changed then the check box which is once grayed out is not becoming input enabled.

the logic which i used is :

doc change :

LOOP AT et_item INTO ls_item WHERE del_ind EQ space.

IF sy-subrc EQ 0.

READ TABLE lt_eitem INTO ls_eitem

WITH KEY guid = ls_item-guid.

IF ls_item-quantity NE ls_eitem-quantity OR ls_item-price NE ls_eitem-price.

value_check = 'CHANGED'.

ELSE.

value_check = 'UNCHANGED'.

ENDIF.

EXPORT value_check FROM value_check TO MEMORY ID 'ZVAL_CHK'.

ENDIF.

ENDLOOP.

cuf badi

IMPORT value_check TO value_check FROM MEMORY ID 'ZVAL_CHK'.

IF value_check EQ 'CHANGED'.

IF is_item-zztotalvalue LE l_val.

ls_et_fields-xdisplay = c_x.

ls_et_fields-xinput = c_x.

ELSEIF is_item-zztotalvalue GE l_val.

ls_et_fields-xdisplay = c_x.

ls_et_fields-xinput = space.

ENDIF.

MODIFY et_fields FROM ls_et_fields

TRANSPORTING xdisplay xinput.

CLEAR ls_et_fields.

ELSEIF value_check EQ 'UNCHANGED'.

IF is_item-zztotalvalue LE l_val.

ls_et_fields-xdisplay = c_x.

ls_et_fields-xinput = c_x.

ELSEIF is_item-zztotalvalue GE l_val.

ls_et_fields-xdisplay = c_x.

ls_et_fields-xinput = space.

ENDIF.

MODIFY et_fields FROM ls_et_fields

TRANSPORTING xdisplay xinput.

CLEAR ls_et_fields.

now if i change the total value the field is not getting grayed out and ungrayed out...

hope this is clear can some body suggest a good logic ...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

solved on my own,thanks

Former Member
0 Kudos

Hi,

I have changed the code in DOC CHANGE badi and what i did is based on the conditions i made the indicator always checked for certain conditions, but at that time the user should not be able to uncheck the box(as of now if user unchecked the check box then the code automatically checks it) i.e, the field should be grayed out, the as we cant write a loop in the CUF BADI to change the fields based on a certain condition? do any have any idea?? help me out in this