on 01-29-2008 6:17 PM
Hi,
I am implementing SAP note 487917 through SNOTE.
But I am getting an error saying:
Create an empty object METH ZZ_NOTE_487917 with the corresponding object editor.
Version: SRM-5.0
Can someone guide me to create an object with type METH?
I have no Idea on OO-ABAP.
Thanks,
Ashwin.
Hi Ashwin,
You need to create a Z/custom implementation for the BADI "BBP_CATALOG_TRANSFER".You cannot apply this note directly thorugh SNOTE.
Follow these steps;
-->Goto trascn SE19.
-->Create a Z implementation for the BADI BBP_CATALOG_TRANSFER ,say zBBP_CATALOG_TRANSFER.
-->Then give some description and under methods tab,click on the method ENRICH_ITEM_DATA.
-->In this method,in the editor,write the code which is given in the attached instructions in the note
i.e.
******************************************************************
This implementation is writing all the fields that are filled
in the OCI-Interface to the application log BCT1. Furhtermore
it is also storing the error messages from ENRICH_ITEM_DATA to
the same log. The log can be view with transaction SLG1.
******************************************************************
******** DATA DECLARATION **************************************
Work area for catalog_content
DATA: ITAB_WA TYPE bbp_ws_oci_item_s.
Data of the aplication log
DATA: L_S_LOG TYPE BAL_S_LOG. "Header of application log
DATA: L_S_TEXT(200) TYPE C. "Message lines
DATA: L_S_HANDLE TYPE BALLOGHNDL. "Log Handle.
DATA: L_T_HANDLE_TAB TYPE BAL_T_LOGH. "Handle tab for BAL_DB_SAVE
Data for OCI-Fields
DATA: OCI_FIELDS TYPE DDFIELDS. "all OCI-fields
DATA: OCI_FIELDS_WA TYPE DFIES. "work area for OCI-fields
DATA: HELP_FIELD(30) TYPE C. "dynamic field for loop at OCI-fields
DATA: DISP_FIELD(30) TYPE C.
DATA: H2(40) TYPE C. "conversion to type C
FIELD-SYMBOLS: <F1> TYPE ANY.
Data for OCI-Error-Tab
DATA: CATALOG_CONTENT_ERRORS_WA TYPE BBP_OCI_ERRORS.
******** END OF DATA DECLARATION *********************************
Read all the fields of the OCI-Interface.
CALL FUNCTION 'GET_FIELDTAB'
EXPORTING
tabname = 'BBP_WS_OCI_ITEM_S'
TABLES
fieldtab = oci_fields.
create a log
L_S_LOG-EXTNUMBER = 'CATALOG_DOWNLOAD'.
L_S_LOG-ALUSER = SY-UNAME.
L_S_LOG-ALPROG = SY-REPID.
L_S_LOG-OBJECT = 'BCT1'.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
I_S_LOG = L_S_LOG
IMPORTING
E_LOG_HANDLE = L_S_HANDLE
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
fill the data for the Application Log
CLEAR ITAB_WA.
LOOP AT CATALOG_CONTENT INTO ITAB_WA.
loop at all oci-fields and add nonempty fields to the appl. log
LOOP AT OCI_FIELDS INTO OCI_FIELDS_WA.
CONCATENATE 'ITAB_WA-' OCI_FIELDS_WA-FIELDNAME INTO HELP_FIELD.
ASSIGN (HELP_FIELD) TO <F1>.
IF <F1> IS INITIAL.
only write the fields that are not initial
ELSE.
H2 = <F1>. "conversion to type C
CONCATENATE 'NEW_ITEM-' OCI_FIELDS_WA-FIELDNAME INTO DISP_FIELD.
CONCATENATE DISP_FIELD '=' H2 INTO L_S_TEXT SEPARATED BY SPACE.
add this line to the application log
CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT'
EXPORTING
I_LOG_HANDLE = L_S_HANDLE
I_MSGTY = 'I'
I_TEXT = L_S_TEXT
EXCEPTIONS
LOG_NOT_FOUND = 1
MSG_INCONSISTENT = 2
LOG_IS_FULL = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDLOOP.
check if there are errors for this item in CATALOG_CONTENT_ERRORS
LOOP AT CATALOG_CONTENT_ERRORS INTO CATALOG_CONTENT_ERRORS_WA
WHERE LINE = ITAB_WA-LINE.
CONCATENATE
CATALOG_CONTENT_ERRORS_WA-LINE
CATALOG_CONTENT_ERRORS_WA-TYPE
CATALOG_CONTENT_ERRORS_WA-CODE
CATALOG_CONTENT_ERRORS_WA-MESSAGE
CATALOG_CONTENT_ERRORS_WA-MESSAGE_V1
CATALOG_CONTENT_ERRORS_WA-MESSAGE_V2
CATALOG_CONTENT_ERRORS_WA-MESSAGE_V3
CATALOG_CONTENT_ERRORS_WA-MESSAGE_V4
INTO L_S_TEXT SEPARATED BY SPACE.
add this line to the application log
CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT'
EXPORTING
I_LOG_HANDLE = L_S_HANDLE
I_MSGTY = CATALOG_CONTENT_ERRORS_WA-TYPE
I_TEXT = L_S_TEXT
EXCEPTIONS
LOG_NOT_FOUND = 1
MSG_INCONSISTENT = 2
LOG_IS_FULL = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
ENDLOOP.
Save this log to the data base (Log-Object = BCT1)
CLEAR L_T_HANDLE_TAB.
APPEND L_S_HANDLE TO L_T_HANDLE_TAB.
CALL FUNCTION 'BAL_DB_SAVE'
EXPORTING
I_T_LOG_HANDLE = L_T_HANDLE_TAB
EXCEPTIONS
LOG_NOT_FOUND = 1
SAVE_NOT_ALLOWED = 2
NUMBERING_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
-->After that save and activate your implementation.
Pls let me know if you need any further help.
BR,
Disha.
Do reward full points for useful answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Disha,
Thanks for the timely help.
I followed the exact steps u said.
Activated the BADI.
However, the functional guys didnot get the expected result.
I placed a break-point in the BADI and also in the fn.module which is calling this BADI and trying to run the process but then it is not getting triggered.
Can you help in some way ?
Regards,
Ashwin.
HI,
What is your exact goal??Please write in detail what prompted you to apply this note?
This BADI is called when you trasnfer/add the products from the catalog to your SC.So when you have inserted a break point in the BADI (and if it is activated properly) then when you add the items from the catalog to the SC,the control should go to the BADI.
Please read the documentation of the BADI again;
____________________________________________________
Short Text
Transfer Shopping Cart from Catalog
You can use the Business Add-In BBP_CATALOG_TRANSFER to change or add to the data that the catalog returns to SAP Enterprise Buyer via the catalog interface.
Note that your changes also affect the following applications in SAP Enterprise Buyer:
Confirm Goods Receipt/Service Entry
Plan Products for Maintenance Order
The call of this BAdI occurs in function module 'BBP_WS_IMPORT_SC_DATA'. This module is called by the relevant application to import catalog items previously sent by the browser of the user to the application Web server from there. After the catalog has transferred the data to SAP Enterprise Buyer the system carries out the following actions.
Conversion of ISO code of unit of measure and currency to SAP format
Conversion of price field to SAP format
In the case of transfer of a material or service number:
The system reads the product master with this number. If the number exists, the system transfers from the product master record the description and the purchase order unit of measure.
In the case of a partner number:
The system reads the business partner master with this number. If the number does not exist, the number in the shopping cart item is reset.
Note
In previous Releases, only the tables with the prefix "ENRICHED" were available. These were then returned to the calling application and transferred to the relevant document structure from there. From this Release on, the data is transferred from the current document structure to the application. The relevant tables are included as additional parameters (parameters with the prefix "ET_SC_").
New implementations should use these tables only and set the parameter "ev_sc_structures_used". In order that previous implementations need not be changed, a mapping occurs after the BADI. The parameter controls the mapping direction:
Set: New structure overwrites old structure
Not set: Old structure overwrites new structure
In the method ENRICH_ITEM_DATA, the following parameters are available:
catalog_content
This parameter contains the original data that the catalog transferred to the catalog interface. The structure corresponds exactly to the catalog interface. The data in this parameter is only for information purposes, you make any changes in the parameters et_sc_item_data , et_sc_accounting, et_sc_partner, et_sc_orgdata, et_sc_longtext, and et_sc_messages.
Note
The catalog interface also contains customer fields that you can use for your own purposes. You can pass these on in fields that the application can use further.
enriched_item_data
This parameter contains the data for a shopping cart item in Enterprise Buyer.
Note
This table should not be used in new implementations (see above Note).
enriched_acct_data
This parameter contains all account assignment fields. This parameter is empty at this time in the standard system.
Note
This table should not be used in new implementations (see above Note).
enriched_item_longtext
This parameter contains the long texts for the items.
Note
This table should not be used in new implementations (see above Note).
catalog_content_errors
This parameter contains the error messages that occurred when the catalog items were being enriched.
Note
This table should not be used in new implementations (see above Note).
ev_sc_structures_used
This parameter has to be set if the following tables are used in the implementation (recommended procedure, see Note above) et_sc_item_data This parameter contains the data of a shopping cart item in Enterprise Buyer.
et_sc_accounting
This parameter contains all account assignment fields. In the standard system, this parameter is empty at this time.
et_sc_partner
This parameter contains the links to the requester and the supplier, if used.
et_sc_orgdata
This parameter contains the links to the org. data for the partners from et_sc_partner.
et_sc_longtext
This parameter contains the long texts for the items.
et_sc_messages
This parameter contains the error messages that occurred during enrichment of catalog items. If this table contains a message of type 'E', the item causing this error is not transferred to et_sc_item_data. If the item is added in the BADI again (from the data from catalog_content), the relevant error message should be deleted, since the current SRM Server application generally searches this table for error messages of type 'E' in order to output an error message to the user.
Also as per the note,when you implement this BADI,you can see the error log in SLG1 if any of the data from the catalog (which is being trasnferred to SC) is in error.
BR,
Disha.
Do reward full points for useful answers.
Hi Disha,
Actually there was a problem in activation in the BADI, which i didnt do it seems.
It is getting triggered and the messages are seen in the Web-SRM.
I know i didnt explain you the reason behind implementing this Note:487917.
They want me to implement this note cuz there was no detailed message generated in the Web-SRM Shopping Cart screen.... (we get a message after we transfer the Items in Shop).
So this message was not so explanatory.
However, after implementing this BADI it is giving detailed messages.
This is my first implementation in SRM.
NE ways, are you a functional or a Techinical consultant?
Thanks for your timely help again.
Regards,
Ashwin.
ABAP Consultant.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.