Skip to Content
0

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

Sep 13, 2017 at 06:16 AM

76

avatar image
Former Member

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

zcust-ovr.png (6.0 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Krishnendu Laha Sep 13, 2017 at 08:16 AM
1

Hi,

I think the following code should be changed:

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

Thanks,

Krish

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Sep 13, 2017 at 08:53 AM
0

Dear Krishnendu,

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

Thanks & Regards

Udit Sharma

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Sep 13, 2017 at 10:55 AM
0

Thanks. It is resolved now.

Share
10 |10000 characters needed characters left characters exceeded