BW-BPS and Exit function on a variable
I have a variable that has 2 characteristics. I have an exit function to fill the variable. I am getting a short dump when executing the functional module. Here is the code I am using and the error message. Any help would be appreciated.
ls_varsel-seqno = '0000'.
ls_varsel-chanm = 'ZLOCBRAND'.
ls_varsel-sign = 'I'.
ls_varsel-opt = 'EQ'.
LOOP AT lt_chavl INTO ls_chavl.
if ls_chavl-/BIC/ZLOCBRAND <> ''.
ls_varsel-seqno = ls_varsel-seqno + 1.
ls_varsel-low = ls_chavl-/BIC/ZLOCBRAND.
APPEND ls_varsel TO eto_charsel.
endif.
ENDLOOP.
ls_varsel-chanm = 'ZBUS_UNIT'.
ls_varsel-sign = 'I'.
ls_varsel-opt = 'EQ'.
LOOP AT lt_chavl INTO ls_chavl.
if ls_chavl-/BIC/ZBUS_UNIT <> ''.
ls_varsel-seqno = ls_varsel-seqno + 1.
ls_varsel-low = ls_chavl-/BIC/ZBUS_UNIT.
APPEND ls_varsel TO eto_charsel.
endif.
ENDLOOP.
error : ITAB_ILLEGAL_SORT_ORDER
\CLASS=CL_SEM_VARIABLE\METHOD=GET_VALUE\DATA=RTO_VALUE
Hi Rich,
looks like the table is defined as sorted table. Try to replace your two APPEND statements by INSERT ls_varsel INTO TABLE eto_charsel.
Hope that helps
Stephan
Similar Messages
-
Change Data in BPS Layout: Exit Function
Hello everyone,
We are using BW-BPS and we need to make a sort of a certain characteristic in a Planning Folder. In the specific Planning Folder it was defined an exit function and it was assigned a function module.
We implement the following code:
FUNCTION Z_ORDENAR_CLASSIFICACAO_PLANO.
""Interface local:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_Y_AREA
*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL
*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD
*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM
*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE
*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP
*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF
*" EXPORTING
*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG
*" CHANGING
*" REFERENCE(XTH_DATA) TYPE HASHED TABLE
DATA:
lr_area TYPE REF TO cl_sem_planarea_attributes,
wa_hash_table type ref to data,
l_sortfield type STRING,
lr_t_data TYPE REF TO data.
FIELD-SYMBOLS:
<lt_data> TYPE STANDARD TABLE,
<ht_head> TYPE ANY TABLE,
<xth_data> TYPE HASHED TABLE,
<ls_data> TYPE ANY,
<wa_data> TYPE ANY,
<fundo> TYPE ANY,
<eco> TYPE ANY.
CALL METHOD cl_sem_planarea_attributes=>get_instance
EXPORTING
i_area = i_area
RECEIVING
er_instance = lr_area.
CREATE DATA wa_hash_table LIKE LINE OF xth_data.
ASSIGN wa_hash_table->* TO <ht_head>.
<ht_head> = xth_data.
LOOP AT <ht_head> ASSIGNING <ls_data>.
This is the characteristic that we pretend to sort
l_sortfield = 'S_CHAS-0CMMT_ITEM'.
SORT <ht_head>
BY (l_sortfield) DESCENDING.
ENDLOOP.
<xth_data> = <ht_head>.
UNASSIGN: <ls_data>, <ht_head>.
ENDFUNCTION.
When execute this function, we get a DUMP (ASSIGN_TYPE_CONFLICT). Does anybody have any suggestion how to change a hash table or somehow make a sort in this hash table?
Thanks in advance.
IldaHi,
After some changes in the code, it seems that xth_data table is assuming the new content. In debugging, we could see that the assignment was made and xth_data records are now in a different order. But when executing the BPS Layout assigned to this planning function, all the lines (records) still in the same place. The Layout doesnt change.
This is the code:
FUNCTION Z_ORDENAR_CLASSIFICACAO_PLANO.
""Interface local:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_Y_AREA
*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL
*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD
*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM
*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE
*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP
*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF
*" EXPORTING
*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG
*" CHANGING
*" REFERENCE(XTH_DATA) TYPE HASHED TABLE
DATA:
lr_area TYPE REF TO cl_sem_planarea_attributes,
l_sortfield type STRING,
data_ref TYPE REF TO data,
lr_t_data TYPE REF TO data.
FIELD-SYMBOLS:
<lt_data> TYPE ANY TABLE,
<ls_data> TYPE ANY,
<ls_data_copy> TYPE ANY.
CALL METHOD cl_sem_planarea_attributes=>get_instance
EXPORTING
i_area = i_area
RECEIVING
er_instance = lr_area.
CREATE DATA lr_t_data TYPE (lr_area->typename_t_data).
ASSIGN lr_t_data->* TO <lt_data>.
<lt_data> = xth_data.
CLEAR xth_data.
l_sortfield = 'S_CHAS-0CMMT_ITEM'.
SORT <lt_data> BY (l_sortfield) DESCENDING.
MOVE <lt_data> TO xth_data.
ENDFUNCTION.
Does anybody understand this behavior, why the changes in the user-exit are not assumed in the BPS Layout?
Thanks,
Ilda -
Bug in SAP B1PL 42 on validate events and exiting functions
I've recently tested an upgrade to PL 42. There seems to be an issue when trying to exit a function or trying to set return false.
Here is a sample code of what i use to accomplish in previous patches.
Case SAPboiuCOM.BoEventTypes.et_VALIDATE
Select Case pVal.ItemUID
Case "matPay"
If pval.InnerEvent Then
do nothing
else
Dim oMatrix as SAPbouiCOM.Matrix = oForm.Items.item(pVal.ItemUID).Specific
Select Case pVal.ColUID
Case "RegHours" : if sglRegHours = oMatrix.Columns.Item(pVal.ColUID).Cells.Item(CInt(val(pval.Row)).Specific.Value then Return False
End Select
No matter what I try here, Return False, Exit Function, it does not work. It keeps executing the rest of the code. And yes, the statement gets executed.
Any one else has found something similar to this odd behavior ?
any comments or suggestions would be greatly appreciated
Edited by: Neftali Figueroa on Jan 31, 2008 10:58 AMWell
I found a workaround for this odd problem. What I did was ... since the evaluation part of the code (if statement) was getting executed right, i changed the statement like this
blnValueEdited = (sglRegHours <> Csgl(oMatrix.Columns.Item(pVal.ColUID).Cells.Item(CInt(val(pval.Row)).Specific.Value ))
and then evaluate the blnValueEdited for true -
SEM-BPS Variable with exit function
Hi,
this is my problem. I use a variable for period and I increment the variable dinamically in a sequence of execution. When I try to read the variable with a exit function, the function is only called the first time and return ok the value, but the next time the function not called and the value is returned from the buffer (I think this, because always is the same value).
How can I change this? I need to my function return the variable value, because is changed.
Thanks.Hi,
thanks for replys.
I think the problem occurs after update the patch level to level 15. This is the code of class_constructor in class cl_sem_variable:
method CLASS_CONSTRUCTOR.
data ls_dark type upc_dark2.
select single * from upc_dark2 into ls_dark
where param = c_param_dark_buffer.
if sy-subrc = 0 and ls_dark-value = 'X'.
m_buffer = 'X'.
endif.
endmethod.
The flag m_buffer is always X and for that reason my the value of the variable is read from the buffer and the exit function for read variable isn't called.
What do yo think about this?
Thanks. -
Hi experts,
I am tring to load flat file in BPS using EXIT function.
For that i am using two function modules where one is main function module
and another one is Init.Function.In function moduled there is no errors but
while upload flat file records are not get generated.
Kindly give me some tips to resolve this.
If i case anyone want that FM means i will attcah those FM.
Regards,
KiruthikaNimesh,
Welcome to the forum.
You can not test an SEM exit function from ABAP workbench rather it has to be tested from BPS.
Exit function requires hash table XTH_DATA which is supplied from BPS.
I think you are testing funciton module from SE37 that leads to error message posted by you.
Have some test data in the planning cube & test it from Planning function exit function.
There is a How-To Document "How-To Loop over reference data in FOX formulas".
Though this function doesn't explain about exit function but it depicts execution of a planning funtion which will give you some insights.
Hope it helps.
Hari Immadi
http://immadi.com
SEM BW Analyst -
Hi Experts,
I am new to BPS. I am developing FM for Unit Convertion. Can some body please direct me the procedure to correct the following error? This error is being generated at the time of execution. I am working on BI 7.0.
Please let me know if this is not enough info.
Thanks in advance.
Regards,
Nimesh
Error generating the test frame
Message no. FL819
Diagnosis
The system could not generate a syntactically correct test frame for function module Z_BPS_EXIT_UNIT_CONV. You therefore cannot test the function module using the test environment. You have probably used an ABAP feature in the interface definition that is not yet supported in the test environment.
The error message is:
"ANY TABLE" expected, not "HASHED TABLE".
System Response
Procedure
Check whether you can change the interface of the function module so that it is possible to generate the test frame. If this is not possible,you will have to write your own utility for testing the function module.Nimesh,
Welcome to the forum.
You can not test an SEM exit function from ABAP workbench rather it has to be tested from BPS.
Exit function requires hash table XTH_DATA which is supplied from BPS.
I think you are testing funciton module from SE37 that leads to error message posted by you.
Have some test data in the planning cube & test it from Planning function exit function.
There is a How-To Document "How-To Loop over reference data in FOX formulas".
Though this function doesn't explain about exit function but it depicts execution of a planning funtion which will give you some insights.
Hope it helps.
Hari Immadi
http://immadi.com
SEM BW Analyst -
Parameter Exit Function in Planning Folder
Hi all,
I created the planning function in SEM BPS using exit function. And then I added the parameter exit function 0VERSION to this function. After that, I tried to put this function in the planning folder.
Does anybody know how to put the parameter exit function to the planning folder?
Because I need the user to fill the value of the 0VERSION before they run the function.
I assume this should work as the selection screen.
Currently, Every time I run this function, there is no selection screen or the place that I could fill the value for this field. So, the system always receives no value for this field.
Or Maybe you have another approach to get the user's value without restrict the data before run the exit function.
Thanks a lot for your help,
-Martin Darmawi-This behaviour is quite normal. You should use different approach.
Parameters in exit functions can be filled in parameter group only and only with fixed values.
You should create a planning variable, put it to the folder and then read value of this variable in your exit function with 'API_SEMBPS_VARIABLE_GETDETAIL' for example. -
How to access BPS variables in ABAP Exit Function
Hi Experts,
I am using a Exit Function. My BPS variables contain multiple values. I want to trasfer then (may be directly read) to an internal table from where I can loop over then.
Could you please suggest me the code for this?
Points will be awarded.
Thanks in advance,
ShiweshDid you try using the FMs API_SEMBPS_VARIABLE_GETDETAIL or Z_VARIABLE_GET_DETAIL for this?
-
How to access reference data in BPS Exit Function
Hi Experts,
Can any please tell me how to access reference data in BPS Exit function. I am creating a copy function using ABAP Exit Function (Std copy and fox formula doesn't work for my requirement).
Please suggest,
Thanks in advance,
ShiweshHi Deepti,
Thanks a lot for your reply. xth_data contains all the data based on package filteration. Let me explain you,
Say, I have a characteristic char and whose value is 'A', I want to change it to 'B' in my copy function, while keeping the original record with 'A' as well. So now I want my xth_data to contain two records, one with A and other with 'B'. I mean to say from value is 'A' and to value is 'B'. Now my package contains 'B' (the to value) as the allowed value, but not A because in the package I am setting this using a BPS variable. There are two types of variables, one is to variables other is from variable. There could be two scenarios,
1. If I set from varibale in the package: if I do so, I will have the data in xth_data containing 'A' as char value. But in this case when I change it to 'B' and try to save both the records, package won't recognize the record with value 'B' and reject it.
2. If I set to variable in the package: In this case the xth_data itself will not contain anything and I can not loop over xth_data because there is no record with 'B'. Only record available in the system is with 'A' values.
That is why I am thinking about having reference daya somewhere. I could loop over reference data and then pass it to xth_data. Package will contain to variable so it will allow all my modifications to get saved.
Thanks and regards,
Shiwesh -
BPS User Exit Variable based on Planning Package Selection
Hi,
I'm implementing a SAP BW-BPS planning layout to be integrated into the CRM we user interface.
Most of the characteristic selections come from the CRM fields that need to be filled by the user when creates a trade promotion.
The charcteristic selections work (as standard) just if in the planning level I flag "Selection in Package", then in package these selections are dinamically defined from what the user select in the CRM fields at runtime.
My problem is that I have to build a BPS User Exit variable to filter, in the planning level, the proper Planning Area based on the CRM Sales Organization value.
The characteristic CRM Sales Organization belongs to whose chararcteristic the value is determined dinamically in the planning package.
Is it possible for a BPS user exit variable, set in the planning level, to catch the value of a characteristic selection made at planning package?
Many thanks for your help.
AlessandroHi Indu,
Many thanks for your answer.
I have already took a look at the document posted by you but I didn't find the solution to my problem.
This because i have to create a user exit variable that need to get the value of the characteristic selection in package.
I mean in the planning level I will have the user exit variable that restrict the planning area and, his function module, need to read, at runtime, what is the value of the characteristic CRM Sales Organization restricted in package by CRM.
So I don't have any idea to which BPS internal table I have referred to in my funcion module to catch the value of the CRM Sales Organization dinamically filtered by CRM.
Many thanks,
Alessandro -
Hello everyone
About my situation:
I need to use exit function in BPS.
I have Character 0VERSION with data 0, 1, 2, 3, 4, 5 LV.
The user can make a lot of version. But there will be the last version with ID for example LV.
I use copy function for coping data from version 0 to version 1 and so on. But now I need to make function for copping only data from last version which was made by user to my last version which was made by me. For example the last user version was 5. So I need to write program that should check that last version is really 5 not 2 or 4 and copy all data of 5 version to version LV. So I want to use exit function but I don know which standard functional module can do for my task. Can somebody tell me the name of suitable functional module?
Thanks for answers. (Points are guaranteed)Hi Svet,
Try this link..
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d3dcc423-0b01-0010-4382-aa3e0784b61e
I hope it helps you.
Award points if useful.
Regards,
Archna. -
Having trouble with using variables in functions and after functions..
Morning,
I have simplified this, as it represents the core of what’s I obviously don't know how to do.
Problem:
Say I populate that variable by reading in a list if IP addresses from file, finding the line that matches the hostname and place that string into the $IPAddress variable for use later throughout the script. I did not run into a significant problem
until I decided to convert the routine of looking up the IP address and populating the variable into a function. As soon as I made it a function, and called that function, the $IPAddress variable only had the data in it until the function completed.
Once the function had done its work, and had placed the data into the variable, I expected that “new” data to be available after the function had completed..in that variable. But it’s like the $IPAddress variable in the main script is a totally
different data then the variable with the same name that’s used within the function.
So I think this demonstrates some of what’s kicking my butt..
$IPAddress = "This is the wrong data”
Function TestFunction ()
$IPAddress #call to display the contents of the variable at the start of the function.
$IPAddress = Read-Host -Prompt "Please enter the text ‘Goober’"
$IPAddress #call to display the contents of the variable at the end of the function.
TestFunction
$IPAddress
The output I get is:
This is the wrong data
"Please enter ‘Goober’" : where I enter Goober
Goober
This is the wrong data
Huh?
I had expected:
This is the wrong data
"Please enter ‘Goober’" : where I enter Goober
Goober
Goober
What good is the repeatability of a function if it’s output is lost?THis seems to work.. IS there any reason NOT to do this?
$Global:IPAddress= "This is the wrong data” #"
Function TestFunction{
Write-Host $IPAddress-fore green
$host.ui.RawUI.FlushInputBuffer()
$Global:IPAddress =
Read-Host -Prompt
"Please enter the text ‘Goober’"
return$Global:IPAddress
TestFunction
return$Global:IPAddress -
Types of variables and exits with screen shots
Hi folks,
I want to know types of variables and Exits and how they are useful in reporitng.
Please can body send me the docs or procedures how to use this.
Useful docs/screen shotts will be hightly appreciated n wiil be assigned points.
thanks in advance.
Urs,
rakiHi,
Variable types:
http://help.sap.com/saphelp_nw04/helpdata/en/c1/759b3c4d4d8d15e10000000a114084/frameset.htm
Customer Exits :
http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm
regards
Happy Tony -
When using the 6024E DAQ card, with VB5, is there anything that one has to do to close / shutdown the card before exiting the application. The application only uses AIRead_Scan and DigIn_Port functions.
Raghunathan
LV2012 to Automate Hydraulic Test rigs.Hello,
You won't need any other functions after AI_Read_Scan or after DIG_In_Prt since both functions are for none buffered acquisitions.
For more information, I recommend that you take a look at the shipping examples that get installed under the folder C:\National Instruments\NI-DAQ\Examples
Good luck with your application! -
Badi's, user exits, function modules and reports
Hi all,
Can anybody tell me the exact diff among Badi's, user exits, function modules and reports? I mean what are their functions?
thanksHi,
This is a beginners question,but still you can check the below links.
BAdis:
Regarding Enhancements/User-Exits in ABAP
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/ee/a1d548892b11d295d60000e82de14a/content.htm
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/779183#
FM:
http://help.sap.com/saphelp_nw70/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
Reports:
http://it.toolbox.com/wiki/index.php/How_many_types_of_reports_are_there_in_ABAP_and_what_is_the_difference_between_them%3F
Regards,
saurabh
Maybe you are looking for
-
House Bank Determination in FPY1
Hi Sap Gurus, I have a question about the Payment Run in Contract Accounting. I am looking for a customized solution (defined Rules) to determinate the own House Bank based on the Business Partner Bank Country insteadt of the Ranking in FPY1,that mea
-
CRM- Find Service contract from Internal Order Number
Hi Friends, I would like to know how to get service contract from internal oredr number. From service contract we can find internal order number by using CRM_ORDER_READ function module- table et_document_flow, but my requirement is how to find servic
-
How to delegate permission to user to update only his attribute
i create GPO logon that Update user descreption and to do that h had to delegate Permission "property-specifc" to user to write in descreption attribute and that work but the problem is the user can update other user descreption if he use secripts
-
Interactivity in the portfolio
Hello, is it possible to have interactivity (link, video, ect....) to be played in the portfolio? so i don't have to open the file ? And, is it possible to have it in full screen (the portfolio) ? i want to use it for presentation on a pc tablet. Tha
-
Trouble syncing photos~~only few photos show(repeat themselves), rest black
Ok. Well I have about 393 pictures on my ipod and for some reasons, almost all of them are not showing, except for about 10 new ones I added to the folder I have allowed to be synced onto my nano. Not only that, but those photos repeat themselves 3 t