Creating a Function Module for Standard Include
Hi ALL,
There is a standard Include in that i have created 1implicit Enhancement Point and there is 200 lines code is there ,so my client is saying to keep this code in function module. This is the below code can any one do how to write this code in function module with passing parameters and all the stuff.Means Import parameters ,Export parameters and Source code ?
Perform change_order_va02.
data: l_vbfa like vbfa,
l_FKART like vbrk-FKART,
l_fksto like vbrk-fksto,
l_sfakn like vbrk-sfakn.
data: begin of lt_vbfa occurs 0,
vbeln like vbfa-vbeln,
end of lt_vbfa.
if komfk-vbtyp ca 'PO'. " debit/credit memo
select vbeln into table lt_vbfa from vbfa
where vbelv = KOMFK-VBELN and
( vbtyp_n = '5' or vbtyp_n = '6' ).
loop at lt_vbfa.
clear: l_fksto, l_sfakn.
select single FKART fksto SFAKN into (l_FKART, l_fksto, l_sfakn)
from vbrk
where vbeln = lt_vbfa-vbeln.
check: sy-subrc = 0,
l_fksto is initial,
l_sfakn is initial.
message e310(zz) with l_FKART l_vbfa-vbeln.
endloop.
endif.
*} INSERT
ENDFORM.
*{ INSERT D01K9A0PBY 1
*& Form change_order_va02
228810/45115 FUWAGNK implement VA02 into VF01 for Turkey
--> p1 text
<-- p2 text
FORM change_order_va02.
Tables : *knvi, *lips, *likp.
DATA: Z_MODE value 'N'.
data: hf-date(10).
DATA: BEGIN OF BDC_TAB OCCURS 0.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDC_TAB.
DATA: BEGIN OF BDC_MSG OCCURS 0.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF BDC_MSG.
select single vbeln vgbel from *lips into corresponding
fields of *lips
where vbeln = KOMFK-VBELN.
select single vbeln LFART from *likp into corresponding
fields of *likp
where vbeln = KOMFK-VBELN.
if *likp-lfart = 'LF'.
select single vbeln vkorg kunnr from vbak into corresponding
fields of vbak
where vbeln = *lips-vgbel.
if vbak-vkorg = '1252'.
clear bdc_tab. refresh bdc_tab.
move 'SAPMV45A' to BDC_TAB-PROGRAM.
move '102 ' to BDC_TAB-DYNPRO.
move 'X' to BDC_TAB-DYNBEGIN.
APPEND BDC_TAB. CLEAR BDC_TAB.
move: 'VBAK-VBELN' to BDC_TAB-FNAM, "Doc.Number
VBAK-VBELN to BDC_TAB-FVAL.
APPEND BDC_TAB. CLEAR BDC_TAB.
MOVE: 'BDC_OKCODE' TO BDC_TAB-FNAM, "OK-CODE
'/00 ' TO BDC_TAB-FVAL.
APPEND BDC_TAB. CLEAR BDC_TAB.
move 'SAPMV45A' to BDC_TAB-PROGRAM.
move '4001' to BDC_TAB-DYNPRO.
move 'X' to BDC_TAB-DYNBEGIN.
APPEND BDC_TAB. CLEAR BDC_TAB.
MOVE: 'BDC_OKCODE' TO BDC_TAB-FNAM, "OK-CODE
'KKAU ' TO BDC_TAB-FVAL.
APPEND BDC_TAB. CLEAR BDC_TAB.
move 'SAPMV45A' to BDC_TAB-PROGRAM.
move '4002' to BDC_TAB-DYNPRO.
move 'X' to BDC_TAB-DYNBEGIN.
APPEND BDC_TAB. CLEAR BDC_TAB.
select single * from *KNVI into *KNVI where KUNNR = vbak-kunnr
and ALAND = 'TR'
and TATYP = 'MWST'
and TAXKD = '2'.
if sy-subrc = 0.
exit.
endif.
move: 'VBAK-WAERK' to BDC_TAB-FNAM, "Currency
'YTL ' to BDC_TAB-FVAL.
APPEND BDC_TAB. CLEAR BDC_TAB.
write sy-datum to hf-date.
move: 'VBAK-AUDAT' to BDC_TAB-FNAM, "Doc.Number
hf-date to BDC_TAB-FVAL.
APPEND BDC_TAB. CLEAR BDC_TAB.
move: 'VBKD-PRSDT' to BDC_TAB-FNAM, "Doc.Number
hf-date to BDC_TAB-FVAL.
APPEND BDC_TAB. CLEAR BDC_TAB.
MOVE: 'BDC_OKCODE' TO BDC_TAB-FNAM, "OK-CODE
'/11 ' TO BDC_TAB-FVAL.
APPEND BDC_TAB. CLEAR BDC_TAB.
CALL TRANSACTION 'VA02'
USING BDC_TAB MODE Z_MODE UPDATE 'S'
MESSAGES INTO BDC_MSG.
IF SY-SUBRC NE 0.
clear bdc_tab. refresh bdc_tab.
endif.
endif.
endif.
ENDFORM. " change_order_va02
Regards,
Venkat
ans
Similar Messages
-
How to find the function module for standard tables.
Hi
Could any one please tell me how to find the standard function module to update the standard tables
Thanks & Regards
SowmyaHi sowmya,
To find the function modules for standard tables you go for a where used list of that particular table and check only function module interfaces checkbox...
and more over you can go for DB_UPDATE_TABLE will be the function module for updating database table..
Hope this information would help you
Regards
Narin Nandivada -
How to create ENQUEUE function module for s567 table
Hi Experts,
Anyone Plz tell the steps how to create a ENQUEUE function module for the table s567.
Its somewht urgent, plz help me.
<REMOVED BY MODERATOR>
Mohana
Edited by: Alvaro Tejada Galindo on Mar 10, 2008 4:21 PMHi,
You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
Technicaly:
When you create a lock object System automatically creat two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
You have to use these function module in your program.
Hope this will give a basic idea.
Regards
Sudheer -
How can create a function module for currency and quantity fields
hi,
i want to create a function module with some fields.when i activated it give some errors for
netpr,menge,wemng fields(currency, quantity fields).error is it asks for reference fields.
please send me solution for it.
sreenu.Hi Sreenu,
While creating CURRENCY/QUANTITY fields in the DataBase Table, you have to enter a REFERENCE TABLE and a REFERENCE FIELD to the field.
For that, after entering the field name and the data type in the correcponding columns, you have to place the cursor on the data type of the required field and click the CURRENCY/QUANTITY FIELDS tab. You will find two columns called REFERENCE TABLE and a REFERENCE FIELD.
you have to enter a reference table in which a currency/quantity field is used and a reference field which is a currency/quantity field in that table.
For Example, below is the table details.
FIELD DATATYPE LENGTH DEC.PLACES REF.TABLE REF.FIELD
1.SNO CHAR 5
2.AMOUNT CURR 10 2 T001 WAERS
3.NOS QUAN 5 KNA1 /VSO/R_PAL_UL
Here Field 2(AMOUNT) is a CURR field whose Ref. Table is T001 and Ref. Field is WAERS and Field 3(NOS) is a QUAN field whose Ref. Table is KNA1 and Ref. Field is /VSO/R_PAL_UL.
Hope this will help you.
Regards,
Vaitheeswaran -
Need SMD function module for business partner in SRM
Hi Gurus,
I am looking for standard Master Idoc create SMD function module for business partner in SRM.
I need to send an Idoc from SRM to ECC based on change pointers i.e. whenever a business partner is changed in SRM. So there are standard function modules *smd* available for other data but i am not able to find any FM for busienss partner.
Please suggest if anyone has came accross such scenario.
Thanks,
RavindraGot it
-
Function module for background jobs email
hi abaper's
i hace to create a function module for background jobs this function module have to send an email automatically when a background job is assigned or processed in background.
thnks n regards
pardeep kumarhi dear
open this site
https://weblogs.sdn.sap.com/pub/wlg/781. [original link is broken] [original link is broken] [original link is broken]
<removed by moderator>
Edited by: Mike Pokraka on Aug 8, 2008 12:48 PM -
Function Module for search help Exit
How to create a function Module for search help exits?
please explain in details with step by step process.Hi,
How to create a function Module for search help exits?
function module for search help F4IF_SHLP_EXIT_EXAMPLE
dynamic search help use 'F4IF_INT_TABLE_VALUE_REQUEST'
please check out the link below it will help you
A repository object maintained in the ABAP Dictionary. It supplies input fields on Dynpros with single- or multi-column input helps. Search helps can be linked in the Dictionary with components from structures, data elements, and check tables. A search help enables you to search for entry values with assigned data, without you having to know the exact spelling of the value.
http://help.sap.com/saphelp_46c/helpdata/EN/cf/21ee52446011d189700000e8322d00/content.htm
please explain in details with step by step process.
create a search help exit:
1. create an fm with this interface:
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCR_TAB_T
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" VALUE(SHLP) TYPE SHLP_DESCR_T
*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
put this logic in it:
Delete duplicate filter logic.
This logic only needs to apply at the 'DISP' event - which is just
before the hit list is displayed
if callcontrol-step = 'DISP'.
delete adjacent duplicates from record_tab.
endif.
2. edit your search help in se11 and enter the name of the above search help exit fm
check this sample code..for dynamic search help
REPORT ZTEST_F4HELP .
*---Report with selection screen and to display the list of
possible entries for field 'B' as per the value in field 'A'.
parameters: p_vbeln type vbak-vbeln,
p_posnr type vbap-posnr.
at selection-screen on value-request for p_posnr.
data: begin of help_item occurs 0,
posnr type vbap-posnr,
matnr type vbap-matnr,
arktx type vbap-arktx,
end of help_item.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_VBELN'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
others = 11.
read table dynfields with key fieldname = 'P_VBELN'.
p_vbeln = dynfields-fieldvalue.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = p_vbeln
importing
output = p_vbeln.
select posnr matnr arktx into table help_item
from vbap
where vbeln = p_vbeln.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'POSNR'
dynprofield = 'P_POSNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_item.
also check this link it will help you
/message/3854825#3854825 [original link is broken]
*********please reward points if the information is helpful to you************* -
Inbound function module for custom IDOC
HI,
I have created custom IDOC.I need to create inbound function module for that custom IDOC.Can any one send me sample
function module for custom IDOC.(what are all the import Export,tables parameters and exceptions that I need to create for function module)
Thanks&Regards
Rama.MekalaHI Rama,
I presumed that You are talking about a FM to create inbound IDOC. So for creating inbound IDOC you can use '
CALL FUNCTION 'IDOC_INBOUND_ASYNCHRONOUS'
TABLES
idoc_control_rec_40 = gt_edidc
idoc_data_rec_40 = gt_edidd.
IF sy-subrc NE 0.
* MESSAGE e000 WITH text-003.
* ELSE.
* MESSAGE i000 WITH text-004 .
ENDIF.
just prepare edidc and edidd record in and pass it to the FM..
Hope this will work for you...
Thanks -
Function module for uploading file in background
hi friends
i am working on Inbound IDOC interface where in which i am creating a function module for that,
in which based on the idoc received , the interface has to choose the file from the shared folder and it has to move its contents to an internal table
can anybody suggest me what function module can i use.
we cant use GUI_upload,or cl_gui_frontend_services=>gui_upload
because this requires an user to interact in mines it is not the case
thanks in advance
with regards
s.janagarhi,
check this thread,you will get idea how to transfer data from file to internal table.
[https://forums.sdn.sap.com/click.jspa?searchID=17706879&messageID=6281020] -
Function Module for Discover Credit Card
We have Payment Credit Card types set up in the SAP system as American Express, Master Card and Visa Card. These use the following Function Modules CCARD_CHECK_AMEX, CCARD_CHECK_MC and CCARD_CHECK_VISA respectively.
We want to add Discover Credit Card. Does anybody know how to create a Function Module for it, or where do I get the specifications for the sme?
Please advice.
Thank You.Hello Sujeet,
have a look at http://en.wikipedia.org/wiki/Credit_card for the checksum of Credit Card's. I think this function is implemented in CCARD_CHECK_LUHN_MOD_TEN. I think you should try to copy CCARD_CHECK_VISA to Z_CCARD_CHECK_DISCOVER and adapt this module to your needs.
Regards
Gregor -
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 -
Standard BAPI or Function Module for FB01posting
Hi Experts,
My requirement is as follows.
Invoice details would be sent across from Middleware to SAP and for which I have developed a Custom Remote Enabled Function Module. The Function Module needs to post the data using FB01 Transaction.
I had planned for recording a BDC for FB01 and post the data, however, we are on the verge of getting upgraded from 4.7 to ECC 6.0. To avoid problems that we might face for change of screens in ECC 6.0, I would prefer using a BAPI or Function Module for FB01 posting, if available, instead of BDC.
Data coming from Middleware are as follows.
HEADER:
BKPF-BLDAT : Document Date
BKPF-BUDAT : Posting Date
BKPF-XBLNR: Reference (Invoice#)
BKPF-BLART : Document Type
BKPF-BUKRS : Company Code
BKPF-BKTXT : DocHeader Text
BKPF-WAERS : Currency
LINE ITEM:
BSEG-LIFNR : Vendor no
BSEG-WRBTR - Total amt -Debit/Credit -Vendor
BSEG-ZUONR : Assignment field
BSEG-EMPFB : Alternative Payee
BSEG-UZAWE : Payment Method Supplement
BSEG-ZTERM : Pmt terms
BSEG-KOSTL : Costcenter
BSEG-HKONT : GL AccountNumber
BSEG-WRBTR : Amount for GL
BSEG-SGTXT : Line item text
The Vendor Line Item would be one where as GL line items could me more than one.
Can any of you suggest me a standard BAPI or Func Mod?
Points will be awarded for valuable inputs.
Thanks to all!!!!You can use RFBIBL00 program for FB01 postings. Go through the program help on how to use this program.
This program requires a file to be on application server in a certain format.
You may also refer the program RFBIBLT0 on how the file format should be.
Hope this helps.
Thanks,
SKJ -
Function Module for creating Functional Location BOM and Equipment BOM
Hi All,
Is there any function module for creating and changing Functional Location BOM and Equipment BOM ???Hi,
Tables for Eq., BOM: EQST, STKO, STPO.
Tables fro Fun., Loc., BOM: TPST, STKO, STPO.
You can use FMs: CS_BOM_EXPL_TPL_V1, CS_BOM_EXPL_EQU_V2 & CS_BOM_EXPL_MAT_V2 for extracting the appropriate BOM related data.
And for the Alternatives please check the customizing or check with your respective Module experts for the appropriate configuration.
Hope this helps.
Best Regards, Murugesh AS -
Function module for to Create fund/Grant management Derivation rules
Hi All,
Is there any function module for to create a derivation rules for fund/Grant management.
Thanks in Advance.
Nara.Hi,
Please try with FM KED0_CREATE_DERIVATION_TABLE
Please let me know if you have some issues,
Regards,
Lijo Joseph
*Assign Points ifuseful. -
Standard function module for checking the sales organization and plant
Hi all,
Does have standard function module for checking the relationship between sales organization and plant?
Thanks a lot!
Ninahi
good
check these BAPIS
BAPI_SALESGROUP_GET_DETAIL Sales Group: Display Name
BAPI_SALESOFFICE_GET_DETAIL Sales Office: Display Name
BAPI_SALESOFFICE_GRP_EXIST Sales Office / Sales Group: Existence Check
BAPI_SALESORG_EXIST Sales Organization: Existence Check
BAPI_SALESORG_GET_DETAIL Sales Organization: Display Data
BAPI_SALESORG_OFFICE_EXIST Sales Organization / Sales Office: Existence Check
PLANT=>
BAPI_PROMO_GETSITEPLANNING Detailed Data for the Plants Involved in a Promotion
thanks
mrutyun^
Maybe you are looking for
-
Acrobat 7.0 and Outlook 2010
I'm currently testing out acrobat 7.0 with Outlook 2010 beta and I noticed that when I try to open a pdf attachment in outlook 2010, the attachment would open but after a few seconds, an error screen would appear "adobe acrobat 7.0 has stopped workin
-
How to get the list of Infocube/DSO in which one nav-attr is used
Hi all, i have a requirement to find the list of all infocubes and DSO in which a particular navigational attribute say:xxx_yyy [i have list of 50 nav attr for which i have to do this] is used. i need ur help on this. i need the distinct list of i
-
When I print to pdf from ArcMap the file save as a pdf on my computer, but if I try to view the files from another computer on the network the files show up as .tmp files. Any suggestions? Is this an adobe issue or an arcmap issue? Thanks, Sam
-
Exception in thread "main" java.lang.UnsatisfiedLinkError: - fresh Install
Pls can someone help me out. I have a similar problem to the one raised in this thread. I want to install 10g Release 2 on a RHEL AS4 Production IBM server. I've followed the installation guide to the letter! I keep getting this error: [oracle@pencom
-
Wireless Router 877W users cannot get ip address from DHCP
Users can connect to wireless but they cant get ip address what can be the problem ? Thanks no aaa new-model resource policy ip subnet-zero ip cef no ip dhcp use vrf connected ip dhcp excluded-address 10.10.10.1 ip dhcp excluded-address 192.168.239.1