cancel
Showing results for 
Search instead for 
Did you mean: 

Manipulate data of custom field in Sales UI

Former Member
0 Kudos

Hi Experts,

I have a requirement to add custom fields to VBAP table and display those fields in Sales Order (customer order) item details.

I have managed to display those custom fields in Sales UI by modifying the configuration of LO_OIF_MAIN_APP. I created new tab under tab item details and using custom configuration for the UIBB which is copied from LO_OIF_FORM_ITEM. Lets say I copied the LO_OIF_FORM_ITEM into ZZ_LO_OIF_FORM_ITEM and use this configuration for my new custom tab which consists of several custom fields. Since those fields value need to be manipulated, then I also copied the standard feeder class of CL_LO_OIF_GUIBB_ITEM_FORM into ZZ_CL_LO_OIF_GUIBB_ITEM_FORM, then I modify the method GET_DATA and manipulate the CS_DATA ( I am unable to modify the field content using the BADI since CS_DATA is said to be obsolete).

What happen is the field content can be saved and retrieved successfully from table if I did not manipulate the data at all or if I change the data directly  from the UI, but if I change the field content from my codes (programmatically by replace value of CS_DATA), then it will be displayed but wont be saved to the table. Is there any other way to manipulate custom field content?

Please share any of your experience and suggestion related to this matter.

Thank you.

Regards,

Leo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Leo,

Instead of copying the configuration and feeder class to new one and using it, we can add the custom fields directly to configuration layout by running web dynpro application Enhancement Workbench for LO API (LO_GAF4OIF_EWB_APPL, run with application configuration).

Before running this application, add all the custom fields to VBAP, then run the above application, it will guide how to do that.It will add entries to LORD_MAPPING table also.

Basically it adds all the fields to communication structures, so that those will be available in the configuration layout (Configure group), so that you can those fields in the order you need. so that  we will have consistency in modifying those custom fields.

Thanks

Ram

Former Member
0 Kudos

Hi Ram,

Thank you for your reply. I have this step done and manage to add those custom fields. The problem is that I need to provide default values to those fields based on certain logic. I have managed to provide default values to those fields by copying feeder class CL_LO_OIF_GUIBB_ITEM_FORM into ZZ_CL_LO_OIF_GUIBB_ITEM_FORM and modify the GET_DATA method. But the table wont be updated. However it is still updated when I remove the code. After I trace it further, it seems that the value changes in my program only reflected to the UI, not the context.

Answers (2)

Answers (2)

Former Member
0 Kudos

Leo,

There is a BADI "BADI_SLS_LO_OIF_ITEM_FORM"  can be used enhance the get_data/get_Defintion method. Just implement this BADI with new class,there you can write your own code

Thanks

Ram

Former Member
0 Kudos

Hi Ram,

I tried to implement this BADI, but I cannot manipulate data in attribute CS_DATA of method GET_DATA. The only thing that works in this BADI is to set the visibility of the fields by modifying table CT_FIELD_USAGE.

Thanks.

Leo

Former Member
0 Kudos

i think you have to ehance  feeder class intead of coping configuration

you can add field by enhancing  GET_DEFINITION method of  feeder class then you just need to enhance your configuration and add these field and check  method is it using some specific structure for saving then you have to enhance that structure also

Former Member
0 Kudos

Hi Jitendra,

I am unable to open the documentation of method GET_DEFINITION since it is not available in EN. Can you please show me how to write the code in this method?

Thanks.

Former Member
0 Kudos

IF in your application you are using statndard Feeder class so you havE to enhance this method same as we ebhance normal standard class by using enhancement spot i thinK at start and before end there will be enhancemnet spot available in all feeder class method so you can use at end enhamncement spot and append your field in ET_FIELD_DESCRIPTION.

Former Member
0 Kudos

Actually I found a BADI related to this, but I don't know the concept to write the codes inside this method. Because if you take a look at class CL_LO_OIF_GUIBB_ITEM_FORM in method get_definition, it is not a simple code.

I have managed to add those custom fields by using the configurator, right now I need to know how to manipulate the value of these fields at PBO.

Thank you.

Regards,

Leo

Former Member
0 Kudos

you can use method PROCESS_EVENT  put a breakpoint in it

as per your screen( initial screen or dialog screen ) it's parameter IO_EVENT hold event .

check which event is trigger when you calling screen you can use that event if that event occur you can set default values in fields