on 04-03-2009 12:25 PM
We need to replace the CRM_INTLAY_GET_HEADER_GUID by another
function/method in our CRM 7.0 system. This question was asked here
before and the solution should be to use the function module CRM_ORDERADM_H_READ_OW which can't be the solution because for this you need the Header Guid.
And to get this header Guid we used befor the CRM_INTLAY_GET_HEADER_GUID.
Thanks for any ideas!
Hi All,
i had similar requirement while executing action . i used below concept and resolved my problem.
first you have to declare one importing parameter IO_APPL_OBJECT TYPE REF TO OBJECT.
after that write below code:
data: lo_bea TYPE REF TO cl_doc_crm_order_h,
LV_GUID TYPE crmt_object_guid.
lo_bea ?= io_appl_object.
lv_guid = lo_bea->get_crm_obj_guid( ).
it will return order guid trigger from webui.
Hope you will resolved your problem easily.
Regards
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
the original post is already pretty old but I will post my solution because it took me while to figure it out:
BTW: FM CRM_INTLAY_GET_HEADER_GUID is still called by the UI framework.
Implement BADI CRM_BTX_EXTENSIONS methode READ:
method IF_EX_CRM_BTX_EXTENSIONS~READ.
check sy-cprog = 'SAPMHTTP'. "Check if WebUI, maybe there is a better way. Maybe by using class cl_gui_control
data: lv_guid TYPE crmt_object_guid.
READ TABLE it_header_guid INTO lv_guid INDEX 1. "the current header guid is passed to the badi
"using it_header
CALL FUNCTION 'CRM_INTLAY_SET_HEADER_GUID' "publish the guid
EXPORTING
IV_HEADER_GUID = lv_guid.
endmethod.
After that, calling FM CRM_INTLAY_GET_HEADER_GUID will return the current BT guid.
Regards,
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roland,
In CRM7.0, header GUID is not stored in buffer when the transaction is processed from web ui, because web ui is not calling the function module CRM_INTLAY_SET_HEADER_GUID. Ofcourse when the transaction is processed in SAPGUI the function module CRM_INTLAY_SET_HEADER_GUID is still called and therefore the global variable "gv_orderadm_h_guid" is set.
Any of these solutions work:
SOlution1: Call fucntion module CRM_INTLAY_SET_HEADER_GUID in 1O BADIs/ in class CL_CRM_ADMINH_RUN_BTIL using enhancement to set global variable "gv_orderadm_h_guid" if the transaction is processed from web ui.
SOlution2:
This is sample code to fetch header guid from BOL and it works only in Web UI/BOL layer
data: entity TYPE REF TO cl_crm_bol_entity,
obj_name type CRMT_EXT_OBJ_NAME,
obj_key type CRMT_GENIL_OBJECT_ID,
header_guid TYPE crmt_object_guid.
obj_name = entity->get_name( ).
obj_key = entity->get_key( ).
if obj_name = 'BTOrder' or 'BTAdminH'.
CALL METHOD cl_crm_genil_container_tools=>get_key_from_object_id
EXPORTING
iv_object_name = obj_name
iv_object_id = obj_key
IMPORTING
es_key = header_guid.
endif.
You may want to check all function modules starting CRM_INTLAY_GET* whichever you are using in the BADIs.
My C user is still active and give me call if any questions.
Regards,
Paparao Undavali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Roland,
What segment of the business transaction do you have when you need to get the guid? Each segment in memory contains the header guid as part of the OW structure. Technically the header guid is always provided to you in every BADI for the one order structures or a reference guid to get the header is available.
Take care,
Stephen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
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.