Function Module: how to setting table import parameter
hi, i'm developing a function module. i create a TABLES where it will allow multiple variables IMPORT from user input to this function module. the tables i set as OPTIONAL and decribed as below.
PSPID PS_PSPID CHAR 24
POSID PS_POSID CHAR 24
AUFNR AUFNR CHAR 12
PSY J_STATUS CHAR 5
PUS J_STATUS CHAR 5
in my source code, i done a select statement to process the IMPORT input . the problems i face,for the PSY and PUS input, if the one or both input is BLANK, NO RESULT will display. What i'm try to do , if input one or both is BLANK, it wil neglect the input and return as ALL RESULT (return result oir all status for input pspis / posid / aufnr) . attached the select statement. thank you
itparm[] = objparm[].
select
a~pspnr a~stspr a~objnr a~pspid
b~psphi b~objnr as wobjnr b~posid
c~aufnr c~objnr as nobjnr c~pspel
d~objnr as jeobjnr d~inact d~stat
e~objnr as jcobjnr e~udate e~usnam e~utime e~stat as jcstat e~inact as jcinact
f~istat as syistat
f~txt04 as sytxt04
f~spras
g~estat as usestat
g~txt04 as ustxt04
into corresponding fields of table itobj
from proj as a
inner join prps as b on a~pspnr = b~psphi
inner join aufk as c on b~pspnr = c~pspel
inner join jest as d on c~objnr = d~objnr
inner join jcds as e on d~objnr = e~objnr
and d~stat = e~stat
inner join tj02t as f on e~stat = f~istat
inner join tj30t as g on a~stspr = g~stsma
for all entries in itparm
where ( a~pspid = itparm-pspid
or b~posid = itparm-posid
or c~aufnr = itparm-aufnr )
and ( f~istat = itparm-PSY and g~estat = itparm-PUS ).
Thanks for your quick reply. actually the data will be somehing like this. since i developed a function module, i keep the import parameter in a table.
PSPID PS_PSPID CHAR 24
POSID PS_POSID CHAR 24
AUFNR AUFNR CHAR 12
PSY J_STATUS CHAR 5
PUS J_STATUS CHAR 5
the example data will be in OTPARM internal table
PSPID POSID AUFNR PSY PUS
aa-aa-aa a1 I001
bb-bb-bb b1 E009
cc-cc-cc
i'll store this into an internal table. from the data. it can be seen there a BLANK input. so the blank input should not be included into WHERE connditions. that why in the previous solution, i use SELECT inside LOOP because every line of the IMPORT tables will be generated with different WHERE conditions. i tried to do something like this:
PSPID POSID AUFNR PSY PUS cond_syx
aa-aa-aa a1 I001 if proj~pspid = itparm-pspid and prps~posid = itparm~posid and ....
bb-bb-bb b1 E009 if proj~pspid = itparm-pspid and aufk~aufnr = itparm~paufnr and ....
cc-cc-cc if proj~pspid = itparm-pspid
and implement with FOR ALL ENTERIES, but at the WHERE conditions i failed to put the CONF_SYX. please comment and give opinions. Thanks you very much.
Similar Messages
-
hi,
how to use ET_ATTACH importing parameter of Function module BBP_PD_SC_CREATE, my requirement is to create SC with attachment.
an example would really help.
Kind Regards,
Kailash.Hi,
Generally we create the SC from ITS or Portal, and there in the Create SC screen , once you add the item into the shopping cart , in the Item details, there is the section called , Documents and Attachements, where in you can upload the attachments which ever you want. Sometimes the extn .DOC, .pdf and .xls are allowed. but that also you can check which are the Authorized files extns avaialbe in Backend R/3.
Using the FM RFC_READ_TABLE, in table pass TDWP and in the i_field pass 'APPSFX' and then you can get the authorized file formats. in Backend Transaction DC30 you can verify which are the allowed file formats.
Moreover for restricting the User from uploading the attachment BADI BBP_ITEM_CHECK_BADI can be implemented for raising the error message if required.
Regarding the ET_ATTACH, it is the structure of type BBPT_PDS_ATT_T, so you have to provide the complete details for this structure. Like : GUID, P_GUID ,LOGICAL_SYSTEM, DESCRIPTION, URL, TYPE,DISP_URL, PHIO_EXT ,etc.
Once all the entries are fine.
You can create the SC, but the recommeded way for creating the SC is thru ITS or Portal.
I hope this will help. Feel Free while asking questions.
Thanks and Regards,
Ankur Goyal -
How to save function module in a custom table..
hi experts,
i need your help, how can i save a customize function module into a custom table?is this possible?
i need your reply ASAP..
thanks,
mauHi,
pls chk this links:
Generic extraction via function module blog siggi
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
Generic extraction via function module
BW genenric delta not TABLE but VIEW
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801ee8454211d189710000e8322d00/frameset.htm
Re: how to use a function module
http://help.sap.com/saphelp_nw70/helpdata/en/2a/f9ff95493111d182b70000e829fbfe/frameset.htm
**pls assign points,if link is useful*
Regards
CSM Reddy -
How to find function modules used in maintenance table views
Hi,
How do I find the function modules used in maintenance table views?
I'm using SM30 and trying to open the custom table but there is an error message saying CREATE DATA PROCESSING FUNCTION MODULE.
Thanks.
Kathhi
in se80 select functon group and put your table function group name there and click display. it will show you the function modules used for that tables.
Regards
Madhu -
How to set this DATS parameter
Hi Pros,
I am calling function 'HR_FORMS_TIM_GET_B2_RESULTS' in the program , its input parameter is BEGDA, I transfer a date variable to BEGDA, but does not work. can not get any data. but if I run this function in SE37, I input date '20140807', successfully get result. please tell me how to set this DATS parameter?Hi,
You might be passing the date in '12.12.2014' or '12/12/2014' format. Please
use the function module 'CONVERSION_EXIT_BEGDA_INPUT' to convert the date
to internal format and then pass it to the function module.
Thanks -
For a function module how can I find its assigned data source name?
Hi BW Gurus,
If i know the data source name then the assigned fn. module/Table/Infoset I could find from RSO2. But for function module How do I know its assigned data source name?
Thanks a lot for the response.
Regards
VenHi Ram,
In SE16, enter the table name as ROOSOURCE and in contents choose field EXTRACTOR for selection and enter the name of the function module.
It will return the list of datasources where the function module has been used.
Best Regards,
Ankit Agrawal -
Function Module to read EDIDC table data.
Dear All,
I am retrieving data from EDIDC table depending upon the creation date and message type. But it is consuming a lot time and hence while going for more than one month data , it gives run time error.
I found while going through debugger that maximum time is consumed by the SELECT query in retrieving the EDIDC data.
Is there any Function Module for retrieving EDIDC table data.
If so kindly let me know.How can a fm replace this performance issue ? You have only two fields to be passed such as creation date and message type.
For the table EDIDC there is a secondary index 3 for message type. Did you use that ? What is your query written ?
If you look into the standard report RSEIDOC2, the field for creation date used is UPDDAT. It implies usage of secondary index 2
Refer line no 114
Regards
Kesav -
Function Module to modify MARC table
Hi all,
Is There any Function Module which modifys the table MARC.
please suggest.
regards,
chandra.Hello Reddy,
Check this sample code:
*& Report ZYTEST02 *
report zytest02 .
parameters:matnr like bapimathead-material,
maktx like bapi_makt-matl_desc default 'Mat. autm. AE',
werks like bapi_marc-plant,
vkorg like bapi_mvke-sales_org,
vtweg like bapi_mvke-distr_chan.
start-of-selection.
perform material_create using matnr
maktx
werks
vkorg
vtweg.
*& Form material_create
* text
* -->P_MATERIAL text
form material_create using value(p_matnr)
value(p_maktx)
value(p_werks)
value(p_vkorg)
value(p_vtweg).
tables: mara.
* shift p_matnr right deleting trailing space.
* translate p_matnr using ' 0'.
data: headdata like bapimathead occurs 0 with header line.
data: clientdata like bapi_mara.
data: clientdatax like bapi_marax.
data: salesdata like bapi_mvke.
data: salesdatax like bapi_mvkex.
data: plantdata like bapi_marc.
data: plantdatax like bapi_marcx.
data: return like bapiret2.
data: taxclassifications like bapi_mlan occurs 0 with header line.
data: commitmessages like bapi_matreturn2 occurs 0 with header line.
data: returnmessages like bapiret2 occurs 0 with header line.
data: materialdescription like bapi_makt occurs 0 with header line.
data: charx value 'X'.
* Kopfdaten
headdata-material = p_matnr.
headdata-matl_type = 'FERT'.
headdata-ind_sector = 'M'.
* Sichten die gepflegt werden sollen
headdata-basic_view = charx. "Sicht auf Grunddaten
headdata-sales_view = charx. "Sicht auf Vertriebsdaten
* Daten für die Sicht GRUNDDATEN 1
materialdescription-langu = sy-langu.
materialdescription-matl_desc = p_maktx.
append materialdescription.
* Mandantenspezifische Materialdaten
clientdata-base_uom = 'ST'.
clientdatax-base_uom = charx.
clientdata-trans_grp = '0001'.
clientdatax-trans_grp = charx.
* Materialdaten auf Werksebene
plantdata-plant = p_werks.
plantdatax-plant = p_werks.
plantdata-loadinggrp = '0001'.
plantdatax-loadinggrp = charx.
* Verkaufsdaten
salesdata-sales_org = p_vkorg.
salesdatax-sales_org = p_vkorg.
salesdata-distr_chan = p_vtweg.
salesdatax-distr_chan = p_vtweg.
* Steuerklassifikation
taxclassifications-depcountry = 'DE'.
taxclassifications-tax_type_1 = 'MWST'.
taxclassifications-taxclass_1 = '1'.
append taxclassifications.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
headdata = headdata
clientdata = clientdata
clientdatax = clientdatax
plantdata = plantdata
plantdatax = plantdatax
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA =
* VALUATIONDATAX =
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
salesdata = salesdata
salesdatax = salesdatax
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
importing
return = return
tables
materialdescription = materialdescription
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
taxclassifications = taxclassifications
returnmessages = returnmessages
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = charx
importing
return = commitmessages.
* commit work and wait.
* Für den Fall das es notwendig wird die Exclusive Sperre wegräumen
CALL FUNCTION 'DEQUEUE_EMMARAE'
EXPORTING
matnr = p_matnr.
* if return-type ne 'S'.
format color col_negative.
loop at returnmessages.
write: / returnmessages-message.
endloop.
* endif.
loop at commitmessages.
write: / commitmessages-message.
endloop.
endform. " material_create
If useful reward.
Vasanth -
How to down lode function module & how to uploaded
Dear friends,
Iam trying 2 transport request 4m development 2 production ,
unknowing i deleted customized function module,
Same functional module was in other client plz guide me how to downloaded functional module & how to up lode ,
How to down lode function module & how to uploaded
Regards,
ReddyHello,
Create a request of type Transport of Copies.
Go to transaction SE03 , select the option Include Objects in a Transport Request, select the object, include in your request and liberate it.
Then copy the DATA and COFILE of this request to your destination system and import it in transaction STMS.
Take a look at this: Transport error!
Regards, -
Storing the output of a function module into a custom table
Hi Gurus,
Is it possible to store the output of a function module into a custom table.How can this be done?Is it complex?hi,
After u execute the FM and get values in the internal table ITAB_RESULT. Create a custom table having structure same as ITAB_RESULT call it ZRESULT.
data :wa type ITAB_RESULT.
call FM and get result it ITAB_RESULT
loop at itab_result.
move-corresponding itab_result to wa.
insert wa to ZRESULT.
endloop.
Regards,
Mansi. -
How to set table cell renderer in a specific cell?
how to set table cell renderer in a specific cell?
i want set a cell to be a button in renderer!
how to do?
any link or document can read>?
thx!Take a look at :
http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
It is very interesting, and I think your answer is here.
Denis -
Is there any delivered BAPI or Functional modules available for MCHB table
Hi Experts,
I have a requirement where I have to pull inventory data from MCHB table without custom code. Is there any delivered BAPI or Functional modules available for MCHB table?
Kindly help!
Thanks
GopalHi,
Can you check using the Fun Modules
MG_BATCH_CHECK_STOCK
VB_READ_BATCH_WITHOUT_STOCK
VB_BATCH_GET_ALL_STOCKS
Regards,
Anji -
How to create function module to update z tables?
Hi,
I am new to ABAP. I checked the forum but did not find relevant solutions.
I have 2 z tables - ZFLIGHT and ZCUSTOMER. I have a few entries in each table.
I want to write a report to update the entries in the table using function modules. For that I have created a function module - zflight_fm and also a function group- zflight_fg and assigned the function group to the Fm. I do not know how to proceed further, what to put as import, export parameters, tables, changing etc. Further I want exceptions to handle the successful update of the entries.
Thanks and regards,
SmruthiSteps:
1) Changing --->a) Zflight TYPE ZFLIGHT(DDIC Ref) OR Zflight TYPE ANY TABLE
b) ZCustomer TYPE ZFLIGHT(DDIC Ref) OR ZCustomer TYPE ANY TABLE
2) Execptions:
a) Upload_failed_Flight
b) Upload_Failed_Customer
3) Exporting ---> a) Information what rows are uploaded
Source Code:
Insert Zflight from Zflight(changing parameter).
If insert failed
RAISE Upload_failed_Flight.
endif.
Insert ZCustomer from ZCustomer(changing parameter).
If insert failed
RAISE Upload_failed_Customer.
endif.
Regards,
Gurpreet -
How to make use of SE37- Function Module & how to find out the table?
Hi ,
1.Could anyone help me what's this SE37-Function module is all about,How to make use of this?
For Eg,If i want to delete a BOM permanently from the system then I have to use the Function module CM_DB_DEL_FROM_ROOT_BOM.
But after giving the particular name what should i do?
Please help me.
2.How to find out the respective table for a particular field sya for T code-COGI, T code MFBF,where its values are getting populated.,Please help in this issue.
Thanks in adavnce for spending some time
Raj.SHi Raj
Function Modules
Function modules are procedures that are defined in special ABAP programs only, so-called function groups, but can be called from all ABAP programs. Function groups act as containers for function modules that logically belong together. You create function groups and function modules in the ABAP Workbench using the Function Builder.
Function modules allow you to encapsulate and reuse global functions in the SAP System. They are managed in a central function library. The SAP System contains several predefined functions modules that can be called from any ABAP program. Function modules also play an important role during updating and in interaction between different SAP systems, or between SAP systems and remote systems through remote communications.
Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from the programmer. You can define the input parameters of a function module as optional. You can also assign default values to them. Function modules also support exception handling. This allows you to catch certain errors while the function module is running. You can test function modules without having to include them in a program using the Function Builder.
The Function Builder also has a release process for function modules. This ensures that incompatible changes cannot be made to any function modules that have already been released. This applies particularly to the interface. Programs that use a released function module will not cease to work if the function module is changed.
Check this link
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
You can execute function module in SE37ie you can perform the activiites defined in the function module by executing it.
By deleting BOM you mention the FM name in se37 and execute. In some function module it will ask input parameters as developed in the program , you have to give the input parameters and execute. -
How to pass value in Table import parameter of an RFC
Hi all,
I have an RFC in which import parameters are in the form of a table
so now when i imported that RFC in my webdynpro application and Apply Service Template to it, it created the structure but when i applied form template to it all the inputfields were readonly
and also when i tried to set the input parameter of that table like:
wdContext.currentBAPI_CREATEElement.set<field>("value");
it shows null pointer exception
MY Context structure created after service template is as follows:
Model Node Zcreate_rfc, it icludes another model node
BAPI_CREATE, and it then includes the input parameters
Please tell me how to solve the problemSuppose the RFC is called ZRFC, and the table structure is called TableStruct, then this works for me (in execute method before calling execute):
ZRFCInput input = wdContext.currentZRFCElement().modelObject();
// these are regular import parameters
input.setAaa(aaa);
input.setBbb(bbb);
if (input.getTableStruct()!=null) {
input.getTableStruct().clear();
// In this loop table rows are added
for (int i=0; i<sourcList.size(); i++) {
ZTableStruct table = new ZTableStruct();
table.setDdd(((SomeBean) sourcList.get(i)).getDdd()); // for property ddd
input.addTableStruct(table);
Good luck, Roelof
Edited by: R. Knibbe on Jan 23, 2008 3:25 PM
Maybe you are looking for
-
How do I correct General Printer error 0X610000f6 for a HP Officejet 6500
The printer keeps throwing this erro message out. How can I correct it.
-
WS To IDOC"CONTENTS OF TRACE IN SXMB_MONI"
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!-- Response --> - <SAP:Trace xmlns:SAP="http://sap.com/xi/XI/Message/30"> <Trace level="1" type="T">Party normalization: sender</Trace> <Trace level="1" type="T">Sender scheme extern
-
Creating the Sales Order using the bapi BAPI_SALESORDER_CREATEFROMDAT2
Hi, My problem is , i have created one module pool program for accelerating the Sales Order creation. I am using the bapi BAPI_SALESORDER_CREATEFROMDAT2 for sales order creation. After executing the program bapi is given an errot that, incomplete sal
-
URGENT HELP REQUIRED AS REGARDS THIS BILLING FIASC...
Dont know wether aloud to post this here but Have also posted Directly to KerryG but if anyone else can help most appeciated Dear KerryG please forgive me contacting you in this manner but I am desperate today saturday the 20th feb I recived my Bt b
-
Hello, I am trying to embed a JavaFX scene in swing JComponent as shown below: import java.awt.; import javax.swing.; import org.jfxtras.scene.SceneToJComponent; public class Main extends JFrame { public static JTextField tf = new JTextField("JavaFX