on 2024 May 15 11:12 AM
Scenario description:
A company is selling flight tickets and hotel accommodation service both in one sale order.
First Scenario:
We have activated the BADI:
Hiding of Custom Item Fields for Mass Change of Sales Documents
ID : SD_MASSCHG_SLSDOC_ITM_HIDE_EXT
And this is the logic we have copied from the sample code provided by SAP: Can you let me know what changes we need to make to the logic?
Request clarification before answering.
Hi,
Please use the BAdI: ‘SD_SLS_FIELDPROP_ITEM’. It is designed to set field properties for custom fields in sales document items.
FIELDPROPERTIES: Table containing one line for each custom field for the sales document item. For each line (and thus, for each field) the properties Read-Only, Invisible and Mandatory can be set.
- Check if the sales document item material is a flight ticket
- Loop through the field properties table and set custom fields specific to flight ticket as visible and set other custom fields as invisible
IF salesdocumentitem-material = 'ABC'.
LOOP AT field_properties INTO ls_field_properties.
" Set custom fields specific to flight ticket as visible
IF ls_field_properties-field_name = 'YY1_FLIGHT_FIELD1' OR
ls_field_properties-field_name = 'YY1_FLIGHT_FIELD2'.
ls_field_properties-invisible = ''.
ELSE.
" Set other custom fields as invisible
ls_field_properties-invisible = 'X'.
ENDIF.
MODIFY field_properties FROM ls_field_properties.
ENDLOOP.
ENDIF.
Regarding custom fields, some Custom Fields can be used in different scenarios if these scenarios are allowed by the Business Context, which is visible within the Custom Field under Tab "Business Scenarios". You can extend the Custom Field to these available scenarios only.
Best regards,
Meghana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.