cancel
Showing results for 
Search instead for 
Did you mean: 

passing parameter in select option transaction launcher in sap crm web ui

0 Kudos

Hi All,

I have a requirement in my project that user want to execute ABAP report through custom button in WEB UI sales quotation page and they want same quotation number pass in Report select option. i am successfully create Tran section launcher and it is handled my custom button also. can anyone please suggest me how can i pass the current quotation number in select option. i have also inset the screen shot where i pass the quotation number. this is a Z report and custom transaction code like ZABC.

Please suggest !!!! Thanks in advance

Regards,

Nayan Sharma.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Dhruvin,

Thanks For your support... i think i am very close to achieve this functionality i have done all the steps accordingly but still i am not getting current quotation number in select option and also when i have test my business object in ECC their also not getting quotation number in select option. i have created 4 parameter and in param2 i have passed PER and value = quotation no.

but not getting any result. Please suggest.Thanks in advance.

Regards,

Nayan Sharma

dhruv_mehta
Active Contributor
0 Kudos

Hi Nayan,

Can u take a snapshot of debugging of the CRM code and ECC Bor method? and why have you passed PER? press on F1 on ur GUI Screen check the parameter id and passs that

0 Kudos

Hi Dhruvin,

I have passed the DFD as a parameter ID but still i am not getting quotation number in select option and below is the code of BOR method and CRM handler class code ..please suggest  every thing is correct or not ???

ECC BOR code..

Below is CRM Class code.

Please suggest..

Thanks & Regards,

Nayan Sharma.

dhruv_mehta
Active Contributor
0 Kudos

how did u get the Parameter DFD? like did u press F1 and checked right?

0 Kudos

Hi Dhruvin,

My select option field is type of one custom table field. so on that custom table i have press f1 in the select option field and get the parameter ID and pass this in my code.

Below is screen shot.

Regards,

Nayan Sharma.

dhruv_mehta
Active Contributor
0 Kudos

Nayan,

This is a wrong place where you are checking , this Parameter ID is od TABLE FIELD FIELD.
So this is ur custom field and I assume there wont be no parameter id will be there.

u can either use memory id or u can use bdc recording in BOR method. but that's a very basic abap thing and not related to this forum so you can mark above answer as answered.

dhruv_mehta
Active Contributor
0 Kudos

Did u try with the BDC approach to set up screen parameter?

dhruv_mehta
Active Contributor
0 Kudos

Hi Nayan,

Did u read the link which I gave u on previous post if no nevertheless I will explain you full now.

Step 1 : Create New Method in ZTSTC Bor object in ECC system ( I assume u are working on ecc system transaction )

Step 2 : Add Parameters in your method ( I suggest u add more then 1 param for future use )

other then params we have also took a flag in parameter which can used to set a flag if u want to skip first screen.

Step 3 : Make the method dialog and synchronize.

Step 4 : Start Config in CRM for TL. Give Transaction ID and Note down the Class name ( which will be generated)

Step 5 : Give the method we created in ECC to this transaction launcher.

Step 6 : Go to method Prepare_Data_flow in CRM class. and code to pass value to the parameters.

And you are done!

This is it! hope it helps

dhruv_mehta
Active Contributor
0 Kudos

I forgot to paster code

Code in ECC for BOR method :

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.

DATA:
   lv_param1 TYPE CPIDLIST,
   lv_param2 TYPE CPIDLIST,
   lv_param3 TYPE CPIDLIST,
   lv_skipscreen TYPE char1.

    swc_get_element container 'param1' lv_param1.
    swc_get_element container 'param2' lv_param2.
    swc_get_element container 'param3' lv_param3.
    swc_get_element container 'skipsc' lv_skipscreen.

    IF lv_param1 IS NOT INITIAL.
       SET PARAMETER ID: lv_param1-pid FIELD lv_param1-value.
    ENDIF.

    IF lv_param2 IS NOT INITIAL.
       SET PARAMETER ID: lv_param2-pid FIELD lv_param2-value.
    ENDIF.

    IF lv_param3 IS NOT INITIAL.
       SET PARAMETER ID: lv_param3-pid FIELD lv_param3-value.
    ENDIF.

    IF lv_skipscreen IS INITIAL.
       CALL TRANSACTION OBJECT-KEY-CODE.
    ELSE.
       CALL TRANSACTION OBJECT-KEY-CODE and skip first screen.
    ENDIF.
ENDIF.

Code in CRM Class of Custom Transaction Launcher :


data: __gdc    type ref to if_crm_ui_data_context,
         __source type        string,
         __line   type        string,
         __path   type        crmt_ic_ac_identify_path.


__gdc ?=
cl_crm_ui_data_context_srv=>get_instance( gv_view_controller ).
********** Begin of parameter declaration ***********

  data ICWCPROCESSEDOBJECT
  type ty_ICWCPROCESSEDOBJECT .
  data SKIPSC
  type ty_SKIPSC .
  data PARAM5
  type ty_PARAM5 .
  data PARAM4
  type ty_PARAM4 .
  data PARAM3
  type ty_PARAM3 .
  data PARAM2
  type ty_PARAM2 .
  data PARAM1
  type ty_PARAM1 .
  data ICWEBCLIENTBORKEYPARAMETER
  type ty_ICWEBCLIENTBORKEYPARAMETER .
PARAM1-PID
=
'PER'.

PARAM1-value = '30084587'.
  me->set_container_data(
     iv_name  = gc_PARAM1
     iv_value = PARAM1 ).
ICWEBCLIENTBORKEYPARAMETER
=
'PA30'.

  me->set_container_object(
    iv_name        = '<*MAINOBJ*>'
    iv_object_key  = ICWEBCLIENTBORKEYPARAMETER
    iv_object_type = gv_bortype ).


* Data flow is complete - set to false if data is missing
gv_data_flow_complete = abap_true.