Adding option to read attributes from DB in case bapi
[attributes] [Bapi] [Case] [Change] [get] [refresh] [sap bapi] [sop bapi]
- Nameformat country missing in BAPI scenario.Symptom The name format country is not filled in a BAPI scenario. Other terms NAMEFORMAT_COUNTRY, NAME FORMAT, BAPI_USER_CREATE1, ADDR_PERS_COMP_INSERT, PARAMETER, BAS_PRINT Reason and Prerequisites The required code to fill the NAMEFORMAT_COUNTRY parameter...
- No proper error messages returned when using case via BAPIsSymptom Meaningless error message returned from BAPIs for wrong input values, For eg : user creates case using BAPI & passes wrong input values get the message: “Internal error: class CL_SCMG_CASE_API; method...
- During case edit raise exception if object is not boundSymptom While making changes to a case, if the attribute object is initial, then a dump occurs. Other terms Case, change, save, bound, dump, exception, initial Reason and Prerequisites If due to...
Symptom
Scenario is valid when using the BAPI’s.
Once the case is opened , the attributes are read from DB and saved in buffer. If the attributes are changed other than by using ‘BAPI_CASE_CHANGEATTRIBUTES’ [ for eg: directly updating the db tables ], the values in the buffer still holds the old values [ if refresh is not called].
Now reading the attributes by ‘BAPI_CASE_GETATTRIBUTES’ , does not return the new values as BAPI reads the buffer values.
Other terms
refresh, bapi ,case,attributes,change, get
Reason and Prerequisites
No option was available to read attribute values from the database.
Solution
Please implement the following manual steps before applying the note.
1. Add optional import parameter in ‘BAPI_CASE_GETATTRIBUTES’.
# Goto transaction SE37.
# type ‘BAPI_CASE_GETATTRIBUTES’ and click on ‘change’ button.
# Goto Import tab, and add the following parameter :
- Parameter Name : IM_RESELECT_DB
- Typing : type
- Associated type : BAPISRMREC-BOOLEAN
- Default value : ‘ ‘
- Optional :
- Pass Value :
- Short text : Read Attributes From Database
# save and activate the BAPI.
2. Apply the note
3. Add the parameter in the BOR interface.
# Goto transaction ‘SWO1′
# type ’scase’ and click on ‘change’ button
# Expand ‘Methods’, the select ‘Case.GetAttributes’ & click on ‘Parameter’ button.Click on ‘Create’ button.
# Pop up asking for ‘create with ABAP dictionary field proposal’ appears, select ‘NO’.
# Add the following parameter.
- Parameter : RESELECT_DB
Under ‘Texts’,
- Name : RESELECT_DB
- Description : Read from DB
Under Parameter Attributes,
- Import : < check the checkbox >
- Name in Function Module : IM_RESELECT_DB
Under Data type reference
- Select ABAP Dictionary.
- Reference Table : BAPISRMREC
- Reference Field : BOOLEAN
# save the parameter.
4. After applying the note, Generate the ’scase’ BOR.
# Goto transaction ‘SWO1′
# type ’scase’ and click on ‘change’ button.
# click on ‘generate’ button