Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Customer field as mandatory in Shopping Cart (SSP in ECC6 EhP6)

laurent_burtaire
Active Contributor
0 Kudos

Hello,

i opened a thread here.

But maybe, it could be more relevant in this forum...

Does anybody have an idea on how to make a field mandatory?

Regards.

Laurent.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Laurant,

I understand, that you want to mark a field which was added as an extension to a node to mandatory. This could be achieved by creating an enhancement BO, having a determination for calculating the properties. For further details please check the help portal documenation for Business Object Builder:

BO Builder in general: http://help.sap.com/erp2005_ehp_05/helpdata/en/2f/e689105fc6487c89b084d1ffd24678/content.htm?framese...

Determinations in general:

http://help.sap.com/erp2005_ehp_05/helpdata/en/be/bbf0e6c29d42d3bed9865be5597018/content.htm

Determinations for calculating dynamic properties:

http://help.sap.com/erp2005_ehp_05/helpdata/en/d4/66f95efd084830a0d0fa8ca2be82d2/content.htm?framese...

Best regards,

Carsten

26 REPLIES 26

Former Member
0 Kudos

Hi Laurant,

I understand, that you want to mark a field which was added as an extension to a node to mandatory. This could be achieved by creating an enhancement BO, having a determination for calculating the properties. For further details please check the help portal documenation for Business Object Builder:

BO Builder in general: http://help.sap.com/erp2005_ehp_05/helpdata/en/2f/e689105fc6487c89b084d1ffd24678/content.htm?framese...

Determinations in general:

http://help.sap.com/erp2005_ehp_05/helpdata/en/be/bbf0e6c29d42d3bed9865be5597018/content.htm

Determinations for calculating dynamic properties:

http://help.sap.com/erp2005_ehp_05/helpdata/en/d4/66f95efd084830a0d0fa8ca2be82d2/content.htm?framese...

Best regards,

Carsten

0 Kudos

Hi Laurent,

let me share some experience one of our customers has made in this context, maybe it is also interesting for you:

As the determination Carsten is suggesting (of course) is attached to some node, by consequence it will only run for existing node instances. Sounds trivial but might have some impact in this context:

If you have some mandatory field on the screen, for which an instance of the underlying node is created if (and only if) the user enters something, she/he most probably will not get an error message if he does not fill the field - as there is no node instance which the determination could be run for. 

Not sure if this is something which could happen in your situation

By the way: If you have an FPM based UI there is also a way to do mandatory field checks on the UI layer (unfortunately having other limitations )

Best regards,

Andreas

0 Kudos

Hello,

thank you Carsten and Andreas for the information.

I will check this in the beginning of next week: i will let you inform about it !

Regards.

Laurent.

0 Kudos

Hello all,

i read sap.help regarding my issue but i still do not understand how to make my fields mandatory

Inside BOBF transaction (Business Object Configuration), i do not know what i have to do.

I found class to check mandatory fields, but i do not understand how property field is managed:

Any advises?

Regards.

Laurent.

0 Kudos

Hi Laurent,

We can set the mandatory fields in the Node Categories of node.

Thanks,

Dhivya.

0 Kudos

Dear Andreas,

I didn't fully get your example but it seems to me you are messing up properties and validations. As this is a common misunderstandind, let me try to clarify:

A property of a note attribute defines how the consumer shall interpret some aspect of the attribute, e. g. whether it's mandatory or not, whether it's changeable and so on. The properties however need to be explicitly requested by the consumer (via core-service retrieve_properties).

But the consumer is not forced to do this, properties have only an informative-role.

So this is not automatically an information of which the adherence to it is ensured by this! If you want a property being validated, there are different ways of doing that:

  • let BOPF generically interpret the properties. This is a general setting for the whole business object. By default this is set to validate the static properties.
  • If you need dynamic properties to be validated as well, I'd recommend to configure a dedicated validation. In order not to duplicate code, you can use the same ABAP-class (simply add the validation interface to it) and refactor the code which checks e. g. the changeability of the instances to a separate method which you call from the execute-methods of both the determination and the validation interface. Caution: Don't return failed-keys from the determination, as this has a side-effect that the determination will be executed after each roundtrip!
  • Especially for ensuring adherance to the mandatory-properties of node-attributes, there is a generic validation (from a library) which you simply need to add to the node: /BOBF/CL_LIB_V_MANDATORY_ATTR . This is far better than relying on the UI to ensure the consistency.

