You are on page 1of 7

Filde control badi testing:cloud

1) Please find the field names which we need to test . please use these field name in the badi for
standard fields.

2)For z custom fields. –please use the identifier mentioned in custom Field AND NOT THE Label.

 BASEUNIT
 PURREQNITEMCURRENCY
 DELIVERYDATE
 MATERIAL
 MATERIALGROUP
 PURREQNPRICEQUANTITY

 PURCHASEREQUISITIONITEMTEXT
 PURCHASEREQUISITIONPRICE
 REQUESTEDQUANTITY
 PRODUCTTYPE
 SERVICEPERFORMER

Pre requisite:Add z custom fields in create own item and item details screen if required .

Now go to Administrator/Welcome1!

Custom fields and logic app.

Click on custom fields : YY1_CUSTOMFIELDSAI

Custom logic app:

Business contex;t: Procurement purchase requisition Item

Badi description:change of Field control for purchase requisition


YY1_HIDE_PRICE

Yy1_hide_price(as this was already implemented. Else you have to create a new one

Note:

Value for FIELDSTATUS can be set to anyone of the following


* '-' Field is Hidden
* '*' Field is only Displayed, which means no entry is possible
* '+' Field is Mandatory, which means an entry must be made
* '.' Field is Optional, which means an entry may be made

Now this is the Badi logic. Blue colour is for Custom field with identifier.

FIELD-SYMBOLS <fs> TYPE mmpur_s_pr_fldsel.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'YY1_CUSTOMFIELDSAI'.


IF sy-subrc EQ 0.

<fs>-fieldstatus = '+'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = ' PRODUCTTYPE'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '*'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = ' PURREQNITEMCURRENCY'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '.'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'MATERIALGROUP'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '-'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'DELIVERYDATE'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '-'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'SERVICEPERFORMER'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '*'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'PURCHASEREQUISITIONITEMTEXT'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '.'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'PURCHASEREQUISITIONPRICE'.

IF sy-subrc EQ 0.
<fs>-fieldstatus = '.'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'BASEUNIT'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '+'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'MATERIAL'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '*'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'REQUESTEDQUANTITY'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '-'.

ENDIF.

Save draftTestPublish.

ALL THE FIELDS AR ECOMIGN AS EXPECTED 😊


Second set of logic:

FIELD-SYMBOLS <fs> TYPE mmpur_s_pr_fldsel.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'YY1_CUSTOMFIELDSAI'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '+'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = ' PRODUCT TYPE GROUP'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '*'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = ' PURREQNITEMCURRENCY'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '.'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'MATERIALGROUP'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '.'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'DELIVERYDATE'.

IF sy-subrc EQ 0.
<fs>-fieldstatus = '-'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'SERVICEPERFORMER'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '*'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'PURCHASEREQUISITIONITEMTEXT'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '.'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'PURCHASEREQUISITIONPRICE'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '.'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'BASEUNIT'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '+'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'MATERIAL'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '*'.

ENDIF.

READ TABLE fieldselection_table ASSIGNING <fs> WITH KEY field = 'REQUESTEDQUANTITY'.

IF sy-subrc EQ 0.

<fs>-fieldstatus = '.'.

ENDIF.

You might also like