cancel
Showing results for 
Search instead for 
Did you mean: 

Add a field on portal side -- Internal Goods/Services

Former Member
0 Kudos

Hi,

While creating a shopping cart from Internal Goods/Services link, selection screen does not contains any field to enter plant information.

i need to add a field for plant.

what is the structure i need to add the required field & what is the BADI.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183819
Active Contributor
0 Kudos

Hi

SRM standard:- Thereis no relationship existing material with combination of plant in SRM like available in ECC.

so how your plant search helps you to search the material in SRM.

you may change the search term by adding plant w.r.t std search term.

Are you going to search a material in the ECC via Function module in SRM.

then only it is possible.

br

muthu

Former Member
0 Kudos

Sorry Muthu i didnt get what u r telling:

whaat i have done is:

BBPH_PRODUCT is the collective search help, BBPH_PRODUCT_GENERAL is the elementary search help which is a standard one(in which i could not see plant/location field), Z_PLANT is my elementary search help in which i have included Plant field along with the existing fields(copied from standard search help and added my field plant). ZBBPV_F4PR_GEN is the selection method(view even this is copied from standard view BBPV_F4PR_GEN) BBP_F4IF_SHLP_EXIT_PRODUCT_GEN is the search help exit. this contains the following code:

do i need to handle any thing in the below to handle my field plant.

function bbp_f4if_shlp_exit_product_gen.

*"----


""Local Interface:

*" TABLES

*" SHLP_TAB TYPE SHLP_DESCT

*" RECORD_TAB STRUCTURE SEAHLPRES

*" CHANGING

*" VALUE(SHLP) TYPE SHLP_DESCR

*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL

*"----


  • Local data -----------------------------------------------------------

  • Constants

constants: lc_hierarchy_ebp type comt_application value '02'.

  • Data declaration

data: lv_hierarchy_guid type comt_hierarchy_guid.

data: lv_tabix type sytabix,

lv_value like ddshiface-value,

lv_langu type spras.

data: ls_selopt type ddshselopt.

data: lv_unit_text type msehl,

lv_product_id type comt_product_id,

lt_product_id type table of comt_product_id,

lt_product_data type table of bbpt_product_purchase_api_exp,

ls_product_data like line of lt_product_data,

lv_unit_out type bbp_unit,

lv_unit_in type bbp_unit.

data: lt_unit_text type table of msehl.

data: ls_t006a like t006a,

*lv_flg is used for clearing the product list(shlp-selopt) that is in the buffer.

lv_flg type c value 'T'.

  • Main part ------------------------------------------------------------

  • EXIT immediately, if you do not want to handle this step

  • IF callcontrol-step <> 'PRESEL' AND

  • callcontrol-step <> 'RETURN '.

  • EXIT.

  • ENDIF.

*"----


  • STEP SELONE (Select one of the elementary searchhelps)

*"----


  • This step is only called for collective searchhelps. It may be used

  • to reduce the amount of elementary searchhelps given in SHLP_TAB.

  • The compound searchhelp is given in SHLP.

  • If you do not change CALLCONTROL-STEP, the next step is the

  • dialog, to select one of the elementary searchhelps.

  • If you want to skip this dialog, you have to return the selected

  • elementary searchhelp in SHLP and to change CALLCONTROL-STEP to

  • either to 'PRESEL' or to 'SELECT'.

if callcontrol-step = 'SELONE'.

endif.

  • PERFORM SELONE .........

*"----


  • STEP PRESEL (Enter selection conditions)

*"----


  • This step allows you, to influence the selection conditions either

  • before they are displayed or in order to skip the dialog completely.

  • If you want to skip the dialog, you should change CALLCONTROL-STEP

  • to 'SELECT'.

  • Normaly only SHLP-SELOPT should be changed in this step.

if callcontrol-step = 'PRESEL'.

*--- Set some selection parameters

*... Hierarchy GUID

  • When you search the product for second time, the search list is shortened and not showing the original list.

  • So buffer has to be cleared once before second search.

  • Clearing the values in shlp-selopt from buffer.

lv_flg = 'F'.

if lv_flg = 'F'.

clear shlp-selopt.

lv_flg = 'T'.

endif.

call function 'COM_APPLCATGRPR_READ_SINGLE'

exporting

iv_application = lc_hierarchy_ebp

importing

ev_hierarchy_guid = lv_hierarchy_guid.

ls_selopt-shlpname = 'BBPH_PRODUCT_GENERAL'.

ls_selopt-shlpfield = 'HIERARCHY_GUID'.

ls_selopt-sign = 'I'.

ls_selopt-option = 'EQ'.

ls_selopt-low = lv_hierarchy_guid.

ls_selopt-high = ''.

append ls_selopt to shlp-selopt .

  • Language

read table shlp-selopt transporting no fields with key shlpfield = 'LANGU'.

if sy-subrc = 4.

ls_selopt-shlpname = 'BBPH_PRODUCT_GENERAL'.

ls_selopt-shlpfield = 'LANGU'.

ls_selopt-sign = 'I'.

ls_selopt-option = 'EQ'.

ls_selopt-low = sy-langu.

ls_selopt-high = ''.

append ls_selopt to shlp-selopt .

endif.

endif.

*"----


  • STEP SELECT (Select values)

*"----


  • This step may be used to overtake the data selection completely.

  • To skip the standard seletion, you should return 'DISP' as following

  • step in CALLCONTROL-STEP.

  • Normally RECORD_TAB should be filled after this step.

  • Standard function module F4UT_RESULTS_MAP may be very helpfull in this

  • step.

