cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass attributes of different context node of different component in Custom Search Helps

parth318
Explorer
0 Kudos

My req is to provide the search help to the custom AET field in the component BT112H_SC, BT112H_SC\Items and Context node ADMINI. The result of the search help must be prefiltered on the basis of the Sales organization (SALES_ORG_SHORT) which is the attribute of the component BTOrgset. 

I suppose, to meet the req I have to get the value of Sales org in the GET_V method of the AET field and must pass it to the search help where in Search help exit function i should filter the result.

Correct me if I am wrong.

Using BOL relations, I am trying to get value of sales org in GET_V of the AET field. But I dont know how to pass it in the Search help so that I can further filter the result in the exit fm. 

Please guide me on this and also suggest if there is any other better approach/solution.

Thanks in Advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Parth,

Refer this link :

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=201066680

Thank You & Regards

Ron

parth318
Explorer
0 Kudos

Hi Ron,

Thanks for your reply...

I am looking for the search help issue..

Let me try to explain it again..

I am having

component      A (BT112h_SC)

view                Items

context node   1 (BTADMINI)

attribute           ZXXX (Custom AET field) 

I am implementing the F4 help functionality in GET_V of ZXXX.

Now I have another

component    B(BTOrgSet)

view               Details

context node     2 (BTOrgSet)

attribute          SALES_ORG_SHORT

After fetching the values of Sales org in the local variable lv_sales_org of GET_V of ZXXX successfully, i am implementing the custom search help for ZXXX

As we implement the search help for a field we write..

         ls_map-context_attr   = 'STRUCT.ZXXX'          "'context_attr name'.

         ls_map-f4_attr        = 'f4 parameter name'.

         APPEND ls_map TO:  lt_inmap, lt_outmap.

Now I want to pass the values of the SALES_ORG_SHORT to the parameter of the search help implemented here.

     ls_map-context_attr = 'STRUCT.ZXXX'      " context_attr name of comp A

     ls_map-f4_attr          = 'SALES_ORG'

     Append ls_map to lt_inmap.

Is this correct method to do ??? How do we pass the values stored in the local var lv_sales_org to the search help parameter SALES_ORG...?

Former Member
0 Kudos

Hi Parth,

The procedure you have chosen is the correct one. Just one modification needed.

As you have used different view  Details of context node BTOrgSet, you cannot use it to create a search help in items view . Now as you fetched lv_sales_org value you can pass it as the context_attr.

   ls_map-context_attr =  '\''ABC\'''.   

     ls_map-f4_attr          = 'SALES_ORG'

     Append ls_map to lt_inmap.

Here ABC is a constant , try to fill the lv_sales_org with appending \ and pass it as above( '\''lv_sales_org''').

Regards,

Nithish

parth318
Explorer
0 Kudos

Hi Nitish,

Thanks for your reply...

I want to check whether the value is passed to the SALES_ORG or not.

Can you guide how to access the value of the Sales_org in the custom Search Help exit FM..

Thanks in advance

Former Member
0 Kudos

Hi Parth,

you need not use a help exit FM inside a search help. You can mark the field as importing so that it will receive the mapped value from Get_v_xx method and it will automatically filter the result based on it.

Refer to this link https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d0646247-efe2-2b10-3b99-c1a12ef2d752&overrid....

Regards,

Nithish

parth318
Explorer
0 Kudos

Hi Nithish,

I am implementing standard search help exit FM 'COM_F4_PR_SHLP_EXIT' (dnt remember the exact name) in my custom search help exit FM.

I need to filter the standard exit FM result on basis of value of 'lv_org _sales'.

So want to know how we can access the lv_sales_org value in exit FM....

Former Member
0 Kudos

Parth,

If you are using a standard search help exit in your custom search help , then first identify in the standard whether there is any logic to get the result based on SALES_ORG field , Then only it can filter the value in standard help exit  ( by mapping the value to the field in custom search help as described in previous posts ) .

       If there is no logic , then I would suggest you to make a z copy of the standard and include the logic there .You can check the value in changing parameter of search help exit shlp-selopt . Place the logic accordingly to filter or fetch the records and append it in record_tab

Regards,

Nithish

parth318
Explorer
0 Kudos

Nithish,

I already checked and logic for my req is missing... So as I said in previous post

"I am implementing standard search help exit FM 'COM_F4_PR_SHLP_EXIT' (dnt remember the exact name) in my custom search help exit FM."

I am using the z search help exit in my search help. In source code I am calling standard search help and getting the result.. Now I want to filter this standard result on the basis of lv_sales_org value..

Actually I am confused, how to access the value of  lv_sales_org in source code of my z exit fm...

whether to fetch the shlp,shlp_tab,record_tab..

Exactly where i am getting values in the FM from the search help and exactly where FM gives result to the search help..


Former Member
0 Kudos

Parth,

I guess you didn't read my previous post properly.

You can check the value in changing parameter of search help exit shlp-selopt . Place the logic accordingly to filter or fetch the records and append it in record_tab.

You can debug it and check where the values are populated and how to modify them.

Regards,

Nithish

parth318
Explorer
0 Kudos

Hi Nithish,

Thanks for ur reply...

consider lv_sales_org  = XYZ01

I tried ur logic for passing the value of sales_org in the search help

   ls_map-context_attr =  '\''lv_sales_org\'''.  

     ls_map-f4_attr          = 'SALES_ORG'

     Append ls_map to lt_inmap.

During debugging,i am getting the following in selopt-low

SALES_ORG = lv_sales_org   not XYZ01.

where as I want SALES-ORG = XYZ01....

can you please help me on this..

Former Member
0 Kudos

Hi Parth,

You should not directly pass the variable ,  in fact the value should be passed in  ls_map-context_attr such that at the end while passing  it should look like '\''XYZ01\''' ( All are single inverted commas, also observe \ after the value)

So you should take some string variable lv_string.

concatenate '\'''   lv_sales_org  '\''' into lv_string.

ls_map-context_attr =  lv_string . (  '\''XYZ01\'''  which will be parsed as  \'ZYZ01\' ).

Regards,

Nithish

parth318
Explorer
0 Kudos

Nithish,

Thanks a lot for your help..

In meantime my req changed and its now like the functionality of the UNIT field..

So referring it, I have solved my problem..

Regards,

Parth.