Skip to Content
avatar image
Former Member

Manipulate data of custom field in Sales UI

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 05, 2013 at 08:28 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • avatar image
    Former Member
    Feb 06, 2013 at 08:17 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • avatar image
    Former Member
    Feb 08, 2013 at 06:09 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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