BPS: Creating FM for function exit.
Hi Everybody,
I have a question regarding creating Function Module that will be used as an exit function while executing a business planning group.
Q1.> Data is displayed in an excel sheet when user clicks on 'Display Plan Data' in Tcode: BPS0. Now user wants to manipulate the data on that excel sheet after executing the planning function. How will i fetch the data displayed on excel and feed the FM?
Hi,
There is a function module called API_SEMBPS_GETDATA
That helps you to get exactly the same result than an end user in different tables (header, rows, columns).
Use it within your user exit.
Regards
Similar Messages
-
Creating Includes for Function Modules
Hi Experts,
Can you please let me know how to create includes for function modules.
I came across this in a standard include program, which was generated by a function library. The includes inside this program where linked to the function modules (when I double clicked on them).
Please let me know how to create it.
Thanks in advance !
Regards,
Anand Patil.Hi,
have a look at the code for better understanding
Declaration of Workareas *
DATA: lwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create,
lwa_data TYPE edidd, " Work area for IDOC
lwa_control TYPE edidc. " Work Area for control rec
Read the control data information of idoc.
loop at idoc_contrl INTO lwa_control Where mestyp = lc_mbgmcr.
Extract the data from the segments.
LOOP AT idoc_data INTO lwa_data
WHERE docnum = lwa_control-docnum and
segnam = lc_item_create.
*->> Set the tabix of the internal table
lv_index = sy-tabix.
Move the Material Document Item Segment data
MOVE lwa_data-sdata TO lwa_e1bp2017_gm_item_create.
Modify the material document item data internal table
PERFORM sub_modify_idocdata changing lwa_e1bp2017_gm_item_create.
*->> set the changed values to the IDOC SDATA
MOVE lwa_e1bp2017_gm_item_create TO lwa_data-sdata.
*->> Modify the table
MODIFY idoc_data FROM lwa_data index lv_index.
Clear the Work areas
CLEAR : lwa_data,
lwa_e1bp2017_gm_item_create.
ENDLOOP. "LOOP AT t_idoc_data
Call the BAPI function module to create the
appropriate Material Document
CALL FUNCTION 'BAPI_IDOC_INPUT1'
EXPORTING
input_method = input_method
mass_processing = mass_processing
IMPORTING
workflow_result = workflow_result
application_variable = application_variable
in_update_task = in_update_task
call_transaction_done = call_transaction_done
TABLES
idoc_contrl = idoc_contrl
idoc_data = idoc_data
idoc_status = idoc_status
return_variables = return_variables
serialization_info = serialization_info
EXCEPTIONS
wrong_function_called = 1
OTHERS = 2.
IF sy-subrc = 1.
RAISE wrong_function_called.
ENDIF.
endloop.
ENDFUNCTION.
here when we write the statment
PERFORM sub_modify_idocdata changing lwa_e1bp2017_gm_item_create and double click on sub_modify_idocdata .
it will create a include with the name "LZDTSINT052F_GPOMS_GMF01 ".
now we can write the FORM ..END FORM In this inculde.like this.
***INCLUDE LZDTSINT052F_GPOMS_GMF01 .
*& Form sub_modify_idocdata
Modify the material document item data internal table
FORM sub_modify_idocdata
CHANGING pwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create.
contant declaration
CONSTANTS: lc_261(3) TYPE c VALUE '261'.
DATA : lv_aplzl LIKE resb-aplzl,
lv_aufpl LIKE resb-aufpl,
lv_subrc LIKE sy-subrc,
lv_charg LIKE resb-charg,
lv_uom LIKE pwa_e1bp2017_gm_item_create-entry_uom.
CLEAR: pwa_e1bp2017_gm_item_create-reserv_no,
pwa_e1bp2017_gm_item_create-res_item.
*->> Get SAP storage bin & Storage type from the Z table
SELECT lgtyp lgpla
INTO (pwa_e1bp2017_gm_item_create-stge_type,
pwa_e1bp2017_gm_item_create-stge_bin)
UP TO 1 ROWS
FROM zdtsint050_sttyp
WHERE zstorage_typ = pwa_e1bp2017_gm_item_create-stge_type
AND zstorage_bin = pwa_e1bp2017_gm_item_create-stge_bin.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR: pwa_e1bp2017_gm_item_create-stge_type,
pwa_e1bp2017_gm_item_create-stge_bin.
ENDIF.
PERFORM get_oper CHANGING pwa_e1bp2017_gm_item_create.
Get the Reservation number and Reservation item number
basing on the idoc data.
SELECT rspos werks lgort
INTO (pwa_e1bp2017_gm_item_create-res_item,
pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
UP TO 1 ROWS
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
AND matnr = pwa_e1bp2017_gm_item_create-material
AND charg = pwa_e1bp2017_gm_item_create-batch
AND aufnr = pwa_e1bp2017_gm_item_create-orderid
AND vornr = pwa_e1bp2017_gm_item_create-activity
AND bwart = lc_261.
ENDSELECT.
IF sy-subrc <> 0.
Start of insertion for R31K993797
CLEAR lv_charg.
SELECT rspos werks lgort
INTO (pwa_e1bp2017_gm_item_create-res_item,
pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
UP TO 1 ROWS
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
AND matnr = pwa_e1bp2017_gm_item_create-material
AND charg = lv_charg
AND aufnr = pwa_e1bp2017_gm_item_create-orderid
AND vornr = pwa_e1bp2017_gm_item_create-activity
AND ( splkz = 'X' or
splkz = space )
AND bwart = lc_261.
ENDSELECT.
IF sy-subrc <> 0.
End of insertion for R31K993797
SELECT SINGLE werks lgort
INTO (pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no.
CLEAR : pwa_e1bp2017_gm_item_create-reserv_no,
pwa_e1bp2017_gm_item_create-res_item.
ENDIF.
ENDIF.
get SAP UOM
SELECT SINGLE zsap_uom
INTO lv_uom
FROM zca_uom_conv
WHERE zext_uom = pwa_e1bp2017_gm_item_create-entry_uom.
IF sy-subrc = 0.
pwa_e1bp2017_gm_item_create-entry_uom = lv_uom.
ENDIF.
ENDFORM. " sub_modify_idocdata
*& Form get_oper
Get the operation
<--P_PWA_E1BP2017_GM_ITEM_CREATE_RE Segment
FORM get_oper CHANGING p_pwa_e1bp2017_gm_item_create TYPE
e1bp2017_gm_item_create.
DATA : l_aufpl LIKE afko-aufpl,
l_aplzl LIKE afvc-aplzl.
REFRESH : i_op.
UNPACK p_pwa_e1bp2017_gm_item_create-orderid TO
p_pwa_e1bp2017_gm_item_create-orderid.
Get the reservation and routing number for the order
SELECT SINGLE
rsnum
aufpl
FROM afko
INTO (p_pwa_e1bp2017_gm_item_create-reserv_no,
l_aufpl)
WHERE aufnr = p_pwa_e1bp2017_gm_item_create-orderid.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_NUMCV_INPUT'
EXPORTING
input = p_pwa_e1bp2017_gm_item_create-activity
IMPORTING
output = p_pwa_e1bp2017_gm_item_create-activity.
ENDIF.
ENDFORM. " get_oper
Regards,
nagaraj -
Creating tcode for function module
Hi all
I have created a screen in the funcion group.Now my problem is I have a requirement that I have to keep this screen inside a function group and I also must create a transaction code for this screen so that the user can see only that screen using this tcode whenever he want.Will you please help me to solve this problem.
Thanks in advance.
Regards
Giri.Hi Giri,
U can create Tcode for Program only i.e for report or module pool program.
So keep ur Function inside ur program and create Tcode for that
se93>tcode name> create
reward if it useful.... -
Table for Function Exit Description
Hi,
Would appreciate if someone could give me the table where the function exit description is stored.
To make things clear, Lets say we have a functon Exit named EXIT_...........
In which table is the description of this function exit maintained.
Thanks in advance.
MickHi Mick,
The function module descriptions are stored in the table TFDIRT.
So try to check in this table.
Sruthi -
Function Exit , How to Debug
hi
i have created five function with four are hidden and one function Exit , for Function Exit i am using functin module , but when i put a Breakpoint in Function module and run the BPS , Debugging is not working out , it directly executing.
can anyone help me how to debug the function exit(Function Module) before running the reportHi,
Go to that corresponding parameter group for that exit function, right click -execute with trace..it will take you to debugging screen.. (put a breakpoint before execution) -
Query on Function Exit EXIT_SAPLIEL2_002
Hi,
When I try to instal an equipment at a Functional Location, internally the user exit IEQM0001 is executed. The function exit EXIT_SAPLIEL2_002 is one of the components available in the exit IEQM0001. I want to use this function module(EXIT_SAPLIEL2_002) as an Interface in SAP XI. But as this function is not remote enabled, I cann't use this function module as an interface.
I want this function exit as remote enabled so that I can use it as an interface in SAP XI. Do I have to create a new function exit for this? Please advise.
Also, please gimme possible solutions to this problem.
Thanks,
Vijayhi,,
You can call this function module in your proxy code.
Regards,
Akshay Jamgaonkar.
Reward points if find useful. -
hi all,
I am doing Function Exit for Transaction CO12.
When the Wage Group is initial it should display message like "Enter Shift A/B/C in field Wage Group".
i am getting this one. after display this message screen should go to previous screen ( What we entered data) . I am getting this one but data is clearing and fresh CO12 transaction is opening.
I want that data also.
Please sugget.
Regards
RamiHi Shaik,
for Functional exit we are adding our own funtionality into sap standard coding.
to find the function exit for a specific transaction
go to system-> status-> double click on transaction.
you will get the package.
now use transaction SMOD.
then Utilities->find->give the package name which you get earlier. Then execute.
You will get all the possible exit existing in that package.
You need to chose the right one.
Then double click on that enhancement & you will get the exit and within that exit you will get one include program.
In that include you need to write down your code.
At last you need to add that exit into a project by using transaction CMOD.
Hope you understand well.
Regards,
Tutun -
Tranceport request for function module
Hi,
first i have created function group and function module under local class, now i created request for function group, but how to create request for function module, i have to trancport my functionmodule. please do the need full help.
thanks in advance.
Radhakrishnago to se37
1.give desired function module
2.select change or display option
3. Click -GOTO optin on menu bar and select 'Object Directory entry '
4.click on object directory entry and press f6
5.change package and reponsible person and save it will ask you request finaly you can relese. -
Error in creating include for the user exit "EXIT_SAPMP56T_002"
Hi,
"treat it as high priority"
when i db click on the include i am got the follwing error message :-
Program names ZX... are reserved for includes of exit function groups
Message no. DS027
Diagnosis
You attempted to create a program name beginning with ZX but this name range is reserved only for includes of exit function groups (function groups containing only function exits).
If you want to create a program ZXaaabbb, note the following for program type I (Include).
1. The program is an include of the function group Xaaa:
In this case, the INCLUDE ZXaaabbb statement should not be inserted in the main program SAPLXaaa, but in the program ZXaaaZZZ .
2. The program is not an include of the function group Xaaa:
Since the syntax check for includes of this name range searches for the global data in the program LXaaaTOP (not ZXaaaTOP), you may not be able to check the include in isolation (--> check main program).
Procedure
Choose a different program name.
cld u please help me out how to further proceed...
awaiting for u r replies...
apprecitaed with points...
regards,
ravi ganjiHello,
1)That is not Error msg it is just warning - first db click then press enter if there is any msg again press enter off course all these things will happen only your user exit Active.
2)see the import,export and changing parameters if you are new to user exit let us know which user exit you are trying to use.
**********Poorna********* -
Hi all,
I have some bad fund in my cube. So to correct these bad funds, I am using function exit in BPS. My question is: Do I need to implement the initialization function and exit function both. how could I write these function modules.
does anybody have sample coding for these functions.
any help appreciated.
Thanks.
BNPThanks ATW and all.
But I still could not figure it out.
I am trying to summarize my problem and code here.
FUNCTION Z_INFOPROV_FUND_EXIT.
""Local Interface:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_Y_AREA OPTIONAL
*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL OPTIONAL
*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD OPTIONAL
*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM OPTIONAL
*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE OPTIONAL
*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP OPTIONAL
*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL OPTIONAL
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA OPTIONAL
*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF OPTIONAL
*" EXPORTING
*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG
*" CHANGING
*" REFERENCE(XTH_DATA) TYPE HASHED TABLE
functional requirement.
correct fund value in the given cube zxxx1.
*characteristics key values
*fund fund center key1 key2
*1A2 4562389 300 500 -
line 1
*to correct the fund above, I am adding these two records
*2A2 4562389 300 500 -
line2
*1A2 4562389 -300 -500 -
line3
*I am trying to accomplish the above scenario.
*Could you please tell me what I am missing.
*Here is my code
TYPES: begin of f_c,
v_from type /BIC/OIZVAL_FROM,
fund type /BI0/OIFUND,
end of f_c.
Data: t_fund type table of f_c,
w_fund type f_c,
old_fund(10) type c..
FIELD-SYMBOLS: <fundctr> type any,
<fund> type any,
<s_kyfs> type any,
<s_chas> type any.
field-symbols: <t_data> type hashed table,
<chavl> type any,
<value> type any,
<s_data> type any.
data: ls_data type ref to data,
lt_data type ref to data,
l_chavl type upc_y_chavlint,
ls_chasel type upc_ys_chasel,
ls_charng type upc_ys_charng.
data: l_app type ref to cl_upx_application.
l_app = cl_upx_application=>get_instance( i_area ).
lt_data = l_app->create_th_data( ).
assign lt_data->* to <t_data>.
ls_data = l_app->create_s_data( ).
assign ls_data->* to <s_data>.
<t_data> = xth_data.
clear xth_data.
transaction data
loop at <t_data> assigning <s_data>.
ASSIGN COMPONENT 'S_CHAS' OF STRUCTURE <s_data> TO <s_chas>.
ASSIGN COMPONENT 'S_KYFS' OF STRUCTURE <s_data> TO <s_kyfs>.
check sy-subrc eq 0.
ASSIGN COMPONENT '0FUND' OF STRUCTURE <s_chas> TO <fund>.
check sy-subrc eq 0.
check not <fund> is initial. "no need to check for blank fund
old_fund = <fund>. "holding old fund for third record above
here add new record with new fund but with same key figures and characteristics
ASSIGN COMPONENT '0FUNDS_CTR' OF STRUCTURE <s_chas> TO <fundctr>.
check sy-subrc eq 0.
select /BIC/ZVAL_FROM fund into table t_fund from /BIC/AZFMDERIV00
where /BIC/ZVAL_FROM <= sy-datum and
/BIC/ZSOUR1_TO = <fundctr>.
check sy-subrc eq 0.
sort t_fund by v_from descending.
read table t_fund into w_fund index 1.
<fund> = w_fund-fund. "new correct fund.
collect <s_data> into xth_data. "adding line 2 above
here add new record with all key figures values reversed
return back old fund now.
<fund> = old_fund.
LOOP AT ito_chasel INTO ls_chasel.
select struture with characteristics
ASSIGN COMPONENT 'S_KYFS' OF STRUCTURE <s_data> TO <s_kyfs>.
choose char according to ito_chasel
ASSIGN COMPONENT ls_chasel-chanm OF STRUCTURE <s_kyfs> TO <value>.
select value according to ito_chasel
READ TABLE ls_chasel-t_charng INTO ls_charng INDEX 1.
set char value
<value> = ls_charng-low * -1.
ENDLOOP.
collect <s_data> into xth_data. "adding line 3 above
endloop.
ENDFUNCTION. -
BPS- Creating Planning Functions Message
Hi Experts,
I am trying create a bps scenary. I did the planning area, planning level and packages but when I try create the planning functions the next message I received:
"Select a node in the related tree"
What node? Isn`t the package level the node for associate the functions? I tried in all level from planning area and the message continue and has´nt any description.
Thank you very much.
Regards,
JeysiYou are trying to create planning function from menu Planning --> Planning Function --> Create
If you want to do that way then double click on your planning level in top left pane and when teh same level appears in bottom left pane, double click on it again and then go to menu Planning --> Planning Function --> Create
Regards,
Deepti -
Function exit for transaction va01
Hi all,
While raising an order with transaction code VA01, and with document types(Ex- ZTA) , the system should not allow the user to save the order until the values of partner function are changed.
Possible way to reduce the mistake of not changing the partner function values is to display a text in the overview screen.
For displaying the text we need a suitable Function Exit where we can make the possible changes?
Thanks in advance
PrashanthHi,
In CMOD, after creating a Project, enter your enhancement - SDTRM001. Go to the components. There you can see your Exit name. Double click on the Exit. It will take you to the Function module. Click on the Include and activate it. Come back. You will see a green tick mark before the Exit name in CMOD. Return to the Initial screen of CMOD and activate project.
Regards,
Sharmila -
Hi,
I have a Exit function module EXIT_SAPLCVV1_003. i wrote my code in the include and i dont know how to activate it in CMOD. i dont have the user exit name. can anyone tell me how to find user exit for function module.
Regardshi
you should find the enhancement name for your function module exit.
go to CMOD Utilities->SAP Enhancement->extended selection->
give the program name(SAPLCVV1) in Component name field and execute.
it will display the enhancement name.Afterwards u should create the enhancement project.
Steps to create enhancement Project:
1.Goto CMOD.
2.Give project name.->Create
3.Assign the enhancement using the option.
4.select Components and choose change.go to ur code and activate.
5.activate the exit
6.activate the enhancement.
Cheers,
Abdul Hakim
mark all useful answers.. -
Re : creation of Function exit for Zfield
Can we create function exit for zfields similar to function exit for std field in SAP . If yes , How...?
Thanks in advance.Hi Jhunu,
Try creating a field exit for the data element and see how it goes..
Run program RSMODPRF -> give the data element name and create a function module...There will be 2 parameters ...importing input and exporting output....write code accordingly
After activating the function module ...run the program again without entering the data element name
Select the required check box -> go to the top menu ->field exit -> activate
Let me know if it works out since we haven't tried it on a custom field yet
Hope it helps
Regards
Byju -
How to create the INBOUND Function Module for INBOUND IDOCs
Hi Friends,
Can any Suggest me How to proceed to Create an INBOUND Function Module for Processing the INBOUND IDOCS
which are recieved from XI Server ?
I am working in SAP-ISU
Here i will recieve the INBOUND IDOCs for the Meter Reading Orders.
We have a Standard INBOUND FUNCTION MODULE
IDOC_INPUT_ISU_MR_UPLOAD
which Uploads the Meter Reading Results.
I copied the Same function Module into ZIDOC_INPUT_
and working on it.
Can any one suggest me, whether i am going in correct way or not.
In IDOC_INPUT_ISU_MR_UPLOAD Inbound fun module,
BAPI_MTRREADDOC_UPLOAD is used to Update or Insert the Meter Reading Results,
My requirment is to Insert and Update the Meter Reading Orders which are Inbounded from XI.
Can I Use the Same BAPI
BAPI_MTRREADDOC_UPLOAD
to Update the below fields,
EABL-SERNR
EABL-ZWNUMMER
EABLG-ABLESGR
EABL-V_ZWSTAND
EABL-N_ZWSTAND
EABL-ABLHINW
EABL-ZSKIPC
EABL-ADAT
EABL-ATIMTATS
EABL-ADATTATS
EABL-ATIM
EABL-ZMESSAGE
EABL-ABLESER(Meter reader number)
Kindly Suggest me,
Thanks in Advance,
GaneshHello Ganesh
I think you are going completely astray with you z-function module for IDoc processing.
If you look at TABLES parameter METERREADINGRESULTS (type BAPIEABLU ) of BAPI_MTRREADDOC_UPLOAD you will find many of the requested fields already:
EABL-SERNR => BAPIEABLU-SERIALNO
EABL-ZWNUMMER =>REGISTER
EABLG-ABLESGR
EABL-V_ZWSTAND
EABL-N_ZWSTAND
EABL-ABLHINW
EABL-ZSKIPC
EABL-ADAT
EABL-ATIMTATS => ACTUALMRTIME
EABL-ADATTATS => ACTUALMRDATE
EABL-ATIM
EABL-ZMESSAGE
EABL-ABLESER(Meter reader number)
Field EABL-ZMESSAGE appears to be custom field (at least I cannot find it on ECC 6.0). If this field was added using include CI_EABL then you probably can get these values into the BAPI using the EXTENSIONIN parameter.
Check routine CHECK_UPLOADRECORDS in the BAPI which allows two extension structures:
- BAPI_TE_EABL
- BAPI_TE_EOSB
Not surprisingly BAPI_TE_EABL contains the include CI_EABL.
Regards
Uwe
Maybe you are looking for
-
I have moved my iTunes library several times. Sometimes to free up space on the main drive, I have moved the library to an external drive. I have also moved the library when changing drives and changing computers. I find that most of the CDs I have i
-
Report painter header text with customize variable
Hi All, Can we have a customize variable/ logic based on the selection parameter in the header text(not in the report's columns) in report painter? understand the standard sap provides a few standard options, gen, variables, sel. parameters, spec. va
-
How do I keep emails in my saved emails folder forever on my iPad?
I have several emails that I would like to keep and not have them deleted off my iPad. how do I do this?
-
Is there a file size limitation on the cut and paste function in OSX?
I have noticed that sometime I am able to cut and paste files and sometimes I can only copy them. Is there a limitation in the system and if so what is it? I have also that sometimes I get the option to keep a duplicate file and sometimes it will o
-
Dear all, I have a sql ResultSet, but I how can I use WebRowSet to convert it to XML? Greatly appreciated if anybody can giveme a clue. Thank you Kevin