cancel
Showing results for 
Search instead for 
Did you mean: 

attribute value to exit function module

Former Member
0 Kudos

Hello group,

I'm working in a sem-bps project and I have a problem with an exit function, because

I need the function module to read the value of a characteristic's attribute.

I read the standard function module UPF_VARIABLE_USER_EXIT_ATTR: it retrieves the attribute value through the import parameters ITO_ATTR TYPE UPC_YTO_ATTR.

I put this attribute on my exit function but when I check the content of the attribute it’s always empty. Do you know how I can transmit the parameter from the exit planning function to the function module?

Any input is appreciated, thanks Andrea

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Andrea, if you want to fill a variable with the characteristic's attribute of another variable look at the document "HowTo_BPS_VarOfTypeExit.pdf" (i send at your e-mail if you want). It Follows an extract in which it's filled the second variable with the characteristic's attribute of another variable:

******************************************************

Source code: Attribute values

SELECT * FROM /bi0/mbps_produ INTO TABLE lt_chavl

WHERE bps_prodl = ls_varsel-low.

if sy-subrc <> 0.

MESSAGE e026(upc) WITH ls_varsel-low '0BPS_PRODL'.

  • attribute value not found

exit.

endif.

ls_varsel-seqno = '0000'.

ls_varsel-chanm = '0BPS_PRODU'.

LOOP AT lt_chavl INTO ls_chavl.

ls_varsel-seqno = ls_varsel-seqno + 1.

ls_varsel-low = ls_chavl-bps_produ.

APPEND ls_varsel TO eto_charsel.

ENDLOOP.

********************************************************

In the example above ls_varsel contains the attribute value to provide to eto_charsel (the output table in which you have the result).

I suggest you to debug your application to see how ito_attr is passed to the FM.

Hope it helps.

Fabio

Former Member
0 Kudos

Thank you Fabio,

I am not able to identify the name of the table similar to /bi0/mbps_produ of the example.

Where am I supposed to look for the name of this table?

Thanks, Andrea

Former Member
0 Kudos

Andrea,

/bi0/mbps_produ is the name of the master data table of the characteristic, related to the example in the doc, for which you want to retrieve the attribute.

In your case you have to specify the master data table of you characteristic (/bi0/m<<i>your_standard_infoobj</i>> or /bic/m<<i>your_custom_infoobf</i>>).

Hope it helps.

Fabio

Former Member
0 Kudos

Thank you Fabio,

the SELECT FROM statement works fine in order to retrieve the attribute value!

To Yannick:

at the very beginning I wasn't able to retrieve attribute values, so I thought to use an exit type variable, but I see that everything works fine with the standard attribute variable. I chose attribute variable because the selection on planning levels were based on attribute conditions, then a characteristic variable wouldn't fit the needs. I hope I answered your questions.

Andrea

Former Member
0 Kudos

Hi Fabio,

Can you please send the document "HowTo_BPS_VarOfTypeExit.pdf" to me if possible? Thanks very much.

Email:jia_liumsg@hotmail.com

Liu Jia

Former Member
0 Kudos

Hi,

Sent you the document.

thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Andrea,

may I ask why you use Userexit for Attribute variable?

I Inquired by SAP about the aim of Attribute variable of type Userexit.... There is no difference to the characteristic variable of type userexit. ==> In both case you have to fill the ETO_CHARSEL table with the values of the base charateristic!!! So no advantage in that type of variable....

It would interest me if the function works as designed or if it is Bugged as designed !!

Best regards

Yannick

PS:

I wanted to fill the Attribute variable with values of the Attribute of the base characteristic, like it is the case for Attribute variable with fixed values!!!