Need to change the way Function module exit is called.
Dear Abaper,
I want to know wheather is it possible to change the way a function module exit is called.In transaction IK11 i am using enhancement imrc0001 this function module is called only when clicking the save button. My requirement will be met only when desired result is obtained while clicking ENTER button.Now the desired result are obtained by Clicking SAVE button. As a result only after saving i am able to view. Is there any way to change by clicking Enter button itself we can call the IMRC0001 enhancement. Please guide me.
Thanks and regards,
Omprasath
Hi,
Each action in the screen have some FCODE(SY-UCOMM) in that exit u can add code when the particular button is clicked then run it or else no need to run.
For Example SAVE has user command as SAV+(SY-UCOMM)
u can restrict it as.
IF SY-UCOMM = 'SAVE+'.
Run ur code.
Endif.
Similar Messages
-
Need to know the standard function module/program in E recruitment
Hi All,
I need to know the standard function module/programm that defaults the 'Functional area' field in the posting page from the requisition page.
Early responce is greatly appreciated.
Thanks and best regards
RajeevHi Masa,
Thanks for your reply.
We are using Assets with the integration of Project systems. We are now in 4.6C R/3 & SRM 5.0 system. And now R/3 upgrade and SRM upgrade going on smultaniously to ECC6.0 and SRM 7.0 respectively.
I would like to know any new functionality available in the latest upgrades and we have done lot of customization for Asset Procurement. And would like to go with Vanilla.
Can you please provide me some inputs about the Project (WBS element ) based Asset Procurement in SRM as standard.
Thanks and Regards,
Ramesh -
Need to know the standard function module in E-Recruitment
Hi All,
I need to know the standard function module that defaults the value of 'Functional area' in 'Posting' from 'Requisition'.
Early response is greatly appreciated.
Thanks an best regards
RajeevHi Masa,
Thanks for your reply.
We are using Assets with the integration of Project systems. We are now in 4.6C R/3 & SRM 5.0 system. And now R/3 upgrade and SRM upgrade going on smultaniously to ECC6.0 and SRM 7.0 respectively.
I would like to know any new functionality available in the latest upgrades and we have done lot of customization for Asset Procurement. And would like to go with Vanilla.
Can you please provide me some inputs about the Project (WBS element ) based Asset Procurement in SRM as standard.
Thanks and Regards,
Ramesh -
Need of Changing Parameters in Function Module
Hi All,
Why we need sepearte Import and Export parameters in Function Module if the Changing Parameters
acts as both import and export parameters.
What is the use of using Changing Parametrs in Function Module.
Thanks in advance.
SundaresanHi,
EXPORT PARAMETERS: When u r passing some value to the function, and the parameter will not be changed in the function, we use export parameter. Example: u pass parameter (a : 10) to a function, even after the function has been executed, value of a will be 10 only.
IMPORT PARAMETER: When u require some value back from the function. u do not provide any initial value to the function. Example : u pass a parameter (b: <blank>) to the function, function returns the same import parameter as (b : 20).
CHANGING PARAMETER: When u pass some value to the function and that function may change that value inside function, then changing parameters are used. Example: u pass parameter ( c: 30) to the function as changing parameter and function modifies this variable and return ( c: 50).
Reward points if helpful.
Thanks & Regards
- Rishika Bawa -
Change the standard function module
The standard function module FI_DUPLICATE_INVOICE_CHECK will check whether an invoice/credit memo has already been posted where all of the following attributes match: Company code, vendor, currency, document date, reference number (If a reference number was entered in the current invoice/credit memo). If no reference number was entered in the current invoice/credit memo the system checks whether an invoice/credit memo has already been posted where all of the following attributes match: Company code, vendor, currency, document date, amount in document currency
my requirement is
The above functionality described in the short description doesnt provide for the need within AP to check on duplicate invoices. The functionality in FI differs from the functionaltiy provided in LIV and therefor needs to be aligned. The risk of posting duplicate invoice entry is eminent since the check is dependent on all parameters. For a good duplicate invoice number check we need FI to check on Vendor and invoice reference within the same fiscal year. To modify rules, copy FI_DUPLICATE_INVOICE_CHECK, modify the checks and then call the copied function module from FB60. The remaining field check in the standard function module should be deleted.
how to achive this. i didn't understand the requirement .Please give me any suggestion for this.Hi ,
I think what you are saying is the functionality given in Logistics Invoice verification is not suitable for FI Invoice.
If I am correct , then there is a configuration setting in SPRO where you set check for duplicate invoice. It has just three checkboxes
a) Company code b) Reference number c) Invoice date
so I think this configuration setting will suffice your requirement.
Please let me know.
Amit -
The way how field exit gets called??????
Hi ALL,
Can any guru tell me how exactally the field exit works.
Senario- I have created field exit on Data element WERKS_EXT for user validation on plant level for T-code VA01.
Issue- I don't have proper user details in Dev. system to test this thing, for ulternative what i m doing is; I am running VA01 by putting brake point inside my Include for field exit to check it is getting called or not?
But the control is not coming to this field exit code and it is creating sales order .
I have checked, it is ACTIVE and GLOBLE for all screens.
So, please tell how exactally the field exit works and how i can test this?
Regards,
RahulField exits can only be executed for fields that are directly related tothe dictionary. If the relation is indirect, i.e. via an ABAP declaration ( LIKE ), no field exit can be executed. Field exits cant be debugged.
For details on field exits, have a look at below link.
http://www.sap-img.com/abap/field-exits-smod-cmod-questions-and-answers.htm
http://www.sap-basis-abap.com/sapab014.htm
Best Regards,
Vibha
*Please mark all the helpful answers -
How to Create the Function Module Exit
Hi,
How to Create the Function Module Exit. Please tell me the step by step procedure.Hi,
Check this link for how to create the function module exit..
http://sap.niraj.tripod.com/id62.html
Thanks
naren -
Where the documentation is provided for the Standard Function module ?
If there is no documentation provided for the standard function module in SE37 what is the best way to understand the functionality of the function module?Is there any where we can find the documentation?
Please dont say the From coding part its too vast to understand
Ex: HRCM_ORGSTRC_INFO_TABLE_GET
Paint for me ..
Regards
sas
Edited by: Julius Bussche on Mar 18, 2009 1:17 PMO Really thanks amit !!
Are you able to understand the below code and please provide your valuable inputs what we are understanding is the same.
PERFORM read_infotypes.
*-- ********************************************************** NMP
*-- IF scb frozen then write to itab-scb field. nmp 11/2001.
*-- ********************************************************** NMP
*--Begin of Change by vneld - 01/17/2007
* IF PA0001-ZZBERN NE SPACE.
* FROZEN = PA0001-ZZBERN.
* ENDIF.
* ITAB-SCB = FROZEN.
*-- ********************************************************** NMP
*--end of Change by vneld- 01/17/2007
PERFORM get_date USING '92'
CHANGING w_hiredate.
PERFORM get_date USING '93'
CHANGING w_rehire.
PERFORM get_date USING '94'
CHANGING w_termdate.
IF NOT ( w_rehire IS INITIAL ).
w_hiredate = w_rehire.
itab-code = 'R'.
ELSE.
itab-code = 'H'.
ENDIF.
IF p0001-persg = '3'.
itab-code = 'T'.
ENDIF.
*Change by Mdukes
** We need HIRE,Rehire & term within 13 month`s window
** But if someone Hire in IT ,change dept and then terminated .
** We need to exclude that person from the list .
** We need to change his Org.Unit by END_DATE 12/31/9999 from Pa0001.
CLEAR:result_tab.REFRESH:result_tab.
CALL FUNCTION 'HRCM_ORGSTRC_INFO_TABLE_GET'
EXPORTING
PLVAR = '01'
ROOT_OTYPE = 'O'
ROOT_OBJID = P0001-ORGEH
BEGDA = SY-DATUM
ENDDA = P0001-ENDDA
PATH_ID = EVPATH
PATH_DEPTH = 10
TABLES
ORG_INFO_TABLE = result_tab
EXCEPTIONS
PATH_ERROR = 1
ROOT_ERROR = 2
OTHERS = 3.
* CALL FUNCTION 'RH_STRUC_GET'
* EXPORTING = 'O'
* act_objid = PA0001-ORGEH
* act_wegid = EVPATH
* act_plvar = TYPE
* act_tflag = space
* act_vflag = space
* authority_check = space
* TABLES
* result_tab = result_tab
* EXCEPTIONS
* no_plvar_found = 1
* no_entry_found = 2
* OTHERS = 3.
* reading the Org.Unit based on employee Org.unit (Evaluation Path 'O-O'.
* After that making sure the latest Pa0001 org.unit is part of selection org.unit
* If yes, set the flag to = 1 . Otherwise ignore the rec .
* We want only IT folks hire/rehire/term within 13 monthu2019s window
* if somebody change the dept and get term within 13 monthu2019s .it
* Should show up in hire but not in term report .
CLEAR:REC.
lOOP AT result_tab.
read table PCHOBJID with key low = result_tab-OBJID.
if sy-subrc = 0 .
Rec = 1.
EXIT.
Endif.
ENDLOOP.
if rec = 1.
*--begin of change by vneld- 01/17/07
CHECK ( ( w_hiredate >= w_13th_mnth_date AND w_hiredate <= sy-datum )
OR
( w_termdate >= w_13th_mnth_date AND w_termdate <= sy-datum ) ).
*--end of change by vneld- 01/17/07
**---check for hires or terms in the calendar year.
**---No future terms
* CHECK ( ( W_HIREDATE(4) = SY-DATUM(4) ) OR
* ( W_TERMDATE(4) = SY-DATUM(4) AND W_TERMDATE <= SY-DATUM ) ).
CONCATENATE p0002-vorna p0002-nachn INTO itab-name SEPARATED BY ' '.
*--Begin of change by vneld 03/29/2007
*--get supervisor name
data : lname(20),
fname(20).
clear: lname,
fname.
Select vorna nachn from pa0002 into (fname ,lname)
where pernr = p0001-zzsuper_no.
endselect.
CONCATENATE lname fname INTO itab-supv SEPARATED BY ' '.
* itab-supv = p0001-zzsuper_text.
*--End of change by vneld 03/29/2007
*----get employee group text
CLEAR t501t.
SELECT SINGLE * FROM t501t WHERE sprsl = 'EN' AND
persg = p0001-persg.
IF sy-subrc EQ 0.
itab-group = t501t-ptext.
ENDIF.
PERFORM get_dept.
PERFORM get_position.
PERFORM append_fields.
endif.
ENDFORM. " PROCESS_EMPLOYEE
Edited by: saslove sap on Mar 19, 2009 7:45 AM -
Can anyone tell me steps to be taken while modifying a function module exit
Hi guys,
I have to make little changes to function module exits in a project .
what are the necessary steps i need to take make the changes and make them work.
Thanks,
Venkat1. Create a project in CMOD
2. Assign the exit definition name (From SMOD)
3. Select the function module you would like to implement from the components screen
4. Double click on the include name within the function module, create the include if not already created
5. Add your code to the include program
6. Save and activate your code
7. Save and activate your CMOD Project
Best Regards,
Chris H. -
Function modules Exit and Init
Hi Friends,
What is the purpose of function modules init and exit in the "Exit" functions.
why two function modules are using in the Exit functions?
Please give me relevant secanarios?
will assign the points.
Thanks
BPS<b>FM Initialization</b>:
A function module to initialize the planning function. This function module is optional. It is only required if new transaction data records are to be generated in the planning function that are different, in terms of the combinations of values, to characteristics in the previous transaction data that are not to be changed. The keys for these new transaction data records are delivered by the function module in the table ETO_CHAS. The keys are supplemented by the keys of the transaction data that already exist. The data objects for which the planning function is called up are formed from these keys. They also influence how often and with which combinations of transaction data the second function module is called up.
<b>Function Module:</b>
A function module that is called up several times and that changes transaction data records. This function module receives a package of transaction data records in each case. These differ only in their characteristics to be changed. They have the same values as far as all other characteristics are concerned. The transaction data is in table XTH_DATA. Only the existing records are transferred. If key combinations were returned by the initialization function module, and no transaction data exists for these, then table XTH_DATA is empty. The key combination is in the table ITO_CHASEL.
Its not necessary to write a init FM unless you need to generate new records by the exit function.
regards,
sanjay. -
Know the all function modules & descriptions
Is there any transaction or table or program to know the all the function modules and its descriptions
Okay, here is an easier way. On the main screen of SE37, click on the binoculars (the "Find" button on the top menu). Now on the next screen just enter the maximum number of hits that you want and click on the execute button.
Note: if you want to use table TFDIR to see all entries, use transaction SE16 and on the selection screen for that table you will need to change the maximum number of hits (last field on the screen).
- April
Message was edited by:
April King -
Hi Experts,
I got a new requirement to add the filed Mfr Name to the PO.
Please guide through the complete process.
( which Function module exit do i need to update and how)
Thanks in advance.Hai.
check the example code.
REPORT Z_SALES_ORDER_CHANGE
NO STANDARD PAGE HEADING
LINE-SIZE 132
LINE-COUNT 65(0)
MESSAGE-ID ZZ.
TABLES: VBAP.
DATA:
V_FILEIN(90) TYPE C,
V_RECIN TYPE I,
V_RECVBAP TYPE I,
V_RECORDER TYPE I,
V_VBELN LIKE VBAP-VBELN,
ORDERHEADERINX LIKE BAPISDH1X.
DATA: BEGIN OF I_ORDERS OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
BRGEW(18) TYPE C,
VOLUM(18) TYPE C,
END OF I_ORDERS.
DATA: BEGIN OF I_OUTPUT OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
GEWEI LIKE VBAP-GEWEI,
BRGEW LIKE VBAP-BRGEW,
VOLUM LIKE VBAP-VOLUM,
CKWGT TYPE C,
CKVOL TYPE C,
END OF I_OUTPUT.
DATA: BEGIN OF ORDERITEMIN OCCURS 0.
INCLUDE STRUCTURE BAPISDITM.
DATA: END OF ORDERITEMIN.
DATA: BEGIN OF ORDERITEMINX OCCURS 0.
INCLUDE STRUCTURE BAPISDITMX.
DATA: END OF ORDERITEMINX.
DATA: BEGIN OF RETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF RETURN.
DATA: BEGIN OF BAPIRETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF BAPIRETURN.
PARAMETERS:
P_PATH(45) TYPE C DEFAULT '/usr/users/ftpsapom/' LOWER CASE,
P_FNAME(32) TYPE C DEFAULT '/sweetjo.txt' LOWER CASE.
START-OF-SELECTION.
CONCATENATE PATH AND FILE NAME INTO ONE VARIABLE
CONCATENATE P_PATH P_FNAME INTO V_FILEIN.
OPEN DATASET
IF V_FILEIN IS INITIAL.
MESSAGE E002 WITH 'FILE' V_FILEIN 'DOES NOT CONTAIN ANY DATA!'.
ELSE.
OPEN DATASET V_FILEIN
FOR INPUT
IN TEXT MODE.
IF SY-SUBRC = 0.
READ DATASET
DO.
READ DATASET V_FILEIN INTO I_ORDERS.
IF SY-SUBRC = 0.
APPEND I_ORDERS.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET
CLOSE DATASET V_FILEIN.
IF SY-SUBRC <> 0.
MESSAGE E002 WITH 'ERROR - CLOSING' V_FILEIN.
ENDIF.
ELSE.
MESSAGE E002 WITH 'ERROR - COULD NOT OPEN' V_FILEIN.
ENDIF.
ENDIF.
SORT AND REMOVE DUPLICATES FROM I_ORDERS
SORT I_ORDERS BY VBELN POSNR.
DELETE ADJACENT DUPLICATES FROM I_ORDERS.
POPULATE I_OUTPUT
LOOP AT I_ORDERS.
SHIFT I_ORDERS-POSNR LEFT DELETING LEADING SPACE.
CONCATENATE '0' I_ORDERS-POSNR INTO I_ORDERS-POSNR.
SELECT SINGLE BRGEW VOLUM
FROM VBAP
INTO (VBAP-BRGEW, VBAP-VOLUM)
WHERE VBELN = I_ORDERS-VBELN
AND POSNR = I_ORDERS-POSNR.
IF SY-SUBRC = 0.
IF VBAP-BRGEW = 0.
I_OUTPUT-CKWGT = 'X'.
ENDIF.
IF VBAP-VOLUM = 0.
I_OUTPUT-CKVOL = 'X'.
ENDIF.
I_OUTPUT-VBELN = I_ORDERS-VBELN.
I_OUTPUT-POSNR = I_ORDERS-POSNR.
I_OUTPUT-GEWEI = 'ST'.
I_OUTPUT-BRGEW = I_ORDERS-BRGEW.
I_OUTPUT-VOLUM = I_ORDERS-VOLUM.
APPEND I_OUTPUT.
CLEAR: I_OUTPUT.
ENDIF.
V_RECIN = V_RECIN + 1.
ENDLOOP.
POPULATE BAPI DATA AND RUN BAPI
CLEAR: ORDERHEADERINX, ORDERITEMIN, ORDERITEMINX,
RETURN, BAPIRETURN.
REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
ORDERHEADERINX-UPDATEFLAG = 'U'.
LOOP AT I_OUTPUT WHERE CKWGT = 'X' OR CKVOL = 'X'.
V_RECVBAP = V_RECVBAP + 1.
IF I_OUTPUT-VBELN <> V_VBELN AND SY-TABIX <> 1.
V_RECORDER = V_RECORDER + 1.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = V_VBELN
ORDER_HEADER_INX = ORDERHEADERINX
TABLES
RETURN = RETURN
ORDER_ITEM_IN = ORDERITEMIN
ORDER_ITEM_INX = ORDERITEMINX.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = BAPIRETURN.
WRITE OUT RETURN
LOOP AT RETURN.
WRITE: / RETURN.
ENDLOOP.
WRITE: / BAPIRETURN.
SKIP.
CLEAR: ORDERITEMIN, ORDERITEMINX,
RETURN, BAPIRETURN.
REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
ENDIF.
ORDERITEMIN-ITM_NUMBER = I_OUTPUT-POSNR.
ORDERITEMIN-UNTOF_WGHT = I_OUTPUT-GEWEI.
IF NOT I_OUTPUT-CKWGT IS INITIAL.
ORDERITEMIN-GROSS_WGHT = I_OUTPUT-BRGEW.
ORDERITEMINX-GROSS_WGHT = 'X'.
ENDIF.
IF NOT I_OUTPUT-CKVOL IS INITIAL.
ORDERITEMIN-VOLUME = I_OUTPUT-VOLUM.
ORDERITEMINX-VOLUME = 'X'.
ENDIF.
APPEND ORDERITEMIN.
ORDERITEMINX-ITM_NUMBER = I_OUTPUT-POSNR.
ORDERITEMINX-UNTOF_WGHT = 'X'.
ORDERITEMINX-UPDATEFLAG = 'U'.
APPEND ORDERITEMINX.
V_VBELN = I_OUTPUT-VBELN.
ENDLOOP.
RUN BAPI ON LAST ORDER
IF NOT ORDERITEMIN IS INITIAL.
V_RECORDER = V_RECORDER + 1.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = V_VBELN
ORDER_HEADER_INX = ORDERHEADERINX
TABLES
RETURN = RETURN
ORDER_ITEM_IN = ORDERITEMIN
ORDER_ITEM_INX = ORDERITEMINX.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = BAPIRETURN.
WRITE OUT RETURN
LOOP AT RETURN.
WRITE: / RETURN.
ENDLOOP.
WRITE: / BAPIRETURN.
SKIP.
ENDIF.
WRITE OUT RECORD COUNT FROM FILE
WRITE: / 'RECORD COUNT FROM FILE ', V_RECIN.
SKIP.
WRITE OUT RECORD COUNT FROM FILE
WRITE: / 'RECORD COUNT OF LINES TO CHANGE ', V_RECVBAP.
SKIP.
WRITE OUT RECORD COUNT FROM FILE
WRITE: / 'RECORD COUNT OF ORDERS TO CHANGE ', V_RECORDER.
SKIP.
TOP OF PAGE
TOP-OF-PAGE.
WRITE:/1(5) TEXT-H01, 6(8) SY-DATUM MM/DD/YY,
100(8) TEXT-H02, 126(8) SY-PAGNO.
WRITE:/1(5) TEXT-H03, 6(8) SY-UZEIT USING EDIT MASK '__:__:__',
20(77) TEXT-H04,
100(8) TEXT-H05, 108(25) SY-REPID.
WRITE:/1(6) TEXT-H06, 8(12) SY-UNAME,
20(4) TEXT-H07, 25(32) SY-HOST,
100(13) TEXT-H08, 121(8) SY-SYSID,
129 '/', 130(3) SY-MANDT.
ULINE.
SKIP.
DATA: LWA_HEADER_DATA LIKE BAPIOBDLVHDRCHG,
LWA_HEADER_CONTROL LIKE BAPIOBDLVHDRCTRLCHG,
LT_ITEM_DATA LIKE TABLE OF BAPIOBDLVITEMCHG,
LWA_ITEM_DATA LIKE LINE OF LT_ITEM_DATA,
LV_OLD_DELIV LIKE GWA_SD_DOCUMENT-VBELN,
LV_NEW_DELIV LIKE GWA_SD_DOCUMENT-VBELN,
LV_OLD_MATNR LIKE GWA_SD_DOCUMENT-MATNR,
LV_NEW_MATNR LIKE GWA_SD_DOCUMENT-MATNR,
LV_OLD_SHIP LIKE GWA_SD_DOCUMENT-TKNUM,
LWA_TECHN LIKE BAPIDLVCONTROL,
LT_ITEM_CONTROL LIKE TABLE OF BAPIOBDLVITEMCTRLCHG,
LWA_ITEM_CONTROL LIKE LINE OF LT_ITEM_CONTROL,
LV_NEW_SHIP LIKE GWA_SD_DOCUMENT-TKNUM,
LT_RETURN LIKE TABLE OF BAPIRET2.
*Local data --> End
LWA_TECHN-UPD_IND = GC_DEFAULT.
LOOP AT GT_SD_DOCUMENT INTO GWA_SD_DOCUMENT.
LWA_ITEM_DATA-DELIV_NUMB = GWA_SD_DOCUMENT-VBELN.
LWA_ITEM_DATA-DELIV_ITEM = GWA_SD_DOCUMENT-POSNR.
LWA_ITEM_DATA-MATERIAL = GWA_SD_DOCUMENT-MATNR.
LWA_ITEM_DATA-DLV_QTY = GWA_SD_DOCUMENT-LFIMG_R.
LWA_ITEM_DATA-DLV_QTY_IMUNIT = GWA_SD_DOCUMENT-LFIMG_R.
LWA_ITEM_DATA-SALES_UNIT = GWA_SD_DOCUMENT-VRKME.
LWA_ITEM_DATA-BASE_UOM = GWA_SD_DOCUMENT-MEINS.
APPEND LWA_ITEM_DATA TO LT_ITEM_DATA.
LWA_ITEM_CONTROL-DELIV_NUMB = GWA_SD_DOCUMENT-VBELN.
LWA_ITEM_CONTROL-DELIV_ITEM = GWA_SD_DOCUMENT-POSNR.
LWA_ITEM_CONTROL-CHG_DELQTY = GC_DEFAULT.
APPEND LWA_ITEM_CONTROL TO LT_ITEM_CONTROL.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
HEADER_DATA = LWA_HEADER_DATA
HEADER_CONTROL = LWA_HEADER_CONTROL
DELIVERY = LV_OLD_DELIV
TABLES
ITEM_DATA = LT_ITEM_DATA
ITEM_CONTROL = LT_ITEM_CONTROL
RETURN = LT_RETURN.
ENDLOOP.
BAPI_OUTB_DELIVERY_CHANGE
Regards.
sowjanya.b -
Changing option in function module
sir,
plz explain the role or importance of changing option in function module SE37hi check this example it had the usage of the changing option..
here the using will input the value to the perform and do some prosses and output some value..
PERNR TYPE P0001-PERNR Personnel Number
PLANS TYPE P0001-PLANS Position
ORGEH TYPE P0001-ORGEH Organizational Unit
DATE TYPE SY-DATUM SY-DATUM Date and time, current (applic
PLVAR TYPE PLOG-PLVAR '01' Plan Version
ISTAT TYPE PLOG-ISTAT '1' Planning Status
MANAGER TYPE ZHMSS_MANAGER Structure for manager for MSS
NO_PERNR_PLANS_ORGEH_SPEC No pernr, position or org unit specified
NO_EXIST_PLANS Position does not exist
INVALID_PLANS Position invalid
NO_EXIST_ORGEH Org unit does not exist
NO_EXIST_PERNR Personnel number does not exist
function z_get_orgunit_manager_info.
""Local interface:
*" IMPORTING
*" REFERENCE(PERNR) TYPE P0001-PERNR OPTIONAL
*" REFERENCE(PLANS) TYPE P0001-PLANS OPTIONAL
*" REFERENCE(ORGEH) TYPE P0001-ORGEH OPTIONAL
*" REFERENCE(DATE) TYPE SY-DATUM DEFAULT SY-DATUM
*" REFERENCE(PLVAR) TYPE PLOG-PLVAR DEFAULT '01'
*" REFERENCE(ISTAT) TYPE PLOG-ISTAT DEFAULT '1'
*" EXPORTING
*" REFERENCE(MANAGER) TYPE ZHMSS_MANAGER
*" EXCEPTIONS
*" NO_PERNR_PLANS_ORGEH_SPEC
*" NO_EXIST_PLANS
*" INVALID_PLANS
*" NO_EXIST_ORGEH
*" NO_EXIST_PERNR
if pernr is initial and
plans is initial and
orgeh is initial.
raise no_pernr_plans_orgeh_spec.
endif."pernr is initial and
if not pernr is initial.
if pernr cn '0123456789'.
exit.
endif.
*-- See if pernr exists
call function 'P_EMPLOYEE_CHECKEXISTENCE'
exporting
object_id = pernr
date = date
exceptions
employee_not_found = 01.
if sy-subrc ne 0.
raise no_exist_pernr.
exit.
endif.
*-- Obtain pernr position
call function 'HR_READ_INFOTYPE'
exporting
pernr = pernr
infty = c_infty_0001
begda = date
endda = date
importing
subrc = g_retcd
tables
infty_tab = i0001
exceptions
infty_not_found = 01
others = 02.
if sy-subrc eq 0.
describe table i0001 lines g_lines.
if g_lines > 0.
read table i0001 index 1.
*-- Got position now find org unit
perform zf_proc_get_om_objects tables i_objects
using c_otype_position
i0001-plans
plvar
c_rsign_a
c_relat_003
istat
date
date
c_otype_orgunit
changing g_retcd.
if g_retcd eq 0.
read table i_objects index 1.
g_orgeh = i_objects-sobid(8).
endif. "g_retcd eq 0.
endif. "g_lines > 0. for i0001
endif. "sy-subrc eq 0 hr_read_infotype
elseif not plans is initial.
if plans co '9' or
plans co '0'.
raise invalid_plans.
exit.
endif.
call function 'RH_READ_OBJECT'
exporting
plvar = plvar
otype = c_otype_position
objid = plans
istat = istat
begda = date
endda = date
langu = sy-langu
exceptions
not_found = 1
others = 2.
if sy-subrc <> 0.
raise no_exist_plans.
exit.
endif.
*-- Find org unit
perform zf_proc_get_om_objects tables i_objects
using c_otype_position
plans
plvar
c_rsign_a
c_relat_003
istat
date
date
c_otype_orgunit
changing g_retcd.
if g_retcd eq 0.
read table i_objects index 1.
g_orgeh = i_objects-sobid(8).
endif."g_retcd eq 0.
elseif not orgeh is initial.
call function 'RH_READ_OBJECT'
exporting
plvar = plvar
otype = c_otype_orgunit
objid = orgeh
istat = istat
begda = date
endda = date
langu = sy-langu
CHECK_STRU_AUTH = space "ASikaria, 10/15
exceptions
not_found = 1
others = 2.
if sy-subrc <> 0.
raise no_exist_orgeh.
exit.
endif.
g_orgeh = orgeh.
endif. "not pernr is initial.
if not g_orgeh is initial.
manager-orgeh = g_orgeh.
*-- Got org unit now find manager
perform zf_proc_get_om_objects tables i_objects
using c_otype_orgunit
manager-orgeh
plvar
c_rsign_b
c_relat_012
istat
date
date
c_otype_position
changing g_retcd.
if g_retcd eq 0.
read table i_objects index 1.
if sy-subrc eq 0.
manager-plans = i_objects-sobid.
call function 'Z_GET_POSITION_HOLDER'
exporting
plans = manager-plans
plvar = plvar
istat = istat
date = date
importing
pernr = manager-pernr
exceptions
position_not_exist = 1
position_invalid = 2
others = 3.
if sy-subrc <> 0.
clear: manager-pernr.
endif.
if not manager-pernr is initial.
*- BOC RTDK902962
*-- Obtained formatted name
clear: i0001.
refresh: i0001.
call function 'HR_READ_INFOTYPE'
exporting
pernr = manager-pernr
infty = c_infty_0001
begda = date
endda = date
importing
subrc = g_retcd
tables
infty_tab = i0001
exceptions
infty_not_found = 1
others = 2.
if sy-subrc eq 0.
read table i0001 index 1.
if sy-subrc eq 0.
manager-ename = i0001-ename.
endif.
endif.
*- EOC RTDK902962
*-- Obtain pernr information
*- Get 0002 data
clear: i0002.
refresh: i0002.
call function 'HR_READ_INFOTYPE'
exporting
pernr = manager-pernr
infty = c_infty_0002
begda = date
endda = date
importing
subrc = g_retcd
tables
infty_tab = i0002
exceptions
infty_not_found = 1
others = 2.
if sy-subrc eq 0.
read table i0002 index 1.
if sy-subrc eq 0.
manager-inits = i0002-inits.
manager-vorna = i0002-vorna.
manager-nachn = i0002-nachn.
manager-midnm = i0002-midnm.
endif.
endif.
*- Get 0105 data
clear: i0105.
refresh: i0105.
call function 'HR_READ_INFOTYPE'
exporting
pernr = manager-pernr
infty = c_infty_0105
begda = date
endda = date
importing
subrc = g_retcd
tables
infty_tab = i0105
exceptions
infty_not_found = 1
others = 2.
if sy-subrc eq 0.
describe table i0105 lines g_lines.
if g_lines > 0.
*- SAP usrid
loop at i0105 where subty = c_0105_usrid_subty.
manager-usrid = i0105-usrid.
endloop.
*- Email address
*// not sure where email is going to be stored but assume it is subtype
*// 0010
loop at i0105 where subty = c_0105_email_subty.
manager-email = i0105-usrid_long.
endloop.
endif. "g_lines > 0
endif."sy-subrc eq 0.
endif. "not manager-pernr is initial.
endif. "sy-subrc eq 0.
endif."g_retcd eq 0.
endif. "not g_orgeh is initial.
endfunction.
zposition holder
PLANS TYPE PLOG-OBJID Object ID
PLVAR TYPE PLOG-PLVAR '01' Plan Version
ISTAT TYPE PLOG-ISTAT '1' Planning Status
DATE TYPE SY-DATUM SY-DATUM Date and time, current (application server) date
PERNR TYPE P0001-PERNR Personnel Number
POSITION_NOT_EXIST Position does not exist
POSITION_INVALID Invalid position
function z_get_position_holder.
""Local interface:
*" IMPORTING
*" REFERENCE(PLANS) TYPE PLOG-OBJID
*" REFERENCE(PLVAR) TYPE PLOG-PLVAR DEFAULT '01'
*" REFERENCE(ISTAT) TYPE PLOG-ISTAT DEFAULT '1'
*" REFERENCE(DATE) TYPE SY-DATUM DEFAULT SY-DATUM
*" EXPORTING
*" REFERENCE(PERNR) TYPE P0001-PERNR
*" EXCEPTIONS
*" POSITION_NOT_EXIST
*" POSITION_INVALID
if plans cn '0123456789'.
raise position_invalid.
endif."plans cn '0123456789'.
if plans co '9'. "default position
exit.
endif.
call function 'RH_READ_OBJECT'
exporting
plvar = plvar
otype = c_otype_position
objid = plans
begda = date
endda = date
exceptions
not_found = 01
others = 02.
if sy-subrc ne 0.
raise position_not_exist.
else.
perform zf_proc_get_om_objects tables i_objects
using c_otype_position
plans
plvar
c_rsign_a
c_relat_008
istat
date
date
c_otype_pernr
changing g_retcd.
if g_retcd eq 0.
sort i_objects by begda descending. "get earliest rec
read table i_objects index 1.
if sy-subrc eq 0.
pernr = i_objects-sobid(8).
endif.
endif. "g_retcd eq 0.
endif. "sy-subrc ne 0.
endfunction.
regards,
venkat -
How to change the Partner function code in Quotation
Hi All,
We have a requirement that whenever a Quote is cancelled,
We need to change one of the function codes in the partner tab and also the user status should be changed.
Can anyone give a quick solution on this?
Your response will be appreciated.
Thanks in advance.
Regards,
RamyaYou will best implement this as an action (tx. SPPFCADM), which is called on changing the status to cancelled. In this action you can call a function module changing the partner functions using e.g. CRM_ORDER_MAINTAIN as the appropriate function module.
Regards, Kai -
CRM-ISU: Need to change the END date and Start Date for contract items
Hi,
There is an old contract item for which I need to change the end date
and there is a new contract item for which I need to change the start date.
I need to change the contract item end date and start date using some function module in IS-U system (may be as RFC to CRM).Pleaselet me know if any body is ware of this functionality?
I am aware of a FM EECRM_CONTRACT_DATE_CHANGE which may be used for changing End Date
but how to change the start date of a new contract item?
Please let me know if any body is aware of this?
ThanksHi,
Hope you can solve it by this [Link1|Re: Function modules; [link2|CRM material;.
Regards,
Surjith
Maybe you are looking for
-
My name is John Grace. I have been an MS customer for years. Never before in my experiences with MS up to this point have I experienced such POOR product support. Your pre-sales agents have no knowledge to offer with pre-sales config or install is
-
i went to plug in into iTunes and it would not allow me to fix it by putting into recovery mode.I tried everything called apple care that did not help
-
Does MV45AFZZ user exit trigger when CRM sales order is replicated into ECC
Hi All, When a Sales order is created in CRM, it is replicated automatically using BDOCS from CRM into ECC. I have requirement to code the logic during the process, when sales order is replicated into ECC. So I need to know the BAPI which is actually
-
Getting PO number in EXIT_SAPLEBND_002
Hello, I've put code in EXIT_SAPLEBND_002 (include ZXM06U22), and in order to trigger my release strategy I need to pass a "Y" in I_CEKKO-USRC1 if the total net value price on the PO that has been changed has increased in value or percentage over a g
-
I was wondering if it was possible to edit the spry menu so that the sub menus showed up as a horizontal line below the main links something like this {the initial state would look like this} home | about us | contact us {then if you rolled over abou