Hope this clarified the responsibilities a bit. If not, just ask

Cheers, Oliver

0 Kudos

Dear Laurent,

apart from the so-called staic properties which Dhivya has described where do apply at designtime, there is the opportunity to derive a mandatory property at runtime. As these "dynamic properties" are calculated implicitly, they have to be created / changed by a determination. These "property-determinations" need to be triggered at the node before retrieve.

How to create them programatically is described in Carsten's links.

Sample:

DATA lo_property_helper TYPE REF TO /bobf/cl_lib_h_set_property.

*      updating property nodes is done using the property helper

CREATE OBJECT lo_property_helper

     EXPORTING

          is_context = is_ctx

          io_modify  = io_modify.

lo_property_helper->set_attribute_mandatory(

     iv_attribute_name = lv_fieldname

     iv_key            = lr_acc_data->key

     iv_value          = lv_mand_check

).

Cheers,

Oliver

0 Kudos

Hello Dhivya,

thanks for the answer...

I enhanced Business Object /SRMERP/CO_SC_ESS using BOB transaction: i see my enhancement in BOBF transaction as Sub Business Objects.

But for Node Element i want to modify its Node Category, i am not able to be in change (button to be in modification is not active).

How can i be in modification in my enhancement?

Regards.

Laurent.

0 Kudos

Dear Laurent,

transaction /bobf/conf_ui is not released for customers. I do not know whether the BOB allows modelling of static properties as it's functionality is very limited.

The "expert mode" which is delivered as transaction BOBX is just getting created (note 1939016 is just bein revised, afaik). This modeling environment will surely feature the modeling of of static properties.

Cheers, Oliver

0 Kudos

Hello Oliver,

OK, thank you regarding BOBF transaction: i did not see it is for 'Internal use only'...

You talk about BOBX transaction. This transaction does not exist in my system.

But my software component WEBCUIF has a 7.31 release for NW (SP SAPK-73105INWEBCUIF).

Is it link to OSS note 1939016 which is not yet released.

Regards.

Laurent.

0 Kudos

Hi Laurent,

as already supposed by Oliver we are currently revisting the BOBX note. I expect that the note will be available for customers at the beginning of next week.

BOBX is a design-time for customers to build new applications with BOPF and will complete our tooling together with BOB which stays the design-time for enhancement scenarios.

Best regards,

Carsten

0 Kudos

Hello Carsten,

OSS note 1939016 - Neue Transaktion BOBX is now available.

Nevertheless, this note exists only in german langage.

When this note will be released in english?

Regards.

Laurent.


0 Kudos

Hi Laurent,

the translation should be provided automatically after the release. I expect that this will happen within the next days. If not or if you face other problems please don't hesitate to contact me.

Best regards,

Carsten

0 Kudos

Hi Laurent,

today the note is also available in english. Could you please try again from your side?

Regards,

Carsten

0 Kudos

Hello Carsten,

yes, it is OK: english translation is done

I have to check now with the customer if we use or not this transaction.

I will let you informed.

Regards.

Laurent.

0 Kudos

Hello,

before implementation of OSS note 1939016 - New transaction BOBX, we tried to manage field properties through dynamic method (runtime property).

For this, we tried with a PostExit method for /BOFU/IF_FBI_VIEW_EXITINTF_RUN~ADAPT_FIELD_PROPERTIES method

from /SRMERP/CL_FBI_VIEW_EXIT_BASE class.

Unfortunately, it does not work. I think problem comes from ABAP code.

I found below OSS notes:

o 1766463 - Not able to make fields read only

o 1776231 - Not able to make fields read only - continue

o 1781859 - Not able to make fields read only - continue 2

o 1935790 - Feature request: provide current usage values to ADAPT*

o 1952642 - Field Usages set only for the first view

Last OSS note is not released yet (due to rework i guess).

