cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass BP no. as parameter while calling custom tcode of ECC in CRM using transaction launcher

Former Member
0 Kudos

Dear Experts,

We have called custom transaction code(ZCUST_OVR) of ECC in CRM using transaction launcher. Tcode has BP number as selection parameter. We are able to launch this transaction in CRM webui but BP no. is not getting populated in selection field.

We have created ZTSTC and using its execute method to call transaction and to pass parameter into that transaction. We have added a import parameter of type KUNNR in execute method. Parameter Id is KUN.

We have followed steps mentioned in threads related to this issue. I am attaching my code which I have written in ECC and CRM.

Code in ECC-

Added Parameter - Customer. Method - Execute

BEGIN_METHOD EXECUTE CHANGING CONTAINER.
data: Customer TYPE KNA1-KUNNR.
swc_get_element container 'CUST' CUSTOMER .
IF sy-subrc = 0.
 SET PARAMETER ID 'KUN' FIELD CUSTOMER.
ENDIF.
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
 EXPORTING
 TCODE = OBJECT-KEY-CODE
 EXCEPTIONS
 OK = 0
 NOT_OK = 1
 OTHERS = 2.
IF SY-SUBRC NE 0.
 MESSAGE S059(EU) WITH OBJECT-KEY-CODE.
ELSE.
 CALL TRANSACTION OBJECT-KEY-CODE.
ENDIF.
END_METHOD.

Code in CRM- Method - PREPARE_DATA_FLOW

 LR_GDC ?= CL_CRM_UI_DATA_CONTEXT_SRV=>GET_INSTANCE( GV_VIEW_CONTROLLER ).
LR_ENTITY ?= LR_GDC->GET_ENTITY( NAME = IF_ICCMP_GLOBAL_DATA_CONT_CON=>GDC_CURRENTCUSTOMER ).
 CALL METHOD LR_ENTITY->GET_PROPERTY_AS_VALUE
 EXPORTING
 IV_ATTR_NAME = 'bp_number' " Component Name
 IMPORTING
 EV_RESULT = LV_BP.
ICWEBCLIENTBORKEYPARAMETER ='ZCUST_OVR'.
 ME->SET_CONTAINER_DATA(
 IV_NAME = 'Customer'
 IV_VALUE = LV_BP  ).
 ME->SET_CONTAINER_OBJECT(
 IV_NAME = '<*MAINOBJ*>'
 IV_OBJECT_KEY = ICWEBCLIENTBORKEYPARAMETER
 IV_OBJECT_TYPE = GV_BORTYPE ).

Still we are not able to populated BP in transaction's selection field.

Thanks

Udit Sharma

Accepted Solutions (1)

Accepted Solutions (1)

krishnendu_laha
Active Contributor

Hi,

I think the following code should be changed:

ME->SET_CONTAINER_DATA( IV_NAME ='CUST' IV_VALUE = LV_BP ).

Thanks,

Krish

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks. It is resolved now.

Former Member
0 Kudos

Dear Krishnendu,

We did the change, but still BP no. is not coming.

Thanks & Regards

Udit Sharma