‎2006 Oct 30 2:52 PM
Hi
Am working on SF in which i need to retrive the charectestic values of <i>customer : classification</i> while searching in this forum i came across two FM i need to retrive the values i.e 'BAPI_OBJCL_GETCLASS' BAPI_CLASS_GET_CHARECTERSTICS'.[Not sure this is right or not]
This is the first time am working on classification, i request you how to retrive the values from those and store in internal tables. All i have is 'class name', 'class type'. Don't know how to send the customer number in that.
I request do any one have the sample code or clue regarding above.
‎2006 Oct 30 3:12 PM
HI,
Check the sample code below. I think it will result in all customers. I think you have to pass the customer characterstic name to get the respective classification.
data: BEGIN OF LT_CHAR OCCURS 0.
INCLUDE STRUCTURE BAPI_CHAR.
DATA: END OF LT_CHAR.
DATA: BEGIN OF LT_CHAR_VALUES OCCURS 0.
INCLUDE STRUCTURE BAPI_CHAR_VALUES.
DATA: END OF LT_CHAR_VALUES.
DATA: BEGIN OF LT_SELECTIONCRITERIONS OCCURS 0.
INCLUDE STRUCTURE BAPI_SELECTION_CRITERIONS.
DATA: END OF LT_SELECTIONCRITERIONS.
DATA: BEGIN OF LT_SELECTEDOBJECTS OCCURS 0.
INCLUDE STRUCTURE BAPI_SELECTED_OBJECTS.
DATA: END OF LT_SELECTEDOBJECTS.
DATA: BEGIN OF LT_OBJECTCLASSIFICATION OCCURS 0.
INCLUDE STRUCTURE BAPI_OBJECT_VALUES.
DATA: END OF LT_OBJECTCLASSIFICATION.
*...Function module to get Characteristics and Allowed Values for Class
CALL FUNCTION 'BAPI_CLASS_GET_CHARACTERISTICS'
EXPORTING
CLASSNUM = 'XXXXXX' "Class Name
CLASSTYPE = '011' "Class Type
LANGU_ISO = 'EN'
TABLES
CHARACTERISTICS = LT_CHAR
CHAR_VALUES = LT_CHAR_VALUES.
LOOP AT LT_CHAR_VALUES.
MOVE-CORRESPONDING LT_CHAR_VALUES TO LT_SELECTIONCRITERIONS.
APPEND LT_SELECTIONCRITERIONS. CLEAR LT_SELECTIONCRITERIONS.
ENDLOOP.
*...Function module to get Customer Groups
CALL FUNCTION 'BAPI_CLASS_SELECT_OBJECTS'
EXPORTING
CLASSTYPE = '011'
CLASSNUM = 'XXXXXX'
LANGUISO = '999999'
TABLES
SELECTIONCRITERIONS = LT_SELECTIONCRITERIONS
SELECTEDOBJECTS = LT_SELECTEDOBJECTS
OBJECTCLASSIFICATION = LT_OBJECTCLASSIFICATION.
Thanks
Ramakrishna
‎2006 Oct 30 3:27 PM
Ramakrishna & Vishnu...
Thanx for the responce, let me check both and will be back.
‎2006 Oct 30 4:34 PM
Ramakrishna,
Thank you for your reply, it helped me alot in retrive the values, apart of that i didn't get the logic how to retrive for purticular customer coz in the program no where am passing the customer data. Please help me down in this.
‎2006 Oct 30 4:41 PM
Hi,
If you pass only one customer characteristic name in the TABLE parameter LT_CHAR of bapi function module BAPI_CLASS_GET_CHARACTERISTICS, then other table parameter LT_CHAR_VALUES will return characteristics of that customer only.
CALL FUNCTION 'BAPI_CLASS_GET_CHARACTERISTICS'
EXPORTING
CLASSNUM = 'XXXXXX' "Class Name
CLASSTYPE = '011' "Class Type
LANGU_ISO = 'EN'
TABLES
CHARACTERISTICS = LT_CHAR
CHAR_VALUES = LT_CHAR_VALUES.
Thanks
Ramakrishna
‎2006 Oct 30 5:01 PM
RamaKrishna
Sorry for asking this question since this is the first am dealing with classification.
I had a requirement in SmartForms where based on the customer number i need to check the classification's in terms as per the condition it has to generate the SF if one of the classification value falls below the limit. My question is: The form will running B/G periodically based on customer no. If i place this code in the form, will it check based on that customer no.? Pls do reply.
‎2006 Oct 30 8:09 PM
Hi,
Sorry for my late reply.
You have to check this for all customers.
No prolem at all provided you have not hardcoded the customer in the program.
Please let meknow if you have any doubts.
Thanks
Ramakrishna
‎2006 Oct 30 3:13 PM
Hi Shinoy,
Pls check the Function Module <b>CLAP_DDB_SHOW_CLASSIFICATION</b> this might help u.
Thanks,
Vishnu