cancel
Showing results for 
Search instead for 
Did you mean: 

Issue In saving custom fields on Overview Tab of Freight Order

0 Kudos

Hi,

I have added two new fields to the Overview Tab of a Freight
Order. Appointment Confirmation Field on the Dates Tab under Overview
Tab and Stop Notes on the STOP tab of Overview Tab. We have added both
the fields to the Extension Include of the STOP node of business object
/scmtms/tor and have added the corresponding fields to the screen using
FPM. However, when we fill in any data in these fields and click on save
the field refreshes and data is erased in the fields and the system
message says that save not required.

Can you please help us with this.

Regards,

Archit

Accepted Solutions (0)

Answers (1)

Answers (1)

holger_polch
Explorer
0 Kudos

Hello Archit,

the problem here is that node
OVERVIEW of the TOR Business Object is a transient node, i.e. the data displayed here is only determined at runtime but not persisted in this same format. The underlying FBI-View is related to this transient node and not the STOP node directly. Therefore that data is currently not
taken over on tab change or on SAVE.

Rough solution idea:
1) Writing the new fields:

  • Enhance (e.g. via implicit enhancement) method /SCMTMS/CL_TOR_D_OVERVIEW_AM=>HANDLE_OVERVIEW_STOP_UPDATE (it's a method that is implemented for the corresponding determination).
  • Data Structure (Method Parameter) IS_OVERVIEW_BI is the "Before-Image", i.e. the data before the round trip. Data Structure (Method Parameter) IS_OVERVIEW is the "Current-
    Image", i.e. the data after the round trip.
  • The extension fields should be already included there. By comparing the data in the two mentioned structures, you can find out whether there has been a change of content in your two extension fields.  - Method Parameter CT_MOD contains the respective Changes to be executed by the BOPF Framework.
  • If there is an entry in CT_MOD for the relevant stop key, then the corresponding record must be changed, else if there is no such entry, you need to create a corresponding modification entry in CT_MOD. Pseudo Coding snippet for this:

     Compare IS_OVERVIEW_BI with IS_OVERVIEW.
     IF changes for extension fields took place = abap_true.
       " check if there is already a modification entry for the stop
       READ TABLE ct_mod assigning <ls_mod>
             WITH KEY node = /scmtms/if_trq_c=>sc_node-stop
                       key = is_overview-inb:stop_key.
       IF sy-subrc = 0.
         " yes, there is one; change it.
         modify <ls_mod>-data->zz... "(i.e. the extension field name)
         add 'zz...' to <ls_mod>-changed_fields.
       ELSE.
         " no, there is no such entry.
         create a new modification record for the extension field in
         table CT_MOD.
       ENDIF.
     ENDIF.

2) Reading the fields:

  • Enhance (e.g. via implicit enhancement) method /scmtms/cl_tor_helper_overview=>CREATE_OVERVIEW_STOP
  • In method parameter is_stage-source_stop the extension fields zz... should be already available but they are in this case not simply copied over into ES_OVERVIEW via move-corresponding but are here handled field by field (exceptional case for the mentioned transient node)
  • Add coding like the following for the extension fields:

       es_overview-zz... = is_stage-source_stop-zz...
    
       This will ensure that the already available data of the extension fields is finally transferred to   

       ES_OVERVIEW to be available on the  screen.
     

Best regards,
Holger

0 Kudos

Hi Holger,

I have the same requirement to store an appointment confirmation number with the inbound stop and tried your description in method HANDLE_OVERVIEW_STOP_UPDATE after enhancing the following elements with a new field ZZCONFIRMATION:

Table:         

/SCMTMS/D_TORSTP

Structures:   

/SCMTMS/S_UI_FRE_ORD_OVW_APP

/SCMTMS/S_TOR_OVERVIEW

/SCMTMS/S_TOR_STOP_K

Good news is IS_OVERVIEW-ZZCONFIRMATION makes it with the correct screen value into Method HANDLE_OVERVIEW_STOP_UPDATE, CT_MOD is nicely filled, the new field is listed in internal table CHANGED_FIELDS and CT_MOD[1]-DATA has the value from the screen.

Bad news is the value does not make it down to table /SCMTMS/D_TORSTP.

Is there any other structure that is required for the data transport or anything else that needs to be added for the BOPF modify?

Best Regards,

Mario

update 07/29/2015

If found the structure that was missing. So the following structures need the new field(s) and Holgers coding change instructions from above:

/SCMTMS/S_UI_FRE_ORD_OVW_APP

/SCMTMS/S_TOR_OVERVIEW

/SCMTMS/S_TOR_STOP

The table /SCMTMS/D_TORSTP is implicitly enhanced once structure /SCMTMS/S_TOR_STOP is appended with the new field.

The logic Holger describes above works. Thanks

holger_polch
Explorer
0 Kudos

Hi Mario,

from your update I understood that you got the enhancement to work, based on the example given in the TM Enhancement Guide Document, right? In case you might still need help with making it work, let me know.

Best regards,

Holger

holger_polch
Explorer
0 Kudos

Hi Mario,

from your update I understood that you got the enhancement to work, based on the example given in the TM Enhancement Guide Document, right? In case you might still need help with making it work, let me know.

Best regards,

Holger

0 Kudos

Hi Holger,

the chapter in the enhancement guide was good but the use case was to display additional data not to write them to persistent status. Your description above in this thread did the trick I was just not sure what structures needed to be enhanced.

Is there more details / documentation available how the nodes with structures relate to each other especially for transient notes in TM?

Best Regards,

Mario

holger_polch
Explorer
0 Kudos

Hi Mario,
Not sure whether I understood the question right(?) but based on my understanding I'd answer as follows. I fear that there is no such detailed documentation.

Of course you can see the structures (persistent and transient ones) that are related to each node in the BO Model (e.g. transaction /BOBF/CONF_UI) but the node structures do not necessarily correspond to the UI structures being used for provisioning the data to the User Interface Building Blocks (UIBBs). So the UI structure can deviate from the BO Node structure (name and attributes). Usualy a UIBB makes use of an FBI View where the related mapper class does a "move-corresponding" between BO Node Structure and the related UI structure. In some cases the mapper class might do an individual mapping (using specific coding) of attributes.

In the specific case, the Ovierview is in general a completely transient UI part which might require a few coding enhancements to also handle such indicated WRITE Use Cases. In other use cases this might have to be solved different. In such cases where the UI data is transient, there is always coding involved to determine the data at runtime (Determinations). These kind of Enhancement Use Cases are not quite as generic as with persistent BO nodes only and require individual handling. That's the reason why there is no such detailed documentation for each case.

Best regards,

Holger