In creation of function module
hi,
i created one rfc enabled function module to update the database table agr_define. but, is it possible to create custom function module in updating the any database table by using one function module only by giving the table name and fileds of that table as input.
please help me in this case.
Hi Mukka,
We could update a table from the function module.
But take care that we should be locking and unlocking the object before and after updating respectively.
Regards,
kiran
Similar Messages
-
Error with quantity field:Datasource Creation Using Function Module method
Problem with DATASOURCE Creation using Function Module method :
I have created a datasource ZSTANDARD_COST_PRICE using Function Module method . The datasource creation is successfull when I remove the quantity field from the Z table . If I dont remove the quantity field from my Z table it gives an error as "Units Field WAERS for field STPRS of datasource ZSTANDARD_COST_PRICE is hidden". I am not able to remove this error . Please someone guide.
Let me know if my explanation is not clear enough.
Thanks in advance,
Neha.
Z table definition is as below :
MATNR MATNR CHAR 18 0 Material Number
BWKEY BWKEY CHAR 4 0 Valuation area
LFGJA LFGJA NUMC 4 0 Fiscal Year of Current Period
STPRS STPRS CURR 11 2 Standard Price " Here the currency field is WAERS and table T001
PEINH PEINH DEC 5 0 Price Unit
VJSTP VJSTP CURR 11 2 Standard price in previous year
VJPEI VJPEI DEC 5 0 Price unit of previous year.
Edited by: Neha Rathi on Jan 30, 2009 3:03 PMHi,
You should add it as one of the main fields as you have added other fields and not as the currency fields...that is..it should be part of the data source and you should be able to see it in RSO2...
Also if added as i said then it will come as new field in the data source...you can either let it be there...or hide it..
also if you want to populate it then you will have to write the code for this fields as well.
Thanks
Ajeet -
BAPI creation versus function module creation...
Hi,
I know the difference between BAPI and simple function module. I have also created custom function module.
But I have not worked on creation of Custom BAPIs.
Is there a much differece in creation of function module and BAPI?
If there is please throw some light on main differences or stepwise differences when I create BAPI versus function module ?
Thanks.
Regards,
Tushar.Hai Tushar
what is BAPI?
BAPI stands for Business API(Application Program Interface).
I have answered this question before..
A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
You can make your function module remotely enabled in attributes of Function module but
A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
Please check out this thread..
Re: bapi
Also refer to the following links..
www.sappoint.com/abap/bapiintro.pdf
www.sap-img.com/bapi.htm
www.sap-img.com/abap/bapi-conventions.htm
www.planetsap.com/Bapi_main_page.htm
www.sapgenie.com/abap/bapi/index.htm
Checkout !!
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://techrepublic.com.com/5100-6329-1051160.html#
http://www.sap-img.com/bapi.htm
http://www.sap-img.com/abap/bapi-conventions.htm
http://www.sappoint.com/abap/bapiintro.pdf
Java Connector(JCO) can call not only BAPI's but also the function modules which are remotely enabled..
BAPI's as i said earlier are remotely enabled function modules..
Hence, JCO can call also BAPI's(n not only BAPI's as u mentioned).
Thanks & regards
Sreeni -
How to automate the creation of Function Module & Class Object (SE24)
Experts,
I have the requirement to automate the creation of any type of programs: ie function module (like how we normally create in SE37 together with the parameters), class object (like how we normally create in SE24 together with attribute & method), normal report (like how we did in SE38), module pool and so on.
For example. I backuped my program into a flat file (the entire source code in txt formal or HTML) through a download program and I need to upload back this flat file into another installation of SAP.
Does SAP provide any predefined FM to cater for the above cases or better still, does anyone know of any upload program which I can use for the above requirement.
Thanks in advance.Hi Kris, I can't use the transport system as these are 2 separate SAP installation in a different place. The requirement came in the form of creation of program to be able to generate FM/Class/Report on the go.
-
Save EAN11 field while creating POrder creation through Function module
Hi All,
I want to update EAN11 field in material master while creating Purchase Order through function module. I am using function module BAPI_PO_CREATE1 for creating purchase order. There are no structures in the PO creation FM in which EAN11 field is there. I have also tried using function module MEPO_DOC_ITEM_PROCESS for updating EAN11 field. It is not working. Please suggest some method to do that.
Note: I am receiving EAN11 through an external system by proxy.
Thanks,
ChinmayHi,
Use BAPI_MATERIAL_SAVEDATA to updat ean numbers for materials.
tables INTERNATIONALARTNOS is used to update EAN.
Regards,
Shanmugavel Chandrasekaran -
Date of creation of function module
Hi Guys,
is there any possibility to find out the date of creation of a function module.
For programs, it can be found in the table TRDIR. But I cant find any table for function modules.
ErikTFDIR will give you the name of the function group program and the include number.
E.g. SAPLZFUNCGROUP Include 01.
From this you can construct the include name: LZFUNCGROUPU01.
You can look this up in TRDIR to find the creation date (CDAT) of the function module.
matt -
Contact Creation Using Function module
Hello Expert,
I want to create contact as a remote enabled function module for gateway services which function module I have to use for creation on contact??
Moderated: Please use the search before posting.
Message was edited by: Andrei VishnevskyHi,
Basically you can use
BAPI_BUPA_CREATE_FROM_DATA this fm allow you to create any kind of BP
You might also need to use BAPI_BUPR_CONTP_CREATE in order to create the relationship between the contact and the corresponding BP.
Dont forget to use also the BAPI_TRANSACTION_COMMIT after the other fm.
Regards -
Error in creation of function module in e.c.c 6.0
HI GURUS,
i encountered a problem while creating function module in e.c.c 6.0, the error is 'THE MAIN PROGRAM OF DOES NOT BEGIN WITH "FUNCTION-POOL". kindly help me in solving this issue.Hi,
You need to activate the Function Group.
GO to Se80 --> Select function group from list box --> press enter --> Select you function group > Right click> Activate.
Thanks,
Sriram Ponna. -
Creation of function module for updating the ztable
Hi,
I am sending the requirement for ceation of function module for updating the ztable.
Requirement----
Table Updation rule (New record)
While creating a new record the calling function will export the following to the table handling function.
Table field Probable Values
ZORDERNO-------> Sales Delivery no in case of sales orderShipment no in case of transfer order
UNAME----
> User ID
ZORDTYPE----
> SALEOR in case of sales orderTRANSF in case of transfer order
ZREFDOCNO----
>Sales Order no in case of sales orderPurchase Order no in case of transfer order
ZREFDOCNO1----
>Delivery no in case of transfer order
The table handling function will calculate the following fields
Table field Probable Values
ZREQNO----
>Running serial number (incremented by 1 for each new record)
ZREQDAT -
>System date
ZREQTIME----
> System time
ZSTATUS----
>OPEN (for all new records)
Before inserting a new record the table handling function will always check if a previous record exists for the same order / shipment no. if record exists the function will not insert a new record.
Table Updation rule (Status Update)
While updating a record the calling function will export the following to the table handling function.
Table field Probable Values
ZORDERNO----
>Sales order no in case of sales orderShipment no in case of transfer order
ZSTATUS----
>CANCEL if cancellation successfulERROR if cancellation not possible (order already processed)
The table handling function will calculate the following fields
Table field Probable Values
ZSTATDAT----
>System date
ZSTATTIME----
> System timeDo you have to create/update new record in Ztable through Function Module ?
or you need to write FM only for validation?
Any how, you need to create a Program with Input values for the fields of Ztable, and for rest of fields the Value can be calculated based on input as per your requirement.
Let me know clearly what exactly u need ?
Regards,
Kiran -
Creation of Function Module exit
Hai Friends,
I found functional exit called -<b>EXIT_SAPLL2018_001</b>. for
<b>Transfer order</b> in ware house management. I need ur help to proceed further.
Pls give me further steps to follow to create Function exit.It is very urgent,
regrds,
PrashanthHi,
go to SMOD <b>MWMBAP01</b>-EXIT_SAPLL2018_001.
sample code reletd to user exit go thorgh this you will get an idea.
look in txn CMOD or SMOD, check enhancement 0VRF0001. It uses function module EXIT_SAPL0VRF_001. It is used to manipulate route determination for SD.
Here is the code
DATA: ls_xvbpa LIKE xvbpa,
lf_aland LIKE tvst-aland,
lf_azone LIKE tvst-azone,
lf_lland LIKE trolz-lland,
lf_lzone LIKE trolz-lzone,
ls_vbadr LIKE vbadr,
ls_xvbap LIKE xvbap,
ls_tvst LIKE tvst,
lv_route LIKE trolz-route.
LOOP AT xvbap INTO ls_xvbap.
IF NOT ls_xvbap-vstel IS INITIAL.
SELECT SINGLE * FROM tvst
INTO ls_tvst
WHERE vstel EQ ls_xvbap-vstel.
IF sy-subrc = 0.
lf_aland = ls_tvst-aland.
lf_azone = ls_tvst-azone.
ENDIF.
ENDIF.
READ TABLE xvbpa INTO ls_xvbpa WITH KEY vbeln = ls_xvbap-vbeln
posnr = ls_xvbap-posnr
parvw = 'Q1'.
IF sy-subrc = 0.
CALL FUNCTION 'SD_ADDRESS_GET'
EXPORTING
fif_address_number = ls_xvbpa-adrnr
IMPORTING
fes_address = ls_vbadr
EXCEPTIONS
address_not_found = 1
address_type_not_exists = 2
no_person_number = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
lf_lland = ls_vbadr-land1.
lf_lzone = ls_vbadr-lzone.
ENDIF.
ENDIF.
CALL FUNCTION 'SD_ROUTE_DETERMINATION'
EXPORTING
i_aland = lf_aland
i_azone = lf_azone
i_lland = lf_lland
i_lzone = lf_lzone
IMPORTING
e_route = lv_route
EXCEPTIONS
no_route_found = 1
departure_error = 2
destination_error = 3
invalid_generic_key = 4
customer_exit_error = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
ls_xvbap-route = lv_route.
MODIFY xvbap FROM ls_xvbap TRANSPORTING route.
ENDIF.
ENDLOOP.
Regards -
Additional Qty calculation during Ticket creation using function modules
HI,
I am trying to create and actualize ticket using FMs in following seuence:
1) OIJB_TICKET_DEFAULTING
2) OIJ_EL_A_TICKETS_MAINTAIN_N
3) OIJB_GENERATE_DOCUMENTS_N
I am passing OIJ_EL_TKT_I_O1 details to FM OIJB_TICKET_DEFAULTING.
Requiement is based on OIJ_EL_TKT_I_O1, it should calculate additional quantities OIJ_EL_TKT_I_O2.
But it seems it is not populating OIJ_EL_TKT_I_O2.
Any Idea why FM does not calculate OIJ_EL_TKT_I_O2? Or do we need to calculate externally and then Pass it to FM? Which FM does this?
Thanks & Regards,
UmeshHi Umesh,
The function module OIJB_TICKET_DEFAULTING should do the conversion based on the parameters you pass via OIJ_EL_TKT_I_O1.
It will do this only if the parameter ET_TICKET_ITEM_O2 is requested.
Check if you are properly passing an internal table in this field.
Best Regards
Vishnu -
Rule creation with Function module to be executed.
Hi there,
I have been trying to create a function module and then use it in a rule... I have declared ACTOR_TAB, AC_CONTAINER, but still I get an error with the below statement.
swc_get_element ac_container 'PERNR' pernr.
The error I get is as below:
The field "PERNR" cannot be changed.
Note that, I have also declared PERNR as an import parameter for the function module....
Help on this would be great.
Thanks.
Sukumar.FUNCTION ZHR_TEST.
""Local Interface:
*" IMPORTING
*" REFERENCE(LV_PERNR) TYPE PERNR_D OPTIONAL
*" REFERENCE(LV_REINR) TYPE REINR OPTIONAL
*" REFERENCE(BEGDA) TYPE BEGDA DEFAULT SY-DATUM
*" REFERENCE(ENDDA) TYPE ENDDA DEFAULT SY-DATUM
*" TABLES
*" ACTOR_TAB STRUCTURE SWHACTOR OPTIONAL
*" AC_CONTAINER STRUCTURE SWCONT OPTIONAL
*" EXCEPTIONS
*" NOBODY_FOUND
include <cntn01>.
data: result_tab like swhactor occurs 0 with header line.
refresh: actor_tab.
clear: result_tab.
swc_get_element ac_container 'PERNR' lv_pernr.
Still it does not work. It keeps showing the error.
Thanks,
Sukumar. -
Task creation using function module
Dear Experts,
Im new to workflow.
I want to use a function module for defining a task.
i created a function module and declared the structures
ACTOR_TAB LIKE SWHACTOR
AC_CONTAINER LIKE SWCONT with in the function module
In the transaction PFAC i given the abbrname, name and category as Agent Determination: Function to be executed and the function module name
when i click on save im getting the error
Function module ZBAPI_PLANT_ADDR does not meet the workflow convention
kindly guide me to solve this issue
Regards
Arun.PI created an extremely simple FM for role res.
FM: "Y_TEST"
Tables:
ACTOR_TAB LIKE SWHACTOR
AC_CONTAINER LIKE SWCONT
Source:
BREAK-POINT ID zwf.
actor_tab-otype = 'US'.
actor_tab-objid = 'SAMPLRL'.
APPEND actor_tab.
created a simple role in PFAC using this Y_TEST FM and same cat as you used.
Works fine with bare min.
Would need to know a little more of what you are doing in the FM to assist.
Rick Sample -
how to create a fuction module which will get data from excel sheet and pass the value to another function module......
regardshi kaveri,
thanks.the answer was really help full but it'll be more better if u cud tell me how the pass the values of the excel sheet collected by the function module(said by u) to another function module
regards,
santosh. -
Regarding creation of function module.
hi experts,
can anybody help me to know how to create a function module.
regards,
joy.Hi joy,
Goto SE37, give a Z- or Y- name and hit create.
Assign it to an already existing function group (or create a new one thru SE80) give the short name.
Give the import & export parameters.
If import/export is gonna thru tables, fill out tables.
Fill the exceptions if you like to.
Then write your code in the source code tab.
Regards,
Dilek
Maybe you are looking for
-
Printing to pdf on Mac...
What is the work around for printing to pdf on a Mac when you what to utilize print options to impose a file. ie: I recently needed to create a saddlestitch booklet from a document. In the past I would just print to pdf and change scaling options
-
Hi, I am getting an error " No relevant DG records found for the material" when I save the sales order. But DG master exist for the material. Can anybody help on this please Thanks in advance Yasin
-
Adobe Flash Player Security on Mac OSX 10.8.5
Hello, I need some help. I keep getting an Adobe Flash Player Security warning every time I try to load Pandora on my Mac. I not sure if this is some form of spyware. I've tried to research it online but I can't find anything with this specific error
-
Teaming servers to multiple switches
I am looking for a configuration guide / example that shows how to connect a Server with multiple NIC's to 2 different switches for failover. The servers could be Window's or Unix based. Thank you.
-
I would like to backup the license file to apply for a fresh installation on the same hardware (3355). Is that possible? I tried resetting the configuration from the CLI and the license was excluded, it was necessary to do a restore.