cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Validation for BP- Data model for supplier

mohd_riyajuddin
Participant
0 Kudos

Hello All,

Requirements to dynamically hide some field on run time based on Input  values of some other field.

I have used BAdis USMD_ACC_FLD_PROP_CUST_DEP_SET, By using this BAdis I am able to hide some filed for BP-Supplier but for first time when I enter to            the create supplier screen.


My Requirement on create screen itself Suppose.

If I enter some thing BU_GROUP on Create supplier screen. I want to hide some attributes of AD_POSTAL entity dynamically at run time like (Transportation zone Etc..)


Please let me know...

Regards,

Riyajudin..

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Riyajudin,

Have you considered using Context Based Adaptation ?


Thanks

Uday

mohd_riyajuddin
Participant
0 Kudos

CBA is not possible because my required field is not there on CBA by which basic I will dynamically hide some field based on other.

former_member219747
Participant
0 Kudos

Hi Riyajuddin,

Check the feeder class.

Go to feeder class, GET_DATA method and use parameter CT_FIELD_USAGE.

Using CT_FIELD_USAGE, we can control the behavior of the UI dynamically.

Please let me know if you face any issue on this.

Regards,

Mrityunjai

mohd_riyajuddin
Participant
0 Kudos

Hi,

I have checked Dynamically not able to handle. But Initially when I enter to create supplier screen was able to handle.

My req was to hide some field based on input from other field.

Regards,

Riyajuddin.

former_member219747
Participant
0 Kudos

Based on the value of the input fields, just fill CT_FIELD_USAGE (visibility to 01) for all those fields you want to hide.

You will do this is GET_DATA method of the feeder class.

former_member219747
Participant
0 Kudos

Please take reference from the below code-

If you are a functional guy, please seek help from any developer from your team.

This should fulfill your requirement.

Please mark this thread completed accordingly, when done.

Regards,

Mrityunjai

mohd_riyajuddin
Participant
0 Kudos

Hi,

Thanks for your suggestion.

Working on Data model BP-Supplier

Each UIBB - Supplier details contains data from different entity like (General Data - BP_HEADER, Organisation Data- BP_CENTRAL, Address data - AD_POSTAL)

for each Section on UIBB we have different feeder class.

My req If I am selecting some data from drop down of General data section of BP_HEADER Entity I need to hide some field of AD_POSTAL entity.

As you have said its working fine for single entity.

But my concern  Can we handle what is the data we enter on BP_HEADER entity on feeder class of AD_POSTAL at run time. (Each UIBB has different feeder class) Even I try by using export and import data between feeder class unfortunately fails because same feeder class call multiple time .

Will close the thread by Tomorrow .

Regards,

Riyajuddin.

former_member219747
Participant
0 Kudos

True, we have different feeder classes for different sections here.

So for this there are so many ways we can exchange the data. I would suggest create a custom class which will dynamically set and get data for all the concerned fields.

Other way out would be to use static variables, set in one feeder class, read the same in another feeder class. But try to avoid this, this is not advisable, create a custom class for the same.

Fyi- best way to say thank u is to mark the replys here helpful/correct

let me know if you need more help on this.

Regards,

Mrityunjai

mohd_riyajuddin
Participant
0 Kudos

Thanks for your valuable suggestion....

former_member219747
Participant
0 Kudos

wc dear

Answers (2)

Answers (2)

Former Member
0 Kudos

HI ,

Please check in the application controller of your FPM application configuration . You could be  able to control from there .

sreenu_b2
Explorer
0 Kudos

Hi Rijajuddin,

You should by using the filter on entity AD_POSTAL in your badi and reading the BP_HEADER entity which contains the BU_GROUP. If that satisfies the BU_GROUP as per your business , then change properties of AD_POTSAL entity attributes accordingly

Regards

Srinivasulu bandi

mohd_riyajuddin
Participant
0 Kudos

Hi Srini,

Thanks for your reply,

I Have done what you have suggested but still  dynamic validation is not working.

Please let me know if you can use this BAdis -- USMD_UI_EVENT2  (In my case this BAdis its not triggering)

For application configuration - BS_OVP_SP.

Regards,

Riyajuddin.

sreenu_b2
Explorer
0 Kudos

Hi ,

could you send the code please.

Regards

bandi

sreenu_b2
Explorer
0 Kudos

Hi Rijay,

I have tried this .Make sure to enter BP_GROUP followed by BP role which derives the field propertie LIKE name1, serach term, country etc. attaching the screen shot

I am

Regards

Bandi

mohd_riyajuddin
Participant
0 Kudos

Hi Shrini,

Please look into it..

METHOD if_ex_usmd_acc_fld_prop_cds~modify_fld_prop_attr.

  DATA: lt_entity TYPE usmd_ts_data_entity,

        wa_entity LIKE LINE OF lt_entity,

        it_data1  TYPE REF TO data,

        lr_data   TYPE REF TO data.

  FIELD-SYMBOLS: <fs_data>          TYPE ANY TABLE,

                 <fs_structure>     TYPE any,

                 <fs_bu_group>      TYPE bu_group,

                 <ls_fld_prop_carr> TYPE /mdgbp/_sk_bp_fp_ad_postal..

  IF io_model->d_usmd_model NE 'BP'.

    EXIT.

  ENDIF.

  IF iv_entity = 'AD_POSTAL'.

    CALL METHOD io_model->read_entity_data_all

      EXPORTING

        i_fieldname    = 'BP_HEADER'

        if_active      = ''

      IMPORTING

        et_data_entity = lt_entity.

    IF lt_entity IS NOT INITIAL .

      READ TABLE lt_entity INTO wa_entity INDEX 1.

      lr_data = wa_entity-r_t_data.

      ASSIGN lr_data->* TO <fs_data>.

      IF <fs_data> IS ASSIGNED.

        LOOP AT <fs_data> ASSIGNING <fs_structure>.

          IF sy-tabix EQ 1.

            ASSIGN  COMPONENT 'BU_GROUP' OF STRUCTURE <fs_structure> TO <fs_bu_group>.

            IF <fs_bu_group> EQ '0002'.

              LOOP AT  ct_fld_prop ASSIGNING <ls_fld_prop_carr>.

                <ls_fld_prop_carr>-usmd_fp-rfe_postl   = if_usmd_fld_prop_const=>hidden .

                <ls_fld_prop_carr>-usmd_fp-rfe_post    = if_usmd_fld_prop_const=>hidden .

                <ls_fld_prop_carr>-usmd_fp-post_cod1   = if_usmd_fld_prop_const=>hidden .

                <ls_fld_prop_carr>-usmd_fp-city1       = if_usmd_fld_prop_const=>hidden .

              ENDLOOP.

            ENDIF.

          ENDIF.

        ENDLOOP.

      ENDIF.

    ENDIF.

  ENDIF.

ENDMETHOD.

0 Kudos

Hi Riyajuddin,

The BAdI USMD_UI_EVENT2 is no longer supported for MDG Vendor.

See SCN discussion: http://scn.sap.com/thread/3308478

Please refer SAP note 2126698:

"USMD_ENTITY_VALUE2 is considered as an outdated user interface. SAP continues providing support for all releases before MDG 7.0. New features will not be implemented."



Thanks

Uday