After implentation of above OSS notes, i will check if it is finally possible to manage field properties.

Regards.

Laurent.

0 Kudos

Dear Laurent,

Note 1952642 is not released since it has side effects that are still pending for correction.

Therefore I would suggest to implements the other notes and do the checks.

Best regards,

Tami

0 Kudos

Dear Laurent,

Note 1952642 is now ready and released.

But you should implement also note 1974627 which is a followup note.

Best regards,

Tami

0 Kudos

Hello Tami,

we applied OSS notes:

1952642 - Field Usages set only for the first view

1974627 - Follow-up: Field Usages set only for the first view

Inside /BOFU/IF_FBI_VIEW_INSTANCE_NEW~GET_FIELD_PROPERTIES method (row 14 for OSS note 1952642 and row 13 for OSS note 1974627), there is this declaration:


ls_header TYPE /bofu/if_uicfg_c=>ts_fbi_data

This is not correct as interface /bofu/if_uicfg_c does not exist. As a consequence, when launching the “Shop” transaction, we have a DUMP.

We opened an OSS message for this point.

Regards.

Laurent.

0 Kudos

Dear Laurent,

We are handling the issue.

We will update you as soon as possible via OSS.

Thank you and best regards,

Tami

0 Kudos

Hello Tami,

thank you for the update.

Regards.

Laurent.

0 Kudos

Hello Tami,

currently, i do not work for customer concerned by OSS message you answered to.

I will be able to check OSS note 1981947 (which is not released yet) only by the end of next week.

Regards.

Laurent.

0 Kudos

Dear Laurent,

Note 1981947 is now released.

Thank you and best regards,

Tami

0 Kudos

Hello Tami,

we applied OSS notes:

1952642 - Field Usages set only for the first view

1974627 - Follow-up: Field Usages set only for the first view

1981947 - Fail to implement notes 1952642 and 1974627

Currently, we do not have any DUMP: thank you

Nevertheless, initial problem remains: it is not possible to manage field property using

/BOFU/IF_FBI_VIEW_EXITINTF_RUN~ADAPT_FIELD_PROPERTIES method

from /SRMERP/CL_FBI_VIEW_EXIT_BASE class.

Indeed, this does not change field properties:

1) CUF we created remain not mandatory,

2) Internal note we added to the User Interface remains not changeable.

Here below is code i implemented in a Post-Exit for concerned method:


DATA: lt_field_usage      TYPE fpmgb_t_fieldusage,
          ls_field_usage     
LIKE LINE OF it_field_usage,
          ls_field_properties
LIKE LINE OF ct_field_properties.


    lt_field_usage[]
= it_field_usage[].
   
SORT lt_field_usage BY name.

   
LOOP AT lt_field_usage INTO ls_field_usage.
     
MOVE-CORRESPONDING ls_field_usage TO ls_field_properties.

     
CASE ls_field_properties-name.
       
WHEN 'INTERNAL_NOTE'.
* Internal note
          ls_field_properties
-enabled = '1'.      "enabled field: true (1), false (0)

       
WHEN 'ZZEKGRP'.
* Purchasing Group
          ls_field_properties
-mandatory = '1'.    "mandatory field : true (1), false (0)

       
WHEN 'ZZEKNAM'.
* Purchasing Group name         
*          ls_field_properties-mandatory = '1'.    "mandatory field : true (1), false (0)


       
WHEN 'ZZAFNAM'.
* Requester code
          ls_field_properties
-mandatory = '1'.    "mandatory field : true (1), false (0)

       
WHEN OTHERS.

     
ENDCASE.

     
APPEND ls_field_properties TO ct_field_properties.

     
CLEAR ls_field_properties.

   
ENDLOOP.
* Field properties changed
    cv_field_properties_changed
= abap_true.

What am i missing?

Regards.

Laurent.

0 Kudos

Hello,

new OSS note 1997049 - Issues with field properties of FBI related views was created.

I will try with implementation of this note.

Regards.

Laurent.

vimal
Active Participant
0 Kudos

Hi Dhivya,

Could you please look into following issue:

Thanks,

Vimal