if callcontrol-step = 'SELECT'.

endif.

*"----


  • STEP POSTSELECT (Select values)

*"----


if callcontrol-step = 'POSTSEL'.

  • Extract the column CARRID into the table results_tab.

  • This should always be done, using the F4UT-functions.

  • Don't rely on the layout of the table RECORD_TAB !!!

  • For details see the function documentation.

endif.

*"----


  • STEP DISP (Display values)

*"----


  • This step is called, before the selected data is displayed.

  • You can e.g. modify or reduce the data in RECORD_TAB

  • according to the users authority.

  • If you want to get the standard display dialog afterwards, you

  • should not change CALLCONTROL-STEP.

  • If you want to overtake the dialog on you own, you must return

  • the following values in CALLCONTROL-STEP:

  • - "RETURN" if one line was selected. The selected line must be

  • the only record left in RECORD_TAB. The corresponding fields of

  • this line are entered into the screen.

  • - "EXIT" if the values request should be aborted

  • - "PRESEL" if you want to return to the selection dialog

  • Standard function modules F4UT_PARAMETER_VALUE_GET and

  • F4UT_PARAMETER_RESULTS_PUT may be very helpfull in this step.

if callcontrol-step = 'DISP'.

exit.

endif.

*====================================================================

  • for selected product we must get the order unit with text

if callcontrol-step = 'RETURN'.

  • read product ID

call function 'F4UT_PARAMETER_VALUE_GET'

exporting

parameter = 'PRODUCT_ID'

tables

shlp_tab = shlp_tab

record_tab = record_tab

results_tab = lt_product_id

changing

shlp = shlp

callcontrol = callcontrol

exceptions

parameter_unknown = 1

others = 2.

clear lv_product_id.

read table lt_product_id into lv_product_id index 1.

  • read language

clear lv_value.

call function 'F4UT_PARAMETER_VALUE_GET'

exporting

parameter = 'LANGU'

importing

value = lv_value

tables

shlp_tab = shlp_tab

record_tab = record_tab

changing

shlp = shlp

callcontrol = callcontrol

exceptions

parameter_unknown = 1

others = 2.

if lv_langu is not initial.

lv_langu = lv_value.

else.

lv_langu = sy-langu.

endif.

  • call product api

call function 'BBP_PDH_PRODUCT_READ_BUFFER'

exporting

i_product_id = lv_product_id

i_language = lv_langu

tables

et_product_purchase_data = lt_product_data

exceptions

not_found = 1

wrong_call = 2

others = 3.

clear ls_product_data.

read table lt_product_data into ls_product_data index 1.

IF ls_product_data-order_unit IS NOT INITIAL.

lv_unit_in = ls_product_data-order_unit.

ELSEIF ls_product_data-base_uom IS NOT INITIAL.

lv_unit_in = ls_product_data-base_uom.

ENDIF.

  • put unit into result table

if lv_unit_in is not initial.

call function 'CONVERSION_EXIT_CUNIT_OUTPUT'

exporting

input = lv_unit_in

importing

output = lv_unit_out

exceptions

unit_not_found = 1

error_message = 2

others = 3.

if sy-subrc <> 0.

lv_unit_out = lv_unit_in.

endif.

  • set unit in the result table

call function 'F4UT_PARAMETER_RESULTS_PUT'

exporting

parameter = 'UNIT'

value = lv_unit_out

  • fieldname = '*'

tables

shlp_tab = shlp_tab

record_tab = record_tab

changing

shlp = shlp

callcontrol = callcontrol

exceptions

parameter_unknown = 1

others = 2.

if sy-subrc = 0.

modify record_tab index 1.

endif.

cl_com_product_basic=>t006a_read_single(

exporting iv_unit = lv_unit_in

iv_langu = lv_langu

importing es_t006a = ls_t006a ).

lv_unit_text = ls_t006a-msehl.

  • set unit text in the result table

call function 'F4UT_PARAMETER_RESULTS_PUT'

exporting

parameter = 'UNIT_TEXT'

value = lv_unit_text

  • fieldname = '*'

tables

shlp_tab = shlp_tab

record_tab = record_tab

changing

shlp = shlp

callcontrol = callcontrol

exceptions

parameter_unknown = 1

others = 2.

if sy-subrc = 0.

modify record_tab index 1.

endif.

endif.

exit.

endif.

*====================================================================

endfunction.

former_member183819
Active Contributor
0 Kudos

Hi

I am asking you where do you this information in SRM i.e

material along with plant details

if you create a new search term for plant. How can you search and where will you search this data?

br

muthu

Former Member
0 Kudos

muthu garu,

i need to add plant to the existing one.

through existing one we r getting product id,product description,language key,category id,product type,logical system,maximum number of hits. Now i need to add my field to this list.

tat means i need to get my plant details based on material.

former_member183819
Active Contributor
0 Kudos

Hi

but what is the use of adding a plant in the search term.

since there is no link between material and plant in srm data . can some one help parsi requirement please?

br

muthu

Former Member
0 Kudos

muthu ......

but how to get this done. this is my first requirement in SRM.

is there any way to handle this from R/3 side.

former_member183819
Active Contributor
0 Kudos

META_READ_TABLE - Fm . As suggested Laurent , by using of this FM, you can validate material combination of plant in ECC via SRM and again SRM will validate that material is available in srm for procurement.

Laurent can you help parsi for this requirement.

br

muthu